Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pdf_book

Convert R Markdown to a PDF book


Description

Convert R Markdown files to PDF after resolving the special tokens of bookdown (e.g., the tokens for references and labels) to native LaTeX commands.

Usage

pdf_book(
  toc = TRUE,
  number_sections = TRUE,
  fig_caption = TRUE,
  pandoc_args = NULL,
  ...,
  base_format = rmarkdown::pdf_document,
  toc_unnumbered = TRUE,
  toc_appendix = FALSE,
  toc_bib = FALSE,
  quote_footer = NULL,
  highlight_bw = FALSE
)

Arguments

toc, number_sections, fig_caption, pandoc_args

See rmarkdown::pdf_document, or the documentation of the base_format function.

...

Other arguments to be passed to base_format.

base_format

An output format function to be used as the base format.

toc_unnumbered

Whether to add unnumberred headers to the table of contents.

toc_appendix

Whether to add the appendix to the table of contents.

toc_bib

Whether to add the bibliography section to the table of contents.

quote_footer

If a character vector of length 2 and the quote footer starts with three dashes (---), quote_footer[1] will be prepended to the footer, and quote_footer[2] will be appended; if NULL, the quote footer will not be processed.

highlight_bw

Whether to convert colors for syntax highlighting to black-and-white (grayscale).

Details

This function is based on rmarkdown::pdf_document (by default) with better default arguments. You can also change the default format to other LaTeX/PDF format functions using the base_format argument.

The global R option bookdown.post.latex can be set to a function to post-process the LaTeX output. This function takes the character vector of the LaTeX output as its input argument, and should return a character vector to be written to the ‘.tex’ output file. This gives you full power to post-process the LaTeX output.

Note

This output format can only be used with render_book().


bookdown

Authoring Books and Technical Documents with R Markdown

v0.22
GPL-3
Authors
Yihui Xie [aut, cre] (<https://orcid.org/0000-0003-0645-5666>), JJ Allaire [ctb], Albert Kim [ctb], Alessandro Samuel-Rosa [ctb], Andrzej Oles [ctb], Atsushi Yasumoto [ctb] (<https://orcid.org/0000-0002-8335-495X>), Aust Frederik [ctb] (<https://orcid.org/0000-0003-4900-788X>), Bastiaan Quast [ctb], Ben Marwick [ctb], Chester Ismay [ctb], Christophe Dervieux [ctb], Clifton Franklund [ctb], Daniel Emaasit [ctb], David Shuman [ctb], Dean Attali [ctb], Drew Tyre [ctb], Ellis Valentiner [ctb], Frans van Dunne [ctb], Hadley Wickham [ctb], Jeff Allen [ctb], Jennifer Bryan [ctb], Jonathan McPhers [ctb], JooYoung Seo [ctb] (<https://orcid.org/0000-0002-4064-6012>), Joyce Robbins [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], Nathan Werth [ctb], Noam Ross [ctb], Peter Hickey [ctb], Pedro Rafael D. Marinho [ctb] (<https://orcid.org/0000-0003-1591-8300>), Romain Lesur [ctb] (<https://orcid.org/0000-0002-0721-5595>), Sahir Bhatnagar [ctb], Shir Dekel [ctb] (<https://orcid.org/0000-0003-1773-2446>), Steve Simpson [ctb], Thierry Onkelinx [ctb] (<https://orcid.org/0000-0001-8804-4216>), Vincent Fulco [ctb], Yixuan Qiu [ctb], Zhuoer Dong [ctb], RStudio, PBC [cph], Bartek Szopka [ctb] (The jQuery Highlight plugin), Zeno Rocha [cph] (clipboard.js library), 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)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.