pagedown: Creating beautiful PDFs with R Markdown and CSS - Yihui Xie

The traditional way to beautiful PDFs is often through LaTeX or Word, but have you ever thought of printing a web page to PDF? Web technologies (HTML/CSS/JavaScript) are becoming more and more amazing. It is entirely possible to create high-quality PDFs through Google Chrome or Chromium now. Web pages are usually single-page documents, but they can be paginated thanks to the JavaScript library Paged.js, so that you can have elements like headers, footers, and page margins for the printing purpose. In this talk, we introduce a new R package, pagedown (, to create PDF documents based on R Markdown and Paged.js. Applications of pagedown includes, but not limited to, books, articles, posters, resumes, letters, and business cards. With the power of CSS and JavaScript, you can typeset your documents with amazing elegance (e.g., a single line of CSS, "tr:nth-child(even) { background: #eee; }", will give you a striped table, and "border-radius: 50%;" gives you a circular element) and power (e.g., HTML Widgets).

About the Author

Yihui Xie

Yihui Xie is a software engineer at RStudio. He earned his PhD from the Department of Statistics, Iowa State University. He is interested in interactive statistical graphics and statistical computing. As an active R user, he has authored several R packages, such as knitr, bookdown, blogdown, xaringan, tinytex, rolldown, animation, DT, tufte, formatR, fun, xfun, mime, highr, servr, and Rd2roxygen. He also co-authored a few other R packages, including shiny, rmarkdown, rticles, and leaflet. He has authored two books, "Dynamic Documents with knitr" (Xie 2015), and "bookdown: Authoring Books and Technical Documents with R Markdown" (Xie 2016), and co-authored two books, "blogdown: Creating Websites with R Markdown" (Xie, Hill, and Thomas 2017), and "R Markdown: The Definitive Guide" (Xie, Allaire, and Grolemund 2018).

Follow on Twitter Follow on Linkedin More Content by Yihui Xie
Previous Video
Using R, the Tidyverse, H2O, and Shiny to reduce employee attrition - Matt Dancho
Using R, the Tidyverse, H2O, and Shiny to reduce employee attrition - Matt Dancho

An organization that loses 200 high-performing employees per year has a lost productivity cost of about $15...

Next Video
Explicit Direct Instruction in Programming Education - Felienne
Explicit Direct Instruction in Programming Education - Felienne

In education, there is and has always been debate about how to teach. One of these debates centers around t...