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

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

A numbered list.

Displays a sequence of items vertically and numbers them consecutively.

Example

Automatically numbered:
+ Preparations
+ Analysis
+ Conclusions

Manually numbered:
2. What is the first step?
5. I am confused.
+  Moving on ...

Multiple lines:
+ This enum item has multiple
  lines because the next line
  is indented.

Function call.
#enum[First][Second]
Preview

You can easily switch all your enumerations to a different numbering style with a set rule.

#set enum(numbering: "a)")

+ Starting off ...
+ Don't forget step two
Preview

You can also use enum.item to programmatically customize the number of each item in the enumeration:

#enum(
  enum.item(1)[First step],
  enum.item(5)[Fifth step],
  enum.item(10)[Tenth step]
)
Preview

Syntax

This functions also has dedicated syntax:

  • Starting a line with a plus sign creates an automatically numbered enumeration item.
  • Starting a line with a number followed by a dot creates an explicitly numbered enumeration item.

Enumeration items can contain multiple paragraphs and other block-level content. All content that is indented more than an item's marker becomes part of that item.

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

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

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

In markup mode, the value of this parameter is determined based on whether items are separated with a blank line. If items directly follow each other, this is set to true; if items are separated by a blank line, this is set to false. The markup-defined tightness cannot be overridden with set rules.

Default value:

true

Show example
+ If an enum has a lot of text, and
  maybe other inline content, it
  should not be tight anymore.

+ To make an enum wide, simply
  insert a blank line between the
  items.
Preview

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

How to number the enumeration. Accepts a numbering pattern or function.

If the numbering pattern contains multiple counting symbols, they apply to nested enums. If given a function, the function receives one argument if full is false and multiple arguments if full is true.

Default value:

"1."

Show example
#set enum(numbering: "1.a)")
+ Different
+ Numbering
  + Nested
  + Items
+ Style

#set enum(numbering: n => super[#n])
+ Superscript
+ Numbering!
Preview

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

Which number to start the enumeration with.

Default value:

auto

Show example
#enum(
  start: 3,
  [Skipping],
  [Ahead],
)
Preview

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

Whether to display the full numbering, including the numbers of all parent enumerations.

Default value:

false

Show example
#set enum(numbering: "1.a)", full: true)
+ Cook
  + Heat water
  + Add ingredients
+ Eat
Preview

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

Whether to reverse the numbering for this enumeration.

Default value:

false

Show example
#set enum(reversed: true)
+ Coffee
+ Tea
+ Milk
Preview

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

The indentation of each item.

Default value:

0pt

body-indent
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

The space between the numbering and the body of each item.

Default value:

0.5em

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

The spacing between the items of the enumeration.

If set to auto, uses paragraph leading for tight enumerations and paragraph spacing for wide (non-tight) enumerations.

Default value:

auto

number-align
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

The alignment that enum numbers should have.

By default, this is set to end + top, which aligns enum numbers towards end of the current text direction (in left-to-right script, for example, this is the same as right) and at the top of the line. The choice of end for horizontal alignment of enum numbers is usually preferred over start, as numbers then grow away from the text instead of towards it, avoiding certain visual issues. This option lets you override this behaviour, however. (Also to note is that the unordered list uses a different method for this, by giving the marker content an alignment directly.).

Default value:

end + top

Show example
#set enum(number-align: start + bottom)

Here are some powers of two:
1. One
2. Two
4. Four
8. Eight
16. Sixteen
32. Thirty two
Preview

children
Required
Required
Required parameters must be specified when calling the function.
Positional
Positional
Positional parameters can be set by specifying them in order, omitting the parameter name.
Variadic
Variadic
Variadic parameters can be specified multiple times.

The numbered list's items.

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

Show example
#for phase in (
   "Launch",
   "Orbit",
   "Descent",
) [+ #phase]
Preview

Definition
Definition
These functions and types can have related definitions. To access a definition, specify the name of the function or type, followed by the definition name separated by a period.

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

An enumeration item.

enum.item()->

number
Positional
Positional
Positional parameters can be set by specifying them in order, omitting the parameter name.
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

The item's number.

Default value:

auto

body
Required
Required
Required parameters must be specified when calling the function.
Positional
Positional
Positional parameters can be set by specifying them in order, omitting the parameter name.

The item's body.

Open official docs

Search