Rmarkdown Error: "! Paragraph ended before \@fileswith@ptions was complete"
Rmarkdown Error: "! Paragraph ended before \@fileswith@ptions was complete"
我正在从 rmarkdown 文档渲染 pdf_document。在本文档中,我在 for 循环中创建了十个乳胶表(来自 Hmisc 包的乳胶函数)。
例如 rmarkdown 代码如下所示:
---
title: "test"
output:
pdf_document:
latex_engine: lualatex
number_sections: yes
toc: yes
toc_depth: 3
html_document: default
header-includes:
- \usepackage[dutch]{babel}
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \fancyfoot[LE,RO]{title}
- \usepackage{dcolumn}
- \usepackage[here]
---
```{r}
library(Hmisc)
```
```{r results="asis",tidy=FALSE,eval=TRUE,echo=FALSE,message=FALSE, error=FALSE, warning=FALSE, comment = NA}
data_object <- structure(list(test = structure(c(1L, 1L, 2L, 2L), .Label = c("test1",
"test2"), class = "factor"), test2 = structure(1:4, .Label = c("1",
"2", "3", "4"), class = "factor")), .Names = c("test", "test2"
), row.names = c(NA, -4L), class = "data.frame")
for (i in 1:10){
latex(data_object, title='',file='',caption="title")
}
```
我收到这个错误:
! Paragraph ended before \@fileswith@ptions was complete.
<to be read again>
\par
l.101
pandoc.exe: Error producing PDF from TeX source
Error: pandoc document conversion failed with error 43
如何确保在完成表格之前段落没有结束?
当未使用方括号 {} 调用包时,此错误很常见。在您的代码中试试这个替代品:
#Change this:
- \usepackage[here]
#To this:
- \usepackage{here}
我正在从 rmarkdown 文档渲染 pdf_document。在本文档中,我在 for 循环中创建了十个乳胶表(来自 Hmisc 包的乳胶函数)。
例如 rmarkdown 代码如下所示:
---
title: "test"
output:
pdf_document:
latex_engine: lualatex
number_sections: yes
toc: yes
toc_depth: 3
html_document: default
header-includes:
- \usepackage[dutch]{babel}
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \fancyfoot[LE,RO]{title}
- \usepackage{dcolumn}
- \usepackage[here]
---
```{r}
library(Hmisc)
```
```{r results="asis",tidy=FALSE,eval=TRUE,echo=FALSE,message=FALSE, error=FALSE, warning=FALSE, comment = NA}
data_object <- structure(list(test = structure(c(1L, 1L, 2L, 2L), .Label = c("test1",
"test2"), class = "factor"), test2 = structure(1:4, .Label = c("1",
"2", "3", "4"), class = "factor")), .Names = c("test", "test2"
), row.names = c(NA, -4L), class = "data.frame")
for (i in 1:10){
latex(data_object, title='',file='',caption="title")
}
```
我收到这个错误:
! Paragraph ended before \@fileswith@ptions was complete.
<to be read again>
\par
l.101
pandoc.exe: Error producing PDF from TeX source
Error: pandoc document conversion failed with error 43
如何确保在完成表格之前段落没有结束?
当未使用方括号 {} 调用包时,此错误很常见。在您的代码中试试这个替代品:
#Change this:
- \usepackage[here]
#To this:
- \usepackage{here}