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

document
Element
Element
Element functions can be customized with set and show rules.

The root element of a document and its metadata.

All documents are automatically wrapped in a document element. You cannot create a document element yourself. This function is only used with set rules to specify document metadata. Such a set rule must not occur inside of any layout container.

#set document(title: [Hello])

This has no visible output, but
embeds metadata into the PDF!
Preview

Note that metadata set with this function is not rendered within the document. Instead, it is embedded in the compiled PDF file.

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

title
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

The document's title. This is often rendered as the title of the PDF viewer window.

While this can be arbitrary content, PDF viewers only support plain text titles, so the conversion might be lossy.

Default value:

none

author
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

The document's authors.

Default value:

()

description
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

The document's description.

Default value:

none

keywords
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

The document's keywords.

Default value:

()

date
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

The document's creation date.

If this is auto (default), Typst uses the current date and time. Setting it to none prevents Typst from embedding any creation date into the PDF metadata.

The year component must be at least zero in order to be embedded into a PDF.

If you want to create byte-by-byte reproducible PDFs, set this to something other than auto.

Default value:

auto

Open official docs

Search