Xaringan: Match page number and URL nav number on slides

Created on 23 Jan 2020  路  2Comments  路  Source: yihui/xaringan

Is there a way to force the URL nav number "myxaringan.html#35" to be the same as the page number displayed on the slide? I'm interested in typing "myxaringan.html#35" and being taken to the 35th slide (currently it does not do this). This would help with navigating a long xaringan presentation, which I've found can be tricky. I think it's also strange in terms of user interface to have the URL "myxaringan.html#35" take you to page 17 or something, if you have a lot of transitions, etc.

I asked this question on RStudio Community (more details about some ideas I have there) and am happy to update my answer based on your feedback here!

Thank you for all your work on this package, it's made including R code in presentations a breeze!


By filing an issue to this repo, I promise that

  • [x] I have fully read the issue guide at https://yihui.org/issue/.
  • [x] I have provided the necessary information about my issue.

    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.

    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('xaringan'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/xaringan').

    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.

  • [x] I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

question

Most helpful comment

Yes! There is an option countIncrementalSlides that when TRUE each new slide is counted individually, regardless of whether or not it is incremental.

For the exact same reason as you, I always set this in the YAML header for my xaringan slides:

output:
  xaringan::moon_reader:
    nature:
      countIncrementalSlides: true
      slideNumberFormat: "%current%"

I also usually add the slideNumberFormat: "%current%" to make sure that only the current slide number is shown to avoid audience anxiety when they see Slide 10 of 130.

All 2 comments

Yes! There is an option countIncrementalSlides that when TRUE each new slide is counted individually, regardless of whether or not it is incremental.

For the exact same reason as you, I always set this in the YAML header for my xaringan slides:

output:
  xaringan::moon_reader:
    nature:
      countIncrementalSlides: true
      slideNumberFormat: "%current%"

I also usually add the slideNumberFormat: "%current%" to make sure that only the current slide number is shown to avoid audience anxiety when they see Slide 10 of 130.

Interesting. Could this be a candidate for a change of the current default?

Was this page helpful?
0 / 5 - 0 ratings