Hey there, thank you for using hydra!
You can customize the behavior of how hydra
displays the section or heading it found by passing a function to its display
parameter. It works similar to a show rule, but also receives the internal context object, we’ll ignore this as its not relevant for the question.
Assuming you’re chapters are headings as they usually are you can do it like this:
#set page(header: hydra(display: (_, it) => {
[Chapter ]
numbering(it.numbering, ..counter(heading).at(it.location()))
[: ]
it.body
}))
The first discarded parameter _
is said context object, the second parameter it
is the heading that hydra
believes to be relevant at the current position.
I’d also like to know if Hydra allows me to determine whether a page is empty. I need this information to hide the header on empty pages.
Not at the moment, but there are other ways to completely ignore the page header, see here and here for some workaround to skip the header there.