Skip to content

Toggle service links
Mathematics

Mathematics

To write formulas and equations, use LaTeX math mode.

Simple expressions can be written within a paragraph, starting and ending with a dollar sign. For example, $\log_b x^b = x$ produces \(\log_b x^b = x\).

To write a dollar sign without starting math mode, write a backslash before it. For example, \$2.99 produces $2.99.

More complicated formulas should be in their own paragraph, surrounded with two dollar signs. For example, the following

`$$\sum_{i=1}^{10} \frac{i}{\sqrt[i]{1+i}}$$`

produces

\[\sum_{i=1}^{10} \frac{i}{\sqrt[i]{1+i}}\]

Numbered equations

You can automatically number equations for later reference with the math directive. For example,

:::{math}
:label: euler-identity

e^{i\pi} + 1 = 0
:::

produces

(1)\[e^{i\pi} + 1 = 0\]

Note that the math directive doesn’t support the caption option and uses label instead of name.

You can reference equations using the standard crossreference syntax.