注意 当サイトは、Typst v0.11.1 公式ドキュメントを、日本語コミュニティが非公式に翻訳したものです。誤訳・未訳・古い情報が含まれている可能性があるため、公式ドキュメント との併用を推奨します。このサイトの内容に誤りを発見された方は、GitHubリポジトリまでご報告を頂けましたら幸いです。我々のコミュニティにご興味のある方は、ぜひ非公式Discordサーバー「くみはんクラブ」にご参加ください。
Warning: This site provides an unofficial translation of the Typst v0.11.1 documentation by the Japanese Community. Please note that there may be some inaccuracies, untranslated sections or outdated information. We highly recommend referring to the latest official documentation as well. If you find any errors in the content, please let us know through our GitHub repository. If you are interested in our community, feel free to join our unofficial Discord server, “Kumihan Club.”
Typst ドキュメント日本語版

heading Element
Element functions can be customized with set and 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 of 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, ...
Preview

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. The offset field can be set to configure the starting depth.

Parameters
Parameters are the inputs to a function. They are specified in parentheses after the function name.

level
auto int
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

The absolute nesting depth of the heading, starting from one. If set to auto, it is computed from offset + depth.

This is primarily useful for usage in show rules (either with where selectors or by accessing the level directly on a shown heading).

Default:auto

View example
#show heading.where(level: 2): set text(red)

= Level 1
== Level 2

#set heading(offset: 1)
= Also level 2
== Level 3
Preview

depth
int
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

The relative nesting depth of the heading, starting from one. This is combined with offset to compute the actual level.

This is set by the heading syntax, such that == Heading creates a heading with logical depth of 2, but actual level offset + 2. If you construct a heading manually, you should typically prefer this over setting the absolute level.

Default:1

offset
int
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

The starting offset of each heading's level, used to turn its relative depth into its absolute level.

Default:0

View example
= Level 1

#set heading(offset: 1, numbering: "1.1")
= Level 2

#heading(offset: 2, depth: 2)[
  I'm level 4
]
Preview

numbering
none str function
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

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

Default:none

View example
#set heading(numbering: "1.a.")

= A section
== A subsection
=== A sub-subsection
Preview

supplement
none auto content function
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

A supplement for the heading.

For references to headings, this is added before the referenced number.

If a function is specified, it is passed the referenced heading and should return content.

Default:auto

View example
#set heading(numbering: "1.", supplement: [Chapter])

= Introduction <intro>
In @intro, we see how to turn
Sections into Chapters. And
in @intro[Part], it is done
manually.
Preview

outlined
bool
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

Whether the heading should appear in the outline.

Note that this property, if set to true, ensures the heading is also shown as a bookmark in the exported PDF's outline (when exporting to PDF). To change that behavior, use the bookmarked property.

Default:true

View example
#outline()

#heading[Normal]
This is a normal heading.

#heading(outlined: false)[Hidden]
This heading does not appear
in the outline.
Preview

bookmarked
auto bool
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

Whether the heading should appear as a bookmark in the exported PDF's outline. Doesn't affect other export formats, such as PNG.

The default value of auto indicates that the heading will only appear in the exported PDF's outline if its outlined property is set to true, that is, if it would also be listed in Typst's outline. Setting this property to either true (bookmark) or false (don't bookmark) bypasses that behavior.

Default:auto

View example
#heading[Normal heading]
This heading will be shown in
the PDF's bookmark outline.

#heading(bookmarked: false)[Not bookmarked]
This heading won't be
bookmarked in the resulting
PDF.
Preview

body
content
RequiredPositional
Positional parameters are specified in order, without names.

The heading's title.