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