These slides are in XHTML, and follow the approach described on a separate page for presentation. That page describes the minimum environment you should have to display these slides with the proper MathML content.
Current solutions to display math on the Web:
a<sub>i</sub>
))
<mrow> <mi>x</mi> <mo>=</mo> <mfrac> <mrow> <mrow><mo>-</mo><mi>b</mi></mrow> <mo>±</mo> <msqrt> <mrow> <msup><mi>b</mi><mn>2</mn></msup> <mo>-</mo> <mrow> <mi>c</mi> </mrow> </mrow> </msqrt> </mrow> <mrow> <mi>a</mi> </mrow> </mfrac> </mrow> |
|
XML Elements in MathML are:
math
element, which binds a formula to the surrounding XML (eg., XHTML)Note: earlier versions relied on XML Entities for special signs (integrals, greek letters, etc), but Unicode has taken over…
Presentation Markup | Content Markup |
---|---|
<msup> <mfenced> <mrow> <mi>a</mi> <mo>+</mo> <mi>b</mi> </mrow> </mfenced> <mn>2</mn> </msup> |
<apply> <power/> <apply> <plus/> <ci>a</ci> <ci>b</ci> </apply> <cn>2</cn> </apply> |
Presentation elements fall in two categories:
identifier, number |
<mi>a</mi> <mn>2</mn> |
|
operator, separator, or accent |
<mi>a</mi><mo>→</mo><mi>b</mi> |
|
text |
<mtext>Theorem 1:</mtext> |
Attributes to control the precise rendering, eg,
<mo> ( </mo> |
||
<mo maxsize="1"> ( </mo>
|
subexpressions |
<mrow><mi>a</mi><mi>b</mi></mrow> |
|
fraction |
<mfrac><mi>a</mi><mi>b</mi></mfrac> |
|
square root |
<msqrt><mi>a</mi></msqrt> |
radical |
<mroot><mi>a</mi><mi>b</mi></mroot> |
|
surround content |
<mfenced open="[" separators=";"> <mi>a</mi><mi>b</mi> </mfenced> |
subscript |
<msub><mi>x</mi><mi>i</mi></msub> |
|
superscript |
<msub><mi>x</mi><mi>i</mi></msub> |
|
tensor indices |
<mmultiscripts><mi>R</mi> <mi>i</mi><mi>j</mi><mi>k</mi><mi>l</mi> <mprescripts/><mi>a</mi><none/><mi>b</mi> ... </mmultiscripts> |
table |
<mrow><mo> [ </mo> <mtable> <mtr> <mtd><mn>1</mn></mtd> <mtd><mn>0</mn></mtd> <mtd><mn>0</mn></mtd> </mtr> ... </mtable> <mo> ] </mo></mrow> |
|
row | ||
entry |
align |
<mtable groupalign="decimalpoint left ..."> <mtr><mtd><mrow> <maligngroup/> <mn> 8.44 </mn> <maligngroup/> <mi> x </mi> ... </mrow></mtd></mtr> <mtr><mtd><mrow> <maligngroup/> <mn> 3.1 </mn> <maligngroup/> <mi> x </mi> ... </mrow></mtd></mtr> </mtable> |
<maction actiontype="toggle" selection="2"> <mrow>...</mrow> <mrow>...</mrow> </maction> |
Other possible action types (depending on the rendering engine)
Content markup reflects the structure of formulae:
|
Content markup reflects the structure of formulae:
<apply><int/> <bvar><ci>t</ci></bvar> <lowlimit><cn>0</cn></lowlimit> <uplimit><cn>1</cn></uplimit> <apply><power/> <ci>t</ci> <cn>2</cn> </apply> </apply> |
MathML does not define the exact mapping from content markup to rendering (only a "Default Rendering" is defined).
Number |
<cn type="complex-cartesian"> 3<sep/>4 </cn> |
|
Variable |
<apply> <ci>F</ci> <ci>x</ci> </apply> |
|
Apply construct | ||
Numeric interval |
<interval closure="open-closed"> <cn>3</cn><cn>4</cn> </interval> |
Functions and operators |
<apply><laplacian/> <ci>f</ci> </apply> |
|
Inverse function |
<apply> <apply><inverse/><sin/></apply> <ci>x</ci> </apply> |
Condition |
<apply> <max/> <condition> <apply><and/> <apply><in/> <ci>x</ci> <ci type="set">B</ci> </apply> <apply><notin/> <ci>x</ci> <ci type="set">C</ci> </apply> </apply> </condition> <ci>x</ci> </apply> |
Matrices |
<matrix> <matrixrow> <cn> 1 </cn> <cn> 2 </cn> </matrixrow> <matrixrow> <cn> 3 </cn> <cn> 4 </cn> </matrixrow> </matrix> |
|
Piecewise |
<piecewise> <piece> <apply><minus/> <ci> x </ci> </apply> <apply><lt/> <ci> x </ci> <cn> 0 </cn> </apply> </piece> <piece>...</piece> </piecewise> |
quotient, exp, max, min, root, and, xor, forall, exists, floor
...eq, neq, equivalent,
...ln, int, partialdiff, diff, limit, laplacian
...list, union, intersect, cartesian product
...sum, product,
...mean, variance, moment
...sin, arccos,
...vector, matrix, vector product,
...integers, reals, pi, infinity,
...Altogether cca. 100 elements!
<apply> <mrow> <msub> <mi>F</mi> <mi>i</mi> </msub> </mrow> <ci>x</ci> </apply> |
definitonURL
to override default semantics (eg, infix, postfix)csymbol
:<!-- reference to OpenMath definition of Bessel function -->
<apply>
<csymbol encoding="OpenMath"
definitionURL="http://www.openmath.org/...">
<msub><mi>J</mi><mn>0</mn></msub>
</csymbol>
<ci>y</ci>
</apply>
<semantics>
<apply>
<divide/>
<cn>123</cn>
<cn>456</cn>
</apply>
<annotation encoding="Mathematica">
N[123/456, 39]
</annotation>
<annotation encoding="Maple">
evalf(123/456, 39);
</annotation>
<annotation-xml encoding="OpenMath">
<OMA xmlns="http://www.openmath.org/OpenMath">
<OMS cd="arith1" name="divide"/>
<OMI>123</OMI>
<OMI>456</OMI>
</OMA>
</annotation-xml>
</semantics>
math
element:
embed
:<embed src="mmls/mixExample.mml" height="60" width="110" />
object
:<object type="application/mathml+xml"
data="mmls/mixExample.mml"
height="60" width="110"></object>
iframe
can also be an alternative in some cases…Using XHTML, the math content should be directly includable:
<body>
<p>Bla bla bla</p>
<m:math xmlns:m="http://www.w3.org/1998/Math/MathML">
<m:mrow>...<m:mrow>
</m:math>
</body>
<?xml version="1.0" encoding="iso-8859-1" ?>
<?xml-stylesheet type="text/xsl" href="mathml.xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
…