I have to generate a pdf from a R markdown document, and the layout should be divided in two different columns. I managed to split the layout in two columns through the multicol package following these instructions. My problem is that now I don't know ho to specify different widths for the two columns, because each of them automatically occupy he 50% of the available space. Below some reproducible code:
---
output:
pdf_document:
latex_engine: xelatex
header-includes:
- \usepackage{multicol}
- \newcommand{\btwocol}{\begin{multicols}{2}}
- \newcommand{\etwocol}{\end{multicols}}
classoption:
- landscape
- a4paper
---
```{r setup, include=FALSE}
library(ggplot2)
knitr::opts_chunk$set(echo = TRUE)
```
\btwocol
```{r}
mtcars[1:10, 1:10]
```
\columnbreak
```{r}
ggplot(data = mtcars,
aes(x = mpg,
y = cyl))
```
\etwocol
Moreover, it seems that with this solution the elements inside the two columns must have the same height, otherwise some blank space is left before one of the outputs.
Thanks!