"math" - MathML Root Element

Q

How to use the MathML Root Element: "math"?

✍: FYIcenter.com

A

"math" is the MathML Root Element that allows you to start new MathML structure to present in a mathematical express.

The syntax for "math" element is:

<math xmlns="http://www.w3.org/1998/Math/MathML"
  display="inline" | "block"
  overflow="linebreak" | "scroll" | "elide" | "truncate" | "scale">
   MathML sub-elements 
</math>

Note that "math" element has 3 commonly used attributes:

  • "xmlns" - Specifies the MathML namespace.
  • "display" - Specifies the display style. Default is "inline".
  • "overflow" - Specifies the behavior of horizontal overflow. Default is "linebreak".

Here is an example showing the behavior of the "display" attribute.

<p>Einstein famous equation,
<math display="inline">
  <mrow>
    <mi>E</mi> <mo>=</mo> <mi>m</mi><msup><mi>c</mi><mn>2</mn></msup>
  </mrow>
</math>,
displayed as "inline".
</p>

<p>Einstein famous equation:
<math display="block">
  <mrow>
    <mi>E</mi> <mo>=</mo> <mi>m</mi><msup><mi>c</mi><mn>2</mn></msup>
  </mrow>
</math>
displayed as "block".
</p>

Most browsers will display the above example as:

Einstein famous equation, E = mc2 , displayed as "inline".

Einstein famous equation: E = mc2 displayed as "block".

 

Use MathML Elements in OBJECT Tags

Insert MathML Element in HTML Documents

Introduction to MathML (Mathematical Markup Language)

⇑⇑ MathML (Mathematical Markup Language)

2025-03-29, 305🔥, 0💬