LaTeX Math in Markdown: Fractions, Roots, Greek Letters and Matrices
The most widely supported way to write math in Markdown is LaTeX syntax. Moread typesets equations with KaTeX, which is fast and sharp, making it a good fit for lecture notes, homework, paper drafts and technical documentation.
Inline and display math
Inline math goes between single dollar signs and flows with the text:
The area of a circle is $A = \pi r^2$.
Display math goes between double dollar signs and is centered on its own line:
$$
E = mc^2
$$
You can also use \( ... \) for inline math, \[ ... \] for display math, or a code block with the language math.
Superscripts and subscripts
| Result | Syntax |
|---|---|
x^2 |
|
a_i |
|
x^{10} |
|
a_{i,j} |
Use braces {} when the exponent or index has more than one character.
Fractions and roots
$\frac{a}{b}$ $\sqrt{2}$ $\sqrt[3]{x}$
The quadratic formula:
Greek letters
| Symbol | Syntax | Symbol | Syntax |
|---|---|---|---|
\alpha |
\beta |
||
\gamma |
\Delta |
||
\theta |
\lambda |
||
\mu |
\pi |
||
\sigma |
\Omega |
Capitalize the first letter of the command for uppercase, e.g. \Delta.
Sums, integrals and limits
$$\sum_{i=1}^{n} x_i \qquad \int_0^1 x^2\,dx \qquad \lim_{x \to 0} \frac{\sin x}{x}$$
Matrices and aligned equations
$$
\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}
$$
& separates columns and \\ starts a new row. Use pmatrix for parentheses and vmatrix for determinant bars.
For multi-line derivations, use aligned and align on &:
Symbol cheat sheet
| Symbol | Syntax | Symbol | Syntax |
|---|---|---|---|
\times |
\div |
||
\leq |
\geq |
||
\neq |
\approx |
||
\infty |
\rightarrow |
||
\in |
\subseteq |
||
\forall |
\exists |
Common problems
- The formula isn't rendered: make sure your
$signs come in pairs and that the opening$isn't followed by a space. - Prices turn into math: escape the dollar sign as
\$100. - A formula shows an error: Moread marks it, keeps the source, and shows the reason when you hover over it.
When you're ready, drop your .md file into Moread to see the typeset equations, or save the document as a PDF.