Просмотр исходного кода

Fix plot image in xaringanthemer vignette

tags/v0.3.0
Garrick Aden-Buie 6 лет назад
Родитель
Сommit
1943793104
2 измененных файлов: 5 добавлений и 10 удалений
  1. +5
    -9
      man/fragments/_quick-intro.Rmd
  2. +0
    -1
      vignettes/xaringanthemer.Rmd

+ 5
- 9
man/fragments/_quick-intro.Rmd Просмотреть файл

<!-- Set link to theme-settings, template-variables, theme functions --> <!-- Set link to theme-settings, template-variables, theme functions -->


```{r include=FALSE} ```{r include=FALSE}
if (!exists("IS_README")) IS_README <- FALSE
IN_PKGDOWN <- identical(Sys.getenv("IN_PKGDOWN"), "true")
``` ```


First, add the `xaringan-themer.css` file to the YAML header of your xaringan slides. First, add the `xaringan-themer.css` file to the YAML header of your xaringan slides.


More details and examples can be found in `vignette("ggplot2-themes")`. More details and examples can be found in `vignette("ggplot2-themes")`.


```{r xaringanthemer-ggplot-setup, include=FALSE, eval=IS_README}
```{r xaringanthemer-ggplot-setup, include=FALSE, eval=!IN_PKGDOWN}
style_mono_accent( style_mono_accent(
base_color = "#1c5253", base_color = "#1c5253",
header_font_google = google_font("Josefin Sans"), header_font_google = google_font("Josefin Sans"),
) )
``` ```


```{r theme_xaringan_demo, echo=TRUE, warning=FALSE, fig.width=13, fig.height=5.5, eval=IS_README}
```{r theme_xaringan_demo, echo=TRUE, warning=FALSE, fig.width=13, fig.height=5.5, eval=!IN_PKGDOWN, fig.showtext=TRUE}
library(ggplot2) library(ggplot2)
ggplot(diamonds) + ggplot(diamonds) +
aes(cut, fill = cut) + aes(cut, fill = cut) +
scale_xaringan_fill_discrete() scale_xaringan_fill_discrete()
``` ```


```{r link-to-plot-image, echo=FALSE, eval=!IS_README, results='asis'}
if (identical(Sys.getenv("IN_PKGDOWN"), "true")) {
cat("![](../reference/figures/index-theme_xaringan_demo-1.png)")
} else {
cat('<img src="../man/figures/index-theme_xaringan_demo-1.png" data-external="1" />')
}
```{r link-to-plot-image, echo=FALSE, eval=IN_PKGDOWN, results='asis'}
cat("![](../reference/figures/index-theme_xaringan_demo-1.png)")
``` ```





+ 0
- 1
vignettes/xaringanthemer.Rmd Просмотреть файл

results = "asis", results = "asis",
echo = FALSE, echo = FALSE,
comment = "#>", comment = "#>",
fig.path = "man/figures/index-",
out.width = "100%" out.width = "100%"
) )
library(xaringanthemer) library(xaringanthemer)

Загрузка…
Отмена
Сохранить