Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 999
b4154 Avatar asked Feb 08 '16 14:02

b4154


1 Answers

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

like image 164
scoa Avatar answered Oct 13 '22 11:10

scoa