Here is a working solution that requires you to set heading.supplement
and redefines the ref
body for level 2 heading when it is an appendix:
#show ref: it => {
let el = it.element
if el == none or el.func() != heading or el.level != 2 or el.supplement != [Appendix] {
return it
}
let lvl = counter(heading).at(el.location()).at(1)
let body = el.supplement + numbering(" A", lvl)
link(el.location(), body)
}
#outline()
This is the body of my text. There is something cool I show in @first, but you
will have to read it to find out.
#heading("Appendices", numbering: none)
#set heading(
offset: 1,
numbering: (_, ..rest) => "Appendix " + numbering("A:", ..rest),
supplement: [Appendix] // <- Important
)
= First <first>
Text of the first appendix.
= Second <second>
Text of the second appendix.
Inspired from this forum post.