9152b37 ←4f1e428antonApr 18, 2026 api

create math.typ via macOS

A /docs/undefined +75 -0
A /docs/undefined +75 -0
1= Math
2
3Typst has first-class math support. Equations are written between `$` signs.
4
5== Inline math
6
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 equations
14
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 roots
24
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== Matrices
30
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 equations
51
52$ a &= b + c \
53 &= d + e + f \
54 &= g $
55
56== Cases
57
58$ f(x) = cases(
59 x^2 &"if" x >= 0,
60 -x^2 &"if" x < 0,
61) $
62
63== Greek letters and symbols
64
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 equations
72
73$ E = m c^2 $ <einstein>
74
75We can refer to @einstein later in the document.