Skip to content

Some show rules break redundancy check  #2

@tingerrr

Description

@tingerrr

With some show rules for vertical spacing on first-level headings, omitting block wrapping breaks the redundancy check. Adding the block back fixes the issue.

#import "@preview/hydra:0.2.0": hydra

#set page(header: hydra(
  display: (_, it) => {
    if it.numbering != none [
      Chapter #counter(heading).display()
    ]
    it.body
  })
)
#set heading(numbering: "1.1")

// if the block is removed this will no longer check for redundancy correctly,
// some of the spacing also subtly changes.
#show heading.where(level: 1) : it => pagebreak(weak: true) + block({
  set text(2em, weight: "bold")
  v(8em)
  if it.numbering != none [
    Chapter #counter(heading).display()
    #v(.5em)
  ]
  it.body
  v(0.5em)
})

= First
asda

= Second
a

= Third
asd

#pagebreak()

asdas

Removing the block will cause each page to reference its next section instead of the last/none.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstreamWaiting for upstream fix

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions