Authoring Books and Technical Documents with R Markdown

Output formats and utilities for authoring books and technical documents with R Markdown.

A open-source (GPL-3) R package to facilitate writing books and long-form articles/reports with R Markdown. Features include:

  • Generate printer-ready books and ebooks from R Markdown documents
  • A markup language easier to learn than LaTeX, and to write elements such as section headers, lists, quotes, figures, tables, and citations
  • Multiple choices of output formats: PDF, LaTeX, HTML, EPUB, and Word.
  • Possibility of including dynamic graphics and interactive applications (HTML widgets and Shiny apps)
  • Support for languages other than R, including C/C++, Python, and SQL, etc.
  • LaTeX equations, theorems, and proofs work for all output formats
  • Can be published to GitHub,, and any web servers
  • Integrated with the RStudio IDE
  • One-click publishing to

Full documentation at, and see "Get Started" at to know how to get started with writing a book. You are welcome to send us feedback using Github issues or ask questions on StackOverflow with the bookdown tag.



  • Added a Github button in the group of sharing buttons on the toolbar. By default, this button is not displayed. You have to set github: yes under sharing in the gitbook configurations ( and specify your Github repo using the top-level option github-repo in the YAML metadata of index.Rmd, e.g. github-repo: rstudio/bookdown.

  • The appendix heading will be preserved in bookdown::html_document2 output, e.g. if you have # (APPENDIX) Appendix {-} in your document, you will see the heading Appendix in the output. Previously it was removed.

  • Parts in HTML output are also be numbered using roman numerals like LaTeX/PDF output.

  • Wrong part titles were inserted to the table of contents of PDF output (thanks, @florisvdh, #243).

  • Cross-references for appendices in html_document2 output did not work (thanks, @florisvdh, #245).

  • Part titles were not correctly processed when they were longer than 20 characters in PDF output (thanks, @florisvdh, #246).


  • Added arguemnts toc_unnumberred, toc_appendix, toc_bib, and quote_footer to pdf_book().

  • Added support for cross-referencing equations in multi-page HTML output and EPUB; see for the syntax (thanks, @deleeuw, #85).

  • Rmd files can live in subdirectories if you use the Merge-and-Knit approach (the default), and they will be found if the configuration option rmd_subdir is true in _bookdown.yml (thanks, @leobuchignani, #205).

  • The force_knit argument of render_book() was removed (to avoid confusion when switching output formats).
  • The merged R Markdown file will not be deleted if rendering failed so you can debug with this file (

  • The configurations edit: text and chapter_name have been moved from the top-level options to the sub-options of language: ui in _bookdown.yml. See

  • Figures are not correctly numbered in Word output using the bookdown::word_document2() format (thanks, @byzheng, #158).

  • For the "Knit and Merge" approach (new_session: yes in _bookdown.yml), certain parts like figures may not show up when switching from one output format to another (e.g. from HTML to LaTeX).

  • The rmd_files option in _bookdown.yml does not work when it is a list of html and latex options (thanks, @ismayc, #177).

  • Math expressions does not appear in the table of contents when the output format is gitbook (thanks, @philomonk, #204).

  • Footnotes of multiple paragraphs are not displayed on the current page (thanks, @axitdn, #234).

  • The output format pdf_document2() also works with articles now when an R Markdown document contains bookdown-specific headers, such as parts or appendix headers (


  • Initial CRAN release.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.5 by Yihui Xie, a month ago

Report a bug at

Browse source code at

Authors: Yihui Xie [aut, cre], JJ Allaire [ctb], Albert Kim [ctb], Alessandro Samuel-Rosa [ctb], Andrzej Oles [ctb], Bastiaan Quast [ctb], Ben Marwick [ctb], Chester Ismay [ctb], Christophe Dervieux [ctb], Daniel Emaasit [ctb], David Shuman [ctb], Dean Attali [ctb], Drew Tyre [ctb], Frans van Dunne [ctb], Hadley Wickham [ctb], Jeff Allen [ctb], Jennifer Bryan [ctb], Jonathan McPhers [ctb], Junwen Huang [ctb], Kevin Cheung [ctb], Kevin Ushey [ctb], Kim Seonghyun [ctb], Kirill Muller [ctb], Luciano Selzer [ctb], Matthew Lincoln [ctb], Maximilian Held [ctb], Michael Sachs [ctb], Michal Bojanowski [ctb], Peter Hickey [ctb], Sahir Bhatnagar [ctb], Steve Simpson [ctb], Vincent Fulco [ctb], Yixuan Qiu [ctb], Zhuoer Dong [ctb], RStudio Inc [cph], Bartek Szopka [ctb] (The jQuery Highlight plugin), jQuery Foundation [cph] (jQuery library), jQuery contributors [ctb, cph] (jQuery library; authors listed in inst/resources/AUTHORS), MathQuill contributors [ctb] (The MathQuill library; authors listed in inst/resources/AUTHORS), FriendCode Inc [cph, ctb] (The gitbook style, with modifications)

Documentation:   PDF Manual  

GPL-3 license

Imports htmltools, knitr, rmarkdown, yaml

Suggests htmlwidgets, rstudioapi, miniUI, rsconnect, servr, shiny, testit, tufte, webshot

System requirements: Pandoc (>= 1.17.2)

Imported by blogdown, bookdownplus, komadown, rmdformats.

Suggested by SimCorMultRes, flippant, shadow.

See at CRAN