In my yaml call I have
---
title: "`r paste0('Test. Done ', format(Sys.Date(), '%B-%Y'))`"
output:
word_document:
fig_caption: yes
fig_height: 4
fig_width: 7
reference_docx: %userprofile%\Documents\template.docx
---
But YAML complains about %userprofile%
. Is it possible to include such a variable?
I have tried e.g.
reference_docx: "`r file.path(path.expand('~'), 'skabelon.docx')`"
But that still results in this YAML error.
pandoc.exe: `r file.path(path.expand('~'), 'skabelon.docx')`: openBinaryFile: does not exist (No such file or directory)
I guess this meens that the r expression is not processed before the yaml? I have checked that the file is there... Or is it becayse pandoc is using another 'userprofile' ? how can I check this?
I can however use such a call in the Title
variable, as per the updated title above. I guess this must be a specific knitr issue.