【发布时间】:2015-06-11 12:36:57
【问题描述】:
Booktabs 和 xtable 因使用 RStudio 的 Rmarkdown 而失败。 Tufte 模板工作正常,但使用标准 .Rmd 文件失败并显示错误消息:
! Undefined control sequence.
l.133 \toprule
pandoc.exe: Error producing PDF from TeX source
Error: pandoc document conversion failed with error 43
一个可重现的例子:
---
title: "Testing booktabs"
author: "r.bot"
date: "11 June 2015"
output: pdf_document
---
```{r, results='asis'}
library(xtable)
options(xtable.comment = FALSE)
options(xtable.booktabs = TRUE)
xtable(head(mtcars[,1:6]), caption = "First rows of mtcars")
```
R 版本 3.1.2 (2014-10-31) 平台:x86_64-w64-mingw32/x64(64位) 安装了最新版本的 Pandoc。
【问题讨论】:
标签: r r-markdown xtable