andreasKroepelin / polylux

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

`#pause` is broken in 0.12 #188

Open upsj opened 2 weeks ago

upsj commented 2 weeks ago

I tried compiling the examples/demo.typ file with typst 0.12, but it fails due to reasons I can't understand, related to #pause:

error: can only be used when context is known
    ┌─ logic.typ:256:44
    │
256 │     repetitions.update(rep => calc.max(rep, pause-counter.get().first() + 1))
    │                                             ^^^^^^^^^^^^^^^^^^^
    │
    = hint: try wrapping this in a `context` expression
    = hint: the `context` expression should wrap everything that depends on this function

help: error occurred in this call of function `get`
    ┌─ logic.typ:299:15
    │
299 │     let reps = repetitions.get().first()
    │                ^^^^^^^^^^^^^^^^^

Both of those locations are wrapped in context expressions, so something else must be going wrong outside.

andreasKroepelin commented 2 weeks ago

Hmm interesting. I will have a look.

sebaseb98 commented 2 weeks ago

I also encountered this problem, but I didn't get an error.

In my case there just were no pauses in the most cases on slides between bullet points, but when I called functions as e.g. #v or used math blocks, the pauses worked.

rmburg commented 5 days ago

See https://github.com/andreasKroepelin/polylux/pull/185#discussion_r1837942016

rmburg commented 5 days ago

Even with this fix, pause does still not work. On the current main branch, pause does not hide anything. I did a bit of bisecting, and found that these two commits broke it:

I'm assuming these show rules were removed for a good reason, but I currently don't understand them. Maybe we can find a better solution? I'm keen to open a PR on this, let's discuss.

andreasKroepelin commented 5 days ago

The show rules were removed because they made Polylux very slow for longer presentations. I'm currently in the process of rewriting the pause implementation. So yeah on current main, pause does nothing.