Convert tex/markdown to docx/tex/html

Usage

tex2docx(in.file = NULL, out.file = NULL, path = paste0(getwd(), "/REPORT"), bib.loc = getOption("bib.loc"))

tex2html(in.file = NULL, out.file = NULL, path = paste0(getwd(), "/REPORT"), bib.loc = getOption("bib.loc"))

md2docx(in.file = NULL, out.file = NULL, path = paste0(getwd(), "/REPORT"), bib.loc = getOption("bib.loc"))

md2tex(in.file = NULL, out.file = NULL, path = paste0(getwd(), "/REPORT"), bib.loc = getOption("bib.loc"))

Arguments

in.file
A character vector of the tex/md file.
out.file
A character vector of the outfile. If "replace" over writes the original HTML file. Default, NULL, uses the root name of the in.file plus a number 2.
path
The path to where the documents reside/should be created. Default is the REPORT directory. This conveniently allows for non paths to be supplied to in.file and out.file (i.e., just the file names). Paths can be supplied to in.file and out.file by setting path to NULL.
bib.loc
Optional path to a .bib resource.

Description

Use http://johnmacfarlane.net/pandoc/ to convert tex/markdown to docx for those colleagues who use docx.

Details

The user must have pandoc installed and on their path. pandoc can be installed from: http://johnmacfarlane.net/pandoc/installing.html

Note

md2docx converts markdown (a .md file) not Rmarkdown (.Rmd). Use knitr to knit to HTML first.

Examples

## Not run: # DOC <- system.file("extdata/doc_library/apa6.qual_tex/doc.tex",# package = "reports")# BIB <- system.file("extdata/docs/example.bib", package = "reports")# tex2docx(DOC, file.path(getwd(), "test.docx"), path = NULL, bib.loc = BIB)# ## End(Not run)