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
page style after pagebreak(to: "odd") affects the even numbered page before the break #2162
Some text on page 1
#pagebreak(to: "odd") //we should now be on page 3
#set page(fill: orange) // This sets the file from page 2...
this is some text on page 3
Expected result: Pages 1 and 2 should be white, and page 3 should be orange.
Actual result: Page 1 is white, but page 2 is Orange.
Some text on page 1
#pagebreak()
#pagebreak(to: "odd") //we should no be on page 3
#set page(fill: orange) // This sets the file from page 2...
this is some text on page 3
Putting an explicit page break before the pagebreak(to:"odd") exhibits the correct behaviour (1&2 white, 3 orange)
Some text on page 1
#pagebreak()
#pagebreak(to: "odd", weak: true) //we should no be on page 3
#set page(fill: orange) // This sets the file from page 2...
this is some text on page 3
adding "weak:true" to the page break exhibits the same behaviour as the error case (1 white, 2 and 3 orange)
putting any text between the two pagebreaks ensures that the page colours are correct, but now there is unwanted text.
Just checked the code and did some experiment. This is not just fill but any style/attribute in general. Essentially, the pagebreak will creates an empty page, but the style of the empty page (fill, width, height, or any other style) will be identical to the next page instead of the previous page. See the fn layout for PageElem in layout/page.rs, note that the created empty page when clear_to flag is triggered.
Some text on page 1
#pagebreak(to: "odd") // We should now skip to page 3
#set page(fill: orange) // This should set the color of the page starting from page 3, but page 2 already is set.
Some text on page 3
I would consider it as a bug to be fixed, as I think it would be natural to assume and expect the empty page to follow the style of the previous page, instead of the style of the next page
Activity
LuxxxLucy commentedon Sep 17, 2023
Just checked the code and did some experiment. This is not just fill but any style/attribute in general. Essentially, the pagebreak will creates an empty page, but the style of the empty page (fill, width, height, or any other style) will be identical to the next page instead of the previous page. See the
fn layoutforPageEleminlayout/page.rs, note that the created empty page whenclear_toflag is triggered.An example as described by @frugal-10191
I would consider it as a bug to be fixed, as I think it would be natural to assume and expect the empty page to follow the style of the previous page, instead of the style of the next page
Enivex commentedon Sep 18, 2023
Seems to be the same issue causing #2095
LuxxxLucy commentedon Sep 18, 2023
Indeed.
laurmaedje commentedon Sep 25, 2023
Fixed by #2182