touying-typ / touying

Touying is a powerful package for creating presentation slides in Typst.
https://touying-typ.github.io/touying/
MIT License
461 stars 10 forks source link

Is it possible to access the `subslide` number in the footer? #21

Closed ntjess closed 3 months ago

ntjess commented 3 months ago

Consider this case:

#slide(repeat: 3, self => [
  #let (uncover, only, alternatives) = utils.methods(self)

  In subslide #self.subslide,

  test #uncover("2-")[uncover] function,

  and test #only("2-")[only] function,

  #pause

  and paused text.
])

The slide number is 1 in each case. I would like it to show 1.1, 1.2, 1.3 in the footer, but self.subslide is not accessible within footer(self) = ...

Is there another way to achieve this result?

ntjess commented 3 months ago

Perhaps we can justify adding self.subslide = i here, instead of inside _parse-content? https://github.com/touying-typ/touying/blob/7b09ec32bf9075399793fc04eeb86e7e1ebbec22/slide.typ#L421

For a similar reason, can we also expose self.repeat = repeat?

OrangeX4 commented 3 months ago

I think that's a good way to do it.