3
votes

I am new to using rmarkdown and knitr to produce .docx word documents. The rmarkdown reference guide states that using -- gives an en-dash, and --- gives an em-dash.

If I knit my .Rmd file to HTML then the en-dashes and em-dashes are working correctly, however when knitting to a word document, they remain as -- and ---.

I am using Microsoft Word 2013, and I have checked the autoformatting options are set to replace hyphens with a dash.

Any help would be very much appreciated, thanks!

1

1 Answers

5
votes

You need to add a pandoc_args: ["--smart"] to the header: Then it words for DocX format

---
output: 
    word_document:
        pandoc_args: ["--smart"]
---