NB: In order to automatically apply a special title slide style while retaining PDF export functionality, this template ships with its own reveal.js pandoc template in pandoc_template.html
. If the presentation seems broken, it may be because the revealjs_presentation RMarkdown exporter has switched to a newer version of reveal.js in the meantime. If that is the case, make sure you have this new version of the template:
And tweak it in the same way as the original pandoc_template.html
by adding the snippet between the following pair of comments at the appropriate place:
<!-- begin pandoc template customization -->
...
<!-- end pandoc template customization -->
Press F
to go fullscreen.
The default layout of this presentation is widescreen, higher resolution. Toggle the commented width
and height
options above to achieve a more traditional, “square” presentation layout. More information about the options for reveal.js R Markdown presentations can be found at http://rmarkdown.rstudio.com/revealjs_presentation_format.html.
Some revealjs plugins are included in the YAML header at the top just to give an idea of how they should be used and what’s available. Feel free to remove any/all of them.
If you don’t use any plugins, you can set self_contained: true
in the YAML header, which will allow you to just open the file with the presentation locally, without having to run a server.
=== / #
) are just section titles, they can’t have content and can be navigated through horizontally--- / ##
) are titles for content slides nested within the individual sections; these can be navigated through vertically within each sectionEsc
to see an overview of the presentation which hopefully willcss
is the path to the CSS file which overrides the presentation styles to bring them in line with the CNC visual stylewidth
and height
: these settings affect how much screen real estate the presentation content is allowed to take up.opts_chunk$set()
instead of repeating the settings in per-chunk optionsfig.{width,height}
relatively small (units of inches), so that font size remains large enough w.r.t. the plot (when increasing the size of the plot, font size isn’t automatically scaled)out.{width,height}
to the actual display size you want to have in your presentation (in pixels); these values should take into account the overall size of the presentation canvas set by width
and height
, and obviously, they should keep the same aspect ratio as fig.{width,height}
, otherwise your graphics will look stretchedfig.{width,height}
to out.{width,height}
to display the figure, you should increase the dpi
, otherwise the figure will look blurryTo generate the presentation, press the Knit button in RStudio or run rmarkdown::render("index.Rmd")
from an R prompt.
Some plugins (e.g. speaker notes) require that the presentation be served over an HTTP connection. The recommended way to deploy it is therefore to drop this entire directory into your ~/public_html
directory on a publicly accessible server.
If you will be serving the presentation locally from your PC / laptop, the easiest way to do so is probably from RStudio itself (just press Knit and it will open). Alternatively, you can run a web server in this directory:
# depending on what you have installed
$ python2 -m SimpleHTTPServer
# or
$ python3 -m http.server
# or
$ php -S localhost:8000
You can then open the presentation by visiting http://localhost:8000 in your browser.
Don’t do this. Seriously. For viewing in the browser, use the recommended deployment method. For offline distribution, export to PDF.
If you truly must, a single-file HTML version of the presentation, which can be opened locally in a web browser without being served over HTTP (just by double-clicking the file, on most systems), can be created by setting the self_contained
option in the YAML header to true
. As mentioned on the previous slide though, be aware that some functionality (e.g. speaker notes) might become unavailable, and you may still need to distribute external resources (such as images) along with the HTML file.
This | is | a | header |
---|---|---|---|
This | is | a | row |
# this chunk will show both input and output
subset(mtcars, mpg > 30)
## mpg cyl disp hp drat wt qsec vs am gear carb
## Fiat 128 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1
## Honda Civic 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2
## Toyota Corolla 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1
## Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2
## mpg cyl disp hp drat wt qsec vs am gear carb
## Duster 360 14.3 8 360 245 3.21 3.570 15.84 0 0 3 4
## Cadillac Fleetwood 10.4 8 472 205 2.93 5.250 17.98 0 0 3 4
## Lincoln Continental 10.4 8 460 215 3.00 5.424 17.82 0 0 3 4
## Chrysler Imperial 14.7 8 440 230 3.23 5.345 17.42 0 0 3 4
## Camaro Z28 13.3 8 350 245 3.73 3.840 15.41 0 0 3 4
## [1] mpg cyl disp hp drat wt qsec vs am gear carb
## <0 rows> (or 0-length row.names)
## mpg cyl disp hp drat wt qsec vs am gear carb
## Hornet Sportabout 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2
## Valiant 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1
## Duster 360 14.3 8 360.0 245 3.21 3.570 15.84 0 0 3 4
## Merc 280 19.2 6 167.6 123 3.92 3.440 18.30 1 0 4 4
## Merc 280C 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4
## Merc 450SE 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3
## Merc 450SL 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3
## Merc 450SLC 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3
## Cadillac Fleetwood 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4
## Lincoln Continental 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4
## Chrysler Imperial 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4
## Dodge Challenger 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2
## AMC Javelin 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2
## Camaro Z28 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4
## Pontiac Firebird 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2
## Ford Pantera L 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4
## Ferrari Dino 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6
## Maserati Bora 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8
## mpg cyl disp hp drat wt qsec vs am gear carb
## Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4
## Mazda RX4 Wag 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4
## Datsun 710 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1
## Hornet 4 Drive 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1
## Merc 240D 24.4 4 146.7 62 3.69 3.190 20.00 1 0 4 2
## Merc 230 22.8 4 140.8 95 3.92 3.150 22.90 1 0 4 2
## Fiat 128 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1
## Honda Civic 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2
## Toyota Corolla 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1
## Toyota Corona 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1
## Fiat X1-9 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1
## Porsche 914-2 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2
## Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2
## Volvo 142E 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2
Non-centered.
Centered.
Even multiple paragraphs.
Non-centered again.
The search
plugin puts a search box in the upper left corner of the screen which lets you quickly jump through textual matches to a query in your presentation.
The notes
plugin adds a speaker notes view with timer and more goodies. It opens in a separate browser window if you press the S
key.
And this is how you create notes:
The chalkboard
plugin lets you doodle either directly over your slide or on an empty fresh virtual chalkboard. Use the buttons in the lower left corner or the C
and B
keys to activate either of these options.
Delete
clears the chalkboard. Backspace
deletes all drawings on the current slide. D
downloads chalkboard drawings as JSON.
Note that this plugin doesn’t seem to play well with the search
plugin, because it overlays the slide and thus makes the search box inaccessible.
It’s possible to customize backgrounds, transitions and other settings per slide. See above for an example, and for more information, search for {data-
on revealjs_presentation’s website, or for data-
on reveal.js’s website.
Lato fonts with full character sets are embedded, so go nuts!
Běžela Magda kaňonem,
srážela banány rádiem.
?print-pdf
or ?print-pdf&showNotes=true
query string, then print using the normal print dialog, adjusting settings for destination (Save as PDF), orientation, margins, background graphics etc. as necessary.For more details on both methods, see reveal.js’s GitHub.
¹ Or possibly any other browser, I think the primary reason for using Chrome or Chromium is that it’s relatively easy to alter the settings for a nice printout without borders etc.