Math and Formulas
Pages do not typeset math. LaTeX written between math delimiters, such as $x^2$ or $$E = mc^2$$, is shown as ordinary text, not as a formatted formula. This page shows what happens to each kind of math you might type, and how to write a formula that reads well today.
What happens to LaTeX math
- Inline, with single dollar signs:
$x^2 + y^2 = z^2$is shown exactly as typed. - Display, with double dollar signs:
$$E = mc^2$$is shown exactly as typed. Over several lines, each line stays a separate line of text. - Inline, with backslash and parentheses:
\(x^2\)shows as(x^2); the backslashes disappear. - Display, with backslash and square brackets:
\[x^2\]shows as[x^2]; the backslashes disappear.
Other things to know:
- Markdown still applies inside the dollar signs.
$a*b*c$shows thebin italics,$[a,b]$turnsa,binto a link to a page of that name, and\\starts a new line. - Backslashes before punctuation disappear.
\{,\,and\$show as{,,and$. Backslashes before letters, such as\fracor\int, are kept. - Nothing is checked. A formula with a mistake in it looks the same as a correct one; there is no error message.
- Environments and extensions don't work.
\begin{align}, matrices and chemistry notation such as\ce{H2O}are shown as text.
Dollar amounts
Dollar signs in ordinary text are always shown as typed. It cost $5 and $10. shows exactly that. You don't need to escape them, though \$5 also shows $5.
Writing a formula that reads well
- Short formulas: use superscript and subscript.
E = mc^2^shows E = mc2, andH~2~Oshows H2O. Write no spaces between the marks. - Symbols: type the character itself: x² ≤ π · r², α, ∑, √, ≠, ∞.
- LaTeX you want readers to copy: put it in a code span,
`\frac{a}{b}`, or in a code block. Inside code, everything is shown exactly as typed, so nothing disappears and nothing turns into a link or italics:
```latex
\int_0^1 x^2 \, dx = \frac{1}{3}
```
- Larger or complex formulas: make an image of the formula and attach it to the page.
More help
- Markdown as we use it: everything you can write on a page
- Markdown Cheat Sheet: quick examples of each element
No comments yet.