Newbie: Tex display glitchy

Newbie: Tex display glitchy

by lucia liljegren -
Number of replies: 5

Hi,

I'm new to moodle. I installed 2.5 at Dreamhost and I'm trying to insert equations. Some equations render fine,others that should display fine break.  I activated debugging (my site/moodle/filter/tex/texdebug.php#help ) , but I don't understand the messages.   The debug message sent me here so I hope you can help.


In case it helps clarify my issue, below in blue is example of what I mean by not rendering:

   Shows tex equations showing errors.


Here's the error message which tells me to come here!


Error message displayed.

Average of ratings: -
In reply to lucia liljegren

Re: Newbie: Tex display glitchy

by Colin Fraser -
Picture of Documentation writers Picture of Testers

I assume that you have turned on the TeX Filter? That is usually the main issue, it is not set on by default. If MathJax is available in v2.5, and I am not sure that it is, then you may have to ask your host to install it, if you cannot access code yourself. Otherwise, go to the Plugins > Filters > Manage Filters. If MathJax is not switched on, then turn it on. Then go to Settings page - make sure all the URLs and configurations are correct, then save the page, if you need to. 

Also, if the TeX filter is on, then you may want to turn it off, they do not always play nicely together when both are being used.  It may still use the fallback, mimetex, if needed, but they won't interfere with each other, as I am given to understand. 

Someone else may be able to provide a more detailed explanation, but if you do these things and it still does not work, then let us know and further assistance should be forthcoming.  


In reply to Colin Fraser

Re: Newbie: Tex display glitchy

by lucia liljegren -

Thanks!

Yes. Tex is on. I found that selection in the administration section.  That's why some equations were rendering. The problem was other (identically formatted) equations where not rendering. It was very mysterious.

I hunted a little more and read a comment and answer that suggested 'mimetex.linux' needed 755 permissions. I changed that and now equations are rendering. There is an annoying (but not fatal) feature now:

If I leave a blank space between the dollar signs delimiters, those render as [?]. This can be remedied by not leaving any blank space, on the mark-up side but I find that makes things more challenging to proof read on the mark-up side.  White space is useful! 

If someone has other tips for making Tex more 'friendly', that would be great.  (My guess is many of the 'tips' involve: "run 2.8", but for now that's not an option!)

Still, if there are some tips on things to put in a  Tex preamble? If yes... or info on where/how that is done in moodle? That would be great!

Sorry to be such a newbie, but I'd like the equations pretty.






That said: I can live with the current behavior.

On Mathjax:The Mathjax page for 2.5 shows 'blank', so I assume it's not available. https://docs.moodle.org/25/en/MathJax_filter

In reply to lucia liljegren

Re: Newbie: Tex display glitchy

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

Hi Lucia,

The problem with spaces is a bug in the TeX filter and TinyMCE.  TinyMCE converts multiple spaces into   or the equivalent code which the TeX filter chokes on rather than ignoring.  It really would be better to remove those.  The TeX filter only uses mimetex when the latex, dvips binaries fail.  Some equations are probably rendered now with latex and others with mimetex (mimetex ignores the space problem).  If so the mimetex images will be larger and of lower quality.

The preamble only affects the latex binary not mimetex. The stock version is good enough for most purposes.  You only need to change it if you are very familiar with latex and need a special package for graphics or formatting. 

MathJax can be run in 2.5 by including it in the header insteader of using MathJaxloader filter.  A good description of how to do this is given in the STACK documentation.

Average of ratings: Useful (1)
In reply to Daniel Thies

Re: Newbie: Tex display glitchy

by Colin Fraser -
Picture of Documentation writers Picture of Testers

As Daniel has said, the mimetex images are seriously sucky, but maths tools were just not looked at for so long by devs that it has only been recently that there has been any reasonable improvement to them. You may get a better render by using something like TeXLive as the binary and changing the image type to png, if that option is available in your version of Moodle. 

If you can implement MathJax you will improve the quality greatly, and at sometime in the future, someone may develop a plugin that will not require the use of a clunky, additional interface to build expressions.

Average of ratings: Useful (1)
In reply to Daniel Thies

Re: Newbie: Tex display glitchy

by lucia liljegren -

Ahh! It's the  ! That's good to know.  I usually enter in raw html.  But I loaded the gui to speed up nice formatting (inserting lists, indenting etc.)  I did that just before 'fixing' the Tex breakage, so I thought it was "Tex" itself. Now I know to just edit the raw html when I see the [?].


Naturally, since I loaded Friday, I notice other 'infelicities', and then need to find solutions.  Glad I know the issue here.

Now on to the 'infelicity' associated with trying to include Tex in 'calculated questions'. (There seems to be a problem with both using { } as delimiters. Right now my solution is "don't use Tex" in calculated questions!)

Average of ratings: Useful (1)