blob: b8d8acd5e77ead828250f0a37212fd0a49074775 [file] [log] [blame]
JJ Allaired708ef02016-01-30 14:30:26 -05001% Generated by roxygen2: do not edit by hand
junkkad4b3a162015-03-16 07:49:11 +01002% Please edit documentation in R/revealjs_presentation.R
JJ Allaire2ec40242014-09-15 09:18:39 -04003\name{revealjs_presentation}
4\alias{revealjs_presentation}
5\title{Convert to a reveal.js presentation}
6\usage{
Atsushi Yasumoto7053f452020-02-15 00:08:46 +09007revealjs_presentation(
8 incremental = FALSE,
9 center = FALSE,
10 slide_level = 2,
Christophe Dervieuxaa008e42021-09-23 16:52:37 +020011 toc = FALSE,
12 toc_depth = 3,
Atsushi Yasumoto7053f452020-02-15 00:08:46 +090013 fig_width = 8,
14 fig_height = 6,
15 fig_retina = if (!fig_caption) 2,
16 fig_caption = FALSE,
Atsushi Yasumoto7053f452020-02-15 00:08:46 +090017 self_contained = TRUE,
18 theme = "simple",
Christophe Dervieuxe1893ae2021-10-07 17:09:02 +020019 transition = "convex",
20 background_transition = "fade",
Atsushi Yasumoto7053f452020-02-15 00:08:46 +090021 reveal_options = NULL,
22 reveal_plugins = NULL,
23 highlight = "default",
24 mathjax = "default",
25 template = "default",
26 css = NULL,
27 includes = NULL,
28 keep_md = FALSE,
29 lib_dir = NULL,
30 pandoc_args = NULL,
31 extra_dependencies = NULL,
32 md_extensions = NULL,
33 ...
34)
JJ Allaire2ec40242014-09-15 09:18:39 -040035}
36\arguments{
37\item{incremental}{\code{TRUE} to render slide bullets incrementally. Note
38that if you want to reverse the default incremental behavior for an
JJ Allaire29152752016-03-08 15:06:38 -050039individual bullet you can precede it with \code{>}. For example:
JJ Allaire2ec40242014-09-15 09:18:39 -040040\emph{\code{> - Bullet Text}}}
41
42\item{center}{\code{TRUE} to vertically center content on slides}
43
JJ Allaire4c178052016-01-30 19:35:39 -050044\item{slide_level}{Level of heading to denote individual slides. If
45\code{slide_level} is 2 (the default), a two-dimensional layout will be
46produced, with level 1 headers building horizontally and level 2 headers
47building vertically. It is not recommended that you use deeper nesting of
48section levels with reveal.js.}
49
Christophe Dervieuxaa008e42021-09-23 16:52:37 +020050\item{toc}{\code{TRUE} to include a table of contents in the output (only
51level 1 headers will be included in the table of contents).}
52
53\item{toc_depth}{Depth of headers to include in table of contents}
54
JJ Allaire2ec40242014-09-15 09:18:39 -040055\item{fig_width}{Default width (in inches) for figures}
56
Atsushi Yasumoto7053f452020-02-15 00:08:46 +090057\item{fig_height}{Default height (in inches) for figures}
JJ Allaire2ec40242014-09-15 09:18:39 -040058
JJ Allaire82a8dee2016-07-12 10:25:36 -040059\item{fig_retina}{Scaling to perform for retina displays (defaults to 2, which
60currently works for all widely used retina displays). Set to \code{NULL} to
61prevent retina scaling. Note that this will always be \code{NULL} when
62\code{keep_md} is specified (this is because \code{fig_retina} relies on
63outputting HTML directly into the markdown document).}
JJ Allaire2ec40242014-09-15 09:18:39 -040064
65\item{fig_caption}{\code{TRUE} to render figures with captions}
66
Atsushi Yasumoto7053f452020-02-15 00:08:46 +090067\item{self_contained}{Whether to generate a full LaTeX document (\code{TRUE})
68or just the body of a LaTeX document (\code{FALSE}). Note the LaTeX
69document is an intermediate file unless \code{keep_tex = TRUE}.}
JJ Allaire2ec40242014-09-15 09:18:39 -040070
Christophe Dervieuxe1893ae2021-10-07 17:09:02 +020071\item{theme}{Visual theme ("simple", "dark", "black", "sky", "beige", "serif", "solarized", "blood", "moon", "night", "league", or "white")}
JJ Allaire2ec40242014-09-15 09:18:39 -040072
Christophe Dervieuxe1893ae2021-10-07 17:09:02 +020073\item{transition}{Slide transition (
74"convex", "fade", "slide", "concave", "zoom", or "none"
75)}
junkkad4b3a162015-03-16 07:49:11 +010076
Christophe Dervieuxe1893ae2021-10-07 17:09:02 +020077\item{background_transition}{Slide background-transition (
78"convex", "fade", "slide", "concave", "zoom", or "none"
79)}
JJ Allaire2ec40242014-09-15 09:18:39 -040080
JJ Allaire35c0b492017-02-10 09:30:24 -050081\item{reveal_options}{Additional options to specify for reveal.js (see
Christophe Dervieuxe1893ae2021-10-07 17:09:02 +020082\url{https://revealjs.com/config/} for details). Options for plugins can also
83be passed, using plugin name as first level key (e.g \code{list(slideNumber = FALSE, menu = list(number = TRUE))}).}
JJ Allaire37f45b72016-01-30 18:17:45 -050084
JJ Allaire35c0b492017-02-10 09:30:24 -050085\item{reveal_plugins}{Reveal plugins to include. Available plugins include
Atsushi Yasumoto7053f452020-02-15 00:08:46 +090086"notes", "search", "zoom", "chalkboard", and "menu". Note that
JJ Allaire35c0b492017-02-10 09:30:24 -050087\code{self_contained} must be set to \code{FALSE} in order to use Reveal
88plugins.}
JJ Allaire82a8dee2016-07-12 10:25:36 -040089
JJ Allaire2ec40242014-09-15 09:18:39 -040090\item{highlight}{Syntax highlighting style. Supported styles include
91"default", "tango", "pygments", "kate", "monochrome", "espresso",
92"zenburn", and "haddock". Pass \code{NULL} to prevent syntax highlighting.}
93
Atsushi Yasumoto7053f452020-02-15 00:08:46 +090094\item{mathjax}{Include mathjax. The "default" option uses an https URL from a
95MathJax CDN. The "local" option uses a local version of MathJax (which is
96copied into the output directory). You can pass an alternate URL or pass
97\code{NULL} to exclude MathJax entirely.}
JJ Allaire2ec40242014-09-15 09:18:39 -040098
JJ Allaire4c178052016-01-30 19:35:39 -050099\item{template}{Pandoc template to use for rendering. Pass "default" to use
100the rmarkdown package default template; pass \code{NULL} to use pandoc's
101built-in template; pass a path to use a custom template that you've
102created. Note that if you don't use the "default" template then some
103features of \code{revealjs_presentation} won't be available (see the
104Templates section below for more details).}
JJ Allaire2ec40242014-09-15 09:18:39 -0400105
Christophe Dervieux21239cf2021-09-15 15:34:01 +0200106\item{css}{CSS and/or Sass files to include. Files with an extension of .sass
107or .scss are compiled to CSS via \code{sass::sass()}. Also, if \code{theme} is a
108\code{\link[bslib:bs_theme]{bslib::bs_theme()}} object, Sass code may reference the relevant Bootstrap
109Sass variables, functions, mixins, etc.}
JJ Allairefad55232015-10-19 07:47:26 -0400110
JJ Allaire2ec40242014-09-15 09:18:39 -0400111\item{includes}{Named list of additional content to include within the
Atsushi Yasumoto7053f452020-02-15 00:08:46 +0900112document (typically created using the \code{\link[rmarkdown]{includes}} function).}
JJ Allaire2ec40242014-09-15 09:18:39 -0400113
114\item{keep_md}{Keep the markdown file generated by knitting.}
115
116\item{lib_dir}{Directory to copy dependent HTML libraries (e.g. jquery,
JJ Allaire091cb122016-02-09 13:04:23 -0500117bootstrap, etc.) into. By default this will be the name of the document with
118\code{_files} appended to it.}
JJ Allaire2ec40242014-09-15 09:18:39 -0400119
120\item{pandoc_args}{Additional command line options to pass to pandoc}
JJ Allaire8d1c2f42016-01-30 14:56:45 -0500121
JJ Allaire35c0b492017-02-10 09:30:24 -0500122\item{extra_dependencies}{Additional function arguments to pass to the base R
123Markdown HTML output formatter \code{\link[rmarkdown:html_document_base]{rmarkdown::html_document_base()}}.}
JJ Allaire375805c2016-11-15 08:56:43 -0500124
Atsushi Yasumoto7053f452020-02-15 00:08:46 +0900125\item{md_extensions}{Markdown extensions to be added or removed from the
126default definition or R Markdown. See the \code{\link[rmarkdown]{rmarkdown_format}} for
127additional details.}
128
JJ Allaire8d1c2f42016-01-30 14:56:45 -0500129\item{...}{Ignored}
JJ Allaire2ec40242014-09-15 09:18:39 -0400130}
131\value{
christophe dervieuxd26add32021-09-23 16:55:00 +0200132R Markdown output format to pass to \code{\link[rmarkdown:render]{rmarkdown::render()}}
JJ Allaire2ec40242014-09-15 09:18:39 -0400133}
134\description{
135Format for converting from R Markdown to a reveal.js presentation.
136}
137\details{
JJ Allaire4c178052016-01-30 19:35:39 -0500138In reveal.js presentations you can use level 1 or level 2 headers for slides.
139If you use a mix of level 1 and level 2 headers then a two-dimensional layout
140will be produced, with level 1 headers building horizontally and level 2
141headers building vertically.
JJ Allaire2ec40242014-09-15 09:18:39 -0400142
JJ Allaire4c178052016-01-30 19:35:39 -0500143For additional documentation on using revealjs presentations see
christophe dervieuxd26add32021-09-23 16:55:00 +0200144\url{https://github.com/rstudio/revealjs}
JJ Allaire2ec40242014-09-15 09:18:39 -0400145}
Christophe Dervieuxe1893ae2021-10-07 17:09:02 +0200146\section{About plugins}{
147\subsection{Built-in plugins with reveal.js}{
148\subsection{Zoom}{
149
150When activated, ALT + Click can be used to zoom on a slide.
151}
152
153\subsection{Notes}{
154
155Show a \href{https://revealjs.com/speaker-view/}{speaker view} in a separated
156window. This speaker view contains a timer, current slide, next slide, and
157speaker notes. It also duplicate the window to have presentation mode
158synchronized with main presentation.
159
160Use\if{html}{\out{<div class="sourceCode markdown">}}\preformatted{::: notes
161Content of speaker notes
162:::
163}\if{html}{\out{</div>}}
164
165to create notes only viewable in presentation mode.
166}
167
168\subsection{Search}{
169
170When opt-in, it is possible to show a search box when pressing \code{CTRL + SHIFT + F}. It will seach in the whole presentation, and highlight matched words. The
171matches will also be highlighted in overview mode (pressing ESC to see all
172slides in one scrollable view)
173}
174
175}
176
177\subsection{Menu}{
178
179A slideout menu plugin for Reveal.js to quickly jump to any slide by title.
180
181Version 2.1.0 is
182currently used and documentation for configurations can be found at
183\href{https://github.com/denehyg/reveal.js-menu/blob/2.1.0/README.md}{denehyg/reveal.js-menu}
184\subsection{Known limitations}{
185
186Some configurations cannot be modified in the current template:
187\itemize{
188\item \code{loadIcons: false} the fontawesome icons are loaded by \pkg{rmarkdown}
189when this plugin is used
190\item \code{custom: false}
191\item \code{themes: false}
192\item \code{transitions: false}
193}
194}
195
196}
197
198\subsection{Chalkboard}{
199
200A plugin adding a chalkboard and slide annotation
201
202Version 4.1.5 is
203currently used and documentation for configurations can be found at
204\href{https://github.com/rajgoel/reveal.js-plugins/tree/4.1.5/4.1.5/chalkboard}{rajgoel/reveal.js-plugins}
205
206By default, chalkboard and annotations modes will be accessible using keyboard
207shortcuts, respectively, pressing B, or pressing C.
208In addition, buttons on the bottom left can be added by using the following\if{html}{\out{<div class="sourceCode yaml">}}\preformatted{reveal_plugins:
209 - chalkboard
210reveal_options:
211 chalkboard:
212 toggleNotesButton: true
213 toggleChalkboardButton: true
214}\if{html}{\out{</div>}}
215}
216}
217
JJ Allaire2ec40242014-09-15 09:18:39 -0400218\examples{
219\dontrun{
220
221library(rmarkdown)
222library(revealjs)
223
224# simple invocation
225render("pres.Rmd", revealjs_presentation())
226
227# specify an option for incremental rendering
228render("pres.Rmd", revealjs_presentation(incremental = TRUE))
229}
JJ Allaired708ef02016-01-30 14:30:26 -0500230
JJ Allaire2ec40242014-09-15 09:18:39 -0400231}