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

panic

Fails with an error.

Arguments are displayed to the user (not rendered in the document) as strings, converting with repr if necessary.

Example

The code below produces the error panicked with: "this is wrong".

#panic("this is wrong")

Parameter
Parameter
Parameters are input values for functions. Specify them in parentheses after the function name.

panic(
any
)

values
any
Required
Required
Required parameters must be specified when calling the function.
Positional
Positional
Positional parameters can be set by specifying them in order, omitting the parameter name.
Variadic
Variadic
Variadic parameters can be specified multiple times.

The values to panic with and display to the user.

Open official docs

Search