设置R Markdown演示文稿中显示的代码块的宽度

时间:2019-02-09 17:48:04

标签: r r-markdown slide presentation

我想为R Markdown演示文稿中显示的代码块设置宽度。在下面的简单示例中,代码行ggplot(df, aes(x = time, y = value)) +在演示文稿中分为两行。我的目标是:

  1. (主要是)它没有被包裹,
  2. 理想情况下,使用幻灯片宽度百分比(%)为显示的代码块设置宽度。

R Makrdown代码:

Presentation title
========================================================
author: Marta 
date: February 9, 2019
autosize: true

Simple plot 
==========================

<small><small><small>
```{r, fig.width = 10, fig.height = 5}
## Make some foo data frame
df <- data.frame(time = 1:10, value = rnorm(10))

## Plot
library(ggplot2)
ggplot(df, aes(x = time, y = value)) + 
  geom_point() + 
  geom_line()
```
</small></small></small>

呈现的演示文稿的幻灯片截图:

enter image description here

0 个答案:

没有答案