39 lines
865 B
TeX
39 lines
865 B
TeX
% From: https://support.rstudio.com/hc/en-us/community/posts/202717656-Can-we-have-columns-in-rmarkdown-beamer-presentations-
|
|
%
|
|
% In the YAML header of your Rmd file, add a reference to a tex file to add to the tex file preamble ;
|
|
%
|
|
% output:
|
|
% beamer_presentation:
|
|
% includes:
|
|
% in_header: mypreamble.tex
|
|
%
|
|
% In mypreamble.tex, add:
|
|
%
|
|
% \def\begincols{\begin{columns}}
|
|
% \def\begincol{\begin{column}}
|
|
% \def\endcol{\end{column}}
|
|
% \def\endcols{\end{columns}}
|
|
%
|
|
% Finally, in the Rmd file, use this kind of syntax:
|
|
%
|
|
% ## Two Column Layout
|
|
%
|
|
% \begincols
|
|
% \begincol{.48\textwidth}
|
|
%
|
|
% This slide has two columns.
|
|
%
|
|
% \endcol
|
|
% \begincol{.48\textwidth}
|
|
%
|
|
% ```{r pressure}
|
|
% plot(pressure)
|
|
% ```
|
|
%
|
|
% \endcol
|
|
% \endcols
|
|
\def\begincols{\begin{columns}}
|
|
\def\begincol{\begin{column}}
|
|
\def\endcol{\end{column}}
|
|
\def\endcols{\end{columns}}
|