Skip to content
This repository

MathML Support in Browsers and MathML output Jax

Introduction

This page describes MathML support in browsers and how well they display the code generated by MathJax. Compared to MathJax the browser's MathML rendering engines are generally faster but of lower quality.

It is intended to serve as a help for people who have plan to use mathematical formulas in their applications or Web content and are trying to find the best solution between a MathML output or other output formats provided by MathJax. It is also a way for the MathJax team to decide on which browser the MathML output processor should be enabled by default and for the users to determine which rendering mode to choose. This document may eventually encourage browser vendors to improve their MathML layout engines by suggesting them to focus on MathJax's needs.

General remarks

Internet Explorer

Internet Explorer does not support MathML and there are no apparent plans to add such support, although others of their products like Microsoft Word have long been able to handle this language.

To remedy this situation, Design Science provides the MathPlayer plug-in which gives a good MathML support to Internet Explorer. The Design Science and MathJax teams collaborate to ensure that MathPlayer works well with MathJax and keep MathPlayer's layout engine the default renderer for Internet Explorer.

MathJax works with MathPlayer to make math accessible to screen readers, to screen magnifiers, and to learning disability software. See Accessible Pages with MathJax for details.

Firefox

Firefox has a good MathML support and should work well with the code generated by MathJax in most situation provided you install mathematical fonts. However because of some rendering issues, the MathJax team decided to disable Firefox's native MathML by default. In particular we do not recommend to use this rendering if you plan to make heavy use of equation labelling or formula linebreaking.

See also the MathML-in-MathJax tracking bug.

Webkit

Webkit has an experimental MathML implementation which is enabled in Safari but the support is still limited and the rendering quality not very high. This implementation has not passed Google's security review and so is not integrated yet in Chrome.

See also the MathML-in-MathJax tracking bug.

Opera

Opera has a support for a subset of MathML implemented using a CSS stylesheet. This choice of implementation design implies several issues, including a bad quality. This may be acceptable for elementary mathematical notations but is not recommended for complex formulas or in cases where the rendering quality is an essential point.

Supported input commands and MathML elements

Here is a table indicating support for various MathJax input commands provided by the TeX processors.

TeX input processor

