huh, yeah you’re right, reimplementing the numbering isn’t necessary, not sure anymore why I ended up doing that.
my point about the numbering not being correctly tracked is that i’d like to be able to just use counter(heading).display()
, and for it to use the correct numbering
of the heading. This does however not work as I would expect.
Your answer did however get me thinking, and I took some time to tinker. I finally figured out how to get this to work without having multiple “sources of truth” as to what numbering
to use where. It also does away with having to use the “backmatter” state
, and is therefore cleaner.
#set figure(numbering: n => {
let hdr = counter(heading).get().first()
let num = query(
selector(heading).before(here())
).last().numbering
numbering(num, hdr, n)
})
this seems to work correctly, in the figures, references, and outlines as well.