|
I would like to insert a computed table into a two-column PDF layout. Consider the following example: ---
title: "Two-Column Layout with Table"
format:
pdf:
documentclass: article
classoption: twocolumn
---
```{r setup, include=FALSE}
library(knitr)
```
This is some introductory text.
```{r}
kable(head(cars))
```This produces the following error: It seems like the I'm using Quarto 1.6.39 on Arch Linux (but the problem also occurs on other OSs like Windows). |
Replies: 2 comments 11 replies
|
Quarto does not control what third party packages/libraries emit. For LaTeX packages conflicts, you need to handle them independently of Quarto. Sidenote: prefer YAML syntax in Quarto to |
|
13 years later, pandoc seems to have a solution for this longtable problem in twocolumns mode : jgm/pandoc@3ecd95b jgm/pandoc#1023 (comment) . However, this seems to be active only with pandoc 3.10.1 (version 3.10 included in quarto 1.10.18), and needs the use of a small lua filter that quarto could handle. |
I think that if you ask knitr for latex output, then it emits tabular, which does work.
What you need to avoid in the emitted LaTeX code is:
longtable(because it plays badly with LaTeX crossreferences and two-column mode)table(because it plays badly with LaTeX crossreferences)