Info
This site is generated using the static site generator developed by the Typst Community. Please adjust the text content of this banner according to your usage requirements. At Typst GmbH's request, when publishing documentation, you must clearly indicate that it is non-official and display the version of Typst being documented. For details, refer to Issue #874 on typst/typst.
TypstDocumentEnglish
v0.dev.2025-09-12

module

A collection of variables and functions that are commonly related to a single theme.

A module can

You can access definitions from the module using field access notation and interact with it using the import and include syntaxes.

#import "utils.typ"
#utils.add(2, 5)

#import utils: sub
#sub(1, 4)
Preview

You can check whether a definition is present in a module using the in operator, with a string on the left-hand side. This can be useful to conditionally access definitions in a module.

#("table" in std) \
#("nope" in std)
Preview

Alternatively, it is possible to convert a module to a dictionary, and therefore access its contents dynamically, using the dictionary constructor.

Open official docs

Search