typst-compile(1)

πŸ“¦
version 0.14.2 Β· 3 versions
, in alpine 3.24, nixos 26.05

πŸ’… typst-compile β€” like, the girlies' guide to compiling ur Typst file ✨

okay so bestie, welcome to typst-compile(1) from the General Commands Manual β€” this is the one that takes ur input file and turns it into an output format that actually slays. Let's get into it 🫢


🌸 SYNOPSIS 🌸

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

πŸ¦‹ DESCRIPTION πŸ¦‹

Compiles an input file into a supported output format. that's it, that's the vibe. iconic behaviour, no notes πŸ’…


✨ OPTIONS ✨

  • -f, --format=FORMAT β€” the format of the output file. by default it's lowkey inferred from the extension, main character energy fr fr
    • possible values: pdf, png, svg, html
  • --root=DIR β€” sets up the project root (for absolute paths, iykyk). you can also set this with the TYPST_ROOT environment variable πŸŽ€
  • --input=key=value β€” drops in a string key-value pair that's visible through sys.inputs
  • --font-path=DIR β€” adds extra directories that get recursively searched for fonts. if you're passing multiple paths, separate them with the system's path separator (: on Unix-like systems and ; on Windows). also available via the TYPST_FONT_PATHS environment variable 🌈
  • --ignore-system-fonts β€” makes sure system fonts won't be searched, unless they're explicitly included via --font-path. also available via the TYPST_IGNORE_SYSTEM_FONTS environment variable
  • --ignore-embedded-fonts β€” makes sure fonts embedded into Typst won't be considered. also available via the TYPST_IGNORE_EMBEDDED_FONTS environment variable
  • --package-path=DIR β€” custom path to local packages. defaults to a system-dependent location. also available via the TYPST_PACKAGE_PATH environment variable
  • --package-cache-path=DIR β€” custom path to the package cache. defaults to a system-dependent location. also available via the TYPST_PACKAGE_CACHE_PATH environment variable
  • --creation-timestamp=UNIX_TIMESTAMP β€” the document's creation date, formatted as a UNIX timestamp ⭐ for more info, see <https://reproducible-builds.org/specs/source-date-epoch/>. also available via the SOURCE_DATE_EPOCH environment variable
  • --pages=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=PDF_STANDARD β€” one (or multiple comma-separated) PDF standards that Typst will enforce conformance with πŸ”₯

Possible values:

  • 1.4: PDF 1.4
  • 1.5: PDF 1.5
  • 1.6: PDF 1.6
  • 1.7: PDF 1.7
  • 2.0: PDF 2.0
  • a-1b: PDF/A-1b
  • a-1a: PDF/A-1a
  • a-2b: PDF/A-2b
  • a-2u: PDF/A-2u
  • a-2a: PDF/A-2a
  • a-3b: PDF/A-3b
  • a-3u: PDF/A-3u
  • a-3a: PDF/A-3a
  • a-4: PDF/A-4
  • a-4f: PDF/A-4f
  • a-4e: PDF/A-4e
  • ua-1: PDF/UA-1
  • --no-pdf-tags β€” so normally, even when you're not producing a PDF/UA-1 document, a tagged PDF document gets written to provide a baseline of accessibility (we love inclusive queen behaviour 🫢). but in some circumstances (for example when you're trying to reduce the size of a document) it can be desirable to disable tagged PDF
  • --ppi=PPI [default: 144] β€” the PPI (pixels per inch) to use for PNG export πŸ“
  • --deps=PATH β€” file path to which a list of the current compilation's dependencies will be written. use - to write to stdout
  • --deps-format=DEPS_FORMAT [default: json] β€” file format to use for dependencies

Possible values:

  • json: encodes as JSON, failing for non-Unicode paths 😭
  • zero: separates paths with NULL bytes and can express all paths
  • make: emits in Make format, omitting inexpressible paths
  • -j, --jobs=JOBS β€” number of parallel jobs spawned during compilation. defaults to the number of CPUs. setting it to 1 disables parallelism πŸ’€
  • --features=FEATURES β€” enables in-development features that may be changed or removed at any time (bestie, they are NOT stable, do not build ur whole personality on them πŸ™ˆ)
    • possible values: html, a11y-extras
    • also available via the TYPST_FEATURES environment variable
  • --diagnostic-format=DIAGNOSTIC_FORMAT [default: human] β€” the format to emit diagnostics in
    • possible values: human, short
  • --open=VIEWER β€” opens the output file with the default viewer or a specific program after compilation. ignored if the output is stdout πŸŽ€
  • --timings=OUTPUT_JSON β€” 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 β€” so like, ur secrets are safe, ngl
  • -h, --help β€” print help (see a summary with -h) ✨
  • <INPUT> β€” path to the input Typst file. use - to read input from stdin πŸ’–
  • [OUTPUT] β€” path to the 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 🌸

πŸ’€ real talk: --features is literally for in-development stuff that may be changed or removed at any time, and --timings is experimental. don't come for me if they get weird, ok? 😭

aaaaaaaaand that's the whole page, bestie πŸ¦‹ ty for coming to my TED talk. this iconic little number lives in the General Commands Manual, its footer says typst-compile and the page is typst-compile(1) β€” go forth and compile, you absolute queen πŸ‘‘πŸ’œ

πŸ“¦ where this page comes from