如何在R Studio中更改pandoc选项

8

在R Studio中安装rmarkdown包,您可以使用Rmd文件创建docx文档,只需按下“Knit Word”按钮即可。

然后调用的命令是:

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS hallo.utf8.md --to docx --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures
--output hallo.docx --highlight-style tango

问题

如何添加其他选项?我想要添加:

--filter ./pandoc-word-pagebreak

获取:

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS hallo.utf8.md --to docx --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --filter ./pandoc-word-pagebreak
    --output hallo.docx --highlight-style tango
1个回答

8
您可以在yaml前置区域中使用pandoc_args
---
title: "Mytitle"
output:
  word_document:
    pandoc_args: [ 
      "--filter", "./pandoc-word-pagebreak" 
    ]
---

See the documentation here


2
文档现在在这里:https://bookdown.org/yihui/rmarkdown/html-document.html#pandoc-arguments - rredondo

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接