LinuxCommandLibrary

typst

Compile Typst markup language into PDF documents

TLDR

Initialize a new Typst project in a given directory using a template (e.g., @preview/charged-ieee)

$ typst init "[template]" [path/to/directory]
copy

Compile a Typst file
$ typst compile [path/to/source.typ] [path/to/output.pdf]
copy

Watch a Typst file and recompile on changes
$ typst watch [path/to/source.typ] [path/to/output.pdf]
copy

List all discoverable fonts in the system and the given directory
$ typst --font-path [path/to/fonts_directory] fonts
copy

SYNOPSIS

typst command [OPTIONS] arguments...
Example: typst compile input.typ [output.pdf]

PARAMETERS

compile
    command
Compiles a Typst file (.typ) into an output format (e.g., PDF).

watch
    command
Monitors a Typst file for changes and recompiles automatically for live preview.

query
    command
Extracts structured information or specific elements from a Typst document.

fonts
    command
Manages Typst's font cache, allowing listing, adding, or clearing fonts.

init
    command
Initializes a new Typst project with a basic template.

-o, --output
    Specifies the output file path for compiled documents.

--root


    Sets the root directory for resolving file paths and imports within a document.

--font-path
    Adds a custom directory to the font search paths for Typst.

--input
    Passes a string key-value pair as an input variable to the document's compilation.

--format
    Determines the output format (e.g., pdf, png, svg) when compiling.

DESCRIPTION

Typst is a new, powerful, and easy-to-learn markup language designed for typesetting. It aims to be a modern alternative to traditional systems like LaTeX, offering high-quality typography while significantly improving compilation speed and user experience. Written in Rust, Typst compiles documents much faster than LaTeX, often in milliseconds. It provides a concise and intuitive syntax for creating a wide range of documents, from scientific papers and books to presentations and letters. Key features include integrated scripting capabilities, robust math typesetting, figure and table support, and direct PDF output. Its focus on user-friendliness and performance makes it an appealing choice for both beginners and experienced document creators.

CAVEATS

As a relatively new system, Typst's ecosystem and tooling are still developing compared to more mature alternatives like LaTeX. Not all LaTeX packages have direct Typst equivalents yet, which might require custom implementations for specific functionalities. While generally faster, very large or complex documents can still be resource-intensive.

KEY FEATURES

Typst offers integrated scripting capabilities, robust math typesetting, and a modular design. It supports custom styling, bibliography management, and cross-referencing, making it versatile for various document types.

PERFORMANCE FOCUS

Leverages the Rust programming language for extremely fast compilation times, often measured in milliseconds. This rapid feedback loop makes Typst ideal for rapid iteration and managing large, complex projects efficiently.

INTUITIVE SYNTAX

Utilizes a clean and intuitive markup syntax that blends elements of Markdown with powerful, function-based programming constructs. This design makes it easier to learn and write documents compared to traditional typesetting systems.

HISTORY

Typst was first publicly released in 2023 by two ETH Zurich students, Lars Bergstrom and Yannis Günther, with the goal of creating a modern, fast, and user-friendly alternative to LaTeX. It quickly gained traction due to its performance, clean syntax, and powerful capabilities. Developed in Rust, it emphasizes speed and reliability. Its development is ongoing, with a strong community contributing to its rapid evolution and the expansion of its core features and package ecosystem.

SEE ALSO

pdflatex(1), pandoc(1), xelatex(1), lualatex(1), groff(1)

Copied to clipboard