| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/word_document.R |
| 3 |
\name{word_document} |
| 4 |
\alias{word_document} |
| 5 |
\title{Convert to an MS Word document} |
| 6 |
\usage{ |
| 7 |
word_document( |
| 8 |
toc = FALSE, |
| 9 |
toc_depth = 3, |
| 10 |
number_sections = FALSE, |
| 11 |
fig_width = 5, |
| 12 |
fig_height = 4, |
| 13 |
fig_caption = TRUE, |
| 14 |
df_print = "default", |
| 15 |
highlight = "default", |
| 16 |
reference_docx = "default", |
| 17 |
keep_md = FALSE, |
| 18 |
md_extensions = NULL, |
| 19 |
pandoc_args = NULL |
| 20 |
) |
| 21 |
} |
| 22 |
\arguments{ |
| 23 |
\item{toc}{\code{TRUE} to include a table of contents in the output} |
| 24 |
|
| 25 |
\item{toc_depth}{Depth of headers to include in table of contents} |
| 26 |
|
| 27 |
\item{number_sections}{\code{TRUE} to number section headings} |
| 28 |
|
| 29 |
\item{fig_width}{Default width (in inches) for figures} |
| 30 |
|
| 31 |
\item{fig_height}{Default height (in inches) for figures} |
| 32 |
|
| 33 |
\item{fig_caption}{\code{TRUE} to render figures with captions} |
| 34 |
|
| 35 |
\item{df_print}{Method to be used for printing data frames. Valid values |
| 36 |
include "default", "kable", "tibble", and "paged". The "default" method |
| 37 |
uses a corresponding S3 method of \code{print}, typically |
| 38 |
\code{print.data.frame}. The "kable" method uses the |
| 39 |
\code{\link[knitr:kable]{knitr::kable}} function. The "tibble" method uses |
| 40 |
the \pkg{tibble} package to print a summary of the data frame. The "paged" |
| 41 |
method creates a paginated HTML table (note that this method is only valid |
| 42 |
for formats that produce HTML). In addition to the named methods you can |
| 43 |
also pass an arbitrary function to be used for printing data frames. You |
| 44 |
can disable the \code{df_print} behavior entirely by setting the option |
| 45 |
\code{rmarkdown.df_print} to \code{FALSE}. See |
| 46 |
\href{https://yihui.org/rmarkdown/html-document.html#data-frame-printing}{Data |
| 47 |
frame printing section} in bookdown book for examples.} |
| 48 |
|
| 49 |
\item{highlight}{Syntax highlighting style passed to Pandoc. |
| 50 |
|
| 51 |
Supported built-in styles include "default", "tango", "pygments", "kate", |
| 52 |
"monochrome", "espresso", "zenburn", "haddock", and "breezedark". |
| 53 |
|
| 54 |
Two custom styles are also included, "arrow", an accessible color scheme, |
| 55 |
and "rstudio", which mimics the default IDE theme. Alternatively, supply a |
| 56 |
path to a \samp{.theme} file to use |
| 57 |
\href{https://pandoc.org/MANUAL.html#syntax-highlighting}{a custom Pandoc |
| 58 |
style}. Note that custom theme requires Pandoc 2.0+. |
| 59 |
|
| 60 |
Pass \code{NULL} to prevent syntax highlighting.} |
| 61 |
|
| 62 |
\item{reference_docx}{Use the specified file as a style reference in |
| 63 |
producing a docx file. For best results, the reference docx should be a |
| 64 |
modified version of a docx file produced using pandoc. Pass "default" |
| 65 |
to use the rmarkdown default styles.} |
| 66 |
|
| 67 |
\item{keep_md}{Keep the markdown file generated by knitting.} |
| 68 |
|
| 69 |
\item{md_extensions}{Markdown extensions to be added or removed from the |
| 70 |
default definition of R Markdown. See the \code{\link{rmarkdown_format}} for |
| 71 |
additional details.} |
| 72 |
|
| 73 |
\item{pandoc_args}{Additional command line options to pass to pandoc} |
| 74 |
} |
| 75 |
\value{ |
| 76 |
R Markdown output format to pass to \code{\link{render}} |
| 77 |
} |
| 78 |
\description{ |
| 79 |
Format for converting from R Markdown to an MS Word document. |
| 80 |
} |
| 81 |
\details{ |
| 82 |
See the \href{https://yihui.org/rmarkdown/word-document.html}{online |
| 83 |
documentation} for additional details on using the \code{word_document} format. |
| 84 |
|
| 85 |
R Markdown documents can have optional metadata that is used to generate a |
| 86 |
document header that includes the title, author, and date. For more details |
| 87 |
see the documentation on R Markdown \link[=rmd_metadata]{metadata}. |
| 88 |
|
| 89 |
R Markdown documents also support citations. You can find more information on |
| 90 |
the markdown syntax for citations in the |
| 91 |
\href{https://pandoc.org/MANUAL.html#citations}{Bibliographies |
| 92 |
and Citations} article in the online documentation. |
| 93 |
} |
| 94 |
\examples{ |
| 95 |
\dontrun{ |
| 96 |
library(rmarkdown) |
| 97 |
|
| 98 |
# simple invocation |
| 99 |
render("input.Rmd", word_document()) |
| 100 |
|
| 101 |
# specify an option for syntax highlighting |
| 102 |
render("input.Rmd", word_document(highlight = "zenburn")) |
| 103 |
} |
| 104 |
} |