Possible Bug With Location-based Page Breaks? #1827
-
Hey everybody! I'm trying to use Typst to layout a book, but I'm struggling with something that feels like a bug, but might not be. I'd appreciate any help! I'm trying to setup the page breaks so that the main chapters always start on the right-hand page. I think my code is sound, but it seems that typst get's confused with the locations of the chapter headings, and after a few pages, it gets out of sync with the actual page number. Here's my code:
Here's an example of the rendered PDF, showing that the location of the title is somehow mis-calculated, with the correct page being displayed in the page header, above it. It ends up with the same issue for the It seems like it might end up one page off, for every time that the conditional page break triggers, or something like that. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This can be done with the |
Beta Was this translation helpful? Give feedback.
This can be done with the
pagebreak()
parameterto: "even" | "odd"
. See the documentation. Use this instead of your custombreak-to-right()
function. Relying on page counters (states) and updating them at the same time is dangerous.