typst
Typst is a markup-based typesetting system: Markdown-like text with a real scripting layer
(#let, functions, #table, #figure, #math), compiled to PDF in milliseconds. The compiler is
$TYPST (pinned; $TYPST --version). Never install another.
Compile, always through the verdict
python3 "$TYPST_TOOLCHAIN/verdict.py" # main.typ → out/main.pdf, verdict, diagnostics
python3 "$TYPST_TOOLCHAIN/verdict.py" paper.typ # another file → out/paper.pdf
$TYPST compile --root . main.typ out/main.pdf # the raw compiler, when you need its flags
$TYPST watch --root . main.typ out/main.pdf # recompile on save (run in the background)
The verdict is what the pane header shows. Typst's own errors and warnings come back with
file:line:col; fix errors first, then warnings.
The language, the parts that matter
- Text and structure:
= Heading, == Sub, *bold*, _italic_, - list, + numbered, #link().
- Set rules at the top:
#set page(paper: "a4", margin: 2cm), #set text(font: "…", size: 11pt),
#set heading(numbering: "1."), #set par(justify: true).
- Tables:
#table(columns: (auto, 1fr, auto), align: (left, left, right), table.header([*A*], …), …).
- Figures:
#figure(image("assets/plot.png", width: 80%), caption: [What it shows]) <fig-plot> and
@fig-plot to reference it.
- Math:
$x^2 + y^2 = z^2$ inline, $ E = m c^2 $ on its own line; #math.equation(numbering: "(1)").
- Code: fenced
```py blocks are highlighted.
- Variables and functions:
#let price = 12.5, #let row(name, qty) = [#name — #qty].
- Slides:
#set page(paper: "presentation-16-9") and #pagebreak() between slides.
- Bibliography:
#bibliography("refs.bib") with @key citations.
Rules
- Images and data live under
assets/, referenced relatively; a missing image is a compile error.
- Fonts: name system fonts (
"Helvetica Neue", "Georgia") or ship a .ttf under fonts/ and pass
--font-path fonts. Typst falls back silently if a font is missing — check the PDF.
- One document per
.typ at the workspace root; shared pieces go in lib/*.typ and are #imported.
- Save early: the first compile within a minute, then refine. The pane redraws on every save, keeps the
reader's page and marks the pages that changed.
- For the pane:
#set document(title: [...]) names the document in the pane's toolbar; every heading
becomes a PDF bookmark, which is the pane's outline, so structure with real = headings (not bold
text); compile errors show there with the source line from the verdict's file:line:col.
1---2name: typst3description: Write documents in Typst — papers, spec sheets, reports, letters, slides — compile them to PDF with the pinned typst binary, read its diagnostics, and keep the pane current. Use for any request that ends in a PDF or a printed page.4---56# typst78Typst is a markup-based typesetting system: Markdown-like text with a real scripting layer9(`#let`, functions, `#table`, `#figure`, `#math`), compiled to PDF in milliseconds. The compiler is10`$TYPST` (pinned; `$TYPST --version`). Never install another.1112## Compile, always through the verdict1314```bash15python3 "$TYPST_TOOLCHAIN/verdict.py" # main.typ → out/main.pdf, verdict, diagnostics16python3 "$TYPST_TOOLCHAIN/verdict.py" paper.typ # another file → out/paper.pdf17$TYPST compile --root . main.typ out/main.pdf # the raw compiler, when you need its flags18$TYPST watch --root . main.typ out/main.pdf # recompile on save (run in the background)19```2021The verdict is what the pane header shows. Typst's own errors and warnings come back with22`file:line:col`; fix errors first, then warnings.2324## The language, the parts that matter2526- **Text and structure**: `= Heading`, `== Sub`, `*bold*`, `_italic_`, `- list`, `+ numbered`, `#link()`.27- **Set rules** at the top: `#set page(paper: "a4", margin: 2cm)`, `#set text(font: "…", size: 11pt)`,28 `#set heading(numbering: "1.")`, `#set par(justify: true)`.29- **Tables**: `#table(columns: (auto, 1fr, auto), align: (left, left, right), table.header([*A*], …), …)`.30- **Figures**: `#figure(image("assets/plot.png", width: 80%), caption: [What it shows]) <fig-plot>` and31 `@fig-plot` to reference it.32- **Math**: `$x^2 + y^2 = z^2$` inline, `$ E = m c^2 $` on its own line; `#math.equation(numbering: "(1)")`.33- **Code**: fenced ```` ```py ```` blocks are highlighted.34- **Variables and functions**: `#let price = 12.5`, `#let row(name, qty) = [#name — #qty]`.35- **Slides**: `#set page(paper: "presentation-16-9")` and `#pagebreak()` between slides.36- **Bibliography**: `#bibliography("refs.bib")` with `@key` citations.3738## Rules3940- Images and data live under `assets/`, referenced relatively; a missing image is a compile error.41- Fonts: name system fonts (`"Helvetica Neue"`, `"Georgia"`) or ship a `.ttf` under `fonts/` and pass42 `--font-path fonts`. Typst falls back silently if a font is missing — check the PDF.43- One document per `.typ` at the workspace root; shared pieces go in `lib/*.typ` and are `#import`ed.44- Save early: the first compile within a minute, then refine. The pane redraws on every save, keeps the45 reader's page and marks the pages that changed.46- **For the pane**: `#set document(title: [...])` names the document in the pane's toolbar; every heading47 becomes a PDF bookmark, which is the pane's outline, so structure with real `=` headings (not bold48 text); compile errors show there with the source line from the verdict's `file:line:col`.