doc2doc: Convert tex/markdown/html to docx/tex/html

Description Usage Arguments Details Note Examples

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
tex2docx(in.file = NULL, out.file = NULL, path = QP(),
  bib.loc = getOption("bib.loc"))

tex2html(in.file = NULL, out.file = NULL, path = QP(),
  bib.loc = getOption("bib.loc"))

md2docx(in.file = NULL, out.file = NULL, path = QP(),
  bib.loc = getOption("bib.loc"))

md2html(in.file = NULL, out.file = NULL, path = QP(),
  bib.loc = getOption("bib.loc"))

md2tex(in.file = NULL, out.file = NULL, path = QP(),
  bib.loc = getOption("bib.loc"))

md2pdf(in.file = NULL, out.file = NULL, path = QP(),
  bib.loc = getOption("bib.loc"))

html2pdf(in.file = NULL, out.file = NULL, path = QP(),
  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.

Details

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

Note

md2docx, md2tex and md2pdf converts markdown (a .md file) not Rmarkdown (.Rmd). Use knitr to knit to HTML first (this creates the .md file).

Examples

1
2
3
4
5
6
7
## 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)

trinker/reports documentation built on May 31, 2019, 9:51 p.m.