rmd2many | R Documentation |
From a single R markdown file create HTML slides, PDF slides, Word and PDF documents.
rmd2many(
x,
outputs = c("ioslides", "word"),
slide_level = 1,
css = "black",
add18 = TRUE,
pdf = TRUE,
highlight = list(word = "monochrome", ioslides = NULL, slidy = NULL, html = NULL),
params = NULL,
zip = TRUE,
...
)
x |
A character vector containing the names (no extension) of
the |
outputs |
A character vector. Specifies the output formats required.
A subset of |
slide_level |
Passed to |
css |
The argument |
add18 |
A logical scalar. If |
pdf |
A logical scalar. If |
highlight |
A named list, with names a subset of
|
params |
A list of named parameters to pass as the argument
|
zip |
A logical scalar or character vector indicating whether PDF
files should be put into a zip archive. If |
... |
Additional arguments to be passed to
|
The default setting creates, for each valid filename
in x
, the
following files
filename.html
: lecture slides in ioslides
format.
filename_slides.pdf
: a PDF document containing the content in
filename.html
.
filename.pdf
: a PDF document created from a Word document produced by
rmd2word
.
filename.docx
: a Word document.
filename18pt.docx
: a Word document. If add18 = TRUE
then a template
Word document with 18pt bold text is used.
filename.zip
: a zip file containing all the files produced.
A list containing the following components:
files |
names of all the files created. |
zips |
names of all zip files created (if |
install_otp
to install
OfficeToPDF.
rmd2word
, rmd2ioslides
,
rmd2slidy
, rmd2html
.
The accessr package page on Github.
# Create documents from example.Rmd
got_hux <- requireNamespace("huxtable", quietly = TRUE)
got_flex <- requireNamespace("flextable", quietly = TRUE)
got_pandoc <- rmarkdown::pandoc_available("1.14")
got_all <- got_hux && got_flex && got_pandoc
# This example needs packages huxtable and flextable
# We pass pdf = FALSE because OfficeToPDF is needed to convert Word to PDF
# and this is only relevant on a Windows Operating System.
#
if (got_all) {
ex_file <- system.file(package = "accessr", "examples", "example.Rmd")
file.copy(ex_file, tdir <- tempdir(check = TRUE), overwrite = TRUE)
ex_file <- list.files(tdir, pattern = "example.Rmd", full.names = TRUE)
ex_file <- sub(".Rmd", "", ex_file)
rmd2many(ex_file, params = list(hide = TRUE), pdf = FALSE, zip = TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.