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.
Agent 可直接安装
这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。
npx -y tokrepo@latest install 9033216a-3649-11f1-9bc6-00163e2b0d79 --target codex先 dry-run 确认安装计划,再运行此命令。
What it is
Typst is a markup-based typesetting system written in Rust, designed as a modern alternative to LaTeX. Created by Martin Haug and Laurenz Maedje as a master thesis project at TU Berlin, Typst compiles documents in milliseconds rather than the seconds or minutes LaTeX requires. It supports math equations, bibliographies, figures, tables, and custom templates out of the box.
Typst targets students writing theses, researchers preparing papers, and professionals who need polished PDF output without wrestling with LaTeX package conflicts. Its syntax is closer to Markdown than to TeX, making the learning curve gentler for newcomers.
How it saves time or tokens
Typst's incremental compilation watches your source file and regenerates only the parts that changed. A document that takes LaTeX 30 seconds to compile rebuilds in under 100 milliseconds with Typst. Error messages point to the exact line and explain what went wrong in plain English, eliminating the time spent deciphering cryptic LaTeX logs. The built-in scripting language handles loops, conditionals, and data-driven content without external toolchains.
How to use
- Install Typst via your package manager:
brew install typston macOS,cargo install --locked typst-clivia Rust, orscoop install typston Windows. - Create a
.typfile with your document content using Typst markup syntax. - Compile to PDF with
typst compile paper.typor usetypst watch paper.typfor live reload during editing.
Example
#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.
Compilation is _instant_ -- no more waiting.
== Background
$ E = m c^2 $
#figure(
table(
columns: 3,
[*Tool*], [*Language*], [*Speed*],
[Typst], [Rust], [< 100ms],
[LaTeX], [TeX], [10-60s],
),
caption: [Compilation speed comparison],
)
#bibliography("refs.bib")
Related on TokRepo
- AI Tools for Documentation -- discover AI-powered documentation workflows that pair well with Typst output
- AI Tools for Coding -- explore coding assistants that can generate Typst templates programmatically
Common pitfalls
- Typst's package ecosystem is smaller than LaTeX's CTAN repository, so niche academic journal templates may not exist yet.
- Some LaTeX features like TikZ diagrams have no direct Typst equivalent; you may need to export SVGs from other tools.
- Typst files are not directly accepted by most academic publishers, so you will still need to export to PDF for submission.
常见问题
Typst compiles in milliseconds instead of seconds, provides clear error messages, and uses simpler syntax. However, LaTeX has a larger package ecosystem and wider publisher acceptance. For most academic writing, Typst handles math, citations, and figures just as well.
Yes. Typst supports BibTeX and Hayagriva bibliography files natively. You add a bibliography command at the end of your document and use citation keys inline, similar to LaTeX.
No. Typst has its own template format and cannot directly use .sty or .cls files from LaTeX. You need to recreate templates in Typst syntax, though the process is simpler than writing LaTeX packages.
Typst outputs PDF by default and also supports SVG. It does not produce HTML or DOCX natively, though community tools exist for conversion.
Yes. The Typst compiler is open source under the Apache-2.0 license. There is also a web-based collaborative editor at typst.app that offers a free tier.
引用来源 (3)
- Typst GitHub— Typst is a modern typesetting system started as a master thesis at TU Berlin
- Typst Documentation— Typst supports incremental compilation and scripting
- Typst Blog— Typst uses X25519-based encryption for its web service
讨论
相关资产
EnTT — Fast Entity Component System for Modern C++
A header-only C++17 library providing a cache-friendly entity-component-system, event dispatcher, and service locator for game engines and simulations.
Alpine.js — Rugged Minimal JS Framework for Your Markup
Alpine.js is a rugged, minimal framework for composing JavaScript behavior directly in your HTML markup. Like jQuery for the modern web but declarative — reactive data, directives, and state with 15KB gzipped and zero build step.
Just — A Modern Command Runner and Makefile Alternative
Just is a command runner, like Make but for modern dev workflows. Write recipes in a Justfile, run them with `just recipe-name`. Simpler syntax than Make, no obscure behaviors, cross-platform, and works great for project tasks.
k6 — Modern Load Testing Tool Using Go and JavaScript
k6 is a modern load testing tool built by Grafana Labs. Write test scripts in JavaScript, run them in a high-performance Go runtime. Developer-centric with CLI-first workflow, CI/CD integration, and Grafana Cloud for result analysis.