introspection
Interactions between document parts.
This category is home to Typst's introspection capabilities: With the
counter
function, you can access and manipulate page, section, figure, and
equation counters or create custom ones. Meanwhile, the query
function
lets you search for elements in the document to construct things like a list
of figures or headers which show the current chapter title.
Most of the functions are contextual. It is recommended to read the chapter on context before continuing here.
定義
counter
Counts through pages, elements, and more.here
Provides the current location in the document.locate
Determines the location of an element in the document.location
Identifies an element in the document.metadata
Exposes a value to the query system without producing visible content.query
Finds elements in the document.state
Manages stateful parts of your document.