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
<chapter>
, <theorem>
, or <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 by hand!
1
www.mathjax.org/
amsmath
package maintained by the American Mathematical Society. Neither you nor I want to write MathML2
en.wikipedia.org/wiki/MathML
The symbols and macros supported by MathJax can be found at their Supported LaTeX commands documentation. Look here to see which parts of LaTeX may be used in your mathematical expressions.
3
docs.mathjax.org/en/latest/tex.html#supported-latex-commands
For inline mathematics, use the short
<m>
tag within a <p>
(or within a <title>
or <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.9.