Reference

typst-watch(1)

Watches an input file and recompiles on changes

NAME

typst-watch - Watches an input file and recompiles on changes

SYNOPSIS

typst-watch [-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] [--no-serve] [--no-reload] [--port] [-h|--help] <INPUT> [OUTPUT]

DESCRIPTION

Watches an input file and recompiles on changes

OPTIONS

-f, --format <FORMAT>

The format of the output file, inferred from the extension by default

Possible values:

•

pdf

•

png

•

svg

•

html

•

bundle

--root <DIR>

Configures the project root (for absolute paths)

May also be specified with the TYPST_ROOT environment variable.

--input <key=value>

Add a string key-value pair visible through `sys.inputs`

--font-path <DIR>

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 <DIR>

Custom path to local packages, defaults to system-dependent location

May also be specified with the TYPST_PACKAGE_PATH environment variable.

--package-cache-path <DIR>

Custom path to package cache, defaults to system-dependent location

May also be specified with the TYPST_PACKAGE_CACHE_PATH environment variable.

--creation-timestamp <UNIX_TIMESTAMP>

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.

--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 <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

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 <PPI> [default: 144]

The PPI (pixels per inch) to use for PNG export

--deps <PATH>

File path to which a list of 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 number of CPUs. Setting it to 1 disables parallelism

--features <FEATURES>

Enables in-development features that may be changed or removed at any time

Possible values:

•

html

•

bundle

•

a11y-extras

May also be specified with 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 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.

--no-serve

Disables the built-in HTTP server for HTML export

--no-reload

Disables the injected live reload script for HTML export. The HTML that is written to disk isn't affected either way

--port <PORT>

The port where HTML is served.

Defaults to the first free port in the range 3000-3005.

-h, --help

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, 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.