use*_*089 2 r pandoc knitr r-markdown
在一个。rmd过去使用YAML行进行干净编译的文档,
output:
  pdf_document:
    fig_caption: yes
    keep_tex: yes
    number_sections: yes
    includes:
        in_header: mystyles.tex spacing.tex
 ...
我现在遇到一个pandoc错误,就像mystyles.tex spacing.tex cannot be found
我现在正在使用R 3.3.2和R Studio 1.0.153。我还尝试了其他几种形式(给出了不同的错误):
        in_header: "mystyles.tex" "spacing.tex"
        in_header: mystyles.tex
        in_header: spacing.tex
如果我在两个文件中合并到LateX代码,并且只使用
        in_header: mystyles.tex
in_header一行中多个文件的语法是什么?它改变了吗?
您必须对向量(数组)使用YAML语法。要么
includes:
  in_header: ["mystyles.tex", "spacing.tex"]
要么
includes:
  in_header: 
    - mystyles.tex
    - spacing.tex
应该没事。请记住in_header在后一种情况下适当缩进列表。