Section 4.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 1 , which quite closely follows the
amsmathpackage maintained by the American Mathematical Society. Neither you nor I want to write MathML 2 by hand!
The symbols and macros supported by MathJax can be found at their Supported LaTeX commands 3 documentation. Look here to see which parts of LaTeX may be used in your mathematical expressions.
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
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
tikzand 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 5.9.