andreasKroepelin / polylux

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

Feature request - Nested subslides #134

Open bram209 opened 10 months ago

bram209 commented 10 months ago

Hey, creating my first presentation and loving polylux so far, great work!

I currently have a utility function like so:

#let effect(fn, start: 1, body) = [
  #only("0-" + str(start), body)
  #only(str(start + 1) + "-", fn(body))
]

Usage:

#slide(title: "Some slide")[
   - Option A
   - Option B
   - #effect(strike)[Option C]
]

I would love to be able to create nested subslides; a way to reset the subslide counter for a block of content:

#slide(title: "Some slide")[
   #subslide[
     First list:
     - #effect(strike, start: 1)[Option A]
     - Option B
     - #effect(strike, start: 2)[Option C]
   ]

   // should automatically pause between subslides

   #subslide[
     Second list:
     - Option A
     - Option B
     - #effect(highlight, start: 1)[Option C]
   ]
bram209 commented 10 months ago

thinking about it some more, I would love a utility that, similar to pause, does the following:

KronosTheLate commented 10 months ago

I am not sure, but would nested subslides solve the following use case?

I want to reveal a list line-by-line, and then cover the content (maintaining title and slide-counter) with an image. It would be great if I could give #alternatives two content blocks: #line-by-line and #image, to achieve this. However, that feels a lot like nesting subslides, and would likely require some rather advanced internals. I just wanted to throw it in here as a related usecase, that might also be solved by a flexible solution to the original problem.

OrangeX4 commented 9 months ago

I am not sure, but would nested subslides solve the following use case?

I want to reveal a list line-by-line, and then cover the content (maintaining title and slide-counter) with an image. It would be great if I could give #alternatives two content blocks: #line-by-line and #image, to achieve this. However, that feels a lot like nesting subslides, and would likely require some rather advanced internals. I just wanted to throw it in here as a related usecase, that might also be solved by a flexible solution to the original problem.

For this case, how about trying pinit?

KronosTheLate commented 9 months ago

For this case, how about trying pinit?

Wow, excatly what I was looking for. Thanks!

bram209 commented 9 months ago

Pinit looks like a lovely addition to polylux!

Maybe a good idea to reference it in the readme?

andreasKroepelin commented 9 months ago

Pinit looks like a lovely addition to polylux!

Maybe a good idea to reference it in the readme?

see #143