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