Scroll to navigation

typst-compile(1) General Commands Manual typst-compile(1)

NAME

typst-compile - Compiles an input file into a supported output format

SYNOPSIS

typst-compile [--root] [--input] [--font-path] [--ignore-system-fonts] [--creation-timestamp] [--diagnostic-format] [--package-path] [--package-cache-path] [-j|--jobs] [--pages] [--make-deps] [-f|--format] [--open] [--ppi] [--timings] [--pdf-standard] [-h|--help] <INPUT> [OUTPUT]

DESCRIPTION

Compiles an input file into a supported output format

OPTIONS

Configures the project root (for absolute paths)
May also be specified with the TYPST_ROOT environment variable.
Add a string key-value pair visible through `sys.inputs`
Adds additional directories that are recursively searched for fonts

If multiple paths are specified, they are separated by the system's path separator (`:` on Unix-like systems and `;` on Windows).

May also be specified with the TYPST_FONT_PATHS environment variable.
Ensures system fonts won't be searched, unless explicitly included via `--font-path`
The document's creation date formatted as a UNIX timestamp.

For more information, see <https://reproducible-builds.org/specs/source-date-epoch/>.

May also be specified with the SOURCE_DATE_EPOCH environment variable.
The format to emit diagnostics in

[possible values: human, short]

Custom path to local packages, defaults to system-dependent location
May also be specified with the TYPST_PACKAGE_PATH environment variable.
Custom path to package cache, defaults to system-dependent location
May also be specified with the TYPST_PACKAGE_CACHE_PATH environment variable.
Number of parallel jobs spawned during compilation, defaults to number of CPUs. Setting it to 1 disables parallelism
Which pages to export. When unspecified, all document pages are exported.

Pages to export are separated by commas, and can be either simple page numbers (e.g. '2,5' to export only pages 2 and 5) or page ranges (e.g. '2,3-6,8-' to export page 2, pages 3 to 6 (inclusive), page 8 and any pages after it).

Page numbers are one-indexed and correspond to real page numbers in the document (therefore not being affected by the document's page counter).

Output a Makefile rule describing the current compilation
The format of the output file, inferred from the extension by default

[possible values: pdf, png, svg]

Opens the output file with the default viewer or a specific program after compilation

Ignored if output is stdout.

The PPI (pixels per inch) to use for PNG export
Produces performance timings of the compilation process (experimental)

The resulting JSON file can be loaded into a tracing tool such as https://ui.perfetto.dev. It does not contain any sensitive information apart from file names and line numbers.

One (or multiple comma-separated) PDF standards that Typst will enforce conformance with

Possible values:

  • 1.7: PDF 1.7
  • a-2b: PDF/A-2b
Print help (see a summary with '-h')
<INPUT>
Path to input Typst file. Use `-` to read input from stdin
[OUTPUT]
Path to output file (PDF, PNG or SVG). Use `-` to write output to stdout.

For output formats emitting one file per page (PNG & SVG), a page number template must be present if the source document renders to multiple pages. Use `{p}` for page numbers, `{0p}` for zero padded page numbers and `{t}` for page count. For example, `page-{0p}-of-{t}.png` creates `page-01-of-10.png`, `page-02-of-10.png` and so on.

typst-compile