Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Rmarkdown错误:“;!段落结束于\@fileswith@ptions“是完整的”;_R_Latex_R Markdown - Fatal编程技术网

Rmarkdown错误:“;!段落结束于\@fileswith@ptions“是完整的”;

Rmarkdown错误:“;!段落结束于\@fileswith@ptions“是完整的”;,r,latex,r-markdown,R,Latex,R Markdown,我正在从rmarkdown文档中呈现pdf_文档。在本文档中,我在for循环中创建了十个latex表(来自Hmisc包的latex函数) 例如,rmarkdown代码如下所示: --- title: "test" output: pdf_document: latex_engine: lualatex number_sections: yes toc: yes toc_depth: 3 html_document: default header-inclu

我正在从rmarkdown文档中呈现pdf_文档。在本文档中,我在for循环中创建了十个latex表(来自Hmisc包的latex函数)

例如,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")

   }
```
---
标题:“测试”
输出:
pdf\U文件:
发动机:lualatex
部分数量:是
toc:是的
toc_深度:3
html_文档:默认值
标题包括:
-\usepack[荷兰语]{babel}
-\usepackage{fancyhdr}
-\pagestyle{fancy}
-\fancyfoot[LE,RO]{title}
-\usepackage{dcolumn}
-\usepackage[此处]
---
```{r}
图书馆(Hmisc)
```
```{r results=“asis”,tidy=FALSE,eval=TRUE,echo=FALSE,message=FALSE,error=FALSE,warning=FALSE,comment=NA}

data_object当不使用括号{}调用包时,此错误很常见。在您的代码中尝试以下替代:

#Change this:
- \usepackage[here]

#To this:
- \usepackage{here}

\usepackage[此处]
标题中的includes
导致问题。将其删除或替换为有效的
\usepackage[opt]{pkg}
@scoa谢谢您的回复。我需要那个软件包,以便在最终文档中将表格准确地放在我想要的位置。您是否知道一个有效的包具有相同的功能?包的名称是否为“here”?然后,
\usepackage{here}
。问题是您有
[
来设置选项,但没有
{
,所以你的
\usepackage
不完整,就是这样!我不敢相信我以前没有看到这一点。这很简单。我想这与我是一个乳胶新手这一事实有关。如果你愿意,我将添加这一点作为答案。嗯,乳胶错误消息不清楚。我投票以印刷错误结束你的问题,因为它是我的It’答案不太可能对其他人有利
#Change this:
- \usepackage[here]

#To this:
- \usepackage{here}