1= Math2
3Typst has first-class math support. Equations are written between `$` signs.4
5== Inline math6
7The quadratic formula gives $x = (-b plus.minus sqrt(b^2 - 4a c)) / (2a)$ for any quadratic equation.8
9Einstein's famous equation $E = m c^2$ relates energy and mass.10
11The Euler identity $e^(i pi) + 1 = 0$ connects five fundamental constants.12
13== Display equations14
15Center a block equation by adding a space after `$`:16
17$ sum_(k=0)^n binom(n, k) x^k = (1 + x)^n $18
19The Gaussian integral:20
21$ integral_(-infinity)^(infinity) e^(-x^2) dif x = sqrt(pi) $22
23== Fractions and roots24
25$ f(x) = frac(x^2 + 1, x - 1) $26
27$ sqrt(a^2 + b^2) quad "and" quad root(3, 27) = 3 $28
29== Matrices30
31$ mat(32 1, 2, 3;33 4, 5, 6;34 7, 8, 9;35) $36
37With delimiters:38
39$ mat(delim: "[",40 a, b;41 c, d;42) dot mat(delim: "[",43 x;44 y;45) = mat(delim: "[",46 a x + b y;47 c x + d y;48) $49
50== Aligned equations51
52$ a &= b + c \53 &= d + e + f \54 &= g $55
56== Cases57
58$ f(x) = cases(59 x^2 &"if" x >= 0,60 -x^2 &"if" x < 0,61) $62
63== Greek letters and symbols64
65Common symbols: $alpha$, $beta$, $gamma$, $delta$, $epsilon$, $theta$, $lambda$, $pi$, $sigma$, $omega$66
67Operators: $plus.minus$, $times$, $div$, $approx$, $equiv$, $subset$, $supset$, $in$, $forall$, $exists$68
69Arrows: $arrow.r$, $arrow.l$, $arrow.r.double$, $arrow.l.r$70
71== Numbered equations72
73Enable numbering with a set rule, then reference by label:74
75#set math.equation(numbering: "(1)")76
77$ E = m c^2 $ <einstein>78
79We can refer to @einstein later in the document. v2
commit fb5175c
message edit math.typ via macOS
author anton
date Apr 18, 2026
size 1.5 KB