Format for converting from R Markdown to a PHS report in MS Word document format.
This is an extension of the word_document
format that adds post-processing
to include the front cover and table of contents for the report.
Usage
phs_report_docx(
toc = FALSE,
toc_depth = 3,
number_sections = FALSE,
fig_width = 5,
fig_height = 4,
fig_caption = TRUE,
df_print = "default",
highlight = "default",
reference_docx = "default",
keep_md = FALSE,
md_extensions = NULL,
pandoc_args = NULL,
cover_page = NULL,
cover_title = "Title",
cover_subtitle = "Subtitle",
cover_date = "DD Month YYYY"
)
Arguments
- toc
TRUE
to include a table of contents in the output- toc_depth
Depth of headers to include in table of contents
- number_sections
TRUE
to number section headings- fig_width
Default width (in inches) for figures
- fig_height
Default height (in inches) for figures
TRUE
to render figures with captions- df_print
Method to be used for printing data frames. Valid values include "default", "kable", "tibble", and "paged". The "default" method uses a corresponding S3 method of
print
, typicallyprint.data.frame
. The "kable" method uses theknitr::kable
function. The "tibble" method uses the tibble package to print a summary of the data frame. The "paged" method creates a paginated HTML table (note that this method is only valid for formats that produce HTML). In addition to the named methods you can also pass an arbitrary function to be used for printing data frames. You can disable thedf_print
behavior entirely by setting the optionrmarkdown.df_print
toFALSE
. See Data frame printing section in bookdown book for examples.- highlight
Syntax highlighting style passed to Pandoc.
Supported built-in styles include "default", "tango", "pygments", "kate", "monochrome", "espresso", "zenburn", "haddock", and "breezedark".
Two custom styles are also included, "arrow", an accessible color scheme, and "rstudio", which mimics the default IDE theme. Alternatively, supply a path to a .theme file to use a custom Pandoc style. Note that custom theme requires Pandoc 2.0+.
Pass
NULL
to prevent syntax highlighting.- reference_docx
Use the specified file as a style reference in producing a docx file. For best results, the reference docx should be a modified version of a docx file produced using pandoc. Pass "default" to use the rmarkdown default styles.
- keep_md
Keep the markdown file generated by knitting.
- md_extensions
Markdown extensions to be added or removed from the default definition of R Markdown. See the
rmarkdown_format
for additional details.- pandoc_args
Additional command line options to pass to pandoc
- cover_page
Cover page document file name.
- cover_title
Title to be used in the cover page.
- cover_subtitle
Subtitle to be used in the cover page.
- cover_date
Date to be used in the cover page.
Value
R Markdown output format to pass to render
Details
See the online
documentation for additional details on using the word_document
format.
R Markdown documents can have optional metadata that is used to generate a document header that includes the title, author, and date. For more details see the documentation on R Markdown metadata.
R Markdown documents also support citations. You can find more information on the markdown syntax for citations in the Bibliographies and Citations article in the online documentation.
Examples
if (FALSE) { # \dontrun{
library(rmarkdown)
library(phstemplates)
render("input.Rmd", phs_report_docx())
} # }