【发布时间】:2015-11-21 19:49:28
【问题描述】:
Pandoc 显然可以从多个文件中读取输入。 Documentation says::
pandoc [options] [input-file]…
如果给出多个输入文件,pandoc 会将它们全部连接起来 (它们之间有空行)在解析之前。
我有:
main.Rmd
---
output:
pdf_document
---
After the above YAML front-matter, additional YAML input follows:
---
myparams: blabla
whatnot: testtest
---
Now the main body follows, using $myparams$ and $whatnot$ from the second YAML block...
问题:
如何将第二个 YAML 块分离到它自己的文件中并将rmarkdown/knitr 指向它,以便他们发出带有两个输入文件而不是一个输入文件的 pandoc 命令?我可以以某种方式在 YAML 前端指定 path-to\separate.yaml 资产吗?
$pandoc main.md separate.yaml --output main.pdf`
separate.yaml
---
myparams: blabla
whatnot: testtest
---
main.Rmd
---
input-files: path-to/separate.yaml
output:
pdf_document
---
Now the main body follows, having access to
$myparams$ and $whatnot$ from the separate YAML file...
【问题讨论】:
标签: r knitr r-markdown pandoc