Typst

For Typst the extension prints each index with page locators, in two columns, built from the same marks every other back-end reads. A declared index that no mark files in prints nothing, not even its heading. It needs no Typst package: everything the index uses is written into the document, so nothing is downloaded when the document compiles.

A page number is known only once Typst has laid out the pages, and the extension runs before that. So it writes an invisible Typst label at each mark, and each locator in the index asks Typst for the page of its label while the document is typeset. A mark in a heading gets its label just after the heading, so the copy of that heading in the table of contents carries none.

Where the index goes

Each index goes where your placement marker puts it, and at the end of the document where no marker names it, in the order your indexes: metadata declares them. See Placing the index. An index starts on a new page under an unnumbered level-one heading, which Typst lists in the table of contents. The heading is the title your indexes: metadata gives the index, or its name where you give no title. A document that declares no indexes: gets Index, or its language’s word for an index where the extension covers that language. The text after the index starts on a new page too.

Entries

The entries are ordered and grouped as in HTML: a Symbols group first, then one group per letter, each under its letter in bold. See Letter groups in the HTML index. A sub-entry is indented under its parent, and sub-entries nest as deep as you write them.

Locators

Each locator is the page number as the page shows it. Each one links to its page.

  • Where the page numbering pattern names two counters, such as 1 / 1, a locator prints both, as the page footer does: 5 / 30.
  • A page with no numbering prints its physical page number.
  • Several marks of one term on one page print that page once.
  • Locators that print the same text print it once, even from different pages, as after a page counter reset. That one locator links to the earliest of those pages, and it is bold where any of their marks is a principal mention. It prints at the place of the first of them in the order below.
  • The locator of a principal mention is set in bold. Where a principal and an ordinary mark of one term share a page, that page’s one locator is bold.
  • A range prints its opening and closing pages, 12–15, and links to the opening page. Where both ends of a range are on one page, with no page counter update between them, it prints that page alone. Where the two ends print the same text, it prints that text alone.
  • An entry’s locators are ordered by the numbering of their opening pages, as the PDF index orders page numbers. Lower roman numbers come first, then upper roman numbers, arabic numbers, lowercase letters, uppercase letters, and then any other numbering. The first counting symbol of the page numbering pattern sets the kind, so 1 / 1 is arabic. A page with no numbering counts as arabic, with its physical page as its number, and a numbering function counts as other. Numbers of one kind are ordered by value, the page counter’s value or the physical page where a page has no numbering, and then by page. So after a page counter reset, 1 comes before a 3 from an earlier page. Where two locators of one kind and number open on one page, the one that closes on the earlier page comes first, and a single mark comes before a range that closes on its page.
  • A range whose two ends print different numbers of one kind, with a higher closing number, spans the numbers from its opening number to its closing number, both included. A mark of the term on a spanned number of that kind prints no locator of its own, even on a page after the range, as after a page counter reset. A principal mention there loses its bold. A range whose two ends print the same text counts as a single mark, and a span removes it the same way. Any other range spans nothing. A span never removes a range whose two ends print different text.
  • Pages you marked separately stay separate: marks on pages 3, 4 and 5 print 3, 4, 5. Only a range you write prints as a range. A mark on the page just after a range prints its own locator, 2–3, 4, where the PDF index prints 2–4.

Cross-references

A cross-reference prints its word in italics, then its target as plain text, with no link. The words are see and see also, your document language’s words where the extension covers that language, or the words you set under index-labels:, which Typst reads for symbols, see and see-also.

The punctuation is fixed: a comma before each locator and before the first cross-reference, and a semicolon between two cross-references. The separator and xref-separator keys of index-labels: do not reach the Typst index.

Books

Quarto renders a Typst book as one merged document, so the extension sees every chapter’s marks at once, and a range you open in one chapter and close in another pairs. Books were tested on Quarto 1.10.18. On that version Quarto’s Typst book template does not compile a book whose book: metadata has no author:. Quarto 1.5.52 does not render a Typst book. It prints the warning The typst format is not supported by book projects and writes no PDF.

A mark Typst never prints

A mark in a front-matter field that Quarto’s Typst template does not print, such as description:, has no label on any page. Its term is still in the index, with no page number.