I have a function that gets passed labels as strings. From these labels I query the associated heading. From this heading object, I can get some properties, such as the body, numbering, etc.
#set heading(numbering: "1.")
#let heading-label-as-str = "heading-B1b"
#let f(l) = context {
let h = query(heading.where(label: label(l))).last()
[
The number of heading "#l" is "2.1.2"
and not #h.numbering, #h.level, or #h.depth
]
}
= A
= B
== B1
=== B1a
=== B1b <heading-B1b>
#f(heading-label-as-str)
How can I get the effective heading number from it? (“2.1.2” in the example)