TypstDocumentation

listElement
Question mark

A bullet list.

Displays a sequence of items vertically, with each item introduced by a marker.

Example

- *Content*
  - Text
  - Math
  - Layout
  - Visualize
  - Meta
  - Symbols

- *Compute*
  #list(
    [Foundations],
    [Calculate],
    [Construct],
    [Data Loading],
  )
Preview

Syntax

This functions also has dedicated syntax: Start a line with a hyphen, followed by a space to create a list item. A list item can contain multiple paragraphs and other block-level content. All content that is indented more than an item's hyphen becomes part of that item.

Parameters
Question mark

tight
boolean
Settable
Question mark

If this is false, the items are spaced apart with list spacing. If it is true, they use normal leading instead. This makes the list more compact, which can look better if the items are short.

Default: true

- If a list has a lot of text, and
  maybe other inline content, it
  should not be tight anymore.

- To make a list wide, simply insert
  a blank line between the items.
Preview

marker
content or array or function
Settable
Question mark

The marker which introduces each item.

Instead of plain content, you can also pass an array with multiple markers that should be used for nested lists. If the list nesting depth exceeds the number of markers, the last one is repeated. For total control, you may pass a function that maps the list's nesting depth (starting from 0) to a desired marker.

Default: []

#set list(marker: [--])
- A more classic list
- With en-dashes

#set list(marker: ([], [--]))
- Top-level
  - Nested
  - Items
- Items
Preview

indent
length
Settable
Question mark

The indent of each item.

Default: 0pt

body-indent
length
Settable
Question mark

The spacing between the marker and the body of each item.

Default: 0.5em

spacing
auto or relative length or fraction
Settable
Question mark

The spacing between the items of a wide (non-tight) list.

If set to auto, uses the spacing below blocks.

Default: auto

children
content
RequiredPositional
Question mark
Variadic
Question mark

The bullet list's children.

When using the list syntax, adjacent items are automatically collected into lists, even through constructs like for loops.

#for letter in "ABC" [
  - Letter #letter
]
Preview

list.item functionElement
Question mark

A bullet list item.

Parameters
Question mark

list.item() -> content

body
content
RequiredPositional
Question mark

The item's body.