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
#set page(..) doesn't work directly after tag #2987
#letvar= state("var", 0)
#setpage(paper: "a7", flipped: true)
#setpage(fill:blue)
#var.update(1)
#setpage(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:
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.
The third slide is also missing the header and footer (because the second slide ends with a pagebreak, the register-section call updates state, and so the #set page in the third slide doesn't work).
It seems that state updates are attached to a page, so if it's before the first page or if a pagebreak has been issued, modifying the state causes a new page to be created before #set page gets a chance to do. The state update needs to happen between the two pages (or before the first page in the original issue).
changed the title [-]#set page(..) doesn't work in first page after state update[/-][+]`#set page(..)` doesn't work directly after tag[/+]on Jul 16, 2024
Activity
tornaria commentedon Dec 17, 2023
I realized the same thing happens in subsequent pages: if a state update is done after a
pagebreakand before#set page().Change the snippet above to:
Then the second page is red (not green).
tornaria commentedon Dec 17, 2023
And this also affects polylux as in:
The third slide is also missing the header and footer (because the second slide ends with a pagebreak, the register-section call updates state, and so the
#set pagein the third slide doesn't work).It seems that state updates are attached to a page, so if it's before the first page or if a pagebreak has been issued, modifying the state causes a new page to be created before
#set pagegets a chance to do. The state update needs to happen between the two pages (or before the first page in the original issue).[-]#set page(..) doesn't work in first page after state update[/-][+]`#set page(..)` doesn't work directly after tag[/+]