The most basic elements of MathML are: mrow, mi, mo and mn.
Index | Elements | Descriptions |
---|---|---|
1) | <mrow> element | The MathML <mrow> element is used to group any number of sub expressions horizontally. |
2) | <mi> element | The MathML <mi> element is used to specify an identifier. |
3) | <mo> element | The MathML <mo> element is used to specify an operator in a broad sense. |
4) | <mn> element | The MathML <mn> element is used to specify a numeric literal. |
For example: To write x + y = 5, the equivalent MathML code are:
- <mrow>
- <mrow>
- <mi>x</mi>
- <mo>+</mo>
- <mi>y</mi>
- </mrow>
- <mo>=</mo>
- <mn>2</mn>
- </mrow>
<mrow> element:
The MathML <mrow> element is used to group any number of sub expressions horizontally.
<mi> element:
The MathML <mi> element is used to specify an identifier. For example: the name of a variable, a constant, a function, etc.
about:blank
It automatically renders the identifier using an italic font, if the identifier is one character long; otherwise the name is rendered using a normal, upright font.
<mo> element:
The MathML <mo> element is used to specify an operator in a broad sense. For example: addition operator ‘+’, a fence operator ‘{‘ or a separator ‘,’
The appropriate amount of space is added on the left and on the right of an <mo> element depending on the textual contents of this element.
For example: if in the above expression you replace <mo>+</mo> by <mo>,</mo>, this will suppress the space at the left of the mo element.
<mn> element:
The MathML <mn> element is used to specify a numeric literal.
For example: PI should be specified as <mi>PI</mi> and not as <mn>PI</mn> while 3.14 should be specified as <mn>3.14</mn> and not as <mi>3.14</mi>.
Leave a Reply