I want to make a Word file using rmarkdown, and the title needs to be broken into 2 parts. Since the title is dynamic, I paste()
the two pieces together.
This works:
---
title: "part 1 \n part 2"
output: word_document
---
But this does not work:
---
title: '`r paste("part 1", "part 2", sep = " \\n ")`'
output: word_document
---
Any help would be much appreciated.
In the meantime, I found a solution myself. Not very clean, but it does the trick:
(this of course requires that in your Word template, there is a style called 'Title')