Documentation

artifactElement
Question mark
Go to source

Marks content as a PDF artifact.

Artifacts are parts of the document that are not meant to be read by Assistive Technology (AT), such as screen readers. Typical examples include purely decorative images that do not contribute to the meaning of the document, watermarks, or repeated content such as page numbers.

Typst will automatically mark certain content, such as page headers, footers, backgrounds, and foregrounds, as artifacts. Likewise, paths and shapes are automatically marked as artifacts, but their content is not. Line numbers created using par.line are automatically marked as artifacts, as are repetitions of table headers and footers.

Once something is marked as an artifact, you cannot make any of its contents accessible again. If you need to mark only part of something as an artifact, you may need to use this function multiple times.

If you are unsure what constitutes an artifact, check the Accessibility Guide.

In the future, this function may be moved out of the pdf module, making it possible to hide content in HTML export from AT.

Parameters

artifact() → content

kind
str
Settable
Question mark
Default: "other"

The artifact kind.

You can improve accessibility by using the most specific artifact kind available. Your choice will govern how the PDF reader treats the artifact during reflow and content extraction (e.g. copy and paste).

Artifact types have been introduced in various different PDF specifications. Depending on which PDF version you target, Typst will select the most appropriate artifact type using your selection here.

ExpandView options
VariantDetails
"header"Repeats on the top of each page.
"footer"Repeats at the bottom of each page.
"watermark"Text or graphics in the back- or foreground of all pages.
"page-number"Page numbers. Note that if your page numbers are contained in a footer or header instead, the whole header or footer should an artifact of the appropriate type.
"line-number"Line or paragraph numbers.
"redaction"Placeholders for areas in which there was content in another rendition of the document which has since been removed.
"bates"Bates numbering. Note that if your Bates numbering is contained in a footer or header instead, the whole header or footer should an artifact of the appropriate type.
"page"Not part of the document, but rather the page it is printed on. An example would be cut marks or color bars.
"pagination-other"Artifacts arising from paginating the document not covered by other artifact types. This category generally applies if this artifact would not appear in your document if it was a website instead. If your artifact is covered by other categories, prefer them over this.
"layout"Purely cosmetric content or typographical flourishes not contributing to the document’s content.
"background"Background of a page or a graphical element. This artifact kind was added in PDF 1.7. However, due to requirements in the PDF 1.7 specification that later specifications lifted, Typst only uses this artifact type in PDF 2.0. If you use it in a PDF 1.7 or earlier, Typst will use the "other" type instead.
"other"Other artifacts.

body
content
RequiredPositional
Question mark

The content that is an artifact.