Slides with Columns in Pandoc

MRocklin picture MRocklin · Feb 28, 2013 · Viewed 10.1k times · Source

I would like to have code and an image side-by-side in a Beamer slide.

In LaTeX I would do this with columns. I would like to use markdown within the column structure.

\begin{columns}
\column{.5\textwidth}

~~~~~~~~Python
>>> some python code
~~~~~~~

\column{.5\textwidth}

![](A_generated_image.pdf)

\end{columns}

Unfortunately Pandoc doesn't process the markdown within the \begin{columns} and \end{columns} statements. Is there a way around this?

  • Is there a way to use markdown within inlined LaTeX?
  • Is there a pure markdown solution?

Answer

ivotron picture ivotron · Sep 27, 2014

The problem is that pandoc ignores markdown if it finds a \begin{}. An alternative is to edit the beamer template and add the following:

\newcommand{\columnsbegin}{\begin{columns}}
\newcommand{\columnsend}{\end{columns}}

And write it like this:

\columnsbegin
\column{.5\textwidth}

~~~~~~~~Python
>>> some python code
~~~~~~~

\column{.5\textwidth}

![](A_generated_image.pdf)

\columnsend