xaringan icon indicating copy to clipboard operation
xaringan copied to clipboard

Page number and progress bar at the same time

Open noeliaricopachon opened this issue 5 years ago • 6 comments

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?

noeliaricopachon avatar Apr 02 '19 16:04 noeliaricopachon

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 ...

juancarloscastillo avatar Jul 31 '19 16:07 juancarloscastillo

Has anyone found a solution for displaying both the slide number and a progress bar?

lnalborczyk avatar Dec 03 '20 15:12 lnalborczyk

Following.

wanyun-yang avatar Jan 14 '21 19:01 wanyun-yang

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")
```

RetoSchmucki avatar Sep 22 '21 21:09 RetoSchmucki

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

edsandorf avatar May 31 '22 06:05 edsandorf

I think this is already solved in the answer from @RetoSchmucki with xaringanExtra as in this example

juancarloscastillo avatar May 31 '22 12:05 juancarloscastillo