Facilitate creating Reveal.js presentations with RMarkdown

This package takes the revealjs R package, which can be used for creating slideshows with RMarkdown, and adds extra functionality and facilitation, including an RMarkdown template with advanced features.

To see an example of the rendered template, click here. Use the spacebar on your keyboard to advance through the slides.


Install R and RStudio

Install the software


It will probably take several minutes to install everything. You’ll know it’s finished once you see the ">" symbol at the bottom of the screen again.

You can then install this package, by similarly pasting the code below and pressing Enter on your keyboard:


Additionally, I recommend installing the remedy package by Colin Fay to facilitate writing in Markdown:



Open an RMarkdown template for a reveal.js presentation

An RMarkdown template illustrating several of the reveal.js features can be viewed and used from within RStudio by clicking File -> New File -> R Markdown... -> From Template -> Reveal.js Additions Slideshow.

Use additional buttons in the RStudio interface

When editing your RMarkdown presentation, you can click Addins at the top of the RStudio window. Under Remedy, you will find buttons to facilitate writing with Markdown (see also the RMarkdown cheat sheet from RStudio).

Under Reveal.js Additions, you will find buttons to facilitate writing markdown specifically for reveal.js:

To create a "fragment" (a part of a slide that is initially hidden and then is revealed after advancing the slide), highlight what you would like to initially hide, and click the "Fragment" button.

<span class="fragment"></span>

You can highlight a fragment (you must hightlight the entire opening <span...> tag), and click the "Fragment index" button to add the order in which the fragment should appear among other fragments on the slide...

<span data-fragment-index="1" class="fragment"></span>

... and/or click the "Fragment highlight" button to make the fragment change color instead of reveal itself. Allowed colors are red, blue, and green.

<span class="highlight-red fragment"></span>

You can highlight markdown (ideally, not including headings) and click the "Speaker notes" button to add speaker notes for a slide.

<aside class="notes">
Speaker notes go here.

You can place your cursor on a heading line, and then click the "Slide background" button to add a custom background, either a color (such as "teal" below), or an image (as is show in the RMarkdown template).

## Slide title {data-background="teal"}

You can also place your cursor on a heading line, and then click the "Slide transition" button to give the slide a custom transition.

## Slide title {data-transition="zoom"}

Finally, you can highlight the text of a slide title, and click on the "White background" button to give the text a white background (for example, for use on slides with dark backgrounds or image backgrounds).

## <span class="box-background">Slide title</span> {data-background="teal"}

Render the presentation

To see an example of the rendered template, click here. Use the spacebar on your keyboard to advance through the slides.

To see your presentation, click Knit at the top of the RStudio window. An HTML file and your_presentation_name_files folder will be generated alongside the presentation document on your computer. You can open that HTML file in any web browser (preferably Google Chrome).

When the presentation has finished rendering, RStudio will open a window displaying it. Some advanced features, such as custom slide backgrounds, may not render in this pop-up window. Within that window, you can click "Open in Browser" to see the presentation in the browser. You can also open the file directly in the web browser, by double-clicking on it in your computer's file browser, or by selecting File --> Open... in your web browser.

Give the presentation

To move the rendered presentation to another computer, copy the HTML and your_presentation_name_files folder that were created when you clicked Knit in RStudio above.

publicus/r-revealjs.additions documentation built on May 5, 2019, 1:36 a.m.