convert_docx_to_rmd | R Documentation |
This function is derived from the
redoc::dedoc()
function and uses pandoc
to convert between docx and markdown.
Several options are preset to end-up with a markdown document that is in
syntax as close as possible to Rmarkdown files in RStudio.
During conversion, graphics (e.g. png, jpg) will be extracted from the docx
archive and placed in a folder ./media
and named image1
, image2
,
etcetera.
Additionally, .emf files will be converted to .png.
convert_docx_to_rmd(
from,
to = sub("docx$", "Rmd", from),
dir_media = ".",
wrap = NA,
overwrite = FALSE,
verbose = FALSE,
wd = getwd()
)
from |
The |
to |
The filename including path to write the resulting |
dir_media |
The directory to write the folder |
wrap |
The width at which to wrap text.
If |
overwrite |
Whether or not to overwrite the |
verbose |
Whether to print |
wd |
Current working directory (used to handle relative paths). |
Metadata in the page headers and footers of the docx are ignored and will thus be lost during conversion. In case the header or footer did contain important metadata, it will need to be recovered manually. Usually header information will go inside a yaml section of an Rmarkdown.
Other convert:
add_captions()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.