blob: 4fc15949271866ff123d9a27fb74b2d862b99203 [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{
7revealjs_presentation(incremental = FALSE, center = FALSE, fig_width = 8,
8 fig_height = 6, fig_retina = if (!fig_caption) 2, fig_caption = FALSE,
JJ Allaired708ef02016-01-30 14:30:26 -05009 smart = TRUE, self_contained = TRUE, theme = "simple",
junkkad4b3a162015-03-16 07:49:11 +010010 transition = "default", background_transition = "default",
JJ Allaire37f45b72016-01-30 18:17:45 -050011 history = TRUE, reveal_options = NULL, highlight = "default",
12 mathjax = "default", template = "default", css = NULL,
13 includes = NULL, keep_md = FALSE, lib_dir = NULL, pandoc_args = NULL,
14 ...)
JJ Allaire2ec40242014-09-15 09:18:39 -040015}
16\arguments{
17\item{incremental}{\code{TRUE} to render slide bullets incrementally. Note
18that if you want to reverse the default incremental behavior for an
19individual bullet you can preceded it with \code{>}. For example:
20\emph{\code{> - Bullet Text}}}
21
22\item{center}{\code{TRUE} to vertically center content on slides}
23
24\item{fig_width}{Default width (in inches) for figures}
25
26\item{fig_height}{Default width (in inches) for figures}
27
28\item{fig_retina}{Scaling to perform for retina displays (defaults to 2 when
29\code{fig_caption} is \code{FALSE}, which currently works for all widely
30used retina displays). Set to \code{NULL} to prevent retina scaling. Note
31that this will always be \code{NULL} when \code{keep_md} is specified (this
32is because \code{fig_retina} relies on outputting HTML directly into the
33markdown document).}
34
35\item{fig_caption}{\code{TRUE} to render figures with captions}
36
37\item{smart}{Produce typographically correct output, converting straight
38quotes to curly quotes, --- to em-dashes, -- to en-dashes, and ... to
39ellipses.}
40
41\item{self_contained}{Produce a standalone HTML file with no external
42dependencies, using data: URIs to incorporate the contents of linked
JJ Allaired708ef02016-01-30 14:30:26 -050043scripts, stylesheets, images, and videos. Note that even for self contained
44documents MathJax is still loaded externally (this is necessary because of
45it's size).}
JJ Allaire2ec40242014-09-15 09:18:39 -040046
JJ Allaired708ef02016-01-30 14:30:26 -050047\item{theme}{Visual theme ("simple", "sky", "beige", "serif",
junkkad4b3a162015-03-16 07:49:11 +010048"solarized", "blood", "moon", "night", "black", "league" or "white").}
JJ Allaire2ec40242014-09-15 09:18:39 -040049
JJ Allaired708ef02016-01-30 14:30:26 -050050\item{transition}{Slide transition ("default", "none", "fade", "slide",
junkkad4b3a162015-03-16 07:49:11 +010051"convex", "concave" or "zoom")}
52
JJ Allaired708ef02016-01-30 14:30:26 -050053\item{background_transition}{Slide background-transition ("default", "none", "fade", "slide",
junkkad4b3a162015-03-16 07:49:11 +010054"convex", "concave" or "zoom")}
JJ Allaire2ec40242014-09-15 09:18:39 -040055
JJ Allaire37f45b72016-01-30 18:17:45 -050056\item{history}{\code{TRUE} to push each slide change to the browser history.}
57
58\item{reveal_options}{Additional options to specify for reveal.js (see
59\href{https://github.com/hakimel/reveal.js#configuration}{https://github.com/hakimel/reveal.js#configuration} for details).}
60
JJ Allaire2ec40242014-09-15 09:18:39 -040061\item{highlight}{Syntax highlighting style. Supported styles include
62"default", "tango", "pygments", "kate", "monochrome", "espresso",
63"zenburn", and "haddock". Pass \code{NULL} to prevent syntax highlighting.}
64
65\item{mathjax}{Include mathjax. The "default" option uses an https URL from
66the official MathJax CDN. The "local" option uses a local version of
67MathJax (which is copied into the output directory). You can pass an
68alternate URL or pass \code{NULL} to exclude MathJax entirely.}
69
70\item{template}{Pandoc template to use for rendering. Pass "default"
JJ Allaired708ef02016-01-30 14:30:26 -050071to use the rmarkdown package default template; pass \code{NULL}
72to use pandoc's built-in template; pass a path to use a custom template
73that you've created. Note that if you don't use the "default" template
74then some features of \code{revealjs_presentation} won't be available
75(see the Templates section below for more details).}
JJ Allaire2ec40242014-09-15 09:18:39 -040076
JJ Allairefad55232015-10-19 07:47:26 -040077\item{css}{One or more css files to include}
78
JJ Allaire2ec40242014-09-15 09:18:39 -040079\item{includes}{Named list of additional content to include within the
80document (typically created using the \code{\link{includes}} function).}
81
82\item{keep_md}{Keep the markdown file generated by knitting.}
83
84\item{lib_dir}{Directory to copy dependent HTML libraries (e.g. jquery,
85bootstrap, etc.) into. By default this will be the name of the document
86with \code{_files} appended to it.}
87
88\item{pandoc_args}{Additional command line options to pass to pandoc}
JJ Allaire8d1c2f42016-01-30 14:56:45 -050089
90\item{...}{Ignored}
JJ Allaire2ec40242014-09-15 09:18:39 -040091}
92\value{
93R Markdown output format to pass to \code{\link{render}}
94}
95\description{
96Format for converting from R Markdown to a reveal.js presentation.
97}
98\details{
99In reveal.js presentations you can use level 1 or level 2 headers for
100slides. If you use a mix of level 1 and level 2 headers then a
101two-dimensional layout will be produced, with level 1 headers building
102horizontally and level 2 headers building vertically.
103
104For more information on markdown syntax for presentations see
105\href{http://johnmacfarlane.net/pandoc/demo/example9/producing-slide-shows-with-pandoc.html}{producing
106slide shows with pandoc}.
107}
108\section{Templates}{
109
110
111You can provide a custom HTML template to be used for rendering. The syntax
112for templates is described in the documentation on
113\href{http://johnmacfarlane.net/pandoc/demo/example9/templates.html}{pandoc
114templates}. You can also use the basic pandoc template by passing
115\code{template = NULL}.
116
117Note however that if you choose not to use the "default" reveal.js template
118then several aspects of reveal.js presentation rendering will behave
119differently:
120
121\itemize{
122 \item{The \code{center} parameter does not work (you'd need to
123 set this directly in the template).
124 }
125 \item{The built-in template includes some additional tweaks to styles
126 to optimize for output from R, these won't be present.
127 }
128 \item{MathJax will not work if \code{self_contained} is \code{TRUE}
129 (these two options can't be used together in normal pandoc templates).
130 }
131}
132}
133\examples{
134\dontrun{
135
136library(rmarkdown)
137library(revealjs)
138
139# simple invocation
140render("pres.Rmd", revealjs_presentation())
141
142# specify an option for incremental rendering
143render("pres.Rmd", revealjs_presentation(incremental = TRUE))
144}
JJ Allaired708ef02016-01-30 14:30:26 -0500145
146
JJ Allaire2ec40242014-09-15 09:18:39 -0400147}
148