Slides with Columns in Pandoc

Current versions of pandoc (i.e., pandoc 2.0 and later) supports fenced divs. Specially named divs are transformed into columns when targeting a slides format:

# This slide has columns

::: columns

:::: column
left
::::

:::: column
right
::::

:::

Pandoc translates this into the following LaTeX beamer code:

\begin{frame}{This slide has columns}
\protect\hypertarget{this-slide-has-columns}{}

\begin{columns}[T]
\begin{column}{0.48\textwidth}
left
\end{column}

\begin{column}{0.48\textwidth}
right
\end{column}
\end{columns}

\end{frame}

This is simple and has the additional advantage of giving similar results when targeting other presentational formats like reveal.js.

More than two columns work out of the box for Beamer output. Powerpoint, however, only supports two columns. For reveal.js, the widths of three or more columns must be given explicitly:

::: columns

:::: {.column width=30%}
left
::::

:::: {.column width=30%}
middle
::::

:::: {.column width=30%}
right
::::

:::

Leave a Comment