I would like to change the way I number headings with the use of a state variable, such that I can simply update that state to change the numbering at any point. I am using this approach for changing the supplement, which can take content however, the numbering argument requires a string and the locate function returns content even though the state has been set with a string value
#let appendix = state("appendix", false)
#let heading-numbering-fmt = state("heading-numbering-fmt", "I.A.1.")
#let heading-supplement = state("heading-supplement", "Section")
#let start-appendix() = {
appendix.update(true)
heading-numbering-fmt.update("A:")
heading-supplement.update("Appendix")
}
#set heading(
numbering: locate(loc => {heading-numbering-fmt.at(loc)}),
supplement: locate(loc => {
heading-supplement.at(loc)
})
)
= Not in the appendix
<a0>
@a0
#start-appendix()
= In the appendix
<a1>
@a1