Hey everyone! I’m fairly new to Typst and am currently building my first slide deck with Touying.
I would like to make page fore- and backgrounds part of the animations/subslides, i.e. only show a foreground element on particular animation steps. Is there a good way to accomplish this? I tried to add only() to the page’s foreground, but this only yields errors (see Error [1] below).
Below is a small example with animations and a foreground overlay, but the overlay is present on all steps, not just the last:
#import "@preview/touying:0.7.4": *
#import themes.metropolis: *
#show: metropolis-theme.with(aspect-ratio: "16-9")
== Example Slide
#slide(
config: config-page(
margin: (bottom: 0em),
foreground: block(
height: 100%,
width: 100%,
fill: color.rgb(0, 0, 0, 140),
text(red, 3em)[Overlay],
),
),
)[
- First bullet point
#pause
- Second bullet point
#pause
- Third bullet point
#pause
- Only now, the overlay should be rendered.
]
https://typst.app/project/rxeebNb6Y02ud9iZulbG7R
Thank you for your help!
Error [1]
== Broken Example
#slide(
config: config-page(
margin: (bottom: 0em),
foreground: only(2, block(
height: 100%,
width: 100%,
fill: color.rgb(0, 0, 0, 140),
text(red, 3em)[Overlay]
)),
),
)[
- First bullet point
#pause
- Second bullet point
#pause
- Third bullet point
#pause
- Only now, the overlay should be rendered.
]
Panicked with: Unsupported mark
touying-fn-wrapperfromonlyat page 1 in section ‘Example’. You can’t use it inside some functions likecontext. You may want to use the callback-styleutils.onlyfunction instead.
