tingerrr / hydra

A typst package for displaying the active section in the page header or footer.
MIT License
21 stars 3 forks source link

`skip-starting: false` will not work in the presence of leading ancestors #8

Open tingerrr opened 8 months ago

tingerrr commented 8 months ago

Given a document like so:

#import "@preview/hydra:0.3.0": hydra
#let hdyra = hydra.with(paper: "a7")

#set page(
  paper: "a7",
  flipped: true,
  width: 100pt,
  header: hydra(skip-starting: false, 2),
)

= Chapter
#lorem(5)

#pagebreak()
// = Chapter
== Section
#lorem(5)

The following two pages are rendered: image

If the second // = Chapter is no longer commented out, the header on page 2 disappears. This will remain an issue until typst allows us to check the structure of the document more thoroughly to really ensure the first content of a page is the primary element, any of its ancestors or spacing/layout content.