TypstDocumentation

eval

Evaluate a string as Typst code.

This function should only be used as a last resort.

Example

#eval("1 + 1") \
#eval("(1, 2, 3, 4)").len() \
#eval("[*Strong text*]")
Preview

Parameters
Question mark

eval() -> any

source
string
RequiredPositional
Question mark

A string of Typst code to evaluate.

The code in the string cannot interact with the file system.