Typst
A modern typesetting system built as a faster, friendlier alternative to LaTeX — documents are written in a clean markup language and compiled in milliseconds.
Typst is a new typesetting system designed to be a modern replacement for LaTeX. It compiles documents written in a clean, readable markup language to PDF (or other formats), with incremental compilation so fast it feels interactive. Unlike LaTeX, error messages are clear, the layout model is predictable, and you can script documents with a real programming language built right in.
Features
- Millisecond compilation — incremental compiler means the PDF updates almost instantly as you type
- Friendly syntax — clean markup that feels closer to Markdown than LaTeX, but with full typesetting power
- Built-in scripting — a real functional scripting language for loops, conditionals, custom functions, and data-driven documents
- Strong math support — first-class math typesetting with a dedicated math mode and beautiful output
- Package ecosystem — a growing registry of community packages at typst.app/universe
- Great error messages — precise, actionable errors that point to the exact location of the problem
- Self-hosted or cloud — use the CLI locally or the official web app at typst.app
- LSP support — the official
tinymistlanguage server provides completions, hover docs, and live preview in VS Code, Helix, Neovim, and others
Installation
cargo install typst-cli
Or via your package manager:
# macOS
brew install typst
# Arch Linux
pacman -S typst
# Debian / Ubuntu (Debian 12+)
apt install typst
# Fedora
dnf install typst
# Nix
nix-env -iA nixpkgs.typst
# Windows (winget)
winget install --id Typst.TypstBasic Usage
# Compile a document to PDF
typst compile document.typ
# Watch for changes and recompile automatically
typst watch document.typ
# Start a local preview server with live reload
typst watch document.typ --open
# Export to PNG (one image per page)
typst compile document.typ output-{n}.png
# Check for errors without producing output
typst compile document.typ --diagnostic-format shortSyntax Overview
#set page(paper: "a4", margin: 2cm)
#set text(font: "Linux Libertine", size: 11pt)
#set heading(numbering: "1.1")
= Introduction
Typst is a *modern* typesetting system. It supports:
- Bullet lists
- _Italic_ and *bold* text
- `inline code` and code blocks
== Math
The quadratic formula is $x = (-b plus.minus sqrt(b^2 - 4a c)) / (2a)$.
== Scripting
#let greet(name) = [Hello, #name!]
#greet("world")
#for i in range(1, 4) {
[Item #i \ ]
}Comparison with LaTeX
| Feature | LaTeX | Typst |
|---|---|---|
| Compilation speed | Slow (multiple passes) | Milliseconds (incremental) |
| Error messages | Cryptic | Clear and precise |
| Syntax | \command{arg} | #command(arg) or = Heading |
| Scripting | Macro-based (TeX) | Real functional language |
| Package install | CTAN / TeX Live | #import "@preview/pkg:version" |
| Math | Excellent | Excellent |
| Learning curve | Steep | Gentle |