Section 3.6 Mathematics
With experience, you may realize that PreTeXt utilizes three principal languages. One is the narrative of everyday sentences and paragraphs. Most of what you write in a paragraph, or a table cell, or a title, or a caption, or an index heading, is in this language. Then there is the structural language, which is the majority of the elements in PreTeXt, such as
<figure>. Then finally, there is the language of mathematical symbols and notation.
A key design decision is that mathematical symbols, expressions and equations are authored using LaTeX syntax. More precisely, we support the symbols and constructions provided by MathJax, which quite closely follows the
amsmath package maintained by the American Mathematical Society. Neither you nor I want to write MathML by hand!
For inline mathematics, use the short
<m> tag within a
<p> (or within a
<caption>). For example,
<m>\alpha^2 + \beta^4</m> will do what you expect, in print and in electronic outputs. To get a single equation, centered, with some vertical separation before and after, use the
<me> tag (“math equation”) in the same way within a
<p>, but do not try using it within a
<title>. For example,
<me>\rho = \alpha^2 + \beta^4</me>. If you want your equation numbered, switch to the
<men> tag (
n = “numbered”).
There is a way to incorporate your own (simple) custom LaTeX macros within mathematics (only). They will be effective in your print and electronic outputs, and can be employed in graphics languages like
tikz and Asymptote. You can also author multi-line display mathematics using the
<md> tag surrounding a sequence of
<mrow> elements (or the
<mdn> variant for numbered equations). We defer the details to Section 4.8.