How to put different page numbering in outline?

You can use the “state-outline” trick (Outlines - Typst Examples Book) which detects if your element is in the outline or not via a state.

#let in-outline = state("in-outline", false)

#set heading(numbering: "1.1")
#set text(font: "DM Sans")

#set page(numbering: (..n) => context {
  if in-outline.get() {
    numbering("1", ..n)
  } else {
    numbering("1 / 1", ..n)
  }
})

#show outline: it => {
  in-outline.update(true)
  it
  in-outline.update(false)
}


#show outline.entry.where(level: 1): it => {
  set text(13pt, font: "DM Sans")
  v(12pt, weak: true)
  strong(it)
}

#outline()

= Introduction

== Don't Know

image

The alternative would be to completely recreate the outline entry via the show-rule which is possible but tedious.

2 Likes