render_pdf | R Documentation |
Auto-edit Rmd to make it more suitable for LaTeX, and create PDF
render_pdf(
infile,
herePath = "Rmd/",
keep = FALSE,
render = TRUE,
output_file = NULL,
keep_tex = FALSE,
custom_removal = NULL,
include = includes(in_header = "parahdr.tex"),
toc = TRUE,
toc_depth = 3,
number_sections = TRUE,
cleanup_ask = FALSE
)
infile |
String giving the name of the input file, without the path and (optionally) without the file extension. |
herePath |
String to pass to |
keep |
Whether to keep the temporary Rmd file produced. Defaults to
|
render |
Whether to render the PDF. Defaults to |
output_file |
String, giving the name of the output file. If not given,
the default behaviour of |
keep_tex |
Passed to |
custom_removal |
Optional string to be replaced with an empty string. |
include |
Defaults to |
toc , toc_depth , number_sections |
Passed to |
cleanup_ask |
Whether to ask before removing temporary files. Defaults
to |
The function assumes your deepest heading is 5 or lower, and that the level 1 heading is abused by being used to create a top level tabset in the HTML output. The code is simple and will likely break at times.
Invisibly, a character vector containing hte modified Rmd.
The function replaces all instances of "# " with " ", the idea being
that for section headings, or those that are written by cat statements,
one hash is removed. This also means that any comments will need to be
started with more than one hash or they will be uncommented. In principle
we should be able to use rmarkdown::render(..., output_format = "all")
.
However, accurately picking up the output format seems to not always work
or be picked up by some of the other functions, such as output_table
.
theFormat <- "html"; render("doc")
theFormat <- "pdf"; render("doc")
theFormat <- "word"; render("doc")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.