Commands Test pages Comments MathPlayer Firefox Webkit Opera
Accents accents-1 See issue 216 OK OK some accents do not stretch too much space between base and accent ; some accents do not stretch
\skew accents-2 OK negative mspace not handled correctly mspaces are ignored mspaces are ignored
\buildrel, \overbrace, \overset, \sideset, \stackrel, \subarray, \substack, \underbrace, \underset buildrel-1, overbrace-1, overset-1, sideset-1, stackrel-1, subarray-1, underbrace-1, underset-1 base and scripts overlap in sideset-1 bad spacing in subarray-1 (@rowspacing/@columnspacing not supported) operators not stretched ; bad vertical alignment of scripts in sideset-1 bad spacing between base and accent ; operators not stretched
\mathtip, \texttip, \toggle mathtip-1, texttip-1, toggle-1 OK maction: tooltip actiontype not supported maction not supported toggle-1: toggle actiontype not supported
Arrows arrows-1, arrows-2, arrows-3, arrows-4, arrows-5, Newextarrow-1 The arrow used in Newextarrow is not really stretchable with available fonts. arrows-3: arrows not stretched ; bad vertical alignment of arrows and numbers ; arrows-5: some operators are very big ; Newextarrow: arrow not stretched arrows-3: arrows not stretched ; bad vertical alignment of arrows and numbers ; Newextarrow: the arrow is "scaled" some arrows not stretched too much space between base and accent ; some arrows not stretched
\mathbin, \mathinner, \mathop, \mathop \mathopenclose, \mathord, \mathpunct, \mathrel mathbin-1, mathinner-1, mathop-1a, mathop-1b, mathop-2, mathopenclose-1, mathord-1, mathpunct-1, mathrel-1 These commands only define the type of an atom, so simply require basic support for token MathML elements OK OK OK OK
\!, \#, \$, \%, \&, \, \:, \;, \>, \_, \{, \|, \}, +, -, =, !, ', :, ., /, ^, _, {, }, ~, #, &, \\, % backslashed-1, basic-operators-1, basic-operators-2 OK OK can not display backslashed-1? backslashed-1: negative space not supported?
\color, \colorbox, \fcolorbox, \definecolor color-1, color-2, colorbox-1, fcolorbox-1, definecolor-1a, definecolor-2, namedcolors-1, fcolorbox: style attribute not used OK problems with mpadded (not supported?) colors not used
Delimiters big-1, big-2, big-3, delimiters-1, delimiters-2, left-right-1, big-*: minsize ignored ; delimiters-1: some operators stretch even if @stretchy=false OK big-*: minsize ignored ; left-right-1: mfenced delimiters not displayed delimiters do not stretch
Environments align, alignat, aligned, eqalign, eqalignno, eqnarray, equation, gather, gathered, leqalignno, multiline, split align-1a, align-1b, alignat-1a, alignat-1b, aligned-1, aligned-2, alignedat-1, eqalign-1, eqalignno-1, eqnarray-1a, eqnarray-1b, equation-1, equation-2, gather-1a, gather-1b, gathered-1, gathered-2, leqalignno-1, multiline-1a, multiline-1b, split-1, aligned-2, gathered-2: bad vertical alignment OK alignat-1*, alignedat-1: bad horizontal alignment; equation-1: menclose@box ignored ; equation-2, aligned-2, gathered-2: bad vertical alignment alignat-1*, alignedat-1: bad horizontal alignment; aligned-2, gathered-2: bad vertical alignment
\above, \abovewithdelims, \atop, \atopwithdelims, \binom, \brace, \brack, \cfrac, \choose, \dbinom, \dfrac, \frac, \genfrac, \tbinom, \tfrac, \overwithdelims above-1, abovewithdelims-1, atop-1, atopwithdelims-1, binom-1, brace-1, brack-1, cfrac-1, choose-1, dbinom-1, dfrac-1, frac-1a, frac-1b, genfrac-1, tbinom-1, tfrac-1, overwithdelims-1 OK OK some mfrac@linethickness attributes ignored ; some mfenced delimiters not displayed some mfrac@linethickness attributes ignored
\boxes, \kern, \llap, \lower, \mathstrut, \moveleft, \moveright, \newline, \phantom, \raise, \rlap, \shove, \skip, \skip, \smash, \spaces, \strut, \vcenter boxes-1, kern-1a, kern-1b, llap-1, lower-1, mathstrut-1, moveleft-1, , newline-1, phantom-1, raise-1, rlap-1, shove-1, skip-1a, skip-1b, smash-1, spaces-1, strut-1, vcenter-1 These are essentially tests for layout commands and may be difficult to verify visually. OK Negative mspace@width not supported ; @rowspacing/@columnspacing not supported ; menclose not supported; Negative mspace@width not supported ; @rowspacing/@columnspacing not supported ; mpadded not supported ; delimiters of mfenced not displayed Negative mspace@width not supported ; @rowspacing/@columnspacing not supported ; mpadded not supported
Greek and Hebrew letters greek-1, greek-2, greek-3 greek-4 hebrew-1 Various characters that should be displayed correctly provided the appropriate fonts are installed. OK OK OK hebrew-1: some letters not displayed
\begingroup, \endgroup, \def, \let, \newcommand, \renewcommand, \newenvironment begingroup-1, def-1, let-1, macro-1a, macro-1b, macro-2, macro-3, macro-4, macro-5 macro-6, macro-7 These commands allow to define macros and do not require any particular MathML features OK OK OK OK
\Bbb, \bf, \boldsymbol, \cal, \frak, \it, \mathbb, \mathbf, \mathbf, \mathbf, \mathcal, \mathfrak, \mathit, \mathrm, \mathsf, \mathtt, \mit, \pmb, \rm, \sf, \text, \textbf, \textit, \textrm, \tt Bbb-1, bf-1, boldsymbol-1, cal-1, frak-1, it-1, mathbb-1, mathbf-1a, mathbf-1b, mathbf-2, mathcal-1, mathfrak-1, mathit-1, mathrm-1, mathsf-1, mathtt-1, mit-1, pmb-1, rm-1, sf-1, text-1, textbf-1, textit-1, textrm-1, tt-1 Bbb-1, cal-1, mathbb, mathcal: red question mark (@mathvariant=double-struck, @mathvariant=script not supported?) @mathvariant=double-struck, @mathvariant=script not supported Some mathvariant attributes not supported ; bad spacing between accent and base ; mpadded@width not supported Some mathvariant attributes not supported ; bad spacing between accent and base ; mpadded@width not supported
Environments array, bmatrix, matrix, pmatrix, smallmatrix, vmatrix array-1a, array-1b, array-2, array-3, bmatrix-1, bmatrix-2, matrix-1, matrix-2, pmatrix-1, pmatrix-2 smallmatrix-1, vmatrix-1, vmatrix-2, OK @rowspacing/@columnspacing not supported @rowspacing/@columnspacing not supported ; menclose@notation=top not supported ; mfenced delimiters not displayed ; vmatrix-2: delimiters do not stretch @rowspacing/@columnspacing not supported
\class, \cssId, \href, \require, \Rule, \style, \Tiny, \unicode Rule-1, Tiny-1, class-1, cssId-1, href-1, href-2, require-1 style-1, unicode-1 These are non-standard LaTeX commands, that do not all have a visual effect. style-1: style attribute ignored style-1: text-decoration=underline ignored Rule-1: mpadded not rendered correcly ; href-1, href-2: @href not supported ; require-1: characters not displayed, mfenced operators not displayed Rule-1: mpadded not rendered correcly ; Tiny-1: mathsize ignored ; href-1, href-2: @href not supported ; style-1: style attribute ignored
\eqref, \label, \notag, \nonumber, \ref, \tag eqref-1, label-1, notag-1, ref-1a, ref-1b, ref-2, ref-3, tag-2 OK mlabeledtr not supported mlabeledtr not supported ; @href not supported mlabeledtr not supported ; @href not supported
\root\of, \leftroot, \uproot root-1, root-2, root-3 OK OK mpadded not supported mpadded not supported
\sqrt sqrt-1, sqrt-2 OK OK OK OK
Large operators largeops-1 See issue 216 bad vertical alignment OK operators too small operators too small
Various symbols binaryops-1, dots-1, relations-1, symbols-1, symbols-2, symbols-3, symbols-4, symbols-5, symbols-6 Various characters that should be displayed correctly provided the appropriate fonts are installed. OK OK OK OK
\TeX, \LaTeX LaTeX-1 Bad vertical alignment Negative mspace@width not supported Bad positioning and size Bad positioning and size
\bbox bbox-1 @style attribute ignored OK Bad size of mpadded boxes Boxes and colors ignored
\boxed boxed-1 OK OK menclose not supported OK
\cancel, \bcancel, \xcancel, \cancelto cancel-1 MathJax uses a non standard syntax to make \cancelto display an arrow OK OK menclose not supported menclose attributes not supported ; mpadded not supported
\displaylines displaylines-1 OK @rowspacing/@columnspacing not supported @rowspacing/@columnspacing not supported @rowspacing/@columnspacing not supported
\enclose enclose-1 MathJax uses a non standard syntax to display an arrow OK OK menclose not supported menclose attributes not supported
\mod, \bmod, \pmod mod-1 OK OK mi with several characters in italic OK
\not not-1 OK OK OK OK
\pod pod-1 OK OK OK OK
Primes, \backprime \prime primes-1 See issue 216 OK OK backprime not displayed OK
\tiny, \small, \normalsize, \large, \Large, \LARGE, \huge, \Huge, \scriptsize mathsize-1 OK OK OK @mathsize not supported
\textstyle, \displaystyle, \scriptscriptstyle, \scriptstyle, \oldstyle style-1, style-2 OK OK @scriptlevel/@displaystyle ignored @scriptlevel/@displaystyle ignored
\verb verb-1 OK OK OK OK
\arccos, \arcsin, \arctan, \arg, \cos, \cosh, \cot, \coth, \csc, \deg, \det, \dim, \exp, \gcd, \inf, \hom, \ker, \lg, \lim, \liminf, \limsup, \ln, \log, \max, \min, \Pr, \sec, \sin, \sinh, \sup, \tan, \tanh, functions-1 OK OK OK OK
\limits, \nolimits, \injlim, \projlim, \varinjlim, \varliminf, \varlimsup, \varprojlim limits-1, limits-2, limits-3 See issue 215 OK limits-2: too much spaces between mi limits-2: Horizontal accents not stretched limits-2: Bad positioning of accent ; Horizontal accents not stretched

