|
MathML
An Introduction |
|
Prof. David Bernstein |
| Computer Science Department |
| bernstdh@jmu.edu |
math Elementmath elementdisplay can be "block" or
"inline"
overflow can be "linebreak",
"scroll", "elide" (i.e., abbreviate),
"truncate", or "scale"
alttext provides a text alternative as a
fall-backmi - an identifiermo - an operatormn - a number
<!DOCTYPE html>
<html>
<body>
<p>An Identifier:
<math>
<mi>x</mi>
</math>
</p>
<p>An Operator:
<math>
<mo>+</mo>
</math>
</p>
<p>Another Operator:
<math>
<mo>⁢</mo>
</math>
</p>
<p>A Number:
<math>
<mn>2</mn>
</math>
</p>
</body>
</html>
mrow
mfenced
<mrow> that contains an
<mrow> for the sub-expression \(ax\))
<!DOCTYPE html>
<html>
<body>
<p>A Row:
<math>
<mrow>
<mi>x</mi> <mo>+</mo> <mn>2</mn>
</mrow>
</math>
</p>
<p>A Fenced Row:
<math>
<mfenced open="(" close=")" separators="">
<mi>x</mi> <mo>+</mo> <mn>2</mn>
</mfenced>
</math>
</p>
<p>Nesting:
<math>
<mrow>
<mrow>
<mi>a</mi> <mo>⁢</mo> <mn>x</mn>
</mrow>
<mo>+</mo>
<mi>b</mi>
</mrow>
</math>
</p>
</body>
</html>
msup or msub - superscript or
subscriptmsubsup - subscript and superscriptmover or munder - above or
belowmunderover - below and above
<!DOCTYPE html>
<html>
<body>
<p>A Simple Superscript:
<math>
<msup>
<mi>x</mi> <mn>2</mn>
</msup>
</math>
</p>
<p>A Complicated Subscript:
<math>
<msub>
<mi>a</mi> <mrow> <mi>i</mi> <mo>+</mo> <mn>1</mn></mrow>
</msub>
</math>
</p>
<p>A Complicated Subscript and Superscript:
<math>
<msubsup>
<mo>∑</mo>
<mrow><mi>i</mi> <mo>=</mo> <mn>1</mn></mrow>
<mi>n</mi>
</msubsup>
</math>
</p>
<p>A Simple Above:
<math>
<mover>
<mi>x</mi> <mo>^</mo>
</mover>
</math>
</p>
<p>A Complicated Below:
<math>
<munder>
<mrow><mi>x</mi> <mo>+</mo> <mi>y</mi></mrow>
<mo>⏟</mo>
</munder>
</math>
</p>
</body>
</html>
mfrac Element:
<!DOCTYPE html>
<html>
<body>
<p>
A Simple Fraction:
<math>
<mfrac>
<!-- Numerator -->
<mrow>
<mi>x</mi>
</mrow>
<!-- Denominator -->
<mrow>
<mn>2</mn>
</mrow>
</mfrac>
</math>
</p>
<p>
A More Complicated Fraction:
<math>
<mfrac>
<!-- Numerator -->
<mrow>
<mn>2</mn> <mo>⁢</mo> <mi>x</mi>
</mrow>
<!-- Denominator -->
<mfenced>
<mfrac>
<!-- Numerator -->
<mrow>
<mi>a</mi> <mo>+</mo> <mi>b</mi>
</mrow>
<!-- Denominator -->
<mrow>
<mi>c</mi> <mo>⁢</mo> <mi>d</mi>
</mrow>
</mfrac>
</mfenced>
</mfrac>
</math>
</p>
</body>
</html>
msqrt and mroot for radicals
mtable (containing mtr and mtd)
for matrices and vectors
mlongdiv for long division (e.g.,
to explain division)
mscarries for carries, borrows, and crossouts (e.g.,
to explain elementary arithmetic)