You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Element with no content followed by pad can force breakable block to create an empty frame #4234
bugSomething isn't workingduplicateThis issue or pull request already existslayoutRelated to the layout category, which is about composing, positioning, etc.
This bug has a similar effect as #2297, which was fixed by #2517. Sadly, the fix does not work in the specific case where the element with no content is directly followed by a pad element (which happens somewhat often given that block used pad under the hood to make inset work).
Example
#setpage(height: 3cm, margin: 0.5cm)
Not enough space remaining on this page to fit the whole block.
#block(stroke: 1pt)[
#counter("dummy").update(1)
#pad(left: 1cm, top: 1cm, rect(height: 1cm, fill: gray))
]
Typst produces the same output without an explicit pad:
#setpage(height: 3cm, margin: 0.5cm)
Not enough space remaining on this page to fit the whole block.
#block(stroke: 1pt)[
#counter("dummy").update(1)
#block(inset: (left: 1cm, top: 1cm), rect(height: 1cm, fill: gray))
]
Note that removing the counter update removes the undesired rectangle.
I'll close this in favor of #2914. There are various ways to reproduce this problem by adding things into the block that aren't visible, but still produce a non-empty or non-zero-sized frame. Needs a more general solution.
bugSomething isn't workingduplicateThis issue or pull request already existslayoutRelated to the layout category, which is about composing, positioning, etc.
Activity
laurmaedje commentedon Jun 14, 2024
Related: #2914
laurmaedje commentedon Jul 5, 2024
I'll close this in favor of #2914. There are various ways to reproduce this problem by adding things into the block that aren't visible, but still produce a non-empty or non-zero-sized frame. Needs a more general solution.