1

I recently updated RStudio to version 1.2.1335 and my rmarkdown package to version 1.12. All other packages have been updated.

Before updating, I was able to knit line breaks in Word documents by inserting \newline in R Markdown code, but it's no longer working.

I am still able to insert page breaks with a word template and heading styles as shown here.

Here's an example of my YAML header (hasn't changed since updating):

---
title: "Document Title"
date:  Created `r strftime(Sys.time(),format="%B-%d-%Y at %H:%M")`
output:
  word_document:
    reference_docx: template.docx
---

Anybody else having this issue or have any ideas on how to fix this? Issue shows up on both on Windows 10 and macOS Mojave.

1 Answers1

0

I have the same experience with rmarkdown version 1.18 on macOS Mojave. racoon_lord's solution works for me, which is to insert a \ at the end of the line to create a new line in MS Word document. (I have not tried this with an example that uses a template file.)