1
votes

I want to have a dynamic header to appear on every page of word document after knitting an r markdown file. The header includes the document title and ID that are the user inputs passed to r markdown via r shiny app.

I followed the link https://vimeo.com/110804387 to create header for word template Template.docx. The header appears on every page but the parameters from YAML can't be passed to the header.

The header in the Template.docx:

    Document title: `r params$title`  
    Document ID: `r params$id`

The YAML in r markdown:

    output: 
      word_document:
        reference_docx:  Template.docx
    params:
      title:  title
      id:  id

The word template image: Image of the Template.docx

Do you know how I can get the parameters passed to the header? I really appreciate your help. I'm learning R and working on this first project at the same time. I'm using RStudio.

1

1 Answers

0
votes

try adding quotes to `r ` --> "`r `"