Chapter 1 · LaTeX
Everything below is a live playground — edit the left side, the math re-renders instantly. You cannot break anything; errors show in red and vanish when fixed. Ten topics, from first symbol to publication-grade formulas — roughly 4 hours, best split over several days (the streak system will thank you).
🎯 New: each topic ends with a “write this in LaTeX” challenge — we show the math, you reproduce it, the page tells you instantly when your version matches.
How do you think LaTeX makes a fraction?
\frac{a}{b} — command, then two brace arguments. Details in Topic 1.What might the symbol for 'infinity' be called?
\infty — most symbols are just their English name with a backslash. Topic 2 has the greatest hits.Guess: how would LaTeX tell a fraction's top from its bottom?
{top} then {bottom}. Order and braces are the whole grammar — Topic 3.1What LaTeX is (and the 60-second mental model)
LaTeX is not a text editor — it's a language: you type plain text with commands like \frac{a}{b}, and a program turns it into perfectly typeset output. Every command starts with a backslash \, arguments go in braces { }. That's 90% of the mental model.
This playground renders as you type. Change the 2 to a 3. Break it. Fix it.
💡 ^ makes a superscript (exponent). _ makes a subscript.
💡 Braces group things: try x_{10} vs x_10 to see why braces matter.
💡 \frac{top}{bottom} takes TWO arguments. \sqrt takes an optional [n] for nth roots.
💡 Any argument can itself contain commands — that's how complex formulas are built.
2Greek letters & the symbols mathematicians actually use
Every Greek letter is a command: \alpha → α. Capitalize the command for capitals: \Delta → Δ. You'll memorize the ~15 you use, and look up the rest.
💡 Try \Omega, \phi, \varphi, \epsilon, \varepsilon.
💡 \le ≤, \ge ≥, \ne ≠, \approx ≈, \to →, \Rightarrow ⇒, \infty ∞.
💡 \mathbb{R} = blackboard bold. \in / \notin = set membership. \; adds a little space.
💡 On \sum and \prod, _ and ^ become the lower/upper limits automatically.
3Fractions, roots, integrals, limits — building real formulas
Real formulas are just the pieces you've seen, combined. The skill is reading a formula outside-in: find the outermost structure first, then fill the slots.
Outer structure: a fraction. Top slot: -b \pm \sqrt{...}. Bottom slot: 2a.
💡 \pm gives the ± sign.
💡 \int works like \sum: _ lower limit, ^ upper limit. \, is a thin space before dx.
💡 \lim_{...} puts its argument underneath in display mode.
💡 Read it outside-in: an integral, with limits, of a product of two powers.
4Brackets that grow & multi-line math
Plain parentheses stay small around tall content — ugly. \left( and \right) grow to fit. For multi-line derivations, aligned lines up the = signs: & marks the alignment column, \\ ends a line.
💡 Every \left needs a matching \right. Use \left. or \right. for an invisible side.
💡 Braces must be escaped: \{ \}. Try \left\langle ... \right\rangle too.
💡 & marks where lines align (before the =). \\ starts a new line.
💡 \text{...} switches to normal words inside math mode.
5Matrices & vectors
Matrices are grids: & separates columns, \\ separates rows. The environment name picks the brackets: pmatrix ( ), bmatrix [ ], vmatrix | |.
💡 Change pmatrix to bmatrix or vmatrix and watch the brackets change.
💡 \vec{v} draws the arrow. One column = no & needed, just \\\\ between rows.
💡 This is the 2D rotation matrix — you'll animate exactly this in the Manim chapter.
💡 \cdots horizontal, \vdots vertical, \ddots diagonal dots.
6Complete documents (the part Manim does for you)
Everything so far was math mode — which is all Manim needs. But a standalone LaTeX document wraps that math in a small skeleton. Learn the skeleton once, mostly so error messages make sense.
This is a full compilable .tex file (paste into any LaTeX editor — this one isn't live because it's a document, not a formula):
\documentclass{article}
\begin{document}
Hello, \LaTeX! Inline math: $E = mc^2$.
\end{document}Euler proved that $e^{i\pi} + 1 = 0$ % inline: flows with text
\[ e^{i\pi} + 1 = 0 \] % display: own centered lineSame formula, two contexts. In Manim you'll only ever write the math part.
\documentclass{article}
\usepackage{amsmath} % better math environments
\begin{document}
\section{The identity}
As shown in equation~\eqref{eq:euler}:
\begin{equation}\label{eq:euler}
e^{i\pi} + 1 = 0
\end{equation}
\end{document}# Manim writes the document FOR you. When you type:
MathTex(r"e^{i\pi} + 1 = 0")
# ...Manim generates a tiny document around your math,
# compiles it, and turns the result into animatable shapes.
# The r"" (raw string) stops Python from eating your backslashes!This is why the math-mode skills above transfer 1:1 to Manim.
7Decorations: vectors, hats, braces that explain
Real math is annotated math: arrows over vectors, hats on estimates, braces that point at part of a formula and name it. These commands wrap around anything.
💡 \dot / \ddot are time-derivatives in physics. \hat is 'estimate' in statistics.
💡 \overline stretches; \bar does not. Same idea: \widehat vs \hat.
💡 _ after \underbrace puts the label BELOW; ^ after \overbrace puts it ABOVE.
💡 \boxed{...} draws a frame — perfect for final answers on slides.
8Calculus notation: derivatives, partials, big integrals
The notation of calculus is its own dialect: primes, Leibniz fractions, curly partials, double integrals, closed-loop integrals, and evaluation bars.
💡 ' is just an apostrophe. The Leibniz form is an ordinary \frac.
💡 \partial is the curly d. \nabla is the gradient triangle.
💡 \iint double, \iiint triple, \oint closed loop. \, adds the thin space before dx.
💡 \left. is an invisible left wall so \right| can grow. \lim takes limits with _.
9Fine-tuning: spacing, color, size — typesetting like a pro
The difference between 'renders' and 'beautiful' is spacing and emphasis. These are the knobs professionals turn — and in Manim they work exactly the same inside MathTex.
💡 From squeeze to gap: \! negative, \, thin, \; medium, \quad wide, \qquad double.
💡 \operatorname gives upright type + correct spacing — sin/cos/log already exist: \sin \log.
💡 \textcolor{name}{...}. In Manim you'd more often use set_color_by_tex.
💡 \displaystyle makes things full-size; \textstyle compact. Useful inside fractions and tables.
10Grand formulas: multi-line proofs & famous equations
Everything combines here. If you can typeset these, you can typeset anything you will ever put on a slide — this is the level of a published paper.
💡 Three lines, one story. & always sits before the =.
💡 \substack stacks multiple lines under one \sum. \lceil\rceil are ceiling brackets.
💡 Fractions, subscripts, an infinite sum, growing brackets, operators — all four chapters of skills.
💡 Closed-loop integral, vectors, Leibniz derivative, double integral. You know every piece now.
Self-examination
No peeking at the topics above — that's the exam part. Solutions are one click away.
show solution
\sum_{k=0}^{n} \binom{n}{k} x^k = (1+x)^nshow solution
I = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}show solution
\operatorname{sgn}(x) = \begin{cases} -1 & x < 0 \\ 0 & x = 0 \\ 1 & x > 0 \end{cases}