Changing Word Template for Knitr in Rmarkdown

Changing word template for knitr in Rmarkdown

I prepared a video for this task. Please see if it helps. Basically you generate a Word document from an arbitrary R Markdown document, then modify the styles in the Word output document, and use this document as the template for future R Markdown documents.

Changing word template for knitr in Rmarkdown

I prepared a video for this task. Please see if it helps. Basically you generate a Word document from an arbitrary R Markdown document, then modify the styles in the Word output document, and use this document as the template for future R Markdown documents.

Styling of Ms Word not working in R Markdown

In a nutshell, make a template using an already knitted document containing your content and different types of headers etc.

I had a similar problem that was fixed by knitting my document and saving the resulting word(.docx) as "template". I now had a good working file with lots of content examples.

Next, I went into this file and manually changed the styles using "styles" in the Home tab. Open up this feature in your new "template" document by using the little down arrow on the bottom right-hand corner. Click on the various paragraphs and headers in your document to see what they refer to (the style will jump about on the dropdown menu) and make your changes. Save again. Now when you want to knit a new document, it will hopefully apply your changes.

Be aware that you might get caught out by the "Body Text" and "First Paragraph", so you might need to change both of these separately.

output:
word_document:
reference_docx: template.docx

Format text for word output while using rmd template

Great question. With the latest development version of papaja (devtools::install_github("crsh/papaja@devel")) you can provide a custom reference DOCX file to apa6_word. So, in you example, instead of word_document you can use apa6_word:

output:
papaja::apa6_word:
reference_docx: template.docx


Related Topics



Leave a reply



Submit