2017-08-24 17 views
2

Rパッケージのrevealjsを使用してReveal JSとR Markdownを使ってプレゼンテーションを作成するのは初めてのことですが、字幕フォントサイズを小さくする方法については固執しています。Reveal JS R Markdownの字幕フォントサイズを変更する

私はこの答えを見た: Changing the font size of figure captions in RMarkdown HTML output

をし、また、チェックアウト: http://rmarkdown.rstudio.com/revealjs_presentation_format.html#custom_css

しかし残念ながら、私は何かが欠けているように見え、動作するようには思えません! 誰が提供できるすべてのヘルプをいただければ幸いです:)

これは私のRの値下げです:

--- 
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) 

``` 

答えて

1

だから、私は追加のCSSファイルを持つことが必要であることが判明しました。 自分の作業ディレクトリにcustom_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) 

``` 
これは、CSSコードでした
関連する問題