Math images are not viewable

Math images are not viewable

by Chris Swaffield -
Number of replies: 11

On our Moodle 2.3 site, when we put in math problems using the DragMath button, the items are displayed as broken images. Right clicking on the broken image will open a page that will run a debugger. That debugger displays the following message:

sh: 1: /var/www/moodle/filter/tex/mimetex.linux: not found 
The shell command
"/var/www/moodle/filter/tex/mimetex.linux" -e "/var/moodledata/filter/tex/9608176195573c30c6beb3cf078fdf66.gif" -- '\Large f(x)=\int_{-\infty}^x~e^{-t^2}dt'
returned status = 127
File size of mimetex executable /var/www/moodle/filter/tex/mimetex.linux is 830675
The file permissions are: 100777
The md5 checksum of the file is 56bcc40de905ce92ebd7b083c76e019e
Image not found!

No text output available

I have MathJax in the head section of the additional HTML to be added to each page. Not sure what the error message is trying to tell me. I believer the permissions are set correctly. Any help would be great.

Average of ratings: -
In reply to Chris Swaffield

Re: Math images are not viewable

by Guillermo Madero -

Hi Chris,

It seems that the mimetex.linux file is not present, though at the end its size is reported.

Anyway, you can try and install the mimetex package:

sudo apt-get install mimetex

then rename the Moodle version:

mv /var/www/moodle/filter/tex/mimetex.linux /var/www/moodle/filter/tex/mimetex.linux.old

and finally link to the installed package:

ln -s /usr/bin/mimetex /var/www/moodle/filter/tex/mimetex.linux

 

---

http://docs.moodle.org/23/en/TeX_notation_filter

In reply to Guillermo Madero

Re: Math images are not viewable

by Marc Grober -

Probably not....

In reply to Marc Grober

Re: Math images are not viewable

by Guillermo Madero -

... not what? thoughtful

In reply to Guillermo Madero

Re: Math images are not viewable

by Marc Grober -

not appropriate...  Mimetex is there, apt-get is not universal, actually makes more sense to compile mimetex yourself, mimetex is a functional fallback but even John thinks one should use MathTex, MathJax won't do fallback from TeX filter because the TeX filter "steals" the tokens (though one could rewrite the TeX filter to fallback to MathJax instead of mimetex, one should determine what the OP is trying accomplish before directing him to do something possibly inconsistent with what he is trying to accomplish (which is really an OP issue, not yours, but there ya go.)

That is why the initial query would be, why are you running TeX filter AND MathJax.  Of course, I think the poster should provide that info on posting,  but that is virtually a non-starter, lol,  so we have to play silly guessing games about what the poster is trying to do, and what he has done. Of course,  the situation IS a moving target, which does present some problems for the newcomer.

Please understand that I am not looking to take a pot shot at you gracious interest in helping the OP....  only suggesting that your assumptions about the OP together with the OP's ignorance could create a good of unintended trouble for the OP wink and sometimes it is worthwhile being a bit circumspect before suggesting a course of action.

For most users, there will be no need whatsoever to run mimetex alongside MathJax.  And if that is the situation, the best recourse is to turn the TeX filter off, ensuring that DragMath is available still depending on your Moodle version, suggesting that the OP install TexLive and configure the TeX filter to use TeX binaries and to use different tokens if he wants to run TeX AND MathJax (and only then turn TeX filter back on) though the work Daniel is doing may soon make that scenario much simpler..


In reply to Marc Grober

Re: Math images are not viewable

by Guillermo Madero -

Hi Marc,

Why, no problem at all from your explaining smile On the contrary, thanks for taking the time.

Yes, I agree. Sometimes one assumes because of the little information provided and thus one recommends a bit blindly but based on similar posts or on best estimates according to what may seem to be the underlying issue; other times one goes and gets into an almost endless cycle asking for info.

While I haven't gotten much into the math filter and everything, sometime ago I made a math course (in Word) that I would like to convert into a Moodle course. At that time I had to get into learning about TeX and now I'd like to start getting familiar with the Moodle math filters.

Once again, thanks Yes

In reply to Guillermo Madero

Re: Math images are not viewable

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

Mimetex is present, but is a 32bit not a 64bit executable. It would give better results if you install full TeX which is easy on Linux or use MathJax.

In reply to Chris Swaffield

Re: Math images are not viewable

by Marc Grober -

First question to ask is why you are running two Tex display tools.  If you intended that, and are not trying to parse the same tokens with both tools then one is irrelevant to the other, there are quite a few system based reasons mimetex chokes on shared hosts and you can find most of them in the forums by searching on your error message (it is likely MathJax is not parsing your expression because the TeX filter scooped up the expression first, and then failed..)  In fact, it is often most helpful to provide details of your searches in the forum and docs so others know what you have done to try and solve your problem.

However, if you do not understand what I just wrote,  then you might try turning the TeX filter off and relying on the MathJax filter.  If the expression is still not parsed as you expect, post a zip of the code you injected in the header and the expression you inserted. I can't recall in what version moodle devs uncoupled DragMath (which was coupled to the TeX filter in Moodle 2) but if it was not decoupled in 2.3, there is a kludge to accomplish that. )

If you really want to parse with other than MathJax, then I suggest TexLive which will produce better result than mimetex.

In reply to Marc Grober

Re: Math images are not viewable

by Guillermo Madero -

Hi Marc,

I read about that, that mimetex could be having problems processing, but it seems strange that the error message says that mimetex is not found.

I thought that the Mathjax would act as a fail back. Seems not.

In reply to Marc Grober

Re: Math images are not viewable

by Chris Swaffield -
First, thanks for helping me get this straight. Running two Tex display tools is my error as I was unaware that they were both on at the same time. (I assumed I was using MathJax only) So, I fixed that and found the following issue. 

When the TeX notation filter is turned on (and no MathJax script),  we can see the DragMath button and use it. However, the math items display as broken images. Clicking on the debugger gives the same output as in my first post. 

When the MathJax script is placed in the Additional HTML header section (and Tex notation off), the math items display just fine, but the DragMath button is gone. 
In reply to Chris Swaffield

Re: Math images are not viewable

by Marc Grober -

Yes, that is why I mentioned that issue when I first responded, lol. 

The PTB decided to couple DragMath with the Tex Filter at one point and for a few version you had to decouple the two by tweaking a line of code.  There is an explanation in the forum but eventually the info was placed in the docs and by doing a quick search on decoupling DragMath you would find this http://docs.moodle.org/23/en/DragMath_equation_editor#Decoupling_DragMath_from_the_Tex_Filter


In reply to Marc Grober

Re: Math images are not viewable

by Chris Swaffield -

After decoupling DragMath, and putting MathJax back in the Additional HTML section, it seems to be working fine now. Thanks for the heads up. 

I did try using TeX, but kept getting errors that "convert executable (/usr/bin/convert) is not readable." Further down the debugger, it was saying the output for the /usr/bin/convert line gave a return code of 127. After making sure texlive and ghostscript were installed, it still gave that error. So, I tried the above remedy which worked. I'm still trying to figure out the convert executable error. Thanks for the help.