😎 Give your xaringan slides some style
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.4KB

  1. <!-- Set link to theme-settings, template-variables, theme functions -->
  2. First, add `css: xaringan-themer.css` to your xaringan slides YAML header under `xaringan::moonreader:`.
  3. ```yaml
  4. output:
  5. xaringan::moon_reader:
  6. lib_dir: libs
  7. css: xaringan-themer.css
  8. ```
  9. Then, in the knitr setup chunk, load **xaringanthemer** and try one of the [theme functions][theme-functions].
  10. ````markdown
  11. ```{r setup, include = FALSE}`r ""`
  12. options(htmltools.dir.version = FALSE)
  13. library(xaringanthemer)
  14. mono_light(
  15. base_color = "#1c5253",
  16. header_font_google = google_font("Josefin Sans"),
  17. text_font_google = google_font("Montserrat", "300", "300i"),
  18. code_font_google = google_font("Droid Mono")
  19. )
  20. ```
  21. ````
  22. ```{r echo=FALSE}
  23. if (exists('IS_README') && IS_README) {
  24. knitr::include_graphics("vignettes/images/example_mono_light_1c5253.png")
  25. } else {
  26. knitr::include_graphics(here::here("vignettes/images/example_mono_light_1c5253.png"))
  27. }
  28. ```
  29. **xaringanthemer** is <kbd>Tab</kbd> friendly -- [use autocomplete to explore][theme-settings] the [template variables][template-variables] that you can adjust in each of the themes!
  30. <center>
  31. ```{r out.width="350px"}
  32. knitr::include_graphics(here::here("vignettes/images/rmarkdown-template-screenshot.png"))
  33. ```
  34. </center>
  35. You can also skip the above and just create a *Ninja Themed Presentation* from the New R Markdown Document menu in RStudio.