HTML5 Guidelines for Web Developers

(coco) #1
6.1 MathML 181

Each MathML block within an HTML5 document begins with and ends
with . In between, you have optional tags for defining the formula—in
our case, six different ones, introduced in the order in which they appear in
Table 6.1.


Table 6.1 The MathML tags of Listing 6.1 and their meaning


Element Name Purpose

mrow row Element for grouping expressions
mi i for identifier Variable, function name, or constant

mo o for operator Operators such as equal, plus, minus, or
multiplication sign
msqrt sqrt for square root Square root expression

mfrac frac for fraction Fractions, division
mn n for number Number

The element mrow for grouping expressions appears three times: once for the
whole expression and then twice more for distinguishing between numerator
and denominator in the division mfrac. Radius r and area A are represented
as mi elements, the equals sign is represented as a mo element, and the root
expression is formed with a msqrt element. For pi we use the mn element in
combination with the MathML entity Π—one of more than 2,000 MathML
entities, which we could also have written as Unicode symbol Π (GREEK
CAPITAL LETTER PI).


The table for converting the named MathML entities to Unicode characters can
be found in the MathML specification at http://www.w3.org/TR/REC-MathML/
chap6/byalpha.html.

The formula for calculating the diagonal of the square in Figure 6.1 contains
another entity as a multiplication sign, × (as Unicode symbol ×
MULTIPLICATION SIGN), and for squaring the rectangle sides a, b in the center
example, we use the msup element (sup for superscript).


Of course, these three MathML examples only show the tip of the iceberg. Start-
ing points for exploring the world of MathML can be found on the following
websites. Do not miss the MathML Basics examples on the Mozilla project demo
page. You will be surprised to see that writing complicated formulas is made pos-
sible by MathML! Check out these websites to learn more about MathML:


NOTE
Free download pdf