MathML
MathML Mathematical Markup Language - is a standard for mathematical expressions defined by W3C that browsers should support to render math formulas
There are two types of MathML:
- presentation - how browsers show draw a mathematical expression
- meaning - what is the meaning of this expression?
Presentation Elements
The presentation elements are meant to express the syntactic structure of mathematical notation
- MathML expressions trees with nested layout.
A token in MathML is an individual symbol, name or number. Tokens are grouped together to form MathML expressions.
Tokens can be:
- identifier, variable or function names
- numbers
- operators (including brackets - so called “fences”)
- text and whitespaces
A “symbol” is not necessarily one character: it could be a string such as sin or 24. In MathML they are treated as single tokens.
As in mathematics, MathML expressions are constructed recursively from smaller expressions or single tokens. Complex expressions are created with so-called “layout” constructor elements, while tokens are created with token elements.
Let us consider an example. A mathematical expression $(a + b)^2$ can be represented in MathML as follows: