andreasKroepelin / polylux

A package for creating slides in Typst
https://polylux.dev/book
MIT License
1.18k stars 55 forks source link

Pauses and numbering #113

Open anderflash opened 1 year ago

anderflash commented 1 year ago

Hi,

By creating a simple slide with pauses (it can be also uncover, only...), I got error when defining equation numbering:

#slide[
  #set math.equation(numbering: "(1)")

  We define:
  $ phi.alt := (1 + sqrt(5)) / 2 $ <ratio>

  With @ratio, we get:
  $ F_n = floor(1 / sqrt(5) phi.alt^n) $
  #pause
  @ratio
]

Except for the last two content lines, this example comes from the official Typst documentation. But when running it, it says:

label occurs multiple times in the document 

Either I have to give up equation numbering (I guess it happens with all types of numbering) and those dynamic presentations with pauses.

I think those pauses are trying to redefine labels like . I don't know if it's really a polylux or Typst problem.

andreasKroepelin commented 1 year ago

Polylux doesn't (can't) do any magic. Things like pause just cause duplicating (parts of) the content on multple PDF pages. So a label you define on a slide with a pause (before the pause) will occur multiple times. There is no way of asking Typst "please replicate this content but without all the labels in it". So currently, labels and dynamic Polylux slides just don't work together, sorry.

anderflash commented 1 year ago

I see. It also poses a problem to section numbering (it keeps increasing between the pauses). Slides with numbering or labels are fine as long as we don't use pauses (or vice-versa, i.e., + pauses - labels). I don't know about the rendering process, but I understand that we don't duplicate the rendered slide. Well, should I close this issue? Perhaps a label "won't fix" might help.

andreasKroepelin commented 1 year ago

I mean, it is an issue and I see why we should fix it once there is a way. I think the recommendation for now is not to use numbering or labels in Polylux.

tapyu commented 5 months ago

There is no way of asking Typst "please replicate this content but without all the labels in it".

Is there any prospective about this feature in Typst? Numbering things is too basic to simply let it go. I believe that, once Typst provides this feature, #165 can also be solved.