touying-typ / touying

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

complex animations inside page columns #39

Closed 0x6e66 closed 2 months ago

0x6e66 commented 2 months ago

I want to use a complex animation with callback style functions inside page columns

This is what I want it to look like:

Slide 1
-----------------------------------------------------
|                         |                         |
|     Alternative A.1     |     Alternative B.1     |
|                         |                         |
-----------------------------------------------------
Slide 2
-----------------------------------------------------
|                         |                         |
|     Alternative A.2     |     Alternative B.2     |
|                         |                         |
-----------------------------------------------------

This is what I was able to produce:

Slide 1
-----------------------------------------------------
|                         |                         |
|     Alternative A.1     |      Other content      |
|                         |                         |
-----------------------------------------------------
Slide 2
-----------------------------------------------------
|                         |                         |
|     Alternative A.2     |      Other content      |
|                         |                         |
-----------------------------------------------------

with this code:

#slide(composer: (1fr, auto), repeat: 2, self => [
  #let (uncover, only, alternatives) = utils.methods(self)

  #alternatives[
    Alternative A.1
  ][
    Alternative A.2
  ]
])[
  Other content
]

Is there a way to achieve what I am going for? Thanks in advance.

OrangeX4 commented 2 months ago
#slide(composer: (1fr, auto), repeat: 2, self => [
  #let (uncover, only, alternatives) = utils.methods(self)

  #alternatives[
    Alternative A.1
  ][
    Alternative A.2
  ]
], self => [
  #let (uncover, only, alternatives) = utils.methods(self)

  #alternatives[
    Alternative B.1
  ][
    Alternative B.2
  ]
])
0x6e66 commented 2 months ago

This works perfectly. Thanks a lot!