Skip to content

slide-number updates after first page during reveal #213

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

Open
derdilla opened this issue May 11, 2025 · 3 comments
Open

slide-number updates after first page during reveal #213

derdilla opened this issue May 11, 2025 · 3 comments

Comments

@derdilla
Copy link

derdilla commented May 11, 2025

I have a simple slide with a progress indication similar to https://polylux.dev/book/toolbox/progress.html, with the exception that I do
#set page(header: my-progress) to add the progress to each slide.

When I create the nth slide with an animation:

#slide[
  === tst
  reveal-code(lines: (1,2,3), after:gray)[```
    A
    B
    C```]
]

The PDF creates the slide n for the slide with A highlighted, and the slides numbered with n+1 for the other subslides and the next slide.

@andreasKroepelin
Copy link
Collaborator

So you mean slide n+1 occurs twice? And what does it have to do with the progress header?

@derdilla
Copy link
Author

derdilla commented May 13, 2025

I think this example illustrates it:

Sample code

#import "@preview/polylux:0.4.0": *

#set page(paper: "presentation-16-9")

#let progress = {
  [#toolbox.slide-number / #toolbox.last-slide-number]

  toolbox.progress-ratio(ratio => {
    stack(
      dir: ltr,
      rect(stroke: blue, fill: blue, width: ratio       * 8cm),
      rect(stroke: blue, fill: none, width: (1 - ratio) * 8cm),
    )
  })
}

#set align(horizon)

#slide[
  Slide 0
]

#set page(header: progress)

#slide[
  Slide 1
]

#slide[
  Slide 2

  #show: later

  B
]

#slide[
  Slide 3
]
Output

Image

You can see that the numbering as well as the progress passed to slide 2 part B are wrong. One notable precondition I missed before is that there is no progress displayed on the first slide.

@andreasKroepelin
Copy link
Collaborator

So the #set page(header: progress) between slides 0 and 1 makes a difference?

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