Fixes #36tags/v0.4.0
| slide level doesn't result in giant slide numbers (#53). | slide level doesn't result in giant slide numbers (#53). | ||||
| * xaringanthemer no longer sets the `fig.showtext` chunk option when the | * xaringanthemer no longer sets the `fig.showtext` chunk option when the | ||||
| showtext package isn't installed (#56). | |||||
| showtext package isn't installed and also when `fig.showtext = FALSE` | |||||
| (thanks @mikedecr #36, #56). | |||||
| * The style functions gain a `link_decoration` argument to set the | * The style functions gain a `link_decoration` argument to set the | ||||
| [`text-decoration`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration) | [`text-decoration`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration) |
| )) | )) | ||||
| } | } | ||||
| set_fig_showtext <- function() { | |||||
| if (!requireNamespace("showtext", quietly = TRUE)) { | |||||
| return(invisible()) | |||||
| } | |||||
| curr_fst <- knitr::opts_chunk$get("fig.showtext") | |||||
| if (!is.null(curr_fst) && identical(curr_fst, FALSE)) { | |||||
| return(invisible()) | |||||
| } | |||||
| knitr::opts_chunk$set(fig.showtext = TRUE) | |||||
| } | |||||
| requires_xaringanthemer_env <- function( | requires_xaringanthemer_env <- function( | ||||
| css_file = NULL, | css_file = NULL, | ||||
| try_css = TRUE, | try_css = TRUE, |
| .onLoad <- function(libname, pkgname, ...) { | .onLoad <- function(libname, pkgname, ...) { | ||||
| if ("knitr" %in% loadedNamespaces()) { | if ("knitr" %in% loadedNamespaces()) { | ||||
| if (requireNamespace("showtext", quietly = TRUE)) { | |||||
| knitr::opts_chunk$set(fig.showtext = TRUE) | |||||
| } | |||||
| set_fig_showtext() | |||||
| } | } | ||||
| setHook( | setHook( | ||||
| packageEvent("knitr", "onLoad"), | packageEvent("knitr", "onLoad"), | ||||
| function(...) { | function(...) { | ||||
| if (requireNamespace("showtext", quietly = TRUE)) { | |||||
| knitr::opts_chunk$set(fig.showtext = TRUE) | |||||
| } | |||||
| set_fig_showtext() | |||||
| } | } | ||||
| ) | ) | ||||