无法使用LaTeX\hline使用RStudio RMarkdown构建pandoc
注意:此摘要可以与其他摘要调用一起最大化,其中每行需要一行,因此在每个表的每行之间放置行的解决方案将不起作用。我正在创建的表需要它 使用最新的RStudio,我有一个对象类型,summary.type为其生成表的Pandoc输出。在pdf/LaTeX输出中,我希望在表的每一行之间有一条水平线。我的所有尝试都失败,并出现以下错误:无法使用LaTeX\hline使用RStudio RMarkdown构建pandoc,latex,rstudio,knitr,pandoc,Latex,Rstudio,Knitr,Pandoc,注意:此摘要可以与其他摘要调用一起最大化,其中每行需要一行,因此在每个表的每行之间放置行的解决方案将不起作用。我正在创建的表需要它 使用最新的RStudio,我有一个对象类型,summary.type为其生成表的Pandoc输出。在pdf/LaTeX输出中,我希望在表的每一行之间有一条水平线。我的所有尝试都失败,并出现以下错误: ! Misplaced \noalign. \hline ->\noalign {\ifnum 0=`}\fi \hrule
! Misplaced \noalign.
\hline ->\noalign
{\ifnum 0=`}\fi \hrule \@height \arrayrulewidth \futurelet...
l.207 \hline
pandoc: Error producing PDF from TeX source
在.md文件中提供以下内容:
------------------------------------------------------------------------------------------------
term estimate std.error statistic p.value N adj.rsq
------------- ----------- ----------- ----------- ----------- ----------- ----------- -----------
**1** NA 26.8 0.766 35 0 1466 0.004
**2** NA 0.012 0.012 0.939 0.348 . .
-------------------------------------------------------------------------------------------------
Another option is to add labels after you have created the table
\hline
并执行以下命令(由RStudio创建):
/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc+RTS-K512m-RTS type.md——到latex——从markdown+autolink\u bare\u URI+ascii\u标识符+tex\u math\u single\u反斜杠-implicit\u数字——输出类型.pdf——目录——目录——目录深度3——模板~/Library/R/3.2/Library/rmarkdown/rmd/latex/default-1.14.tex——突出显示样式tango--latex引擎/Library/TeX/texbin/pdflatex--变量图形=是--变量“几何图形:边距=1in”
删除最后一行(“\hline”),所有内容都会正确编译
当我创建html而不是pdf时,会忽略\hline(应该是这样),并成功创建文件
我做错了什么?为了在表的每一行中都有一行,我可以在Pandoc输出中嵌入的最小值是多少
尝试的解决方案:
------------------------------------------------------------------------------------------------
term estimate std.error statistic p.value N adj.rsq
------------- ----------- ----------- ----------- ----------- ----------- ----------- -----------
**1** NA 26.8 0.766 35 0 1466 0.004
\hrulefill \hrulefill \hrulefill \hrulefill \hrulefill \hrulefill \hrulefill \hrulefill
**2** NA 0.012 0.012 0.939 0.348 . .
---
**3** NA -0.718 0.291 -2.469 0.014 . .
-------------------------------------------------------------------------------------------------
Another option is to add labels after you have created the table
答案是没有答案。这是Pandoc的markdown->tex转换器正在创建的tex的一个片段:
\begin{longtable}[c]{@{}llll@{}}
\toprule
\begin{minipage}[b]{0.16\columnwidth}\raggedright\strut
\strut\end{minipage} &
每个单元格都是自己的“页面”,有自己的页边距,因此,任何生成行的内容都不能超出该页面并通过这些页边距
除了创建一个强制LaTeX在文件中每个表的每一行末尾放一行的模板(正如建议的那样),我不相信有任何方法可以实现我想要的,缺少自己为表格编码的功能。可能重复的
\hline
只能在表格
或类似环境中使用。要在latex文档的其他位置绘制水平线,请使用\hrulefill
。要在每行添加hline,请参见dupeIn Pandoc的标记。您只需创建一条水平线,如下所示:--
,请参见@mb21尝试创建一条带“---”的水平线即可终止table@scoa不幸的是,将一行添加到文档中每个表的每一行,而不是我正在生成的表的每一行,超出了我的能力范围。