Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting page redundancy check fails in the presence of some heading show rules #16

Open
tingerrr opened this issue May 5, 2024 · 0 comments
Labels
bug Something isn't working upstream Waiting for upstream fix

Comments

@tingerrr
Copy link
Owner

tingerrr commented May 5, 2024

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.

Upstream issue: typst#4029.
Supersedes #2.

@tingerrr tingerrr added bug Something isn't working upstream Waiting for upstream fix labels May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream Waiting for upstream fix
Projects
None yet
Development

No branches or pull requests

1 participant