| code_font_family = "'Source Code Pro'", | code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css" | |||||
| outfile = "xaringan-themer.css" | |||||
| ) { | ) { | ||||
| # DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R | # DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R | ||||
| eval(parse(text = call_write_xaringan_theme())) | eval(parse(text = call_write_xaringan_theme())) |
| code_font_family = "'Source Code Pro'", | code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css" | |||||
| outfile = "xaringan-themer.css" | |||||
| ) { | ) { | ||||
| # DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R | # DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R | ||||
| eval(parse(text = call_write_xaringan_theme())) | eval(parse(text = call_write_xaringan_theme())) |
| code_font_family = "'Source Code Pro'", | code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css" | |||||
| outfile = "xaringan-themer.css" | |||||
| ) { | ) { | ||||
| # DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R | # DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R | ||||
| eval(parse(text = call_write_xaringan_theme())) | eval(parse(text = call_write_xaringan_theme())) |
| code_font_family = "'Source Code Pro'", | code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css" | |||||
| outfile = "xaringan-themer.css" | |||||
| ) { | ) { | ||||
| # DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R | # DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R | ||||
| eval(parse(text = call_write_xaringan_theme())) | eval(parse(text = call_write_xaringan_theme())) |
| code_font_family = "'Source Code Pro'", | code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css" | |||||
| outfile = "xaringan-themer.css" | |||||
| ) { | ) { | ||||
| # DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R | # DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R | ||||
| eval(parse(text = call_write_xaringan_theme())) | eval(parse(text = call_write_xaringan_theme())) |
| code_font_family = "'Source Code Pro'", | code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css" | |||||
| outfile = "xaringan-themer.css" | |||||
| ) { | ) { | ||||
| # DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R | # DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R | ||||
| eval(parse(text = call_write_xaringan_theme())) | eval(parse(text = call_write_xaringan_theme())) |
| code_font_family = "'Source Code Pro'", | code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css" | |||||
| outfile = "xaringan-themer.css" | |||||
| ) { | ) { | ||||
| # DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R | # DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R | ||||
| eval(parse(text = call_write_xaringan_theme())) | eval(parse(text = call_write_xaringan_theme())) |
| code_font_family = "'Source Code Pro'", | code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css" | |||||
| outfile = "xaringan-themer.css" | |||||
| ) { | ) { | ||||
| # DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R | # DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R | ||||
| eval(parse(text = call_write_xaringan_theme())) | eval(parse(text = call_write_xaringan_theme())) |
| code_font_family = "'Source Code Pro'", | code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css" | |||||
| outfile = "xaringan-themer.css" | |||||
| ) { | ) { | ||||
| # DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R | # DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R | ||||
| eval(parse(text = call_write_xaringan_theme())) | eval(parse(text = call_write_xaringan_theme())) |
| code_font_family = "'Source Code Pro'", | code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css" | |||||
| outfile = "xaringan-themer.css" | |||||
| ) { | ) { | ||||
| # Make sure font names are wrapped in quotes if they have spaces | # Make sure font names are wrapped in quotes if they have spaces | ||||
| f_args <- names(formals(sys.function())) | f_args <- names(formals(sys.function())) |
| ## Quick Intro | ## Quick Intro | ||||
| First, add `css: xaringan-themed.css` to your xaringan slides YAML header under `xaringan::moonreader:`. | |||||
| First, add `css: xaringan-themer.css` to your xaringan slides YAML header under `xaringan::moonreader:`. | |||||
| ```yaml | ```yaml | ||||
| output: | output: | ||||
| xaringan::moon_reader: | xaringan::moon_reader: | ||||
| lib_dir: libs | lib_dir: libs | ||||
| css: xaringan-themed.css | |||||
| css: xaringan-themer.css | |||||
| ``` | ``` | ||||
| Then, in the first knitr chunk, load **xaringanthemer** and try one of the [theme functions](#themes). | |||||
| Then, in the knitr setup chunk, load **xaringanthemer** and try one of the [theme functions](#themes). | |||||
| ````markdown | ````markdown | ||||
| ```{r setup, include = FALSE}`r ""` | ```{r setup, include = FALSE}`r ""` | ||||
| options(htmltools.dir.version = FALSE) | options(htmltools.dir.version = FALSE) | ||||
| library(xaringanthemer) | library(xaringanthemer) | ||||
| mono_light( | mono_light( | ||||
| base_color = "#1c5253", | base_color = "#1c5253", | ||||
| #### `mono_light()` | #### `mono_light()` | ||||
| A light theme based around a single color | |||||
| A light theme based around a single color. | |||||
|  |  | ||||
| #### `mono_dark()` | #### `mono_dark()` | ||||
| A dark theme based around a single color | |||||
| A dark theme based around a single color. | |||||
|  |  | ||||
| #### `mono_accent()` | #### `mono_accent()` | ||||
| The default xaringan theme with a single color used for color accents on select elements (headers, bold text, etc.) | |||||
| The default xaringan theme with a single color used for color accents on select elements (headers, bold text, etc.). | |||||
|  |  | ||||
| #### `mono_accent_inverse()` | #### `mono_accent_inverse()` | ||||
| An "inverted" default xaringan theme with a single color used for color accents on select elements (headers, bold text, etc.) | |||||
| An "inverted" default xaringan theme with a single color used for color accents on select elements (headers, bold text, etc.). | |||||
|  |  | ||||
| output: | output: | ||||
| xaringan::moon_reader: | xaringan::moon_reader: | ||||
| lib_dir: libs | lib_dir: libs | ||||
| css: ["xaringan-themed.css"] | |||||
| css: ["xaringan-themer.css"] | |||||
| nature: | nature: | ||||
| highlightStyle: solarized-dark | highlightStyle: solarized-dark | ||||
| highlightLines: true | highlightLines: true |
| ## Quick Intro | ## Quick Intro | ||||
| First, add `css: xaringan-themed.css` to your xaringan slides YAML | |||||
| First, add `css: xaringan-themer.css` to your xaringan slides YAML | |||||
| header under `xaringan::moonreader:`. | header under `xaringan::moonreader:`. | ||||
| ``` yaml | ``` yaml | ||||
| output: | output: | ||||
| xaringan::moon_reader: | xaringan::moon_reader: | ||||
| lib_dir: libs | lib_dir: libs | ||||
| css: xaringan-themed.css | |||||
| css: xaringan-themer.css | |||||
| ``` | ``` | ||||
| Then, in the first knitr chunk, load **xaringanthemer** and try one of | |||||
| Then, in the knitr setup chunk, load **xaringanthemer** and try one of | |||||
| the [theme functions](#themes). | the [theme functions](#themes). | ||||
| ```` markdown | ```` markdown | ||||
| ```{r setup, include = FALSE} | ```{r setup, include = FALSE} | ||||
| options(htmltools.dir.version = FALSE) | options(htmltools.dir.version = FALSE) | ||||
| library(xaringanthemer) | library(xaringanthemer) | ||||
| mono_light( | mono_light( | ||||
| base_color = "#1c5253", | base_color = "#1c5253", | ||||
| #### `mono_light()` | #### `mono_light()` | ||||
| A light theme based around a single color | |||||
| A light theme based around a single color. | |||||
|  |  | ||||
| #### `mono_dark()` | #### `mono_dark()` | ||||
| A dark theme based around a single color | |||||
| A dark theme based around a single color. | |||||
|  |  | ||||
| #### `mono_accent()` | #### `mono_accent()` | ||||
| The default xaringan theme with a single color used for color accents on | The default xaringan theme with a single color used for color accents on | ||||
| select elements (headers, bold text, etc.) | |||||
| select elements (headers, bold text, etc.). | |||||
|  |  | ||||
| #### `mono_accent_inverse()` | #### `mono_accent_inverse()` | ||||
| An “inverted” default xaringan theme with a single color used for color | An “inverted” default xaringan theme with a single color used for color | ||||
| accents on select elements (headers, bold text, etc.) | |||||
| accents on select elements (headers, bold text, etc.). | |||||
|  |  | ||||
| output: | output: | ||||
| xaringan::moon_reader: | xaringan::moon_reader: | ||||
| lib_dir: libs | lib_dir: libs | ||||
| css: ["xaringan-themed.css"] | |||||
| css: ["xaringan-themer.css"] | |||||
| nature: | nature: | ||||
| highlightStyle: solarized-dark | highlightStyle: solarized-dark | ||||
| highlightLines: true | highlightLines: true |
| glue::glue("{f_name} <- function(") %,% | glue::glue("{f_name} <- function(") %,% | ||||
| as.character(glue::glue_data( | as.character(glue::glue_data( | ||||
| tv, " {variable} = {ifelse(!stringr::str_detect(default, '^[{].+[}]$'), paste0('\"', default, '\"'), stringr::str_replace_all(default, '[{}]', ''))},")) %,% | tv, " {variable} = {ifelse(!stringr::str_detect(default, '^[{].+[}]$'), paste0('\"', default, '\"'), stringr::str_replace_all(default, '[{}]', ''))},")) %,% | ||||
| " outfile = \"xaringan-themed.css\"" %,% | |||||
| " outfile = \"xaringan-themer.css\"" %,% | |||||
| ") {" | ") {" | ||||
| if (!is.null(body)) x <- c(x, body, "}") | if (!is.null(body)) x <- c(x, body, "}") | ||||
| if (file == "clip") { | if (file == "clip") { |
| code_font_google = NULL, code_font_family = "'Source Code Pro'", | code_font_google = NULL, code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css") | |||||
| outfile = "xaringan-themer.css") | |||||
| } | } | ||||
| \arguments{ | \arguments{ | ||||
| \item{primary_color}{Duotone Primary Color, defaults to #1F4257} | \item{primary_color}{Duotone Primary Color, defaults to #1F4257} |
| code_font_google = NULL, code_font_family = "'Source Code Pro'", | code_font_google = NULL, code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css") | |||||
| outfile = "xaringan-themer.css") | |||||
| } | } | ||||
| \arguments{ | \arguments{ | ||||
| \item{primary_color}{Duotone Primary Color, defaults to #006747} | \item{primary_color}{Duotone Primary Color, defaults to #006747} |
| code_font_google = NULL, code_font_family = "'Source Code Pro'", | code_font_google = NULL, code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css") | |||||
| outfile = "xaringan-themer.css") | |||||
| } | } | ||||
| \arguments{ | \arguments{ | ||||
| \item{primary_color}{Duotone Primary Color, defaults to #006747} | \item{primary_color}{Duotone Primary Color, defaults to #006747} |
| code_font_google = NULL, code_font_family = "'Source Code Pro'", | code_font_google = NULL, code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css") | |||||
| outfile = "xaringan-themer.css") | |||||
| } | } | ||||
| \arguments{ | \arguments{ | ||||
| \item{base_color}{Monotone Base Color, works best with a strong color., defaults to #43418A} | \item{base_color}{Monotone Base Color, works best with a strong color., defaults to #43418A} |
| code_font_google = NULL, code_font_family = "'Source Code Pro'", | code_font_google = NULL, code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css") | |||||
| outfile = "xaringan-themer.css") | |||||
| } | } | ||||
| \arguments{ | \arguments{ | ||||
| \item{base_color}{Monotone Base Color, works best with a light color., defaults to #3C989E} | \item{base_color}{Monotone Base Color, works best with a light color., defaults to #3C989E} |
| code_font_google = NULL, code_font_family = "'Source Code Pro'", | code_font_google = NULL, code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css") | |||||
| outfile = "xaringan-themer.css") | |||||
| } | } | ||||
| \arguments{ | \arguments{ | ||||
| \item{base_color}{Monotone Base Color, works best with a light color., defaults to #cbf7ed} | \item{base_color}{Monotone Base Color, works best with a light color., defaults to #cbf7ed} |
| code_font_google = NULL, code_font_family = "'Source Code Pro'", | code_font_google = NULL, code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css") | |||||
| outfile = "xaringan-themer.css") | |||||
| } | } | ||||
| \arguments{ | \arguments{ | ||||
| \item{base_color}{Monotone base color, works best with a strong color, defaults to #23395b} | \item{base_color}{Monotone base color, works best with a strong color, defaults to #23395b} |
| code_font_google = NULL, code_font_family = "'Source Code Pro'", | code_font_google = NULL, code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css") | |||||
| outfile = "xaringan-themer.css") | |||||
| } | } | ||||
| \arguments{ | \arguments{ | ||||
| \item{text_color}{Text Color, defaults to #839496} | \item{text_color}{Text Color, defaults to #839496} |
| code_font_google = NULL, code_font_family = "'Source Code Pro'", | code_font_google = NULL, code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css") | |||||
| outfile = "xaringan-themer.css") | |||||
| } | } | ||||
| \arguments{ | \arguments{ | ||||
| \item{text_color}{Text Color, defaults to #657b83} | \item{text_color}{Text Color, defaults to #657b83} |
| code_font_google = NULL, code_font_family = "'Source Code Pro'", | code_font_google = NULL, code_font_family = "'Source Code Pro'", | ||||
| code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700", | ||||
| code_font_family_fallback = "'Lucida Console', Monaco", | code_font_family_fallback = "'Lucida Console', Monaco", | ||||
| outfile = "xaringan-themed.css") | |||||
| outfile = "xaringan-themer.css") | |||||
| } | } | ||||
| \arguments{ | \arguments{ | ||||
| \item{text_color}{Text Color, defaults to #000} | \item{text_color}{Text Color, defaults to #000} |