Output Formats in R Markdown

Output formats in R Markdown

There are different ways to set how the output files are generated:

1. YAML file

title: “The Races”
author: “Mike Jones”
output: pdf_document

2. The Knit Button
The default file format is HTML. The available doc formats are as follows:

Document Formats:

Document Format Description Required Software Document Extension
HTML Document (html_document) Default output format generating an HTML document for web viewing. Web Browser .html
PDF Document (pdf_document) Generates a PDF file using LaTeX, prompting installation if necessary. LaTeX (if not installed) .pdf
Microsoft Word Document (word_document) Creates a .docx file for editing and formatting in Microsoft Word. Microsoft Word .docx
OpenDocument Text Document (odt_document) Generates an .odt file using the OpenDocument standard. Software supporting .odt .odt
Rich Text Format Document (rtf_document) Creates an .rtf file for compatibility with various word processing applications. Software supporting .rtf .rtf
Markdown Document (md_document) Generates a Markdown document adhering to the original Markdown specification. Any text editor .md
GitHub Document (github_document) Customized Markdown format for sharing on GitHub, including GitHub-specific features. Any text editor .md


A notebook (html_notebook) is a variation on an HTML document (html_document). Overall, the output formats are similar; the main difference between them is that the rendered output of a notebook always includes an embedded copy of the source code.

output: html_notebook

3. Presentations

Presentation Format Description Required Software Document Format
beamer_presentation For PDF presentations using the LaTeX-based Beamer framework, allowing for highly customizable presentations. LaTeX (and LaTeX Editor, e.g., TeXShop) PDF (.pdf)
ioslides_presentation Ideal for HTML presentations with ioslides, offering interactive features for web-based presentations. Web Browser HTML (.html)
slidy_presentation HTML presentations with a clean design, suitable for web-based slides. Web Browser HTML (.html)
powerpoint_presentation Tailored for creating PowerPoint presentations in .pptx format, editable and presentable using Microsoft PowerPoint. Microsoft PowerPoint PowerPoint (.pptx)
revealjs::revealjs_presentation Dynamic HTML presentations with reveal.js framework (requires reveal.js package), providing advanced web-based slides. R and reveal.js package HTML (.html)


Plus more


Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top