Skip to main content

Typst format

Overview

typst output renders your document with Typst, a modern typesetting system, and produces a PDF. It’s an alternative to pdf (LaTeX) worth considering when you want fast compiles and don’t need LaTeX-specific packages.

Rendering to typst requires a typst binary. Quarto does not bundle one — install it from typst.app and make sure it’s on your PATH, or point the QUARTO_TYPST environment variable at wherever it lives. Quarto requires typst 0.8 or newer.

Basic usage

Render a single document to typst from the command line:

quarto render document.qmd --to typst

Or set it as the document’s format in the YAML front matter:

document.qmd
---
title: "My Document"
format: typst
---

Either way, the output is a PDF — the intermediate Typst source Quarto generates along the way is deleted once the compile succeeds (see keep-typ below if you want to keep it).

Format options

Set these under format: typst: in your document or project YAML.

Multi-column layout

document.qmd
format:
  typst:
    columns: 2

Custom template

Typst output is built from a Quarto-provided template. Point template at your own .typ file to override it:

document.qmd
format:
  typst:
    template: my-template.typ

Your template can still reference Quarto’s own template partials (for example the numbering and page-geometry helpers) — they’re staged alongside it, not replaced.

PDF standard

Typst can target a specific PDF/A or PDF/UA conformance level via pdf-standard:

document.qmd
format:
  typst:
    pdf-standard: "a-2b"

Accepts either a single value or an array (e.g. ["2.0", "a-2b"]). An unrecognized standard is dropped with a warning rather than passed through to typst verbatim.

Keeping the intermediate Typst source

Quarto deletes the intermediate .typ file after a successful compile. Set keep-typ: true to keep it alongside the PDF — useful if you want to inspect or hand-edit the generated Typst source:

document.qmd
format:
  typst:
    keep-typ: true

Producing Typst source instead of a PDF

output-ext chooses what format: typst produces. The default, pdf, means “generate Typst source, then compile it”. Any other value stops after the first step: the output is the Typst source itself, written as <name>.<output-ext> with the extension exactly as you spelled it (conventionally typ).

document.qmd
format:
  typst:
    output-ext: typ

You can set output-ext under format: typst:, at the top level of the document, or in the same places in _quarto.yml; the document wins over the project, and format: typst: wins over the top level. keep-typ has no effect when output-ext is not pdf, since the source is already the output.

In the browser (Quarto Hub), format: typst previews and downloads as a PDF; with a non-pdf output-ext it downloads the Typst source instead.

format: pdf is LaTeX, not Typst

To get a PDF through Typst, use format: typst. format: pdf means LaTeX and is not yet supported by quarto render; in the browser it is reported as unavailable, with a pointer back to format: typst.

Cross-references and numbering

Figures, tables, equations, and other cross-referenced elements are numbered natively by Typst’s own compiler, not by Quarto — the same @fig-/@tbl-/@eq- syntax you use for every other format works as expected, and the numbers Typst prints always match the numbers your @refs resolve to.

Margin notes

Content placed in a column-margin div (or referenced via margin citations) renders in the page margin, using Typst’s marginalia package, which Quarto vendors and stages automatically — no extra installation step required:

Body text with a reference to the margin.[^note]

::: {.column-margin}
This appears in the margin next to the paragraph above.
:::

brand.yml support

typst output honors your project’s _brand.yml for colors and typography, the same way other formats do.

Packages beyond the ones Quarto vendors

Quarto vendors a handful of Typst packages its own template and Lua filters depend on (including marginalia for margin notes). If your document’s own Typst content references an additional Typst Universe package via #import "@preview/..." — for example inside a raw Typst block — Quarto detects that reference and fetches the package automatically before compiling, the first time it’s needed.