在Reveal JS R Markdown中更改标题字体大小

断断续续123

我是不熟悉使用R包揭示js用Reveal JS和R Markdown创建演示文稿的人,并且我对如何减小标题字体的大小感到困惑。

我看到了这个答案:在RMarkdown HTML输出中更改图形标题的字体大小

并且还签出了:http : //rmarkdown.rstudio.com/revealjs_presentation_format.html#custom_css

但不幸的是,我似乎丢失了一些东西,而且似乎没有用!任何人都可以提供的任何帮助将不胜感激:)

这是我的R Markdown:

    ---
title: "Cars"
author: "Me"
date: "24 August 2017"
output:
  revealjs::revealjs_presentation:
    fig_caption: yes

---

<style>

.reveal section p.caption {
  font-size: 0.2em;
}

</style>

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

```{r,echo = FALSE, warning = FALSE,message=FALSE, fig.cap= "Cars"}

library(ggplot2)
data(mtcars)
g <- ggplot(mpg, aes(class))
g <- g + geom_bar()

print(g)

```
断断续续123

因此,事实证明我需要一个附加的CSS文件。我在工作目录中保存了一个名为custom_css.css的CSS文件。这是CSS代码:

.reveal section figcaption {
  font-size: 0.3em;
}

然后,在我的RMarkdown文件中,编写的代码为:

---
title: "Cars"
author: "Me"
date: "24 August 2017"
output:
  revealjs::revealjs_presentation:
    css: custom_css.css
    fig_caption: yes


---


```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

```{r,echo = FALSE, warning = FALSE,message=FALSE, fig.cap= "Cars"}

library(ggplot2)
data(mtcars)
g <- ggplot(mpg, aes(class))
g <- g + geom_bar()

print(g)

```

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章