Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.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\hline使用RStudio RMarkdown构建pandoc_Latex_Rstudio_Knitr_Pandoc - Fatal编程技术网

无法使用LaTeX\hline使用RStudio RMarkdown构建pandoc

无法使用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

注意:此摘要可以与其他摘要调用一起最大化,其中每行需要一行,因此在每个表的每行之间放置行的解决方案将不起作用。我正在创建的表需要它

使用最新的RStudio,我有一个对象类型,summary.type为其生成表的Pandoc输出。在pdf/LaTeX输出中,我希望在表的每一行之间有一条水平线。我的所有尝试都失败,并出现以下错误:

! 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输出中嵌入的最小值是多少

尝试的解决方案:

  • 使用\hr规则填充:问题:将只填充单个列的90%。把它放在每一列并不能填满这一行
  • 使用“---”告诉Pandoc我需要一条水平线:问题:结束表格
  • 更改LaTeX模板,使每个表的每一行都有一行分隔:问题:只希望对summary.myType创建的行执行此操作,而不是对文档中任何位置的所有表执行此操作
  • 尝试的解决方案和结果:

    ------------------------------------------------------------------------------------------------
                   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不幸的是,将一行添加到文档中每个表的每一行,而不是我正在生成的表的每一行,超出了我的能力范围。