Basic Elements
- The
<math>
element is the containing element for all MathML expressions.
- The
<mn>
element is used to designate literal numbers, such as
or , and typically rendered in a normal style with a special serif font.
- The
<mi>
element is used to designate an identifier, such as
or , and typically rendered in italics for single character variables.
- The
<mo>
element is used to designate an operator such as
or .
- The
<mtext>
element is used to designate short text inside an formula or statement,
such as or .
- The
<ms>
element is used to represent a string literal, such as
, when the MathML is interpreted by programming languages and
computer algebra systems.
- The
<mspace>
element adds space within an expression, using three parameters:
depth, height, and width to specify the space below the baseline, the space above the
baseline, and width of the space, respectively. For example, .
- The
<merror>
element is used to display content as an error messages. For example,
- The
<mrow>
element is used to group together a set of elements so that they can be
treated as one by the container.
- The
<mfrac>
element creates a fraction out of the two interior elements, while external
operators are stretched vertically to match its height.
- The
<msqrt>
elementcreates a square root around the interior element.
- The
<mroot>
element creates a root around the first interior element with the second
element designated as the fractional power.
- The
<mover>
, <munder>
, and <munderover>
elements
are used to place symbols over, under, or both for special symbols like vectors, groupings, and summations.
- The
<msub>
, <msup>
, and <msubsup>
elements are used
to place symbols as subscripts, superscripts, or both.
- The
<mtable>
, <mtr>
, and <mtd>
elements are used to
create tables, row, and data elements for matrices or general layout control.
- The
columnspan
and rowspan
attributes can be used to size internal elements,
much like standard tables.
The <mmultiscripts>
element allows for the place of subscripts and superscripts
- The addition of a
<mprescripts>
element allows subscripts and superscripts to be
placed before the main symbol:
The <mstyle>
element is used to designate the style of the set of contained elements:
.
- Currently, all elements may be styled in this manner. So, this element functions much like the
<mrow>
element to group elements.
The <annotation>
, <annotation-xml>
, and <semantics>
elements are used to add presentation and content markup annotations and semantic meaning.
Stylistic Usage
- Using
<mo>
versus <mtext>
versus nothing for parentheses:
versus
versus
()
- versus
versus
- versus
- versus
versus
||
- versus
- versus
- The effect of display="block"
versus
- Horizontal Stretching:
Applying Tables
- Function definitions:
- Equation Derivations: