Typst Math Cheat Sheet, with LaTeX Equivalents
By Laxmi SolutionsUpdated 3 min read
Typst math drops the backslashes and braces of LaTeX: symbols are words, a/b is a fraction, and parentheses group without printing. This cheat sheet lists the common constructs with their LaTeX equivalents. It is checked against Typst 0.15.
The basics
$x$is inline math.$ x $, with spaces inside the dollars, is a display equation on its own line.- Single letters are variables; longer words are names of symbols or functions. Put text in quotes:
"if". - Parentheses group without printing when they are the whole argument:
x^(2n),(a+b)/2. - Number display equations with
#set math.equation(numbering: "(1)").
Structures
| Typst | LaTeX | What |
|---|---|---|
a/b or frac(a, b) | \frac{a}{b} | Fraction |
x^2, x_i, x_(i+1)^2 | x^2, x_i, x_{i+1}^2 | Super- and subscripts |
sqrt(x), root(3, x) | \sqrt{x}, \sqrt[3]{x} | Roots |
sum_(i=1)^n i | \sum_{i=1}^n i | Sum |
product_(k=1)^n k | \prod_{k=1}^n k | Product |
integral_0^1 f(x) dif x | \int_0^1 f(x)\,dx | Integral |
lim_(x -> 0) sin(x)/x | \lim_{x \to 0} \frac{\sin x}{x} | Limit |
binom(n, k) | \binom{n}{k} | Binomial |
abs(x), norm(v) | \lvert x \rvert, \lVert v \rVert | Absolute value, norm |
floor(x), ceil(x) | \lfloor x \rfloor, \lceil x \rceil | Floor, ceiling |
sin, cos, log, ln, exp, max | \sin, \cos, \log, ... | Upright function names |
Greek letters
| Typst | LaTeX | Symbol |
|---|---|---|
alpha, beta, gamma, delta | \alpha, \beta, \gamma, \delta | α β γ δ |
theta, lambda, mu, pi, sigma | \theta, \lambda, \mu, \pi, \sigma | θ λ μ π σ |
Gamma, Delta, Sigma, Omega | \Gamma, \Delta, \Sigma, \Omega | Γ Δ Σ Ω |
epsilon, epsilon.alt | \varepsilon, \epsilon | ε ϵ |
phi, phi.alt | \varphi, \phi | φ ϕ |
Watch the last two rows: Typst's epsilon and phi are the curly forms, which LaTeX calls \varepsilon and \varphi.
Operators, relations and arrows
| Typst | LaTeX | Symbol |
|---|---|---|
times, div, plus.minus | \times, \div, \pm | × ÷ ± |
dot | \cdot | ⋅ |
<=, >=, != | \leq, \geq, \neq | ≤ ≥ ≠ |
approx, equiv, prop | \approx, \equiv, \propto | ≈ ≡ ∝ |
->, =>, <=>, |-> | \to, \Rightarrow, \Leftrightarrow, \mapsto | → ⇒ ⇔ ↦ |
oo or infinity | \infty | ∞ |
partial, nabla | \partial, \nabla | ∂ ∇ |
dots.h, dots.c, dots.v | \ldots, \cdots, \vdots | … ⋯ ⋮ |
Sets and logic
| Typst | LaTeX | Symbol |
|---|---|---|
in, in.not | \in, \notin | ∈ ∉ |
subset, subset.eq | \subset, \subseteq | ⊂ ⊆ |
union, inter | \cup, \cap | ∪ ∩ |
emptyset | \emptyset | ∅ |
forall, exists, not | \forall, \exists, \neg | ∀ ∃ ¬ |
and, or | \land, \lor | ∧ ∨ |
RR, NN, ZZ, QQ, CC | \mathbb{R}, \mathbb{N}, ... | ℝ ℕ ℤ ℚ ℂ |
Accents and styles
| Typst | LaTeX |
|---|---|
hat(x), tilde(x), overline(x) | \hat{x}, \tilde{x}, \overline{x} |
arrow(v), dot(x), dot.double(x) | \vec{v}, \dot{x}, \ddot{x} |
bold(v), upright(d), cal(L) | \mathbf{v}, \mathrm{d}, \mathcal{L} |
"if" | \text{if} |
thin, quad, wide | \,, \quad, \qquad |
vec(a, b) in Typst is a column vector, not an arrow accent. For an arrow over a letter, use arrow(v).
Matrices, cases and alignment
// Matrix (semicolons end rows) and column vector
$ mat(a, b; c, d) quad vec(x, y) $
// Piecewise function
$ abs(x) = cases(x & "if" x >= 0, -x & "otherwise") $
// Aligned at &, with \ ending each line
$ (a+b)^2 &= (a+b)(a+b) \
&= a^2 + 2 a b + b^2 $The LaTeX equivalents are pmatrix, cases and align. In Typst none of them need a package. Brackets are round by default; use #set math.mat(delim: "[") for square ones.
In Kern, Insert → Symbols lists every symbol to tap, and Explain at cursor shows the documentation for any name. Writing LaTeX instead? See the LaTeX math symbols cheat sheet.