这是一个老问题,但我最近被类似的问题困扰,这是我发现的:
使用 RPres 格式,可以像这样指定两列(details https://support.rstudio.com/hc/en-us/articles/200486468-Authoring-R-Presentations)。注意,RPres只能通过点击RStudio中的按钮来转换为HTML,似乎没有任何命令行方法,这有点烦人。尽管如此,我想说它是目前使用 Markdown 获取幻灯片列的最简单、最灵活的方法:
===
Two Column Layout
===
This slide has two columns
***
```{r, echo=FALSE}
plot(cars)
```
通过调整列比例可以提供一定的灵活性:
===
Two Column Layout
===
left: 30%
This slide has two columns
***
```{r, echo=FALSE}
plot(cars)
```
使用 rmarkdown 我们可以获得两列,但无法控制中断位置,这是一个问题:
---
output: ioslides_presentation
---
## Two Column Layout {.columns-2}
This slide has two columns
```{r, echo=FALSE}
plot(cars)
```
我们还可以使用以下命令在 Rmd 文件中混合 markdown 和 LaTeXbeamer_presentation
在 RStudio 中格式化以获得这样的两列,但无法在任一列中运行任何代码,这是一个限制:
---
output: beamer_presentation
---
Two Column Layout
-------
\begin{columns}
\begin{column}{0.48\textwidth}
This slide has two columns
\end{column}
\begin{column}{0.48\textwidth}
If I put any code in here I get an error, see
https://support.rstudio.com/hc/communities/public/questions/202717656-Can-we-have-columns-in-rmarkdown-beamer-presentations-
\end{column}
\end{columns}
如果你想使用 LaTex,那么常规的 Rnw LaTeX 文档似乎是获取列的最佳方式,而不是这个 Markdown 混合文档(参见带有网格图形的两柱投影仪/摆动幻灯片 https://stackoverflow.com/questions/6964750/two-column-beamer-sweave-slide-with-grid-graphic)
在以上所有内容中,图像都可以放置在列中。
slidify 网站有关于在此处制作两列的说明:http://slidify.org/customize.html http://slidify.org/customize.html但不清楚 asset/layouts 文件夹中必须包含哪些内容才能使其正常工作