Sorry for asking, it is a very simple question. How can I get the heading (level: 1) ? I need to do some processing before including it in the footer with the page number.
Thank you.
Sorry for asking, it is a very simple question. How can I get the heading (level: 1) ? I need to do some processing before including it in the footer with the page number.
Thank you.
Get how? query(heading.where(level: 1))
?
https://typst.app/docs/reference/introspection/query/#finding-elements
Based on the last sentence, I believe @Andrew_Duncan is looking to include the most recent heading in the footer.
To achieve this, I’ll recommend using the hydra
package: hydra – Typst Universe
With it, calling hydra(1)
or hydra(2)
in the header or footer will display the latest heading. Check its docs for more information!