Plain Markdown doesn’t include mathematical notation — but modern editors add it using LaTeX, the standard syntax for typesetting math. With it you can write everything from a simple fraction to a full system of equations, right inside your Markdown, and see it rendered beautifully by KaTeX. This guide shows the syntax and how to use it.

If you’re still learning the fundamentals, the complete Markdown guide covers the rest of the language.

Inline vs. block math

There are two ways to include math, mirroring LaTeX:

  • Inline math sits inside a sentence, wrapped in single dollar signs: $ ... $.
  • Block (display) math stands on its own line, centered, wrapped in double dollar signs: $$ ... $$.
The area of a circle is $A = \pi r^2$, derived from the integral:

$$
A = \int_0^{2\pi} \int_0^{r} \rho \, d\rho \, d\theta
$$

The first renders inline within the text; the second renders as a large, centered equation.

Common LaTeX math syntax

You don’t need to know all of LaTeX — a small vocabulary covers most writing:

You wantYou write
Superscriptx^2
Subscriptx_i
Fraction\frac{a}{b}
Square root\sqrt{x}
Greek letters\alpha, \beta, \pi
Sum\sum_{i=1}^{n}
Integral\int_a^b
Multiplication dot\cdot
Infinity\infty
Comparison\leq, \geq, \neq
Vectors\vec{v}

Wrap a group in { } when it’s more than one character — x^{10} gives x¹⁰, while x^10 would only raise the 1.

A few worked examples

Euler's identity: $e^{i\pi} + 1 = 0$

The quadratic formula:

$$
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$

A summation:

$$
\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
$$

Each renders as clean, typeset mathematics — the same notation you’d see in a textbook.

Why KaTeX?

Most Markdown editors that support math use KaTeX, a fast, high-quality math typesetting library. It renders equations almost instantly (noticeably faster than older alternatives) and produces crisp output that scales to any size. In practice this means your equations appear the moment you finish typing them.

Writing math in Inkiostro

On Mac, Inkiostro renders LaTeX math with KaTeX live, as you type — inline $…$ and block $$…$$ both work, and equations appear in the preview immediately. Better still, the math is preserved in every export: when you convert your document to PDF, HTML or EPUB, the equations come along, perfectly rendered. That makes it a genuinely good tool for students, researchers and anyone writing technical documents.

Need diagrams too? See how to make flowcharts and diagrams from plain text.

Tips

  • Group exponents and subscripts with braces: a_{ij}, x^{n+1}.
  • Use \left( and \right) for parentheses that grow with tall content like fractions.
  • Escape special characters inside math with a backslash where needed (for example \%).
  • Preview as you go — a live renderer catches a mistyped command instantly.

FAQ

Does standard Markdown support math?

No. Mathematical notation isn’t part of the original Markdown or CommonMark spec. Editors add it as an extension using LaTeX syntax, typically rendered with KaTeX or MathJax. Inkiostro supports it natively on Mac.

How do I write an inline equation in Markdown?

Wrap the LaTeX in single dollar signs, like $E = mc^2$. For a large, centered equation on its own line, use double dollar signs: $$ ... $$.

What is KaTeX?

KaTeX is a fast math typesetting library used by many Markdown tools to render LaTeX equations. It’s known for rendering almost instantly and producing sharp, scalable output.

Can I export Markdown math to PDF?

Yes. In Inkiostro on Mac, LaTeX equations render in the live preview and are preserved when you export to PDF, HTML or EPUB, so your math looks the same in the final document.

Do I need to know all of LaTeX to write math in Markdown?

No. A small set of commands — fractions, exponents, roots, Greek letters and sums — covers most everyday equations. You can learn more advanced notation only if and when you need it.