#Is there a way to prevent page breaking to happen between a heading and an adjacent block?

4 messages · Page 1 of 1 (latest)

zenith jacinth
#

I could put the heading and block into another block; but that seems hacky.

alpine urchin
#

For now, another block is the only fix I'm aware of. I'll fix this bug for 0.12.

azure arrow
#

another workaround (proposed by @tardy yarrow I think) is to reserve some space on the page below the heading:

// Make a heading reserving some space below to avoid
// a page break between heading and content
#let custom-heading(it, reserve: 6em) = {
  block(breakable: false, it + v(reserve), above: 3em)
  v(-1 * reserve)
}
#

that's better if you just want to avoid a heading right before the page break, but still want to allow a large block after the heading to be broken to show on several pages