MathML Basic Elements



  • The most basic elements of MathML are: mrow, mi, mo and mn.
 Basic Elements

Basic Elements

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 Eg: To write x + y = 5, the equivalent MathML Code are:

Sample Code

<mrow>  
  <mrow>  
    <mi>x</mi>  
    <mo>+</mo>  
    <mi>y</mi>  
  </mrow>  
  <mo>=</mo>  
  <mn>5</mn>  
</mrow>

Output

 Basic Elements2

Basic Elements

Read Also

<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 ex: The name of a variable, a continuing , a function, etc.
  • It automatically renders the identifier using an italic font, if the identifier is one character long; otherwise the name is rendered with help of normal, upright font.

<mo> element

  • The MathML <mo> element is used to specify an operator during a broad sense. For Ex: addition operator '+', fence operator '{' or a separator ','
  • The appropriate amount of space is added on the left and on the right of an <mo> element based on the textual contents of this element.
  • For ex: In the above expression you replace <mo> + <mo> by <mo> , <mo>, this may suppress the space at the left of the mo element.

<mn> element

  • The MathML <mn> element is used to specify a numeric literal.
  • For eg: 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>.


Related Searches to MathML Basic Elements