MathML input processor

In theory, one can use the MathML input processor to enter arbitrary input allowed by the MathML 3 recommendation. We give a general overview for elements, attributes or general MathML features supported by MathJax. The table below is not too strict and "OK" may also mean partial support. For details, please read the documentation provided by the browser vendors:

Elements (basic support) MathPlayer Firefox Webkit Opera
<mi>, <mn>, <mo>, <mtext>, <ms> OK OK OK OK
<mrow> OK OK OK OK
<mfrac> OK OK OK OK
<msqrt> OK OK OK OK
<mroot> OK OK OK OK
<mstyle> OK OK OK Not supported
<merror> OK OK OK OK
<mpadded> OK OK Not supported Not supported
<mphantom> OK OK OK OK
<mfenced> OK OK OK OK
<menclose> OK OK Not supported OK
<msub>, <msup>, <msubsup> OK OK OK OK
<munder>, <mover>, <munderover> OK OK OK OK
<mmultiscripts> OK OK Not supported Not supported
<mtable>, <mtr>, <mtd> OK OK OK OK
<maligngroup> OK Not supported Not supported Not supported
<malignmark> OK Not supported Not supported Not supported
<mglyph> OK Not supported Not supported Not supported
<maction> OK OK Not supported OK
<semantics> OK OK Not supported Not supported
Feature MathPlayer Firefox Webkit Opera
Operator Stretching OK OK Partial Not supported
Embellished Operators OK OK Not supported Not supported
Something went wrong with that request. Please try again.