How to have page numbering in outline only for level 1 headings?

Hi, welcome to the Typst forum! I’ve edited your question title to follow the guidelines, see here for more info on that.

Regarding your question, there’s an example in the documentation that’s very close to what you want I think:

#show outline.entry: it => link(
  it.element.location(),
  // Keep just the body, dropping
  // the fill and the page.
  it.indented(it.prefix(), it.body()),
)

#outline()

In your case, you want to do this configuration only for level 2 headers, so replace #show outline.entry with #show outline.entry.where(level: 2).

1 Like