Skip to content

Sticky block loses stickiness when the other block is labelled #6304

@bluss

Description

@bluss

Description

In this example, there are two blocks: A(sticky) + B(label). If the label is removed on B, then stickiness works as expected.

Reproducing code. There is a headline text "Sticky block" and then a styled raw block following it. If we remove <label> in this code, the headline sticks properly to the following block.

#set page(height: 10cm)
#v(6.5cm)
#block(sticky: true)[Sticky block]

#show raw: it => {
  [#block(it.text)<label>]
}
#raw(block: true, "
Raw text
And more raw text. And more
")

Picture 1: <label> present (code as above). This behaviour is bad.
Image

Pipcture 2: Remove <label>. This behaviour is as expected.
Image


The problem does not reproduce for me with just blocks, the show rule was necessary.

Possibly related to issue #6203

Reproduction URL

No response

Operating system

No response

Typst version

  • I am using the latest version of Typst

Other

There is a workaround. Apply the label like this: [#{[] + block(it.text)}<label>]. This is not exactly equivalent - not labelling the block anymore, just something that contains the block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglayoutRelated to layout, positioning, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions