Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#pause may hide parts of the template (or: we need a way to reset the pause counter) #192

Open
rmburg opened this issue Nov 18, 2024 · 2 comments

Comments

@rmburg
Copy link

rmburg commented Nov 18, 2024

Suppose we have a template like follows:

#let slide(title: "", content) = {
  let content = {
    grid(
      columns: (1fr, 3.5em),
      // Title and content
      grid(
        rows: (3em, 1fr),
        text(size: 25pt, title),
        text(size: 18pt, content),
      ),
      // Sidebar
      grid(
        rows: (1fr, 2em),
        [],
        text(size: 14pt, logic.logical-slide.display()),
      ),
    )
  }

  logic.polylux-slide(content)
}

If we now use #pause in such a slide, the sidebar of the template will be hidden on all but the last subslide.
To fix this, we would need some sort of mechanism to reset or scope the effect of #pause.
I tried wrapping the last grid in an only((:)) block, but this didn't work.

@andreasKroepelin
Copy link
Owner

Very true. I think pause should work differently in the future and follow Typst scopes and be less hacky.

@rmburg
Copy link
Author

rmburg commented Nov 18, 2024

Workaround for now:

#let unhide(it) = {
  show hide: x => x.body

  it
}

#let slide(title: "", content) = {
  // [..]
  // Sidebar
  unhide(grid(
    // [..]
  ))
  // [..]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants