Typst Guide

Typst Table of Contents

One function: #outline(). Auto-renders from your headings. Targets: figures, tables, equations. Depth-limitable. No two-pass compile.

Basic TOC

#outline()              // standard TOC
#outline(depth: 2)      // limit to two levels deep
#outline(title: [Contents])      // custom title
#outline(title: none)            // no title

List of figures and tables

// Main TOC
#outline()

#pagebreak()

// List of figures
#outline(
  title: [List of Figures],
  target: figure.where(kind: image),
)

#pagebreak()

// List of tables
#outline(
  title: [List of Tables],
  target: figure.where(kind: table),
)

Skip headings from TOC

// One-off: pass outlined to the heading
#heading(outlined: false)[Acknowledgments]

// Or via show rule
#show heading.where(level: 3): set heading(outlined: false)
// All level-3 headings now skip TOC

Customize TOC entry style

#show outline.entry: it => {
  // Bold for level 1
  if it.level == 1 {
    v(0.6em)    // extra space before chapters
    text(weight: "bold", it)
  } else {
    it
  }
}

#outline()

Front matter pagination + TOC

// Title page (no number)
#set page(numbering: none)
... title page content ...
#pagebreak()

// Front matter (Roman numerals)
#set page(numbering: "i")
#counter(page).update(1)

#outline()
#pagebreak()
#outline(title: [List of Figures], target: figure.where(kind: image))

// Main matter (Arabic)
#pagebreak()
#set page(numbering: "1")
#counter(page).update(1)

= Introduction
... main content ...
Try Typst TOC live

TypeTeX is a free in-browser Typst editor — add an outline, see the TOC update as you write headings.

Try TypeTeX free

Frequently Asked Questions

How do I add a table of contents in Typst?

Place #outline() where you want the TOC. Typst auto-generates from your headings — no two-pass compile needed (unlike LaTeX). The TOC updates immediately as you add or remove headings.

How do I limit the TOC depth?

Pass depth: #outline(depth: 2) shows only level-1 and level-2 headings. depth: 1 shows only top-level. depth: 3 shows three levels deep. Default is unlimited (shows all heading levels).

How do I add a list of figures or tables?

#outline(target: figure) for list of figures. #outline(target: figure.where(kind: table)) for list of tables. Place after the main #outline(). Both auto-populate from your figure() calls.

How do I exclude a heading from the TOC?

Pass outlined: false to the heading: #heading(outlined: false)[Acknowledgments]. Or with #set: #set heading(outlined: false) for a section, then turn back on with #set heading(outlined: true).

How do I customize the TOC title?

#outline(title: [Contents]) sets a custom title. #outline(title: none) removes the title entirely. Default is 'Contents' (or 'Outline' depending on language).

How do I customize the TOC entry style?

Use a #show rule on outline.entry: #show outline.entry: it => { ... }. Inside, you can access it.body (the heading text), it.fill (dot leader), it.page (page number). Customize spacing, fonts, layout per level.

How do I make the TOC start on a new page?

#pagebreak() #outline() #pagebreak(). Or define a wrapper: #let toc-page = { pagebreak(); outline(); pagebreak() }. Common for theses where the TOC sits between front matter and main content.

How does Typst's outline differ from LaTeX's tableofcontents?

Typst's #outline() is one function call — no \makeindex / makeglossaries / two-pass compile. Auto-renders. Filters by kind (figure, table). Customizable via #show rules. LaTeX's \tableofcontents requires running pdflatex twice and using the tocloft package for non-trivial customization.

More Typst guides