😎 Give your xaringan slides some style
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

124 lines
3.1KB

  1. ### Monotone
  2. Use these functions to automatically create a consistent color palette for your slides, based around a single color.
  3. #### `mono_light()`
  4. A light theme based around a single color.
  5. ```{r mono_light}
  6. demo_function_call <- function(f, n_params = 1) {
  7. cat(sep = "",
  8. "```r\n",
  9. paste(substitute(f)), "(",
  10. if (n_params > 0) paste(collapse = ", ",
  11. sapply(1:n_params, function(i) {
  12. paste0(names(formals(f))[i], ' = "', formals(f)[[i]], '"')})),
  13. ")\n```"
  14. )
  15. }
  16. demo_function_call(mono_light, 1)
  17. ```
  18. `r knitr::include_graphics(here::here("vignettes/images/example_mono_light.png"))`
  19. #### `mono_dark()`
  20. A dark theme based around a single color.
  21. ```{r mono_dark}
  22. demo_function_call(mono_dark, 1)
  23. ```
  24. `r knitr::include_graphics(here::here("vignettes/images/example_mono_dark.png"))`
  25. #### `mono_accent()`
  26. The default xaringan theme with a single color used for color accents on select elements (headers, bold text, etc.).
  27. ```{r mono_accent}
  28. demo_function_call(mono_accent, 1)
  29. ```
  30. `r knitr::include_graphics(here::here("vignettes/images/example_mono_accent.png"))`
  31. #### `mono_accent_inverse()`
  32. An "inverted" default xaringan theme with a single color used for color accents on select elements (headers, bold text, etc.).
  33. ```{r mono_accent_inverse}
  34. demo_function_call(mono_accent_inverse, 1)
  35. ```
  36. `r knitr::include_graphics(here::here("vignettes/images/example_mono_accent_inverse.png"))`
  37. ### Duotone
  38. These themes build from two (ideally) complementary colors.
  39. #### `duo()`
  40. A two-colored theme based on a primary and secondary color.
  41. ```{r duo}
  42. demo_function_call(duo, 2)
  43. ```
  44. `r knitr::include_graphics(here::here("vignettes/images/example_duo.png"))`
  45. #### `duo_accent()`
  46. The default Xaringan theme with two accent colors.
  47. ```{r duo_accent}
  48. demo_function_call(duo_accent, 2)
  49. ```
  50. `r knitr::include_graphics(here::here("vignettes/images/example_duo_accent.png"))`
  51. #### `duo_accent_inverse()`
  52. An "inverted" default Xaringan theme with two accent colors.
  53. ```{r duo_accent_inverse}
  54. demo_function_call(duo_accent_inverse, 2)
  55. ```
  56. `r knitr::include_graphics(here::here("vignettes/images/example_duo_accent_inverse.png"))`
  57. ### Solarized
  58. There are also two themes based around the [solarized color palette](http://ethanschoonover.com/solarized), `solarized_light()` and `solarized_dark()`.
  59. For both themes, it is advisted to change the syntax highlighting theme to `solarized-light` or `solarized-dark` (looks great paired or constrasted).
  60. #### `solarized_light()`
  61. ```{r solarized_light}
  62. demo_function_call(solarized_light, 0)
  63. ```
  64. `r knitr::include_graphics(here::here("vignettes/images/example_solarized_light.png"))`
  65. #### `solarized_dark()`
  66. ```{r solarized_dark}
  67. demo_function_call(solarized_dark, 0)
  68. ```
  69. `r knitr::include_graphics(here::here("vignettes/images/example_solarized_dark.png"))`
  70. To do this, your YAML header should look more-or-less like this:
  71. ```yaml
  72. output:
  73. xaringan::moon_reader:
  74. lib_dir: libs
  75. css: ["xaringan-themer.css"]
  76. nature:
  77. highlightStyle: solarized-dark
  78. highlightLines: true
  79. countIncrementalSlides: false
  80. ```