How to referencing custom numbering for appendicies

Additionally, I am using a level 2 heading so with numbering:"A" it shows as Appendix AA:.

For this just refine the show rule to show heading.where(level: 1): ...

Thank you, I now understand how supplement works, but as you said, the key difference is how they show in the outline. With your solution, I have tried but I can not figure out how to have Appendix A show in the outline.

This is of course a valid argument. It is still possible to solve it via something like this:

#show outline.entry: it => {
  if it.element.supplement != [Appendix] { return it }
  it.indented(
    [#it.element.supplement #it.prefix():],
    it.inner()
  )
}

All in all:

#show outline.entry: it => {
  if it.element.supplement != [Appendix] { return it }
  it.indented(
    [#it.element.supplement #it.prefix():],
    it.inner()
  )
}

#let appendix(body) = {
  set heading(numbering: "A", supplement: [Appendix])

  show heading.where(level: 1): it => block({
    [#it.supplement ]
    counter(heading).display(it.numbering)
    [: #it.body]
  })
  counter(heading).update(0)
  body
}

// Main text

#show: appendix

= Content // Appendix A

But now one could argue that it’s getting quite complicated. Anyway, this is just for demonstration/learning of how Typst works and what is possible!

2 Likes