mdweave_to_pdf | R Documentation |
Run the code in a markdown file and generate a new document
mdweave_to_pdf(
fn,
ofn = file_subs_ext(basename(fn), ".pdf", FALSE),
extra_arguments2 = "--self-contained",
run_in_temp = TRUE,
cmd2 = "pandoc %3$s -s \"%1$s\" -t latex -o \"%2$s\"",
...
)
mdweave_to_tex(
fn,
ofn = file_subs_ext(basename(fn), ".tex", FALSE),
extra_arguments2 = "--self-contained",
run_in_temp = TRUE,
cmd2 = "pandoc %3$s -s \"%1$s\" -t latex -o \"%2$s\"",
...
)
mdweave_to_html(
fn,
ofn = file_subs_ext(basename(fn), ".html", FALSE),
extra_arguments2 = "--self-contained",
run_in_temp = TRUE,
cmd2 = "pandoc %3$s -s \"%1$s\" -t html -o \"%2$s\"",
...
)
fn |
filename of the markdown file (should use pandoc markdown). |
ofn |
name of the resulting file. |
extra_arguments2 |
extra arguments passed on to pandoc. Should be a length 1 character vector. |
run_in_temp |
When TRUE the intermediary markdown file and generated figures (when not using custom paths) are created in a temporary directory. Otherwise these will be generated in the same directory as the output file. |
cmd2 |
command used to run pandoc. See details. |
... |
additional arguments are passed on to |
These functions first call mdweave
to run the code in the original
file and convert the original markdown file to a new markdown file. This second
markdown file is then converted to the desired output format using a second run
of pandoc
.
In case of converting to pdf the file is required to have the extension
.pdf
. In case of converting to LaTeX, the file cannot have the extension
.pdf
. That is because in both cases the file is first converted to
LaTeX. In case of a file with the extension .pdf
the file is than
further converted to PDF.
Returns the name of the resulting outout file.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.