# Math
Mathematical expressions are typeset using TeX notation, a powerful system
developed by Dr. Donald E. Knuth for producing documents with complex
mathematical and scientific content. In TeX, you write plain text commands that
describe the structure and formatting of your document, and then compile them
to generate the final output.
{{app.title}} supports only plain TeX, allowing usage of either ConTeXt or
LaTeX.
## TeX notation
All TeX commands start with a backslash (`\`), followed by the name of the
command, and often use braces (`{}`) for any arguments.
Some simple mathematical elements using standard TeX syntax include:
* Fractions: `\fraction{numerator}{denominator}` (or `\frac{}{}`)
* Square roots: `\sqrt{expression}`
* Superscripts: `x^2`
* Subscripts: `x_1`
* Greek letters: `\alpha`, `\beta`, `\gamma`, etc.
* Integrals: `\int`
* Summations: `\sum`
* Limits: `\lim_{x \to 0}`
More complex expressions combine these elements:
Produces:
$$\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}$$
:: Basel problem {#eqn:matter}
When exported to XHTML, mathematical expressions can be output as TeX notation
or SVG images. Using TeX notation allows rendering the mathematics using a
JavaScript library such as KaTeX or MathJax. When exported to PDF, the
typesetting system renders expressions directly.
## Sigil syntax
A sigil is a special symbol used to mark or identify different types of
elements, much like how medieval magicians and alchemists used them to
represent spirits, forces, or intentions. Rooted in occult traditions, sigils
served as visual signatures—condensed symbols encoding names, ideas, or goals
in a hidden or abstract form.
Mathematical expressions must be enclosed within sigils. Spaces are not
allowed after the opening sigil or before the closing one.
## Inline expressions
Enclose inline TeX code inside single dollar sign sigils (`$`):
Outputs an equation within a sentence:
> The quadratic formula is $x=\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$.
## Standalone expressions
Enclose standalone TeX code inside double dollar sign sigils (`$$`):
Outputs a lone paragraph:
> $$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$$
The assigned equation reference number will differ, of course.