While this is not the way I wanted to announce this, it seems the cat is out of the bag. But for those who haven't noticed, as part of our Community Asks Sprint, I spent the week investigating how we might go about upgrading our MathJax version from 2.x to 3.x+, as had been requested in several places, notably:
- Are there plans to switch to the current version of MathJax?
- Switch to MathJax version 3? - Mathematics Meta Stack Exchange
- MathJax out of date - Mathematics Meta Stack Exchange
Caveats
Right off the bat, I want to place some important caveats on this work:
- It's still experimental and early stages.
- There are several features that were removed in v3 that will likely come back in v4 that are probably worth including in a GA release.
- If there are too many insurmountable issues, we may have to stick with v2 for the foreseeable future until we can further dedicate / prioritize efforts.
For these reasons, v3+ right now is opt-in only at the individual account level for folks who would like to take part in early beta testing and report back any issues they find (on this post). On sites that have MathJax enabled, you'll see a preference toggle under /users/preferences/current
that will enable MJv3 for your account.
If this in any way impedes your work please feel free to toggle back off to V2. If we need to roll this back for any reason, we can disable the toggle and serve all users v2 until any Sev 0 issues are fixed. Also, if there are any syntax choices that work better in v2 than v3, please stick with v2 while drafting new posts to optimize for all viewers until we've rolled this out everywhere.
Known Issues / Deltas / Mitigations
- Currently only the TeX font is available (HTML-CSS.availableFonts not implemented)
- Note: we used to allow STIX & TeX, but preferred TeX, so only having that option should be acceptable.
- The HTML-CSS.EqnChunk option is not yet implemented (but may be in a future release)
- Note: Chunking allows for the site to process small batches of changes to optimize load times. On mobile we chunked 10 at a time, on desktop 50. The new version is more efficient and does all loading in a single pass, so chunking is not really a concept there and much less of a need.
- Extension TeX/begingroup is not yet implemented (but may be in a future release)
- Note: Grouping allowed expressions from one post to not impact another by sideloading resources. This is not implemented for v3 so it's possible to have side-effects from multiple different posts on the same page. This may be a blocker for GA.
- The HTML-CSS.linebreaks option is not yet implemented (but may be in a future release)
- Note: This is a known limitation of v3, but it should be added back by v4. We had our configuration set to allow automatic linebreaking so long expressions should have wrapped. We will handle this in v3 with an overflow scrollbar when necessary. Example of Mathjax v2 vs v3 linebreaking comparison showing horizontal scrollbar in v3
- MHChem is now included in the base package by default, so we may eventually be able to do away with enabling mhchem on a site-by-site basis as it will automatically lazy load if used.
- Packages that are
\require
'd in many have been moved around, notably AMScd which seems to break spectacularly enough that JS throws for the entire page. I'll try to get a quick turnaround to patch that up, so we can focus on more edge case error reporting here.
Reporting / Future
A future consideration is how any content changes will work if we need to update syntax on posts between v2 and v3. For Example, in my testing AMScd seems to be case sensitive, which is gonna be a tricky migration if we need to fix during the upgrade, but maybe there's a programmatic solution we can unlock as well.
I wanna thank Davide Cervone for his helpful analysis here and ongoing project updates. Please feel free to report any issues you run into under this post, that'll be helpful for the full migration, but please be aware that there's not a team on this full time right now, so this is more to help line up and document remaining work than a full feature rollout at this point.
\sin
looks uneven in v3\color
command is a serious problem that needs to be fixed before making the upgrade, e.g. I have almost 2800 answers that use color to convey essential information. Destroying that info would make many of these answers much harder to icomprehend (possibly incomprehensible in many cases). Are you able to write a script to fix these on your end? (it's too much work and disruption for users to do so)