3.6 Rich Text Format document

To create a Rich Text Format (RTF) document from R Markdown, you specify the rtf_document output format in the YAML metadata of your document:

---
title: "Habits"
author: John Doe
date: March 22, 2005
output: rtf_document
---

If you know the RTF format really well, you can actually embed raw RTF content in R Markdown. For example, you may create a table in RTF using other software packages, and insert it to your final RTF output document. An RTF document is essentially a plain-text document, so you can read it into R using functions like readLines(). Now suppose you have an RTF table in the file table.rtf. To embed it in R Markdown, you read it and pass to knitr::raw_output(), e.g.,

```{r, echo=FALSE}
knitr::raw_output(readLines('table.rtf'))
```

3.6.1 Other features

Refer to Section 3.1 for the documentation of most features of RTF documents, including table of contents (Section 3.1.1), figure options (Section 3.1.5), keeping Markdown (Section 3.1.10.1), Markdown extensions (Section 3.1.10.4), Pandoc arguments (Section 3.1.10.5), and shared options (Section 3.1.11).