typst_compile: Compile a '.typ' file and return the output path.

View source: R/compile.R

typst_compileR Documentation

Compile a .typ file and return the output path.

Description

This function uses the Typst Rust library to compile a .typ file to a supported output format and return the output path.

Usage

typst_compile(
  file,
  output = NULL,
  font_path = NULL,
  pdf_standard = NULL,
  output_format = NULL,
  ...
)

Arguments

file

Path to an existing .typ file.

output

Optional output path. Defaults to the input path with the extension implied by the output format.

font_path

Optional path to font files.

pdf_standard

Optional PDF standard specification. Options are: : 1.4, 1.5, 1.6, 1.7, 2.0, ⁠a-1b⁠, ⁠a-1a⁠, ⁠a-2b⁠, ⁠a-2u⁠, ⁠a-2a⁠, ⁠a-3b⁠, ⁠a-3u⁠, ⁠a-3a⁠, a-4, ⁠a-4f⁠, ⁠a-4e⁠, ua-1. Only used for PDF output.

output_format

Optional output format. Supported values are pdf, html, png, and svg. Defaults to NULL, which means "infer from output when possible, otherwise use pdf". Multi-page png and svg outputs are merged into a single image.

...

Named inputs passed to the Typst document via sys.inputs. Each argument must be named. Scalar values are passed as-is; other values are JSON-encoded.

Value

Output path, invisibly.


tynding documentation built on March 31, 2026, 5:06 p.m.