Switch slide number display on and off in RMarkdown xaringan / reveal.js slides

Viewed 300

I am currently preparing html slides for a workshop, for which I use the xaringan package for R, that is based on remark.js. Here the slides are created with RMarkdown. This works well, but for some reasons (explained in a former SO question) I want to switch off slide numbers on some pages, while keeping them visible on most others.

Until now, I am able to switch all slide numbers on and off either in a personal css style file or with an inline chunk:

```{css slide-number-off}
.remark-slide-number {
  display: none;
}
```

```{css slide-number-on}
.remark-slide-number {
  display: inline;
}
```

But I have not been able to switch page numbers on and off for individual slides.

1 Answers

A quick trick, is to include this property within an inverse class:

.inverse .remark-slide-number {
  display: none;
}

Related