I am trying to create a Beamer Presentation slide in RMarkdown / Knitr . In the slide I would like to have a table and a figure placed Side-by-side , and then some more text
There have been issue having two column layout in beamer presentation. But in the same post there is workaround:
In short: Error is related to pandoc conversion engine, which treats everything between \begin{...}
and \end{...}
as TeX. It can be avoided by giving new definition for begin{column}
and end{column}
in yaml header.
Create mystyle.tex and write there:
\def\begincols{\begin{columns}}
\def\begincol{\begin{column}}
\def\endcol{\end{column}}
\def\endcols{\end{columns}}
In the Rmd file use these new definitions
---
output:
beamer_presentation:
includes:
in_header: mystyle.tex
---
Two Column Layout
-------
\begincols
\begincol{.48\textwidth}
This slide has two columns.
\endcol
\begincol{.48\textwidth}
```{r}
#No error here i can run any r code
plot(cars)
```
\endcol
\endcols
And you get: