How to change pandoc option in R Studio

家住魔仙堡 提交于 2020-02-23 09:49:33

问题


Installing package rmarkdown in R Studio you can create docx documents using a Rmd-file and pressing the Knit Word button.

The invoked command is then:

"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

Question

How to add other options? I want to add:

--filter ./pandoc-word-pagebreak

to get:

"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:


You can use pandoc_args in your yaml front matter:

---
title: "Mytitle"
output:
  word_document:
    pandoc_args: [ 
      "--filter", "./pandoc-word-pagebreak" 
    ]
---

See the documentation here



来源:https://stackoverflow.com/questions/35271593/how-to-change-pandoc-option-in-r-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!