🎨 xaringanthemer

Give your xaringan slides some style without (much) CSS

Garrick Aden-Buie


May 12, 2018

Follow @gadenbuie  Star  Fork

Give your xaringan slides some style with xaringanthemer within your slides.Rmd file without (much) CSS.


xaringanthemer currently lives on GitHub.

# install.packages("devtools")

Read on for a quick overview, or read through the xaringanthemer documentation for more information.


First, add the xaringan-themer.css file to the YAML header of your xaringan slides.

    lib_dir: libs
    css: xaringan-themer.css

Then, in a hidden chunk just after the knitr setup chunk, load xaringanthemer and try one of the theme functions.

```{r xaringan-themer, include = FALSE}`r ""`
  base_color = "#1c5253",
  header_font_google = google_font("Josefin Sans"),
  text_font_google   = google_font("Montserrat", "300", "300i"),
  code_font_google   = google_font("Droid Mono")

xaringanthemer example with mono_light theme

Tab Completion

xaringanthemer is Tab friendly – use autocomplete to explore the template variables that you can adjust in each of the themes!

xaringanthemer rstudio autocompletion example

R Markdown Template in RStudio

You can also skip the above and just create a Ninja Themed Presentation from the New R Markdown Document menu in RStudio.

rstudio xaringanthemer rmarkdown template

xaringanthemer was built by Garrick Aden-Buie (@grrrck).

Big thank you to Yihui Xie, especially for xaringan. Also thanks to Ole Petter Bang for remark.js.

Feel free to file an issue if you find a bug or have a theme suggestion – or better yet, submit a pull request!