Chapter 21. Math

Table of Contents

Plain text math
Graphic math
SVG math
DBTeXMath
Bitmap versions for HTML
MathML

DocBook does not have elements to describe mathematics. DocBook does provide two container elements for mathematics: equation to format the math as a block (with or without a title), and inlinequation to include math within a paragraph or other inline context. You have several alternatives for what you put in the container element:

Plain text math

Some mathematics can be expressed as straight text, using characters from the keyboard and special characters entered as entities. You might think you could put the text in an inlineequation element, but its content model does not permit bare text.

The only solution seems to be to use phrase with a role="math" attribute for inline instances. The stylesheets don't apply any special formatting to phrase by default, so you would have to create a stylesheet customization if you want special formatting. This example makes the math italic:

<xsl:template match="phrase[@role = 'math']">
  <xsl:call-template name="inline.italicseq"/>
</xsl:template>

The math you can display this way is limited to a linear sequence of text and symbols, with superscript and subscript as the only modifiers.