Description
This function calls Pandoc to convert documents to other formats such asHTML, LaTeX/PDF and Word, etc, (optionally) based on a configuration file orin-file configurations which specify the options to use for Pandoc.
Usage
Batch file to convert HTML files to Word docx with Pandoc Raw. Html2docx.bat:: This batch file converts HTML files in a folder to docx.:: It requires Pandoc, and a list of files to convert:: named file-list, in which each file is on a separate line,::.
I use Pandoc to convert a tex file to docx. I used the following commandpandoc -s foo.tex -bibliography=foo.bib -o foo.docxBut in the output word document, citation are in format of (author da. I was preparing a journal article for a medical journal, and the only formats they accepted were Word DOC and RTF. Oh the horror of having to use Word to write a journal paper I was horrified.
Arguments
A character vector of Markdown filenames (must be encoded inUTF-8).

Name of the output format (see References). This can be acharacter vector of multiple formats; by default, it is obtained from thet field in the configuration. If the configuration is empty or thet field is not found, the default output format will be'html'.
Path to the Pandoc configuration file. If missing, it isassumed to be a file with the same base name as the input file andan extension .pandoc (e.g. for foo.md it looks forfoo.pandoc)
Filename extensions. By default, the extension is inferred fromthe format, e.g. latex creates pdf, dzslidescreates html, and so on
Value
The output filename(s) (or an error if the conversion failed).

Details
There are two ways to input the Pandoc configurations -- through a configfile, or embed the configurations in the input file as special commentsbetween <!--pandoc and -->.
The configuration file is a DCF file (see read.dcf). This filemust contain a field named t which means the output format. Theconfigurations are written in the form of tag:value and passed toPandoc (if no value is needed, just leave it empty, e.g. the optionstandalone or s for short). If there are multiple outputformats, write each format and relevant configurations in a block, andseparate blocks with blank lines.
If there are multiple records of the t field in the configuration, theinput markdown file will be converted to all these formats by default, unlessthe format argument is specified as one single format.
References
Pandoc: https://pandoc.org; Examples and rules of the configurations: https://yihui.org/knitr/demo/pandoc/
Also see R Markdown (v2) at https://rmarkdown.rstudio.com. The rmarkdown package has several convenience functions and templates that make it very easy to use Pandoc. The RStudio IDE also has comprehensive support for it, so I'd recommend users who are not familiar with command-line tools to use the rmarkdown package instead.
See Also
Pandoc Html To Word Free
Examples
