Typst
A markup-based typesetting system that is as powerful as LaTeX yet far easier to learn.
Repository Health
Technical Analysis
Typst is a modern, markup-based typesetting system and compiler written in Rust that aims to match the power of LaTeX while being dramatically simpler to learn and use. It combines lightweight markup for common formatting, a tightly integrated scripting language, first-class math typesetting, and bibliography management into a single tool.
Thanks to incremental compilation, Typst offers near-instant preview and fast build times, making it well suited for everything from academic papers and books to reports and slides. The project ships as both a compiler library and a command-line interface, and is complemented by a free collaborative web editor.
What You Get
- A single
typstCLI that compiles and watches documents into PDF, PNG, SVG, and HTML - A built-in scripting system with variables, functions, and set/show rules for full styling control
- First-class math typesetting, bibliography management, and reusable templates via Typst Universe
- Fast incremental compilation for near-instant preview while editing
Common Use Cases
- Writing academic papers, theses, and scientific documents with heavy math
- Producing reports, books, and technical documentation with consistent styling
- Generating documents programmatically from data using the scripting system
Under The Hood
Architecture - Typst is organized as a Cargo workspace of focused crates that mirror the compilation pipeline: typst-syntax tokenizes and parses source into an untyped syntax tree with a typed AST layer; typst-eval evaluates markup and scripting into a hierarchical content tree; typst-library defines the standard set of elements and foundations; typst-layout lays content into a PagedDocument of positioned frames; and exporters like typst-pdf, typst-render (PNG), typst-svg, and typst-html turn frames into output formats. The typst crate ties these together as the compiler, while typst-cli provides the user-facing compile/watch binary.
Tech Stack - Written in Rust (edition 2024, MSRV 1.92) and built with Cargo. It depends on comemo for incremental memoized compilation, ecow for compact strings and vectors, rustc-hash for fast hashing, and arrayvec among others, plus typst-assets for bundled fonts and data.
Code Quality - The codebase is cleanly decomposed into single-responsibility crates with extensive module-level documentation and a large test suite under tests/ (reference-image based ref/, suite/, and fuzz targets). Consistent naming, clippy.toml/rustfmt.toml enforcement, and a documented architecture guide reflect a mature, well-maintained engineering process.
API Design - For end users the ergonomics center on the typst CLI (typst compile file.typ, typst watch), which is discoverable and well-documented. As a Rust library the crate re-exports typst_library, typst_syntax, and typst_utils behind a clear compiler entry point, though embedding the full compiler is an advanced use case relative to simply running the binary.