Unable to use a modified Word template from Rstudio using Knit Word from Rstudio. Rstudio and required packages were installed and updated this week. Running OS X 10.10.5 and using Word 2011. Simplified testing to Yihui Xie's 113-externalization.rmd and 113-foo.R and have followed his Vimeo video https://vimeo.com/110804387 on this subject. In all cases, knitting the RMD file uses the default formats and not the modified template stored as template.docx. I have tried putting copies in all locations in the project directory without success.
#113-externalization.Rmd
---
title: "Untitled"
output:
word_document:
reference_doc: "template.docx"
---
# Code Externalization
```{r cache=FALSE}
knitr::read_chunk('113-foo.R')
```
The following two chunks are from the external R script `113-foo.R`:
```{r test-a}
```
```{r test-b}
```
#code for 113-foo.R
# ---- test-a ----
1 + 1
x = rnorm(10)
# ---- test-b ----
mean(x)
sd(x)
Search found Changing word template for knitr in Rmarkdown, but that failed to locate the modified template at any location in the project directory.
reference_docx:
. Does that make the difference? – Martin Schmelzerreference_docx: word-template.docx
. Make sure your indentation in the YAML header is correct (check the video again). – Martin Schmelzerreference_doc
orreference_docx
. I guess it is the indentation then... – Martin Schmelzer