Skip to content

State update in show rule affects element position #1886

@freundTech

Description

@freundTech

Description

When adding spacing before a heading, references to the heading still point to the heading:

#set heading(numbering: "1")
#show heading.where(level: 1): it => {
    pagebreak(to: "odd")
    it
}

= Hello World <hello>
#lorem(1500)
 = Hello Again
Go to @hello

However, when adding a state update before the page break references now point to before the page break, where the state update is.

#let s = state("s")
#set heading(numbering: "1")
#show heading.where(level: 1): it => {
    s.update(1)
    pagebreak(to: "odd")
    it
}

= Hello World <hello>
#lorem(1500)
 = Hello Again
Go to @hello

As state updates are invisible in the rendered document they should probably be ignored, as spacing and page breaks already are.

Reproduction URL

No response

Operating system

Linux

Typst version

  • I am using the latest version of Typst

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstylingAbout set and show rules or style properties

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions