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

时间:2020-11-05 18:31:41

标签: 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, 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。 执行停止

0 个答案:

没有答案
相关问题