问题
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