How can I add the top level heading title to the header of each page?

How can I add the top level heading title to the header of each page?

Example image:

Check this package: hydra

1 Like

Thank you. With your suggestion i got it to work with the following hydra command:

#set page(paper: "a4", margin: (inside: 3cm, outside:   3cm, y: 1.75cm), header: context {
  if counter(page).get().first() > 3{  align(left, emph(hydra(1)))
  line(length: 100%)
  }
})
2 Likes

using this, the displayed heading in the header is always one heading behind… Any idea on how to fix that?

@PhiloSoPh , it seems like you have something between the page start and the heading. Maybe v() for the spacing above the heading? Not sure how your show rule for headings looks like, but to make hydra work you either use #show heading: pad.with(top: 3cm) or do something like #show heading: it => block(v(3cm) + it) which is mentioned in the hydra manual.

1 Like

Thank you! That was the case, and now it works :)