title: How to use before-body pandoc argument in R markdown?
body: <p>I want to insert a document before the table of contents of my Word exported markdown document.</p>
  
  <p>My idea is to change pandoc template as indicated <a href="https://stackoverflow.com/questions/25591517/pandoc-inserting-pages-before-generated-table-of-contents/39853290#39853290">here</a>.</p>
  
  <p>Before changing the pandoc template however, I need to pass the document to insert to pandoc.</p>
  
  <p>So I tried:</p>
  
  <pre><code>---
  title: "Test"
  author: "ben"
  date: "2/2/2017"
  output:
    word_document:
      toc: true
      pandoc_args: [
        "-B", "BeforeBody.Rmd"
      ]
  ---
  
  ```{r setup, include=FALSE}
  knitr::opts_chunk$set(echo = TRUE)
  ```
  
  # R Markdown
  
  This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see &lt;http://rmarkdown.rstudio.com&gt;.
  
  # Click
  
  When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this
  </code></pre>
  
  <p>But nothing happens, I just have my Word document, without the inserted text before the body.</p>
  
  <p>I also tried to insert a Word document:</p>
  
  <pre><code>output:
    word_document:
      toc: true
      pandoc_args: [
        "-B", "/Users/ben/test.docx"
      ]
  </code></pre>
  
  <p>But nothing happens.</p>
  
  <p>I also tried:</p>
  
  <pre><code>output:
    word_document:
      toc: true
      pandoc_args: [
        "--include-before-body", "/Users/ben/test.docx"
      ]
  </code></pre>
  
  <p>and</p>
  
  <pre><code>output:
    word_document:
      toc: true
      pandoc_args: [
        "--include-before", "/Users/ben/test.docx"
      ]
  </code></pre>
  
  <p>... still nothing. What can I do?</p>