two-column layouts in RStudio presentations/slidify/pandoc

This is an old Q, but I was recently plagued by a similar question, here’s what I found:

Using the RPres format, two columns can be specified like so (details). Note that RPres can only be converted to HTML by clicking a button in RStudio, there doesn’t seem to be any command line method, which is a bit annoying. Despite, that I’d say it is currently the simplest and most flexible method for getting slide columns with markdown:

=== 

Two Column Layout  
===

This slide has two columns

***

```{r, echo=FALSE}
plot(cars)
```

enter image description here

Some flexibility is afforded by adjusting the column proportions:

===

Two Column Layout  
===
left: 30%
This slide has two columns

***

```{r, echo=FALSE}
plot(cars)
```

enter image description here

With rmarkdown we can get two columns, but with no control over where the break is, which is a bit of a problem:

---
output: ioslides_presentation
---


## Two Column Layout  {.columns-2}

This slide has two columns


```{r, echo=FALSE}
plot(cars)
```

enter image description here

We can also mix markdown and LaTeX in an Rmd file using the beamer_presentation format in RStudio to get two columns like this, but can’t run any code in either column, which is a limitation:

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

enter image description here

Seems like a regular Rnw LaTeX doc is the best way to get columns if you want to use LaTex, not this markdown hybrid (cf. two column beamer/sweave slide with grid graphic)

In all of the above an image can be placed in an column.

The slidify website has instructions on making two columns here: http://slidify.org/customize.html but it’s not clear what has to go into the assets/layouts folder to make it work

Leave a Comment