Description Usage Arguments Examples
knit2docx
Converts Rmd to docx including some sideeffects, such as figure labelling, file renaming etc. Currently settings are rather tightly tied to the requirements of pelagic publishing. Also it is not tested on anything else than linux. Pandoc and pandoc-citeproc must be installed and in your path. It is not overly beautiful, could be more efficient and less of a hack, but does the job.
1 2 |
.fileBasename |
character. basename of .Rmd file without extension, e.g. "Chapter1". Should be preceded by a path if not in the current working directory, e.g. "FolderX/Chapter1". |
.docxFile |
optional. character. basename of output docx file. If not suplied |
.withBibliography |
logical. run pandoc with or without pandoc-citeproc, i.e. with or without resolving citatations to a bibliography |
.bibFile |
character. basename of Bibtex .bib file. Optional if equal to |
.bibStyle |
literature formatting style |
stopOnErrors |
logical. Stop if there were errors in R code. (Happens after knitr) |
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
## Copy demo files to knit2docx_demo folder
dir.create("knit2docx_demo")
file.copy(list.files(system.file("extdata/demo/", package = "knit2docx")), "knit2docx_demo", recursive = TRUE)
rlist.files("knit2docx_demo")
## Convert Rmd to docx
knit2docx("knit2docx_demo/Chapter_template")
## Open with Word:
list.files("knit2docx_demo", pattern = "docx")
## Remove demo directory
unlink("knit2docx_demo", recursive = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.