Skip to main content

custom-progressive-outline

A fully-featured progressive outline that renders headings from multiple levels with per-level styling.

Uses arrays indexed by heading level (first element = level 1, second = level 2, etc.) to apply different styling to each level. Unlike progressive-outline (a thin wrapper around Typst's built-in outline), this function renders each heading manually, giving full control over numbering, indentation, fills, and typography. For styling parameters the last value in the array is used for all levels beyond the array length, it is repeated. So you can write indent: (1em,) to apply a 1em indentation to all levels, or indent: (0em, 1em) to apply no indentation to level-1 headings and 1em to level-2 and beyond. This is not the case for numbering or vspace nor for filled, numbered, paged.

Parameters

self : none    default: none

The self context.

alpha : ratio    default: 60%

The transparency of the covered headings. Default is 60%.

level : auto | int    default: auto

The outline level. When auto, all levels up to slide-level are shown. Default is auto.

numbered : array    default: (false,)

Per-level booleans indicating whether headings are numbered. Default is (false,). Last value in the array is not-repeated!

filled : array    default: (false,)

Per-level booleans indicating whether to show a fill between the heading and the page number. Default is (false,). Last value in the array is not-repeated!

paged : array    default: (false,)

Per-level booleans indicating whether to show the page number. Default is (false,). Last value in the array is not-repeated!

numbering : array    default: ()

Per-level numbering strings or none overrides. Default is (). Last value in the array is not-repeated!

text-style : array | none    default: none

Per-level text style dicts. Default is none (inherits current text style). See the parameters of text (https://typst.app/docs/reference/text/text/).

vspace : array | none    default: none

Per-level vertical space above each heading. Default is none. Last value in the array is not-repeated!

title : str | none    default: none

The title of the outline section. Default is none.

indent : array    default: (0em,)

Per-level left indentation. Default is (0em,).

fill : array    default: (repeat[.],)

Per-level fill content between heading and page number. Default is (repeat[.],).

short-heading : bool    default: true

Whether to shorten headings that have labels using utils.short-heading. Default is true.

show-past : array | function | none    default: none

Per-level booleans indicating whether to show headings for past sections. Default is none, reverts to the cover behaviour of progressive-outline. The last value in the array is used for all levels beyond the array length. \ If a function is provided instead, the function is used to style the outline entries and the styles passed to custom-progressive-outline are ignored. It receives (level: int, it) where it is the outline entry element and level is the heading level of that entry.

show-current : array | function | none    default: none

Per-level booleans. Defaul is none. For more info see show-past.

show-future : array | function | none    default: none

Per-level booleans. Default is none. For more info see show-past.

style-current : array    default: none

Per level text style dicts which override text styles for the non-covered headings. Default is none, which uses the styles from text-style. See text-style for more details.

..args : arguments

Additional arguments forwarded to the underlying outline call, see https://typst.app/docs/reference/model/outline/.

Returns: content