Documentation

Reference

This reference documentation is a comprehensive guide to all of Typst’s syntax, concepts, functions, types, and other definitions. Use the reference to answer specific questions about Typst and to broaden your understanding of the available features.

If you are completely new to Typst, we recommend starting with the tutorial and then coming back to the reference to learn more about Typst’s features as you need them.

Language

The reference starts by covering fundamentals of the Typst language. First, we give an overview of Typst’s syntax. The following sections cover core concepts central to the Typst language such as styling documents, using Typst’s scripting capabilities, and reasoning about the contents of your document.

Library

The second part includes sections on all functions, types, and other definitions provided by the standard library of the Typst language.

The definition sections are grouped by topic. For example, if you would like to explore all tools Typst provides to adjust where elements land on the page, you should start in the Layout section.

Export

Some of the features in Typst only apply to certain output file formats. In the third part, you find the available format-specific settings and learn what features are available to customize your document for a given format.

Reading the reference

This reference uses a few graphical conventions and labels to let you quickly scan its sections.

str

These pills indicate that a value is of a particular type. Each type’s chapter uses the respective pill as its title. Similar types share a color. For example, all numeric types have the same color.

Element

Some functions are labelled as elements. This means that they can be used with set and show rules. Some elements can be located and used with the query function. Elements generally produce visible output in the document. You may be using elements even if you are not calling functions, as there is dedicated markup for some elements.

Contextual

These functions can reason about the contents of your document. They can only be used when context is available, for example through a context block. Refer to the Context section for more information.

Required

Appears on a function parameter if calling the function without that parameter would result in an error.

Positional

Appears on a function parameter that is specified without a parameter name and colon. Instead, Typst will use the parameter order to determine which argument is which. Parameters not marked as positional are named parameters.

Variadic

Appears on function parameters that can be specified multiple times.

Settable

Appears on function parameters of element functions that can be customized with a set rule.