6 min readUpdated 2026-06-11

Anki LaTeX setup: the complete guide (and the easy alternative)

Anki supports math notation two ways. The modern route is MathJax, which is built into Anki 2.1+ with nothing to install: wrap inline math in \(...\) and display math in \[...\], and it renders on desktop, AnkiMobile, and AnkiDroid. The older route is native LaTeX, which produces images but requires a full TeX installation plus dvipng and only generates on desktop. For almost everyone, MathJax is the right choice.

This guide covers both routes honestly — including the friction — and ends with the alternative for people who decide that hand-typing LaTeX into every card is not how they want to spend exam season.

Route 1: MathJax (recommended)

Since version 2.1, Anki ships with MathJax support built in. There is nothing to install and nothing to configure.

Syntax. Inline math goes between \( and \); display (centered, own-line) math goes between \[ and \]:

The derivative of \(\sin x\) is \(\cos x\).

\[\int_a^b f(x)\,dx = F(b) - F(a)\]

Those cards render as: the derivative of sinx\sin x is cosx\cos x, and

abf(x)dx=F(b)F(a)\int_a^b f(x)\,dx = F(b) - F(a)

The editor button. You do not have to remember the delimiters: in the card editor, the rightmost toolbar dropdown has MathJax inline, MathJax block, and MathJax chemistry options with keyboard shortcuts (Ctrl+M, M for inline).

Where it renders. MathJax cards render on Anki desktop, AnkiMobile, AnkiDroid, and AnkiWeb — your equations work everywhere without extra steps. This is the decisive advantage over the native-LaTeX route.

Chemistry. MathJax in Anki includes the mhchem extension, so \(\ce{H2SO4}\) renders proper chemical formulas.

What MathJax covers. Standard mathematical notation: fractions, integrals, sums, Greek letters, matrices, aligned equations. It does not cover arbitrary LaTeX packages — no TikZ diagrams, no custom document-level macros. For flashcards, this is rarely a real constraint.

Route 2: Native LaTeX (the power-user path)

Anki's older LaTeX support works differently: it sends your LaTeX to a local TeX installation, compiles it to an image, and shows the image on the card. The syntax is [latex]...[/latex], or the shortcuts [$]...[$] for inline and [$$]...[$$] for display math.

The friction is real, and worth listing plainly:

  1. You must install a full TeX system — MiKTeX on Windows, MacTeX on macOS, your distribution's TeX Live packages on Linux — plus dvipng. These are multi-gigabyte installations.
  2. Images generate only on desktop. Mobile apps and AnkiWeb can display the generated images, but cannot create them. If you author or edit cards on the go, the math will be missing until you return to desktop.
  3. Sync requires preparation. Before studying on another device, run Tools → Check Media on desktop to bulk-generate every image, then sync.

Why would anyone choose this route? Full LaTeX: custom packages, exotic notation, document-class-level control. If you are writing graduate-level cards that need \usepackage lines, native LaTeX is there. Everyone else should use MathJax.

Cloze deletions and math: the one classic gotcha

If you use cloze cards with MathJax, there is a known conflict: a cloze deletion ends with }}, and LaTeX expressions frequently contain }} too — for example \(\frac{1}{x^{2}}\). Anki can misparse where the cloze ends.

The fix is to add a space between closing braces in your LaTeX: write x^{2} } style spacing inside the math so the literal }} sequence never appears. The Anki manual's math section covers this. It is a small habit, but you have to know it — debugging a half-rendered cloze card at midnight is no one's idea of revision.

A realistic workflow for a math-heavy course

Suppose you are taking calculus and want a card for integration by parts. In Anki, you would author it by hand:

  • Front: State the integration by parts formula. When do you choose \(u\) by LIATE?
  • Back: \(\int u\,dv = uv - \int v\,du\). Choose \(u\) in order: Log, Inverse trig, Algebraic, Trig, Exponential.

That card renders beautifully: udv=uvvdu\int u\,dv = uv - \int v\,du. Multiply this by a semester — every definition, theorem, formula, and condition of applicability across all your courses — and the authoring time becomes the limiting factor. The notation itself is a bounded skill you can learn in an afternoon; typing it card by card is the part that competes with actually studying. Our guide on making flashcards with math formulas covers what belongs on a math card in the first place.

The easy alternative: generate the cards, keep the rigor

This is where we should disclose: we build ExamTeX, and it exists largely because of the workflow above. You upload the course materials you already have — lecture PDFs, slides, problem sets — and the AI generates a flashcard deck with the math already typeset in LaTeX. No delimiters to type, no TeX installation, no Check Media step. The deck feeds a built-in SM-2 spaced-repetition queue, and the same upload can also produce a printable practice exam with an answer key.

The honest trade-off: Anki gives you total control and costs nothing on desktop, with the strongest add-on ecosystem in existence. Generated decks are a first draft — you should review and edit cards before drilling them, because cards you have engaged with are cards you learn faster. If you have the hours and enjoy the authoring process (many people genuinely do — writing cards is itself a form of study), Anki plus MathJax is a superb system. If exam season has already started, generation gets you to the reviewing part today.

The bottom line

Set up Anki math the modern way: use MathJax, which is already installed — \(...\) for inline, \[...\] for display, the editor dropdown if you forget. Reserve native LaTeX for the rare case that truly needs custom packages, and remember the cloze }} gotcha. And if the bottleneck turns out to be authoring time rather than rendering, generating typeset cards from your existing notes solves the part of the problem that MathJax cannot.

FREE

Try ExamTeX

Upload your notes and get AI-generated flashcards, practice exams, or study podcasts in under a minute.

Frequently Asked Questions

Do I need to install LaTeX to use math in Anki?

No. Anki ships with MathJax built in since version 2.1, so you can write math between backslash-parenthesis delimiters with nothing to install. Only the older native-LaTeX mode requires a full TeX installation plus dvipng, and it is needed solely for advanced cases like custom LaTeX packages. For standard coursework notation, MathJax covers everything.

Why is my Anki math not rendering on mobile?

If you used MathJax delimiters, math renders on AnkiMobile and AnkiDroid automatically. If you used the native LaTeX mode, the images are generated only on desktop: run Tools then Check Media on your computer to bulk-generate every image, sync, and the cards will display correctly on your phone afterward.

How do I use cloze deletions with math in Anki?

Watch for one known conflict: cloze deletions end with two closing braces, and LaTeX expressions often contain the same sequence, which can break parsing. The fix is to add a space between closing braces inside your math so the literal double-brace sequence never appears. With that habit in place, cloze cards and MathJax work well together.

Is there a faster alternative to typing LaTeX into Anki?

Yes — generating cards from your existing materials. ExamTeX produces flashcard decks from uploaded lecture PDFs and slides with the math already typeset, plus built-in spaced repetition, so you skip the per-card authoring entirely. The trade-off is less manual control than Anki: generated decks are a first draft you should review and edit before drilling.