As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact
Last Comment Bug 687809 - (mathml-in-mathjax) MathML in MathJax
: MathML in MathJax
Status: NEW
: meta
Product: Core
Classification: Components
Component: MathML (show other bugs)
: Trunk
: All All
: -- normal with 9 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: Anthony Jones (:kentuckyfriedtakahe, :k17e)
Depends on: linebreaksAroundMath stretch-mtd-math mathml-fonts mathml-linebreaking maction mlabeledtr-support mathvariant upright-mi row-column-spacing mlabeledtr 415413 442637 459363 491384 mpadded-voffset negative-namedspaces 685628 687807 697053 mathjax-fonts 717546 mtable-width 732830 732832 mathjax-in-math-text 854339 875294 877563 941607 941611
Blocks: mathjax
  Show dependency treegraph
Reported: 2011-09-20 03:56 PDT by Frédéric Wang (:fredw)
Modified: 2016-02-02 07:51 PST (History)
21 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Frédéric Wang (:fredw) 2011-09-20 03:56:35 PDT
MathJax is a popular Javascript library to display mathematical formulas in any browser. For Firefox, the native MathML rendering is used. MathJax is also able to convert LaTeX to MathML. However, our MathML support has some issues that prevent the markup generated by MathJax to render correctly. This makes some people switch to MathJax's layout engine and it's a shame.

This is a tracking bug for issues that have been reported by MathJax folks. It looks like more and more people are using MathML throughout this library and so it seems important to fix these bugs.
Comment 1 User image [Baboo] 2011-09-21 03:29:03 PDT
Printing issues reproducible using MathJax too?
Comment 2 User image [Baboo] 2011-09-21 03:30:56 PDT
MathJax using MathML-based rendering that is.
Comment 3 User image Frédéric Wang (:fredw) 2011-10-24 10:27:55 PDT
MathJax also has its own Open Type fonts, which look closer to LaTeX fonts and thus are often preferred by MathJax users. That may be interesting to see if we can support them. They do not seem to contain an OpenType MATH table, though.
Comment 4 User image Frédéric Wang (:fredw) 2011-10-25 04:11:15 PDT
Adding bug 468568.
See MathJax issue tracker:
Comment 5 User image Frédéric Wang (:fredw) 2011-10-25 04:12:55 PDT
(In reply to Frédéric Wang from comment #4)
> Adding bug 468568.
> See MathJax issue tracker:

Sorry it is
Comment 6 User image Frédéric Wang (:fredw) 2011-10-25 04:20:36 PDT
(In reply to [Baboo] from comment #1)
> Printing issues reproducible using MathJax too?

I've added dependencies to bug 697053 and bug 468568.
Comment 7 User image lasdka88+mozbugs 2011-10-31 08:11:54 PDT
*** Bug 698375 has been marked as a duplicate of this bug. ***
Comment 8 User image Frédéric Wang (:fredw) 2012-02-14 07:54:16 PST
Another bug due to bad width computation (testcase to reduce):
Comment 9 User image Frédéric Wang (:fredw) 2012-02-29 11:27:14 PST
Things to do for MathJax fonts:
- horizontal braces (see bug 701758 comment 2)
- add rules in mathml.css (see bug 701758 comment 13)
- allow use of downloadable fonts (see bug 701758 comment 17)
Comment 10 User image Frédéric Wang (:fredw) 2012-04-28 07:22:38 PDT
MathJax has three commands \mathtip, \texttip and \toggle that generate maction elements:
Comment 11 User image elim.qiu 2012-05-12 14:33:11 PDT
I noticed that Firefox on snow leopard is extremely slow with MathJax content.

Please open this page with various browsers.

Stop and reload is helps but it's just strange why the page cannot load in the first request
Comment 12 User image Frédéric Wang (:fredw) 2012-05-14 01:34:35 PDT
(In reply to elim.qiu from comment #11)
> I noticed that Firefox on snow leopard is extremely slow with MathJax
> content.
> Please open this page
> with various
> browsers.
> Stop and reload is helps but it's just strange why the page cannot load in
> the first request

This bug is to track MathML issues related to MathJax. Apparently, the page you refer to seems to use MathJax's HTML-CSS rendering so your problem would better be handled on the MathJax side or, if one can determine a precise reason of slowness in Firefox, as a dependency of bug 745687.

Anyway, MathJax's rendering engine is entirely written in Javascript and that's why it is so slow compared to the native rendering of browsers, especially for pages that contain a lot of formulas. Maybe MathJax's code can still be optimized (improvements have been made in version 2.0, but the page you mention still uses version 1.1) and Javascript execution in browsers can be made faster. But this will never be as efficient as Gecko's native rendering. So your problem will really be fixed by making MathJax use Firefox's MathML by default again, which is now the main goal of the present bug entry.

Other possible reasons:
- download time of Web fonts: to fix that, you can install local version of MathJax/STIX fonts on your system.
- LaTeX parsing: could be made faster if done before serving the page.

BTW, for those following this bug, Wikipedia now has an experimental MathJax option:

Note You need to log in before you can comment on or make changes to this bug.