26
$\begingroup$

It seems it has been a long time since the MathJax has been updated on this site (probably MathJax 2.7 beta by @m0sa). So I was wondering if there is a plan to switch to newer version 3? (http://docs.mathjax.org/en/latest/upgrading/whats-new-3.0.html)

It should supposedly have better performance, unfortunately it is not a drop-in replacement (they changed it quite a lot). However since the version 2 will no longer be supported, this site should switch sooner or later.

Perhaps it could also fix some of the issues that have been reported but never fixed? (such as for example Plenty of [Math Processing Error]s before and after selecting duplicate in review queues or Redundant overlapping expressions in review queues when closing as duplicates).

$\endgroup$
  • $\begingroup$ Do we trust them, when they typo support ? $\endgroup$ – Roddy MacPhee Nov 17 at 16:36
  • 17
    $\begingroup$ It would be good to go to MathJax v3 at some point, but I suspect it is premature currently. In particular, the automatic line breaking hasn't been ported to v3 yet, and I suspect that is a deal breaker. Also, the editor preview MathJax code would need to be substantially rewritten. I did the original version, but haven't had time to work on a rewrite (and my method of testing it may no longer work). So an update to v3 is not a small project. Note that this site uses 2.7.5., which is (nearly) the latest v2 version (2.7.6 only updates one file, not used here). $\endgroup$ – Davide Cervone Nov 17 at 20:48
  • $\begingroup$ @DavideCervone Makes sense, in that case I guess it would be better to wait till these features are implemented/ready for use here. $\endgroup$ – Sil Nov 17 at 21:19
  • $\begingroup$ I've just noticed there is also an interesting alternative in KaTeX which have matured quite a lot since last considered, so I've post a more generic post on meta meta.stackexchange.com/questions/338933/… . $\endgroup$ – Sil Nov 23 at 11:49
  • 1
    $\begingroup$ One problem with an upgrade is: "MathJax version 2.7.5 has (claimed) 0 issues open, but MathJax version 3 has 31 issues open.". Also, we might need to have a 'radio button' (selectable in the question) to choose which version of MathJax is loaded on a per-page basis; since sometimes creative editing had been used to get everything just right (and we don't want to rewrite particularly difficult Q&As to get them to render correctly on v3). $\endgroup$ – Rob Nov 23 at 13:16
  • $\begingroup$ @Rob, your link to the 2.7.5 issues is to the milestone (which only includes the issues resolved in 2.7.5). There are 423 open issues for MathJax as a whole (and have been in the hundreds for the entire time SE has been using MathJax. The v3 and v2 issues are all supposed to be in the same issue tracker, but not everyone follows the request, so the 31 for v3 are only some of them. I don't think a radio button will be necessary, as the output is intended to be compatible between the two. I'm not sure what "creative editing" means, here. however. $\endgroup$ – Davide Cervone Nov 23 at 13:29
  • $\begingroup$ @sil, while it is true that KaTeX has come a long way since its initial release, the coverage of LaTeX for KaTeX and MathJax are not the same (each has coverage the other doesn't have), and so such a change would certainly break some posts. In addition, the editor preview code would still ne to be changed in order to accommodate KaTeX. Finally, not all the needed packages are available in KaTeX (e.g., mhchem as used on the Chemistry sites, for example). Such a change would be more difficult than upgrading to MathJax v3. $\endgroup$ – Davide Cervone Nov 23 at 13:34
  • $\begingroup$ @DavideCervone, re ^^, even with the breakage we've managed to get a good result (creative editing, sometimes). If you think the output will be identical that's good enough for me, and I'm glad that I upvoted this question. --- Re reply to user sil, yes let's not break anything or lose features. MathJax intensive webpages render adequately fast on my old phone, but some with older phones or laptops have complained about excessive load times. Simply working on optimizing render speed is a benefit that should be considered over switching to KaTex (or anything else) since we're invested. $\endgroup$ – Rob Nov 23 at 13:45
  • 1
    $\begingroup$ @Rob, Our preliminary tests show a 60% to 80% reduction in MathJax processing time (compared to the v2 CommonHTML output, which is its fastest renderer), but we don't have a lot of real-world data yet. On the other hand, SE uses the older HTML-CSS output format as the default, which is the slowest MathJax output. Switching to CommonHTML would already give you a speed boost in v2 (you can switch for your own use via the MathJax contextual menu to see if that improves the speed for you). It doesn't support the STIX fonts, which may be why SE hasn't changed to it. $\endgroup$ – Davide Cervone Nov 23 at 13:58
  • $\begingroup$ @DavideCervone Thanks. At least 20% faster on this webpage, at 9 seconds vs. 11 ( look at the \sum, in #2, to see how long it takes to rerender and increase its size the second round). $\endgroup$ – Rob Nov 23 at 14:07
  • $\begingroup$ @DavideCervone The mhchem actually seems to be supported as claimed here: katex.org/docs/libs.html#extensions. $\endgroup$ – Sil Nov 23 at 19:18
  • $\begingroup$ @sil, OK, interesting. They've taken the MathJax implementation and adapted it to their system. I don't see AMScd, however. Perhaps that is built in. $\endgroup$ – Davide Cervone Nov 24 at 20:29

You must log in to answer this question.

Browse other questions tagged .