😎 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.
Garrick Aden-Buie 2bb0fd418a Separate sizes for code inline and code blocks пре 8 година
R Separate sizes for code inline and code blocks пре 8 година
docs Squash screenshot пре 8 година
inst Separate sizes for code inline and code blocks пре 8 година
man Separate sizes for code inline and code blocks пре 8 година
man-roxygen Add solarized dark and light themes пре 8 година
tests Initial commit, MWP пре 8 година
.Rbuildignore Oops, setup README.Rmd > github README.md пре 8 година
.gitignore Initial commit, MWP пре 8 година
DESCRIPTION Add package dependencies пре 8 година
NAMESPACE Add solarized dark and light themes пре 8 година
README.Rmd Update Readme пре 8 година
README.md Update Readme пре 8 година
xaringanthemer.Rproj Initial commit, MWP пре 8 година

README.md

xaringanthemer

Easily style your xaringan slides with xaringanthemer

Installation

Currently, this is a work in progress. Try it yourself:

devtools::install_github("gadenbuie/xaringanthemer")

Make it work

To make it work, add css: xaringan-themed.css to your xaringan slides YAML header under xaringan::moonreader:

output:
  xaringan::moon_reader:
    lib_dir: libs
    css: xaringan-themed.css

Then, in the first knitr chunk, try this:

```{r setup}
options(htmltools.dir.version = FALSE)
library(xaringanthemer)
mono_light(
  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")
)
```

Monotone Themes

Use these functions to automatically create a consistent color palette for your slides, based around a single color.

  • mono_light(): A light theme based around a single color

  • mono_dark(): A dark theme based around a single color

  • mono_accent(): The default xaringan theme with a single color used for color accents on select elements (headers, bold text, etc.)

  • mono_accent_inverse(): An “inverted” default xaringan theme with a single color used for color accents on select elements (headers, bold text, etc.)

Duotone Themes

These themes build from two (ideally) complementary colors.

  • duo(): A two-colored theme based on a primary and secondary color.

  • duo_accent(): The default Xaringan theme with two accent colors.

  • duo_accent_inverse(): An “inverted” default Xaringan theme with two accent colors.

Solarized

There are also two themes based around the solarized color palette, solarized_light() and solarized_dark(). For both themes, it is advisted to change the syntax highlighting theme to solarized-light or solarized-dark (looks great paired or constrasted).

To do this, your YAML header should look more-or-less like this:

output:
  xaringan::moon_reader:
    lib_dir: libs
    css: ["xaringan-themed.css"]
    nature:
      highlightStyle: solarized-dark
      highlightLines: true
      countIncrementalSlides: false