Mathjax locally on Moodle

Mathjax locally on Moodle

by Susana L. -
Number of replies: 3
Hi,
As an admin I want to have Mathjax locally available on Moodle.
I use to download from github version 'v2.6-latest' to moodle/lib/ folder and insert the path /lib/mathjax/MathJax.js on moodle Mathjax filter configurations just like it is described on moodle admin settings... and it works just fine.

But there are new versions of Mathjax. My question is, how to use the new versions? There is no MathJax.js file on new versions and when I try to call files like /lib/mathjax/es5/tex-chtml.js I get a javascript error on moodle:
Uncaught TypeError: Cannot read properties of undefined (reading 'Queue')

I would much appreciate your considerations about this issue.

Thank you in advance!
best,
susana 
Average of ratings: Useful (1)
In reply to Susana L.

Re: Mathjax locally on Moodle

by Oliver Smitkowski -
Hi Susana,

I was just going to ask a similar question. We installed MathJax 3 on another server and inserted a script tag as "additional html":
<script type="text/javascript" src="<path-to-mathjax>/tex-chtml.js?config=TeX-AMS_HTML"></script>

Now everything inside
$$..$$
is interpreted and formulas are displayed, but since it was necessary to deactivate the MathJax filter in moodle, there is not button to add a formula in the Atto editor.


Did you find a better way to use new versions of MathJax with moodle? We will probably switch to MathJax 2.7.9.

Best,
Oliver

In reply to Oliver Smitkowski

Re: Mathjax locally on Moodle

by Susana L. -
Hi Oliver,

Still don't know how to use new MathJax versions (like MathJax 3) with Moodle...
Maybe the Moodle mathjaxloader filter plugin is no prepared for newer versions (?)

Best,
susana
In reply to Susana L.

Re: Mathjax locally on Moodle

by Oliver Smitkowski -
Yes, the source code (updated a few weeks ago) still contains references to the 2.7.9 version. Also, MathJax 3 is very different from MathJax 2. You could try what I described above, but in our case, the rendered formulas actually look better with v2.