Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.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
Latex 错位\n尝试使用RMarkdown/kable编织pdf时没有对齐错误_Latex_R Markdown_Knitr - Fatal编程技术网

Latex 错位\n尝试使用RMarkdown/kable编织pdf时没有对齐错误

Latex 错位\n尝试使用RMarkdown/kable编织pdf时没有对齐错误,latex,r-markdown,knitr,Latex,R Markdown,Knitr,我正在尝试编织一个pdf,其中我将数据帧列表打印成pdf。我有以下代码,其中给出了以下错误: --- geometry: margin=1.7cm output: pdf_document: fig_caption: yes fig_height: 3.5 fig_width: 6.4 keep_tex: yes knit: (function(inputFile, encoding) { rmarkdown::render(inputFile, encodi

我正在尝试编织一个pdf,其中我将数据帧列表打印成pdf。我有以下代码,其中给出了以下错误:

---
geometry: margin=1.7cm
output:
  pdf_document:
    fig_caption: yes
    fig_height: 3.5
    fig_width: 6.4
    keep_tex: yes
knit: (function(inputFile, encoding) { rmarkdown::render(inputFile, encoding = encoding, output_file=paste0('IIDP Data Dictionary ',Sys.Date(),'.pdf')) })
---
\clearpage
\tableofcontents
{r setup, include=FALSE}
library(knitr)
library(kableExtra)
options(tinytex.verbose = TRUE)
opts_chunk$set(echo = FALSE, fig.align='center', message=FALSE)
source("H:/IU_DataManagement/Data_Dict_Code_IIDP_20201104.R")
\newpage
\begin{center}
\section{Demographic Variables}
\end{center}
{r, results = "asis", echo = FALSE}
## tables
for(i in seq_along(demo)) {
  print(
      kable(demo[[i]], format = "latex", caption = names(demo)[i], longtable = TRUE, col.names = NULL) %>%
          kable_styling(font_size = 7, latex_options = "repeat_header", full_width = FALSE)
  )
}
### There are 19 other for loops that use the same format but a different list.
我收到的错误不知道是什么意思:

!!错位\n对齐。 \hline->\n链接 {\ifnum 0=`}\fi\let\hskip\vskip\let\vrule\hrule\let。。。 l、 15724 348}\text反斜杠{}\hline 453&变量名&

错误:LaTeX未能编译IIDP数据字典2020-11-05.tex。有关调试提示,请参阅。更多信息请参见IIDP数据字典2020-11-05.log。
执行已暂停

能否显示中间.tex文件?@samcarter\u is\u在\u topanswers.xyz您应该可以在此处找到tex文件。我也很乐意以另一种方式分发。虽然大多数表都会生成正确的tex代码,但pandoc似乎会错误地跳过其中的几个表,并生成类似于
\text backslash begin
的胡言乱语。您能否将标记文件归结为一个包含一个工作表的小示例,一个断开的表和运行示例所需的数据?@samcarter_is_at_topanswers.xyz我可以很好地打印我的一个for循环,但出于某种原因,行号也打印出来了。每个列表都来自一个CSV读取的大数据帧,该CSV由20种不同的变量类型子集。我不知道如何不打印行号。我将继续逐一添加每个变量,看看谁是罪魁祸首。