LaTeX not displaying properly

LaTeX not displaying properly

by Ian McIlroy -
Number of replies: 11

Hi,

I get the following and can´t see how to fix it.

In glossary, the right arrow symbol is displayed and all is fine:

From%20Glossary.png

In the pop up, the LaTeX code is displayed, not the symbol:

From%20pop%20up.png

Any help would be great,.

Thanks, Ian

Average of ratings: -
In reply to Ian McIlroy

LaTeX not displaying properly

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers
Hi Ian,

There was a recent discussion of this problem here https://moodle.org/mod/forum/discuss.php?d=468927. It is a recent bug. What version are you using?
In reply to Daniel Thies

LaTeX not displaying properly

by Ian McIlroy -
Hi Daniel,
thanks for the reply.
I am using Moodle 5.0.2 (Build: 20250811), which I believe is the latest, with the Academi plug in theme. I have tried with the standard Boost theme - the problem still occurs.
Additional data: it renders perfectly in the mobile phone app.
Ian
In reply to Ian McIlroy

LaTeX not displaying properly

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

Hi Ian,

I have been looking into this a little more. There seems to be a bug in the way the code is cleaned when using MathJax filter with the glossary filter. I think this was created when upgrading to MathJax 3.2, but it could also have been caused with other changes to the filters. I have not found an existing bug report yet. 

I have two work arounds. One is to configure the TeX notation filter as in the other discussion. The other is to manually wrap the mathematics in a span with class 'filter_mathjaxloader_equation'. The filter is suppose to do that, but it does not appear to do that. 

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

LaTeX not displaying properly

by Ian McIlroy -
Hi Daniel,
thanks again. I used your 'filter_mathjaxloader_equation' work around which almost solved the problem, it just didn´t look nice! So  I then followed the previous threads and after some study found an acceptable solution on my XAMPP set up.
 
I basically looked at the TeX settings and the Default paths it was showing and created the path on my C drive having downloaded the dvisvgm.exe file. This worked perfectly.
 
My next step was to change my production site.  The default paths are /usr/bin/name_of_file, the current active one being /usr/bin/convert. I imagine the easy solution is to simply upload the dvisvgm.exe file into the same folder and activate it in TeX. However I can´t find that path not folder. I am hosting the site with  cPanel access. Or is it not that simple?
Sorry to dump all this on you  but do you know how I find it?
I have searched and come up with nothing!
Thanks, Ian
Attachment Acceptable fractions.png
In reply to Ian McIlroy

LaTeX not displaying properly

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

Hi Ian,

Your server is probably a Linux installation which will not run a windows binary. Usually TeX binaries are installed with a package manager. If you are on a share host, you probably do not have access to that. What is showing is from default binaries included with Moodle which are limited.

In reply to Daniel Thies

LaTeX not displaying properly

by Ian McIlroy -
Hi,
yeah that makes sense. It is a Linux installation. I have one last question which I still dont fully get: the active binary shows as being on the path /usr/bin/convert. Where is this? I couldn't find it anywhere but it is an active path!!

Ian
In reply to Ian McIlroy

LaTeX not displaying properly

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers
You are probably not able to see it with cpanel. Those are system files that normal users can't change. It is not part of Moodle. You would need to have the system admin install the required TeX binaries. They are not normally installed. The /user/bin/convert binary is a image manipulation program that is used for a lot of different things. It won't help if latex and dvips are not installed.
In reply to Ian McIlroy

LaTeX not displaying properly

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers
I added a tracker issue MDL-86818 for this. This is a regression starting in Moodle 4.4. MathJax worked in the glossary popups prior to that.
In reply to Daniel Thies

LaTeX not displaying properly

by Harald Schnurbusch -
Picture of Particularly helpful Moodlers
Hi Daniel,

I think the link you posted to the tracker issue is wrong. It points to the docs and an empty page. The correct link: MDL-86818. We opened a similar issue in July, MDL-85941. I guess that one should be closed then?
 
Best
Harald
Average of ratings: Useful (1)
In reply to Harald Schnurbusch

LaTeX not displaying properly

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

Hello Harald,

I saw that issue, but did not see that it referenced MathJax. I linked the issues for now to make sure it resolves your issues. Changing the template did not seem to fully resolve the Mathjax issue for me, but also found the template issue and agree with your change. Since glossary definitions are formatted HTML they should not be included in a <p> tag since block tags would break that.

I have a patch attached to my issue if you are able to test that.

Daniel

In reply to Daniel Thies

LaTeX not displaying properly

by Harald Schnurbusch -
Picture of Particularly helpful Moodlers
HI Daniel,

thank you very much for the reply and for working on a fix. Our developers tested the patch attached to MDL-86818 and we couldn't reproduce the former error anymore. So it seems to work.


Best
Harald
Average of ratings: Useful (1)