Slide Transitions and Navigation in R Presentations
The default slide transition ("linear") is a simple right-to-left animation. You can specify an alternate transition style using the
transition field. For example:
Presentation Title ======================================== author: John Doe date: February 15th, 2013 transition: rotate
Valid values for the
transition field include:
To specify a default transition style for the entire slide deck you include the
transition field on the first slide of the deck. You can also set the transition on a slide-by-slide basis by including the
transition field on individual slides.
You can also specify the speed of transitions (either globally or on a per-slide basis) using the
transition-speed field. Valid values for
Note that slide transitions do not occur when previewing presentations within RStudio Desktop (they do however occur when using RStudio Workbench or RStudio Server via a browser or when viewed in an external browser in standalone mode).
Hierarchy and Navigation
Slide Types and Sections
You can specify a
type for a slide which changes it's default appearance. There are four built-in types:
New Section ==================================== type: section Prompt Slide ==================================== type: prompt
sub-section slide types use distinct background and font colors, have slightly larger heading text, and appear at a differnet indent level within the slide navigation menu.
alert slide types have a distinct background color to communicate to viewers that the slide has a different intent.
You can choose to display content incrementally by adding
incremental: true to a slide. For example
My Slide ==================================== incremental: true
Headers, paragraphs, blockquotes, code blocks, and list items are all shown incrementally (note however that the first paragraph on any slide is always shown immediately).
incremental on the title slide sets the default behavior for the entire deck (you can then override this default on a per-slide basis).
Valid values for the `incremental` field are:
true— render incrementally
false— don't render incrementally (this is the default behavior)
Slide Navigation Menu
By default users can navigate to any slide in the deck using the navigation menu above the slides within the IDE. For example:
If you want to limit this you can include the
navigation field on the first slide.
My Presentation ===================================== navigation: section
Valid values include:
none— no slide navigation is possible
section— users can navigate to sections only
slide— users can navigate to any slide
If you don't include the
navigation field then the default will be
Right to Left Navigation
You can specify that your slide deck should be navigated from right to left by setting the
rtl field to true. For example:
My Presentation ===================================== author: John Doe rtl: true
You can add hyperlinks to slides using the standard markdown syntax for links:
You can also add an
id field to a slide which enables you to target it as an internal link. For example:
Slide 1 ==================================== id: slide1 Slide 2 ==================================== [Go to slide 1](#/slide1)
Opening Source Files
You can cause a source file to be opened automatically whenever a slide displays by adding the
source command to the slide. For example:
My Slide ==================================== source: example.R
You can also specify that a specific line of code be highlighted when the source file is opened. For example, to navigate to line 30 of a source file you'd use this sytnax:
source: example.R 30
You can also navigate to the first line that matches a regular expression, for example:
source: example.R /loading data/