Getting Started with LaTeX Math in Markdown
A practical introduction to LaTeX math notation in markdown — inline equations, display formulas, and common symbols. Includes examples rendered with KaTeX.
If you're a student, researcher, or engineer writing technical documentation, LaTeX math notation is something you'll encounter constantly. It's the standard way to write mathematical expressions in plain text — supported by Jupyter notebooks, GitHub, academic papers, and increasingly, markdown editors.
This guide walks through the essentials: syntax, common formulas, and how to write math that renders beautifully in a markdown document.
What Is LaTeX Math?
LaTeX (pronounced "lah-tech" or "lay-tech") is a typesetting system developed in the 1980s and still the standard for academic publishing. Its math notation system has become the lingua franca for expressing mathematics in digital text.
In markdown, LaTeX math is written inside dollar sign delimiters. Most markdown renderers that support math use KaTeX (by Khan Academy) or MathJax — two JavaScript libraries that take LaTeX notation and render beautiful typeset equations.
Inline vs Display Math
There are two modes for math in markdown:
Inline math uses single dollar signs: $expression$
Write $E = mc^2$ and it renders as a small equation inline with your text. Good for mentioning a variable or a simple formula in a sentence.
Display math uses double dollar signs on their own line:
$$
E = mc^2
$$
The equation gets its own line, centred and larger — the standard form for important formulas you want to call out.
Essential Syntax
Subscripts and Superscripts
x^2 → x squared
x_i → x sub i
x_i^2 → x sub i, squared
x^{10} → x to the 10th (use braces for multi-character exponents)
Fractions
\frac{numerator}{denominator}
Renders as a vertical fraction. Use \tfrac for a smaller inline version.
Square Roots and Radicals
\sqrt{x} → square root of x
\sqrt[n]{x} → nth root of x
\sqrt{x^2 + y^2}
Greek Letters
Lowercase:
\alpha \beta \gamma \delta \epsilon
\theta \lambda \mu \pi \sigma \phi \omega
Uppercase:
\Gamma \Delta \Theta \Lambda \Pi \Sigma \Phi \Omega
Common Formulas
The Quadratic Formula
$$
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$
This is probably the most commonly written formula for demonstrating math rendering. \pm is the ± sign, \sqrt{} is the square root, \frac{}{} builds the fraction.
Euler's Identity
$$
e^{i\pi} + 1 = 0
$$
Often called the most beautiful equation in mathematics. e is Euler's number, i is the imaginary unit, \pi is pi.
Summation
$$
\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
$$
\sum creates the Σ symbol. The subscript _{i=1} sets the lower bound and ^{n} sets the upper limit.
The Integral
$$
\int_0^{\infty} e^{-x^2}\, dx = \frac{\sqrt{\pi}}{2}
$$
\int is the integral sign. \infty is the ∞ symbol. The \, adds a thin space before dx.
Matrix Notation
$$
A = \begin{pmatrix}
a & b \\
c & d
\end{pmatrix}
$$
\begin{pmatrix}...\end{pmatrix} creates a matrix with parentheses. Use \begin{bmatrix} for square brackets. Columns are separated by &, rows by \\.
The Normal Distribution
$$
f(x) = \frac{1}{\sigma\sqrt{2\pi}}
e^{-\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2}
$$
Notice \left( and \right) — these make parentheses that scale to match the height of the expression inside them.
Limit Notation
$$
\lim_{x \to 0} \frac{\sin x}{x} = 1
$$
\lim is the limit command, \to is the → arrow, and \sin is the sine function (formatted upright, not italic).
Useful Symbols Reference
| Symbol | Command | Symbol | Command |
|---|---|---|---|
| ≤ | \leq | ≥ | \geq |
| ≠ | \neq | ≈ | \approx |
| ∈ | \in | ∉ | \notin |
| ⊂ | \subset | ⊆ | \subseteq |
| ∩ | \cap | ∪ | \cup |
| ∀ | \forall | ∃ | \exists |
| → | \to | ↔ | \leftrightarrow |
| ⇒ | \Rightarrow | ⇔ | \Leftrightarrow |
| ∇ | \nabla | ∂ | \partial |
| × | \times | · | \cdot |
| ± | \pm | ∓ | \mp |
Which Editors Support LaTeX Math?
LaTeX math support in markdown editors is not universal.
GitHub: Supports LaTeX math in markdown files and issues (uses MathJax).
Jupyter Notebooks: Full native support via MathJax. LaTeX math is a core feature.
VS Code: Requires the "Markdown All in One" or "Markdown Preview Enhanced" extension.
Obsidian: Requires enabling in settings; community plugins extend support.
Typora: Built-in support with some configuration.
iA Writer, Bear: No LaTeX math support.
OpenMark: Renders LaTeX math out of the box using bundled KaTeX — no plugins, no configuration, completely offline. Write $E=mc^2$ in your markdown file and it renders inline in document view.
Common Mistakes
Forgetting braces for multi-character exponents. x^10 renders as x followed by 10 in text. Use x^{10} to raise the full 10.
Mixing up command syntax. Commands start with a backslash: \alpha not alpha. Plain alpha renders as italic text.
Unbalanced environments. \begin{pmatrix} needs a matching \end{pmatrix}. A missing end causes a render error.
Percent signs in math. In LaTeX, % is a comment character. Use \% for a literal percent sign inside math mode.
Missing $ delimiters. If your formula renders as plain text, you've probably forgotten the opening or closing $.
For more on markdown tooling for developers and technical writers, see Markdown for Developers: README Files, Documentation, and More. And if you're choosing a markdown editor that handles math natively, the full comparison is at The Best Markdown Editors for Mac in 2026.
OpenMark renders LaTeX math natively using bundled KaTeX — the same library used by Khan Academy. No setup, no internet connection, no plugins. If you write technical documents with math, it's worth trying.