I have a pandoc grid table in an otherwise brand-new bookdown project:
# Hello bookdown
All chapters start with a first-level heading followed by your chapter title, like the line above. There should be only one first-level heading (`#`) per .Rmd file.
+---------------+---------------+--------------------+
| Fruit | Price | Advantages |
+===============+===============+====================+
| Bananas | $1.34 | - built-in wrapper |
| | | - bright color |
+---------------+---------------+--------------------+
| Oranges | $2.10 | - cures scurvy |
| | | - tasty |
+---------------+---------------+--------------------+
Rendering to html and normal pdf via bookdown::gitbook
and bookdown::pdf_book
are fine, however rendering to a tufte format via tufte::tufte_book
or bookdown::tufte_book2
fails with:
! Undefined control sequence.
<argument> @{} >{\raggedright \arraybackslash
}p{(\columnwidth - 4\tabcolsep...
l.93 ...umnwidth - 4\tabcolsep) * \real{0.29}}@{}}
The table structure is different to the other tables generated:
\begin{longtable}[]{@{}
>{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.22}}
>{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.22}}
>{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.29}}@{}}
\toprule
Fruit & Price & Advantages \\
...
Therefore I think the source of the problem is in the tufte-latex
package which tufte_book relies on, but I am unable to narrow it down further.
The tex code of the document is here - the culprit section starts at line 96.
This was an issue in the tufte package.
It has now been fixed in dev version 0.10.2 one can install from github
remotes::install_github("rstudio/tufte")
The fix will be on CRAN for next version 0.11