3.6 Rich Text Format document

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

---title:"Habits"author: John Doedate: March 22, 2005output: 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 likereadLines(). Now suppose you have an RTF table in the filetable.rtf. To embed it in R Markdown, you read it and pass toknitr::raw_output(), e.g.,

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

3.6.1 Other features

Refer to Section3.1 for the documentation of most features of RTF documents, including table of contents (Section3.1.1), figure options (Section3.1.5), keeping Markdown (Section3.1.10.1), Markdown extensions (Section3.1.10.4), Pandoc arguments (Section3.1.10.5), and shared options (Section3.1.11).