b4154 February 2016

How to change pandoc option in R Studio

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

Answers


scoa February 2016

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

Post Status

Asked in February 2016
Viewed 2,377 times
Voted 13
Answered 1 times

Search




Leave an answer