Given a show rule which introduces an "invisible" element such as v(...) before the heading, the margin redundancy check fails, causing hydra to display the last heading on a page which starts with a new heading.
#import "@preview/hydra:0.4.0": hydra
#set page(header: context hydra(1))
#set heading(numbering: "1.1")
#show heading.where(level: 1) : it => pagebreak(weak: true) + {
// uncommenting this or adding a block around this whole rule fixes the issue
// metadata(())
v(1em)
it
}
= First
#lorem(10)
= Second
#lorem(10)
#pagebreak()
#lorem(10)
To work around this, consider surrounding your headings with a container, i.e. a block or box, avoid using metadata as it is likely not intended to cause the location collapse, see the upstream issue.
Given a show rule which introduces an "invisible" element such as
v(...)
before the heading, the margin redundancy check fails, causinghydra
to display the last heading on a page which starts with a new heading.To work around this, consider surrounding your headings with a container, i.e. a
block
orbox
, avoid usingmetadata
as it is likely not intended to cause the location collapse, see the upstream issue.Upstream issue: typst#4029. Supersedes #2.