# Typst — Modern Markup-Based Typesetting System > Typst is a new markup-based typesetting system that is powerful and easy to learn. A modern alternative to LaTeX with fast incremental compilation, friendly error messages, and a scripting language built in. Write beautiful papers, theses, and documents without the LaTeX pain. ## Install Save as a script file and run: ## Quick Use ```bash # Install brew install typst # macOS cargo install --locked typst-cli # Rust scoop install typst # Windows ``` Create `paper.typ`: ```typst #set page(paper: "a4", margin: 2cm) #set text(font: "New Computer Modern", size: 12pt) #set heading(numbering: "1.1") = Introduction This paper explores how *Typst* can replace LaTeX for academic writing. Compilation is _instant_ — no more waiting 30 seconds. == Background Here is a citation @doe2024. $ E = m c^2 $ #figure( table( columns: 3, [*Framework*], [*Language*], [*Stars*], [React], [JavaScript], [230K], [Vue], [JavaScript], [210K], ), caption: [Popular frameworks comparison], ) #bibliography("refs.bib") ``` Compile: ```bash typst compile paper.typ # PDF output typst watch paper.typ # Live reload typst compile paper.typ paper.svg # SVG output ``` ## Intro Typst is a new markup-based typesetting system designed as a modern alternative to LaTeX. Written in Rust by Martin Haug and Laurenz Maedje (started as a master thesis project at TU Berlin). Typst compiles incrementally in milliseconds (vs LaTeX minutes), has friendly error messages, and includes a built-in scripting language for templates and automation. - **Repo**: https://github.com/typst/typst - **Stars**: 52K+ - **Language**: Rust - **License**: Apache 2.0 ## What Typst Does - **Markup** — lightweight syntax for headings, emphasis, lists, links - **Math** — `$ ... $` for equations with intuitive syntax - **Scripting** — built-in programming language (variables, loops, functions) - **Templates** — create and share reusable document templates - **Bibliography** — BibTeX and Hayagriva support - **Figures and tables** — numbered, captioned, cross-referenced - **Incremental compilation** — sub-second rebuilds - **Error messages** — human-readable with line/column info - **PDF output** — production-quality PDF - **typst.app** — collaborative online editor ## Architecture Rust compiler: source → AST → layout → PDF. Incremental: only recomputes changed pages. Scripting engine evaluates Typst code at compile time for dynamic content generation. Font subsetting and PDF/A compliance built in. ## Self-Hosting CLI tool + optional typst.app (collaborative SaaS). ## Key Features - Millisecond compilation - Readable markup syntax - Built-in math typesetting - Scripting language - Templates and packages - Bibliography support - Friendly errors - PDF output - Live watch mode - Collaborative editor (typst.app) ## Comparison | System | Compilation | Syntax | Scripting | |---|---|---|---| | Typst | Milliseconds | Easy | Built-in | | LaTeX | Seconds-minutes | Complex | TeX macros | | Markdown + Pandoc | Fast | Simple | Limited | | Asciidoc | Fast | Medium | Macros | | Groff | Fast | Arcane | Macros | ## 常见问题 FAQ **Q: 能替代 LaTeX 吗?** A: 对 80% 的学术写作可以。少数高级 LaTeX 功能(特定期刊模板、TikZ 复杂图)暂不支持。Typst 正在快速补齐。 **Q: 数学公式支持如何?** A: 优秀。语法比 LaTeX 更直观:`$sum_(i=1)^n i = (n(n+1))/2$`,不用记 `\frac{}{}`。 **Q: 模板生态?** A: typst.app 有社区模板库(IEEE、ACM、thesis、resume、letter)。也可以自定义 `.typ` 模板并分享。 ## 来源与致谢 Sources - Docs: https://typst.app/docs - GitHub: https://github.com/typst/typst - License: Apache 2.0 --- Source: https://tokrepo.com/en/workflows/9033216a-3649-11f1-9bc6-00163e2b0d79 Author: Script Depot