typst-compile(1) General Commands Manual typst-compile(1)
NAME
typst-compile - Compiles an input file into a supported output format
SYNOPSIS
typst-compile [-f|--format] [--root] [--input] [--font-path]
[--ignore-system-fonts] [--ignore-embedded-fonts] [--package-path]
[--package-cache-path] [--creation-timestamp] [--pretty] [--pages]
[--pdf-standard] [--no-pdf-tags] [--ppi] [--deps] [--deps-format]
[-j|--jobs] [--features] [--diagnostic-format] [--open] [--timings]
[-h|--help] [OUTPUT]
DESCRIPTION
Compiles an input file into a supported output format
OPTIONS
-f, --format
The format of the output file, inferred from the extension by
default
Possible values:
o pdf
o png
o svg
o html
o bundle
--root
Configures the project root (for absolute paths)
May also be specified with the TYPST_ROOT environment variable.
--input
Add a string key-value pair visible through `sys.inputs`
--font-path
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.
--ignore-system-fonts
Ensures system fonts won't be searched, unless explicitly
included via `--font-path`
May also be specified with the TYPST_IGNORE_SYSTEM_FONTS
environment variable.
--ignore-embedded-fonts
Ensures fonts embedded into Typst won't be considered
May also be specified with the TYPST_IGNORE_EMBEDDED_FONTS
environment variable.
--package-path
Custom path to local packages, defaults to system-dependent
location
May also be specified with the TYPST_PACKAGE_PATH environment
variable.
--package-cache-path
Custom path to package cache, defaults to system-dependent
location
May also be specified with the TYPST_PACKAGE_CACHE_PATH
environment variable.
--creation-timestamp
The document's creation date formatted as a UNIX timestamp.
For more information, see
.
May also be specified with the SOURCE_DATE_EPOCH environment
variable.
--pretty
Whether to pretty-print produced output.
This formats the output in a more human-readable, but less
space-efficient way. Affects HTML, SVG, and PDF export, but not
PNG export.
--pages
Which pages to export. When unspecified, all 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 physical page
numbers in the document (therefore not being affected by the
document's page counter).
--pdf-standard
One (or multiple comma-separated) PDF standards that Typst will
enforce conformance with
Possible values:
o 1.4: PDF 1.4
o 1.5: PDF 1.5
o 1.6: PDF 1.6
o 1.7: PDF 1.7
o 2.0: PDF 2.0
o a-1b: PDF/A-1b
o a-1a: PDF/A-1a
o a-2b: PDF/A-2b
o a-2u: PDF/A-2u
o a-2a: PDF/A-2a
o a-3b: PDF/A-3b
o a-3u: PDF/A-3u
o a-3a: PDF/A-3a
o a-4: PDF/A-4
o a-4f: PDF/A-4f
o a-4e: PDF/A-4e
o ua-1: PDF/UA-1
--no-pdf-tags
By default, even when not producing a `PDF/UA-1` document, a
tagged PDF document is written to provide a baseline of
accessibility. In some circumstances (for example when trying to
reduce the size of a document) it can be desirable to disable
tagged PDF
--ppi [default: 144]
The PPI (pixels per inch) to use for PNG export
--deps
File path to which a list of current compilation's dependencies
will be written. Use `-` to write to stdout
--deps-format [default: json]
File format to use for dependencies
Possible values:
o json: Encodes as JSON, failing for non-Unicode paths
o zero: Separates paths with NULL bytes and can express
all paths
o make: Emits in Make format, omitting inexpressible
paths
-j, --jobs
Number of parallel jobs spawned during compilation. Defaults to
number of CPUs. Setting it to 1 disables parallelism
--features
Enables in-development features that may be changed or removed
at any time
Possible values:
o html
o bundle
o a11y-extras
May also be specified with the TYPST_FEATURES environment
variable.
--diagnostic-format [default: human]
The format to emit diagnostics in
Possible values:
o human
o short
--open []
Opens the output file with the default viewer or a specific
program after compilation. Ignored if output is stdout
--timings
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.
-h, --help
Print help (see a summary with '-h')
Path to input Typst file. Use `-` to read input from stdin
[OUTPUT]
Path to output file (PDF, PNG, SVG, or HTML). 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 typst-compile(1)