尝试使用RMarkdown / kable编织pdf时\ noalign错误放置

问题描述

我正在尝试编织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.

我收到的错误,不知道是什么意思:

! \ noalign放错位置。 \ hline-> \ noalign {\ ifnum 0 =`} \ fi \ let \ hskip \ vskip \ let \ vrule \ hrule \ let ... l.15724 348} \ textbackslash {} \ hline 453&变量名称

错误:LaTeX无法编译IIDP数据字典2020-11-05.tex。有关调试提示,请参见https://yihui.org/tinytex/r/#debugging。有关更多信息,请参见IIDP数据字典2020-11-05.log。 执行停止

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)