-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
DEV backlog
-
Moodle Apps Sprint 2025-I1.4
In MDL-75486 the MathJax version is being upgraded to 3.2.
I've been looking at the documentation to upgrade from v2 to v3 and it seems most of the breaking changes affect configuration, API and output, they aren't changes that affect end users. I think the only breaking changes that affect end users are the ones described in the "Input Changes" section:
- The \color macro has changed. This means that, after upgrading to v3, some text might appear with the wrong color. E.g. $$\color{red}Test$$ displays the word "Test" in red in v3, but in v2 it only displays the letter T in red. This is just a visual problem, and there is some syntax that works in both versions (e.g. $${\color{red} Text}\$$ works for both versions).
- Some extensions names have changed when using the \require macro. E.g. in v3 it's \require{amscd} while in v2 it's \require{AMScd}. This seems a quite advanced feature, and I guess users could put both requires in the content so it works in both versions of MathJax, but this is just a guess. EDIT: This workaround is not valid, please see the comments.
Besides those, there are few things that haven't been ported to v3 yet but will be added in the future. These limitations also affect Moodle LMS:
- Localization is now in English only. In the app we disabled the menus opened when right clicking formulas, so I guess this could only affect a11y (I'm not sure if it affects or not).
- Automatic line breaking support is not supported in v3 yet, it will be added in the future.
- Now the MathJax output only supports one font. This is just a visual limitation.
- The begingroup and mediawiki-texvc TeX extensions haven’t been ported to version 3 yet, but should be in the future.
- The auto-collapse assistive extension is not yet available for version 3.
Since the 2 first breaking changes are either visual or advanced, and the rest of limitations are temporary and also affect Moodle LMS, we decided that in the app we will always use MathJax v3.2, no matter which site the app is connecting to. Of course we can re-evaluate this in the future if we detect this is causing problems to end users.