我在一个全新的预订项目中有一个pandoc网格表:
# 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 |
+---------------+---------------+--------------------+通过bookdown::gitbook和bookdown::pdf_book将html和普通pdf呈现为html和普通pdf是很好的,但是通过tufte::tufte_book或bookdown::tufte_book2呈现为tufte格式的方法失败了:
! Undefined control sequence.
<argument> @{} >{\raggedright \arraybackslash
}p{(\columnwidth - 4\tabcolsep...
l.93 ...umnwidth - 4\tabcolsep) * \real{0.29}}@{}}表结构不同于生成的其他表:
\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 \\
...因此,我认为问题的根源在于tufte_book所依赖的tufte_book包,但我无法进一步缩小它的范围。
文档的tex代码是这里 --罪魁祸首从第96行开始。
发布于 2021-11-09 14:53:02
这是tufte包中的一个问题。
现在可以从github安装的开发版本0.10.2中已经修复了
remotes::install_github("rstudio/tufte")下一个版本0.11的补丁将放在CRAN上。
https://stackoverflow.com/questions/69893867
复制相似问题