How to change the format of page numbers only in the outline (and skip the first few pages)

Currently my outline looks like this:

How can I change the format of the numbers

I also want to skip the first few pages where the outline is, so I call it like this:

#show: template
#set page(numbering: none)
#place(
  top + center,
  float: true,
  scope: "parent",
  text(35pt, weight: "bold")[
    Optimierung
  ],
)
\

#outline()
#pagebreak()
#counter(page).update(1)
// #setpagenumbering
#set page(numbering: "- 1 -")

where template is imported from another function.

How can I remove the dashes from the page numbers in the outline?

If you don’t have any other conflicting configuration of the footer, you could make your page numbering more regular ("1") and apply the extra decoration in the footer:

#set page(numbering: "1", footer: context {
  let num = page.numbering
  if num != none {
    set align(page.number-align.x)
    "- " + numbering(num, ..counter(page).get()) + " -"
  }
})

The outline is smart and uses the page numbering as it was on each page, but it gives the wrong result in this case.

You can look at outline docs how to re-implement outline entry styling if you want, or apply something like the following, but any regex solution can of course have false positives:

#{
  show outline.entry: it => {
    show regex("- \d+ -"): it => {
      it.text.trim(regex("[- ]"))
    }
    it
  }
  outline()
}

Change to what? With your current page numbering, you are trying to solve a different problem.

#counter(page).update(1) is fine.

Where what? What template? You include #show: template here. How can you import template from another function? Are you using currying or something?

If the template doesn’t matter, then you shouldn’t include it. Otherwise, include relevant parts. Your current example does not compile. See https://sscce.org/.

Is this the same question as the first one?

![image|600x164](upload://i7H2RVzjSmHAk3Q34cG3DmcQ3oq.png)
#set text(lang: "de")
#set pagebreak(weak: true)
#set heading(numbering: "1.1")
#show outline.entry.where(level: 1): strong

#align(center, text(35pt)[*Optimierung*])
#v(2em)
#outline()
#pagebreak()

#counter(page).update(1)
#set page(footer: context align(center)[\- #counter(page).display() - ])

= Heading
== Heading

image