-
MathType
-
Wiris Quizzes
-
Learning Lemur
-
CalcMe
-
MathPlayer
-
Store FAQ
-
VPAT for the electronic documentation
-
MathFlow
-
BF FAQ
MathML and HTML5
Reading time: 1minHTML5 updated HTML4 to help meet the needs of modern web architecture. One of those updates brought math support into HTML5 via MathML. Most MathML will work just fine in HTML5, but here are a few things to watch out for:
HTML5 normally doesn't care about namespaces and puts all of the elements in the HTML namespace; MathML and SVG are the two exceptions to this rule. For compatibility with XTHML 1.x and XHTML5, the math tag should include the MathML namespace as shown below:
<math xmlns="http://www.w3.org/1998/Math/MathML"> … </math>
Another namespace issue arises with the use of annotation-xml
inside of semantics
. Inside of MathML, all elements are placed in the MathML namespace with two exceptions: inside some annotation-xml
elements and inside of mtext
elements.
The first exception allows you to include an HTML alternative encoding inside of a semantics
elements. The exception happens when the encoding attribute for annotation-xml
is either "text/html" or "application/xhtml+xml". In these cases, the elements are placed inside the HTML namespace and can be manipulated by script or styled by CSS if made visible. For other encodings, the non-HTML5 elements are placed in the MathML namespace even if they are declared to be in another namespace (eg, http://www.openmath.org/OpenMath ). If you use XHTML5 which is namespace aware, namespaces inside of MathML should be handled properly.
The second exception is inside of mtext
. HTML5 extends MathML by allowing HTML5 elements inside of mtext. These elements are placed in the HTML namespace. It is not recommended that you make use of this extension because it is unlikely to work in other environments.
If HTML tags occur elsewhere inside of a MathML element (with the two exceptions above), the MathML element is terminated (closed off) by the HTML5 parser at that point. That is almost certainly not what most authors intend, so care should be taken when adding HTML5 in MathML.