R/convert_docx.R
convert_docx_to_rmd.Rd
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.
The .docx
file to convert.
Can be given as an absolute or relative path.
The filename including path to write the resulting .Rmd
file.
The default is to use the same name and path as the .docx
document.
The directory to write the folder media
with images to,
relative to the folder where the .Rmd
is written.
Defaults to '.' (the path where the .Rmd
file is written).
The width at which to wrap text.
If NA
(default), text is not wrapped.
Whether or not to overwrite the to
file if it already
existed.
Defaults to FALSE
.
Whether to print pandoc
progress text.
Defaults to FALSE
.
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()