polylux icon indicating copy to clipboard operation
polylux copied to clipboard

Overflowing content + one-by-one is not handled

Open trustedtomato opened this issue 1 year ago • 2 comments

Overflowing content results in empty slides and unnecessarily repeated content. In the following example, the expected result would be to have page 1, 2, 3, 9, 10, 11, 12. (Meaning 4 to 8 are redundant.)

Code to reproduce:

#import "@preview/polylux:0.3.1": *

#set page(paper: "presentation-16-9", footer: counter(page).display())
#set text(size: 25pt)

#polylux-slide[
  #one-by-one[
    THE FIRST ONE STARTS HERE.
    #lorem(300)
  ][
    THE SECOND ONE STARTS HERE.
    #lorem(300)
  ] 
]

Demo: https://typst.app/project/roiL5M6_QK1nrbEezOk1q3

The issue is also there with #pause, I haven't tried the other constructs, but I'm assuming they use the same base.

trustedtomato avatar Jan 05 '24 14:01 trustedtomato

This is the expected behaviour at the moment. Fixing this would require to know how many pages each bit of content spans. I am currently unaware of a solution but I agree that this is not desirable.

andreasKroepelin avatar Jan 07 '24 18:01 andreasKroepelin

Hmm... I'm not aware of the capabilities of Typst, and I find it amazing what you did so far, but if it's just about calculating how many pages a content spans, maybe the page counter could be used for this purpose? Something like, get the location, lay out the first chunk of content, then get the location again, get the current page at both locations, get their difference, and add one. If that doesn't work, then just ignore my comment, and I'll hope that a new Typst patch will come out which can resolve this 🤞

trustedtomato avatar Jan 07 '24 22:01 trustedtomato