使用当前RStudio的开发版本(0.98.758),我喜欢用rmarkdown编写一个ioslides演示文稿。
这种格式的重标记文档描述了如何进行两列幻灯片,并附带了以下警告:
请注意,内容将流经各列,因此,如果您希望在一边有一个图像,而另一侧有一个文本,那么您应该确保图像有足够的高度将文本强制放到幻灯片的另一边。
但我似乎不可能把图像拍得足够大!文本仍然被从第一列的底部推开。在下面的演示中,我想在列中比较基本直方图和qplot直方图,以及一些注释和代码。我包含了一个相对较短的示例的代码,并尝试了一些基本的解决方案。如果你能织,我想问题会很明显的。(请注意,您需要一个RStudio预览版。)
---
title: "Two Column"
author: "Some guy on Stack Overflow"
date: "Friday, April 04, 2014"
output: ioslides_presentation
---
## Two-Column Attempt {.smaller}
<div class="columns-2">
Base graphics can be quick...
```{r, fig.width = 3, fig.height = 4}par_opts <- name(par())
hist(nchar(par_opts), breaks = seq(1.5, 9.5, by = 1))But `ggplot2` can be quick too:
```{r, fig.width = 2.5, fig.height = 2.5}要求(ggplot2,静音= T)
(因子(nchar(Par_opts)
</div>
## Two-Column Attempt: Taller Hist {.smaller}
<div class="columns-2">
Base graphics can be quick...
```{r, fig.width = 3, fig.height = 6}par_opts <- name(par())
hist(nchar(par_opts), breaks = seq(1.5, 9.5, by = 1))But `ggplot2` can be quick too:
```{r, fig.width = 2.5, fig.height = 2.5}要求(ggplot2,静音= T)
(因子(nchar(Par_opts)
</div>
## Two-Column Attempt: Extra div {.smaller}
<div class="columns-2">
Base graphics can be quick...
```{r, fig.width = 3, fig.height = 4}par_opts <- name(par())
hist(nchar(par_opts), breaks = seq(1.5, 9.5, by = 1))<div>
...
</div>
But `ggplot2` can be quick too:
```{r, fig.width = 2.5, fig.height = 2.5}要求(ggplot2,静音= T)
(因子(nchar(Par_opts)
</div>这是第四张幻灯片的图片,你可以看到左边栏底部的文字被切断了,而右边的一栏有足够的空间。

发布于 2014-06-17 13:16:25
我也一直在挠头。
您可以避免使用div,并使用{.columns-2}作为标头属性。
对于这些图像,我使用fig_height和fig_width在yaml中默认设置了一个相对较大的大小。然后,使用块中的out.width属性控制输出的大小(350 to在此布局中似乎运行良好)
---
title: "Two Column"
author: "Some guy on Stack Overflow"
date: "Friday, April 04, 2014"
output:
ioslides_presentation:
fig_height: 7
fig_width: 7
---
## Two-Column Attempt {.smaller .columns-2}
Base graphics can be quick...
```{r, out.width = '350px'}par_opts <- name(par())
hist(nchar(par_opts), breaks = seq(1.5, 9.5, by = 1))But `ggplot2` can be quick too:
```{r, out.width = '350px'}要求(ggplot2,静音= T)
(因子(nchar(Par_opts)
https://stackoverflow.com/questions/22871611
复制相似问题