The support for MathML in MathJax involves two functions: the first
<math> tags within your document and marks them for
later processing by MathJax, and the second converts the MathML to the
internal format used by MathJax, where one of MathJax’s output
processors then displays it in the web page.
Although some browsers have native support for rendering MathML, not all do, and so MathJax makes it possible to view MathML notation in all browsers. Even for those that do support MathML, it may be valuable to use MathJax, since that will produce consistent output across all browsers, and MathJax implements features and functionality that is not available in some native MathML implementations.
MathML in HTML pages¶
For MathML that is handled via the preprocessor, you should not use
named MathML entities, but rather use numeric entities like
√ or unicode characters embedded in the page itself. The
reason is that entities are replaced by the browser before MathJax
runs, and some browsers report errors for unknown entities. For
browsers that are not MathML-aware, that will cause errors to be
displayed for the MathML entities. While that might not occur in the
browser you are using to compose your pages, it can happen with other
browsers, so you should avoid the named entities whenever possible.
If you must use named entities, you may need to declare them in the
DOCTYPE declaration by hand.
When you use MathML in an HTML document rather than an XHTML one (MathJax will work with both), you should not use the “self-closing” form for MathML tags with no content, but should use separate open and close tags. That is, use
<mspace width="thinmathspace" />. This is because
HTML does not have self-closing tags, and some browsers will get the
nesting of tags wrong if you attempt to use them. For example, with
<mspace width="1em" />, since there is no closing tag, the rest of
the mathematics will become the content of the
<mspace> tag; but
<mspace> should have no content, the rest of the mathematics
will not be displayed. This is a common error that should be avoided.
Modern browsers that support HTML5 should be able to handle
self-closing tags, but older browsers have problems with them, so if
you want your mathematics to be visible to the widest audience, do not
use the self-closing form in HTML documents.
The version 2
content-mathml extension is not yet available in
Experimental mml3 extension¶
The version 2
mml3 extension is not yet available in version 3.
Semantics and Annotations¶
Some popular annotation formats like TeX, Maple, or Content MathML are
often included in the MathML source via the
This is particularly true of MathML that is generated by other
software, such as editors or computational tools.
MathJax provides access to these annotations through the
As" menu, via the
Annotations submenu. See the MathML Annotation Framework and
the Contextual Menu Options documentation for details.