xaringan
xaringan copied to clipboard
Page number and progress bar at the same time
Hi everyone,
what can I do for keeping the page number when I add the progress bar with the default theme? If I follow the #109 issue for getting the progress bar I miss the number because I'm overwriting the css class. But I'm not sure where should I write the number for getting it back.
A different option that would work for me too could be adding the progress bar at the top of the slide.
Anyone could help me here?
I managed to locate the progress bar at the top, see here: https://github.com/juancarloscastillo/jc-castillo/blob/master/documents/ISPP2019Lisboa/xaringan_custom/progress-bar.css
Still, I haven't been suscessful in adding the slide number toghether with the progress bar ...
Has anyone found a solution for displaying both the slide number and a progress bar?
Following.
xaringanExtra R-package offers a solution
Define the slide number format in the YAML and use the xaringanExtra function outside your YAML for the progress-bar.
---
title: "Presentation Ninja"
subtitle: "⚔<br/>with xaringan"
author: "Yihui Xie"
institute: "RStudio, PBC"
date: "2016/12/12 (updated: `r Sys.Date()`)"
output:
xaringan::moon_reader:
css: [default, metropolis, metropolis-fonts]
nature:
slideNumberFormat: "%current%/%total%"
---
```{r xaringanExtra, echo = FALSE}
xaringanExtra::use_progress_bar(color = "red", location = "bottom")
```
I've recently just posted the same question to Stackoverflow hoping for an answer. I also included a small (not completely minimal) working example.
https://stackoverflow.com/questions/72432470/access-current-slide-number-in-custom-slide-number-format-in-xaringan
I think this is already solved in the answer from @RetoSchmucki with xaringanExtra as in this example