| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/slidy_presentation.R |
| 3 |
\name{slidy_presentation} |
| 4 |
\alias{slidy_presentation} |
| 5 |
\title{Convert to a slidy presentation} |
| 6 |
\usage{ |
| 7 |
slidy_presentation( |
| 8 |
number_sections = FALSE, |
| 9 |
incremental = FALSE, |
| 10 |
slide_level = NULL, |
| 11 |
duration = NULL, |
| 12 |
footer = NULL, |
| 13 |
font_adjustment = 0, |
| 14 |
fig_width = 8, |
| 15 |
fig_height = 6, |
| 16 |
fig_retina = 2, |
| 17 |
fig_caption = TRUE, |
| 18 |
dev = "png", |
| 19 |
df_print = "default", |
| 20 |
self_contained = TRUE, |
| 21 |
highlight = "default", |
| 22 |
math_method = "default", |
| 23 |
mathjax = "default", |
| 24 |
template = "default", |
| 25 |
css = NULL, |
| 26 |
includes = NULL, |
| 27 |
keep_md = FALSE, |
| 28 |
lib_dir = NULL, |
| 29 |
md_extensions = NULL, |
| 30 |
pandoc_args = NULL, |
| 31 |
extra_dependencies = NULL, |
| 32 |
... |
| 33 |
) |
| 34 |
} |
| 35 |
\arguments{ |
| 36 |
\item{number_sections}{\code{TRUE} to number section headings} |
| 37 |
|
| 38 |
\item{incremental}{\code{TRUE} to render slide bullets incrementally. Note |
| 39 |
that if you want to reverse the default incremental behavior for an |
| 40 |
individual bullet you can precede it with \code{>}. For example: |
| 41 |
\emph{\verb{> - Bullet Text}}. See more in |
| 42 |
\href{https://pandoc.org/MANUAL.html#incremental-lists}{Pandoc's Manual}} |
| 43 |
|
| 44 |
\item{slide_level}{The heading level which defines individual slides. By |
| 45 |
default this is the highest header level in the hierarchy that is followed |
| 46 |
immediately by content, and not another header, somewhere in the document. |
| 47 |
This default can be overridden by specifying an explicit |
| 48 |
\code{slide_level}.} |
| 49 |
|
| 50 |
\item{duration}{Duration (in minutes) of the slide deck. This value is used |
| 51 |
to add a countdown timer to the slide footer.} |
| 52 |
|
| 53 |
\item{footer}{Footer text (e.g. organization name and/or copyright)} |
| 54 |
|
| 55 |
\item{font_adjustment}{Increase or decrease the default font size (e.g. -1 or |
| 56 |
+1). You can also manually adjust the font size during the presentation |
| 57 |
using the 'S' (smaller) and 'B' (bigger) keys.} |
| 58 |
|
| 59 |
\item{fig_width}{Default width (in inches) for figures} |
| 60 |
|
| 61 |
\item{fig_height}{Default height (in inches) for figures} |
| 62 |
|
| 63 |
\item{fig_retina}{Scaling to perform for retina displays (defaults to 2, which |
| 64 |
currently works for all widely used retina displays). Set to \code{NULL} to |
| 65 |
prevent retina scaling. Note that this will always be \code{NULL} when |
| 66 |
\code{keep_md} is specified (this is because \code{fig_retina} relies on |
| 67 |
outputting HTML directly into the markdown document).} |
| 68 |
|
| 69 |
\item{fig_caption}{\code{TRUE} to render figures with captions} |
| 70 |
|
| 71 |
\item{dev}{Graphics device to use for figure output (defaults to pdf)} |
| 72 |
|
| 73 |
\item{df_print}{Method to be used for printing data frames. Valid values |
| 74 |
include "default", "kable", "tibble", and "paged". The "default" method |
| 75 |
uses a corresponding S3 method of \code{print}, typically |
| 76 |
\code{print.data.frame}. The "kable" method uses the |
| 77 |
\code{\link[knitr:kable]{knitr::kable}} function. The "tibble" method uses |
| 78 |
the \pkg{tibble} package to print a summary of the data frame. The "paged" |
| 79 |
method creates a paginated HTML table (note that this method is only valid |
| 80 |
for formats that produce HTML). In addition to the named methods you can |
| 81 |
also pass an arbitrary function to be used for printing data frames. You |
| 82 |
can disable the \code{df_print} behavior entirely by setting the option |
| 83 |
\code{rmarkdown.df_print} to \code{FALSE}. See |
| 84 |
\href{https://yihui.org/rmarkdown/html-document.html#data-frame-printing}{Data |
| 85 |
frame printing section} in bookdown book for examples.} |
| 86 |
|
| 87 |
\item{self_contained}{Produce a standalone HTML file with no external |
| 88 |
dependencies, using data: URIs to incorporate the contents of linked |
| 89 |
scripts, stylesheets, images, and videos. Note that even for self contained |
| 90 |
documents MathJax is still loaded externally (this is necessary because of |
| 91 |
its size).} |
| 92 |
|
| 93 |
\item{highlight}{Syntax highlighting style passed to Pandoc. |
| 94 |
|
| 95 |
Supported built-in styles include "default", "tango", "pygments", "kate", |
| 96 |
"monochrome", "espresso", "zenburn", "haddock", and "breezedark". |
| 97 |
|
| 98 |
Two custom styles are also included, "arrow", an accessible color scheme, |
| 99 |
and "rstudio", which mimics the default IDE theme. Alternatively, supply a |
| 100 |
path to a \samp{.theme} file to use |
| 101 |
\href{https://pandoc.org/MANUAL.html#syntax-highlighting}{a custom Pandoc |
| 102 |
style}. Note that custom theme requires Pandoc 2.0+. |
| 103 |
|
| 104 |
Pass \code{NULL} to prevent syntax highlighting.} |
| 105 |
|
| 106 |
\item{math_method}{Math rendering engine to use. This will define the math method to use with Pandoc. |
| 107 |
\itemize{ |
| 108 |
\item It can be a string for the engine, one of "mathjax", "mathml", "webtex", "katex", "gladtex", or "r-katex" |
| 109 |
or "default" for \code{mathjax}. |
| 110 |
\item It can be a list of |
| 111 |
\itemize{ |
| 112 |
\item \code{engine}: one of |
| 113 |
"mathjax", "mathml", "webtex", "katex", or "gladtex". |
| 114 |
\item \code{url}: A specific url to use with \code{mathjax}, \code{katex} or \code{webtex}. |
| 115 |
Note that for \code{engine = "mathjax"}, \code{url = "local"} will use a local version of MathJax (which is |
| 116 |
copied into the output directory). |
| 117 |
} |
| 118 |
} |
| 119 |
|
| 120 |
For example, |
| 121 |
|
| 122 |
\if{html}{\out{<div class="sourceCode yaml">}}\preformatted{output: |
| 123 |
html_document: |
| 124 |
math_method: |
| 125 |
engine: katex |
| 126 |
url: https://cdn.jsdelivr.net/npm/[email protected]/dist/ |
| 127 |
}\if{html}{\out{</div>}} |
| 128 |
|
| 129 |
See \href{https://pandoc.org/MANUAL.html#math-rendering-in-html}{Pandoc's Manual about Math in HTML} for the details |
| 130 |
about Pandoc supported methods. |
| 131 |
|
| 132 |
Using \code{math_method = "r-katex"} will opt-in server side rendering using |
| 133 |
KaTeX thanks to \href{https://docs.ropensci.org/katex/}{katex} R package. This is |
| 134 |
useful compared to \code{math_method = "katex"} to have no JS dependency, only a |
| 135 |
CSS dependency for styling equation.} |
| 136 |
|
| 137 |
\item{mathjax}{Include mathjax. The "default" option uses an https URL from a |
| 138 |
MathJax CDN. The "local" option uses a local version of MathJax (which is |
| 139 |
copied into the output directory). You can pass an alternate URL or pass |
| 140 |
\code{NULL} to exclude MathJax entirely.} |
| 141 |
|
| 142 |
\item{template}{Pandoc template to use for rendering. Pass "default" to use |
| 143 |
the rmarkdown package default template; pass \code{NULL} to use pandoc's |
| 144 |
built-in template; pass a path to use a custom template that you've |
| 145 |
created. See the documentation on |
| 146 |
\href{https://pandoc.org/MANUAL.html}{pandoc online documentation} for |
| 147 |
details on creating custom templates.} |
| 148 |
|
| 149 |
\item{css}{One or more css files to include.} |
| 150 |
|
| 151 |
\item{includes}{Named list of additional content to include within the |
| 152 |
document (typically created using the \code{\link{includes}} function).} |
| 153 |
|
| 154 |
\item{keep_md}{Keep the markdown file generated by knitting.} |
| 155 |
|
| 156 |
\item{lib_dir}{Directory to copy dependent HTML libraries (e.g. jquery, |
| 157 |
bootstrap, etc.) into. By default this will be the name of the document with |
| 158 |
\verb{_files} appended to it.} |
| 159 |
|
| 160 |
\item{md_extensions}{Markdown extensions to be added or removed from the |
| 161 |
default definition of R Markdown. See the \code{\link{rmarkdown_format}} for |
| 162 |
additional details.} |
| 163 |
|
| 164 |
\item{pandoc_args}{Additional command line options to pass to pandoc} |
| 165 |
|
| 166 |
\item{extra_dependencies}{A LaTeX dependency \code{latex_dependency()}, a |
| 167 |
list of LaTeX dependencies, a character vector of LaTeX package names (e.g. |
| 168 |
\code{c("framed", "hyperref")}), or a named list of LaTeX package options |
| 169 |
with the names being package names (e.g. \code{list(hyperef = |
| 170 |
c("unicode=true", "breaklinks=true"), lmodern = NULL)}). It can be used to |
| 171 |
add custom LaTeX packages to the .tex header.} |
| 172 |
|
| 173 |
\item{...}{Additional function arguments to pass to the base R Markdown HTML |
| 174 |
output formatter \code{\link{html_document_base}}} |
| 175 |
} |
| 176 |
\value{ |
| 177 |
R Markdown output format to pass to \code{\link{render}} |
| 178 |
} |
| 179 |
\description{ |
| 180 |
Format for converting from R Markdown to a slidy presentation. |
| 181 |
} |
| 182 |
\details{ |
| 183 |
See the \href{https://yihui.org/rmarkdown/slidy-presentation.html}{online |
| 184 |
documentation} for additional details on using the \code{slidy_presentation} |
| 185 |
format. |
| 186 |
|
| 187 |
For more information on markdown syntax for presentations see the |
| 188 |
\href{https://pandoc.org/MANUAL.html}{pandoc online documentation}. |
| 189 |
} |
| 190 |
\examples{ |
| 191 |
\dontrun{ |
| 192 |
library(rmarkdown) |
| 193 |
|
| 194 |
# simple invocation |
| 195 |
render("pres.Rmd", slidy_presentation()) |
| 196 |
|
| 197 |
# specify an option for incremental rendering |
| 198 |
render("pres.Rmd", slidy_presentation(incremental = TRUE)) |
| 199 |
} |
| 200 |
} |