L.6.1.17 Math Paragraphs
Math paragraphs exist between oMathPara elements and are comprised of one or more equations or expressions. (The examples in this subclause are all based on expressions) .Each expression exists within its own <m:oMath> block. An example of how expressions would be laid out in a single math paragraph is shown below:
<m:oMathPara>
<m:oMathParaPr>
...math paragraph properties
</m:oMathParaPr>
<m:oMath>
...an expression
</m:oMath>
<m:oMath>
...another expression
</m:oMath>
</m:oMathPara>
When part of an Office Open XML WordprocessingML document, Math Paragraphs exist inside the <w:body> block of the document. They also always exist in <w:p> blocks even if there is no additional text in the paragraph. An example of the above XML as part of a WordprocessingML document is shown below:
Example XML:
<?xml version="1.0"?>
<w:document xmlns:w="…">
<w:body>
<w:p>
<m:oMathPara>
<m:oMathParaPr>
...math paragraph properties
</m:oMathParaPr>
<m:oMath>
...an expression
</m:oMath>
<m:oMath>
...another expression
</m:oMath>
</m:oMathPara>
</w:p>
</w:body>
</w:document>
Display equations or expressions (typically, these are simply referred to as just “Display Equations” for the sake of brevity) are always inside a Math Paragraph. Inline equations or expressions (typically referred to as just “Inline equations”), however, might not be part of a Math Paragraph if they are inside an existing WordprocessingML paragraph (<w:p> block). Such an inline equation is illustrated by the following example:
Example:
The following formula calculates the area of a circle: 𝐴
Example XML:
<w:document>
<w:body>
<w:p>
<w:r>
<w:t>The following formula calculates the ares of a circle:</w:t>
</w:r>
<m:oMath>
<m:r>
<m:t>A=π</m:t>
</m:r>
<m:sSup>
<m:e>
<m:r>
<m:t>r</m:t>
</m:r>
</m:e>
<m:sup>
<m:r>
<m:t>2</m:t>
</m:r>
</m:sup>
</m:sSup>
</m:oMath>
<w:r>
<w:t>.</w:t>
</w:r>
</w:p>
</w:body>
</w:document>
When inside a WordprocessingML document, <m:oMath> blocks commonly include WordprocessingML at various points to describe desired formatting such as color, font, character effects, annotations, and other non-math-specific effects and display features. DrawingML and other mark-ups defined in the Office Open XML standard can also exist inside oMath blocks. These additional non-OMML components are optional when defining an expression or equation. The following example includes WordprocessingML to describe desired text effects.
Example:
Example XML:
<m:oMathPara>
<m:oMath>
<m:r>
<w:rPr>
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math" />
<w:emboss />
<w:sz w:val="32" />
<w:szCs w:val="32" />
</w:rPr>
<m:t>E=m</m:t>
</m:r>
<m:sSup>
<m:sSupPr>
<m:ctrlPr>
<w:rPr>
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math" />
<w:i />
<w:emboss />
<w:sz w:val="32" />
<w:szCs w:val="32" />
</w:rPr>
</m:ctrlPr>
</m:sSupPr>
<m:e>
<m:r>
<w:rPr>
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math" />
<w:emboss />
<w:sz w:val="32" />
<w:szCs w:val="32" />
</w:rPr>
<m:t>c</m:t>
</m:r>
</m:e>
<m:sup>
<m:r>
<w:rPr>
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math" />
<w:emboss />
<w:sz w:val="32" />
<w:szCs w:val="32" />
</w:rPr>
<m:t>2</m:t>
</m:r>
</m:sup>
</m:sSup>
</m:oMath>
</m:oMathPara>
In the above example, WordprocessingML is used to describe the font used, the character effect desired, and the character size desired. The <w:rFonts> tag in this example would only be necessary if “Cambria Math” were not the default font for this document. Document editors have the option of being overly explicit at the expense of adding potentially unnecessary / redundant XML.