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

Data Loading

Data loading from external files.

These functions help you with loading and embedding data, for example from the results of an experiment.

Encoding

Some of the functions are also capable of encoding, e.g. cbor.encode. They facilitate passing structured data to plugins.

However, each data format has its own native types. Therefore, for an arbitrary Typst value, the encode-to-decode roundtrip might be lossy. In general, numbers, strings, and arrays or dictionaries composed of them can be reliably converted, while other types may fall back to strings via repr, which is for debugging purposes only. Please refer to the page of each data format for details.

Definition

  • Reads structured data from a CBOR file.
  • Reads structured data from a CSV file.
  • Reads structured data from a JSON file.
  • Reads plain text or data from a file.
  • Reads structured data from a TOML file.
  • Reads structured data from an XML file.
  • Reads structured data from a YAML file.
Open official docs

Search