← 返回命令列表

Linux command

typst 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Compile document to PDF

typst compile [document.typ]

Compile with specific output

typst compile [document.typ] [output.pdf]

Watch and recompile on changes

typst watch [document.typ]

Compile to PNG

typst compile [document.typ] [output.png]

Compile to SVG

typst compile [document.typ] [output.svg]

List available fonts

typst fonts

Compile with custom font path

typst compile --font-path [/path/to/fonts] [document.typ]

Initialize new project

typst init

说明

Typst is a modern typesetting system designed as an alternative to LaTeX. It combines the power of LaTeX with simpler syntax and faster compilation. Documents use .typ files with markup similar to Markdown. Headers, lists, emphasis, and links use familiar syntax. Mathematical equations use a LaTeX-inspired but simpler notation. Compilation is incremental and extremely fast - documents compile in milliseconds. Watch mode provides near-instant preview updates during editing. Styling uses a functional approach. Set rules configure defaults; show rules transform elements. The language is Turing-complete, enabling complex documents with scripting. Templates and packages extend functionality. Bibliography support uses BibTeX or Hayagriva formats. Multi-column layouts, figures, and tables work intuitively. Output formats include PDF (default), PNG pages, and SVG. Font embedding ensures documents render correctly anywhere.

参数

compile _INPUT_ _OUTPUT_
Compile document to output.
watch _INPUT_
Watch for changes and recompile.
fonts
List available fonts.
init _TEMPLATE_
Initialize new project.
query _INPUT_ _SELECTOR_
Query document metadata.
--root _DIR_
Project root directory.
--font-path _PATH_
Additional font search path.
-f, --format _FORMAT_
Force output format (pdf, png, svg). Normally inferred from output extension.
--ppi _NUM_
Pixels per inch for raster output (default 144).
--pages _RANGE_
Comma-separated list of pages to export (e.g. 1-3,5).
--diagnostic-format _FMT_
Diagnostic format: human, short.
--input _KEY=VALUE_
Set input variable.
--open
Open output after compile.
-h, --help
Show help.
-V, --version
Show version.

FAQ

What is the typst command used for?

Typst is a modern typesetting system designed as an alternative to LaTeX. It combines the power of LaTeX with simpler syntax and faster compilation. Documents use .typ files with markup similar to Markdown. Headers, lists, emphasis, and links use familiar syntax. Mathematical equations use a LaTeX-inspired but simpler notation. Compilation is incremental and extremely fast - documents compile in milliseconds. Watch mode provides near-instant preview updates during editing. Styling uses a functional approach. Set rules configure defaults; show rules transform elements. The language is Turing-complete, enabling complex documents with scripting. Templates and packages extend functionality. Bibliography support uses BibTeX or Hayagriva formats. Multi-column layouts, figures, and tables work intuitively. Output formats include PDF (default), PNG pages, and SVG. Font embedding ensures documents render correctly anywhere.

How do I run a basic typst example?

Run `typst compile [document.typ]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does compile _INPUT_ _OUTPUT_ do in typst?

Compile document to output.