Learn R Programming

reports (version 0.1.4)

tex2docx: Convert tex to docx

Description

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

Usage

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

Arguments

in.file
A character vector of the 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. Paths can be supplied to in.file and out.file by setting path to NULL.
bib.loc
Optional path to a .bib resource.

Details

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

Examples

Run this code
## 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)

Run the code above in your browser using DataLab