Skip to content

#set page(..) doesn't work directly after tag #2987

@tornaria

Description

@tornaria

Description

Simple example:

#let var = state("var", 0)
#set page(paper: "a7", flipped: true)
#set page(fill:blue)
#var.update(1)
#set page(fill:red)
This page is blue! (var = #var.display())
#var.update(2)
#pagebreak()
This page is red! (var = #var.display())

I would expect the first page to be red, but it is blue. If one comments out the line #var.update(1), or if it's moved after the #set page(fill:red) then both pages are red.

This issue affects polylux as in the following example:

#import "@preview/polylux:0.3.1": *
#import themes.clean: *

#show: clean-theme.with(
  footer: [Author, institution],
  short-title: [Short title],
)

#slide[#lorem(20)]
#slide[#lorem(20)]

Here the header and footer is not added to the first slide, since the call to #set page(...) inside #slide(...) is not applied to the first page because clean-theme(...) already updated state.

This might be related to #2326 and/or #1886.

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