heading
ShowableShowable functions can be customized with show
rules.
show
rules.A section heading.
With headings, you can structure your document into sections. Each heading has a level, which starts at one and is unbounded upwards. This level indicates the logical role of the following content (section, subsection, etc.) A top-level heading indicates a top-level section of the document (not the document's title).
Typst can automatically number your headings for you. To enable numbering, specify how you want your headings to be numbered with a numbering pattern or function.
Independently from the numbering, Typst can also automatically generate an
outline of all headings for you. To exclude one or more
headings from this outline, you can set the outlined
parameter to
false
.
Example
#set heading(numbering: "1.a)")
= Introduction
In recent years, ...
== Preliminaries
To start, ...

Syntax
Headings have dedicated syntax: They can be created by starting a line with one or multiple equals signs, followed by a space. The number of equals signs determines the heading's logical nesting depth.
ParametersParameters are the inputs to a function. They are specified in parentheses after the function name.
title
The heading's title.
level
The logical nesting depth of the heading, starting from one.
numbering
How to number the heading. Accepts a numbering pattern or function.
#set heading(numbering: "1.a.")
= A section
== A subsection
=== A sub-subsection

outlined
booleanSettableSettable parameters can be customized for all following uses of the function with a set
rule.
set
rule.Whether the heading should appear in the outline.
#outline()
#heading[Normal]
This is a normal heading.
#heading(outlined: false)[Hidden]
This heading does not appear
in the outline.
