This package contains functions for rendering R Markdown and Quarto documents — priamrily xaringan or revealjs slides — to different formats, including HTML, PDF, PNG, GIF, PPTX, and MP4, as well as a ‘social’ output, a png of the first slide re-sized for sharing on social media.
Looking for xaringanBuilder? The renderthis package was previously called xaringanBuilder. We updated the name as the package evolved (see this blog post detailing the package’s history) If you need to install xaringanBuilder under the previous package name, see the instructions below.
Installation
Note: To get the most out of renderthis, we recommend installing the package with dependencies and making sure that you have a local installation of Google Chrome. See the Setup page for details.
Since renderthis is temporarily not on CRAN (we’ll eventually get it back up), you can install it from GitHub with:
# install.packages("pak")
pak::pak("jhelvy/renderthis")Some output formats require additional packages, and each format will provide instructions about how to install any missing dependencies. You can also choose to install renderthis with all of its dependencies:
# From GitHub
pak::pak("jhelvy/renderthis", dependencies = TRUE)Usage
Use renderthis to render slides to different formats. Here is a diagram of the render hierarchy:
Rmd / qmd
|
|--> social (png, from Rmd only)
|
|--> html
|
|--> pdf
|
|--> png
|
|--> gif
|
|--> mp4
|
|--> pptxTo use renderthis, first load the package:
All of the package functions follow a common pattern:
- All functions start with
to_*()to render slides to a desired format (e.g.,to_pdf()). - All functions have a required
fromargument which should be set to the full or local path to the input file. - All functions have an optional
toargument. If provided, it can be a full or local path to the output file, and it must end in an appropriate extension (e.g.slides.gifforto_gif()). If it is not provided, the output file name will be determined based on thefromargument.
Learn more about renderthis in the Get Started article.
Author and License Information
- Authors: John Paul Helveston (aut, cre, cph) & Garrick Aden-Buie (aut)
- Date First Written: Originally as {xaringanBuilder} on September 27, 2020
- License: MIT
Citation Information
If you use this package in a publication, I would greatly appreciate it if you cited it. You can get the citation information by typing citation("renderthis") into R:
To cite renderthis in publications use:
Helveston, John Paul and Aden-Buie, Garrick (2021). renderthis: Render slides to different formats. R package version 0.2.2. https://jhelvy.github.io/renderthis/
A BibTeX entry for LaTeX users is
@Manual{, title = {renderthis: Render slides to different formats}, author = {John Paul Helveston and Garrick Aden-Buie}, year = {2021}, note = {R package version 0.2.2}, url = {https://jhelvy.github.io/renderthis/}, }
