multi_document: Formatter wrapper for 'rmarkdown::html_document' to...

multi_documentR Documentation

Formatter wrapper for rmarkdown::html_document to facilitate multiple output format porting.

Description

This function produces a markdown file suitable for rendering as a stylized, standalone HTML document tailored for academic and technical reports, as well as alternative output formats. Available formats include PDF, EPUB and DOCX.

The DOCX format is an adaptation of the docx_document processor which allows for seamless integration for importing html-documents in the MS Word .docx-format. The advantage of html documents is the ability to create advanced formatting frequently needed in medical publications and that is available in the htmlTable function. You can view the series for more details regarding how to achieve fast-track-publishing (ftp) together with knitr.

Usage

multi_document(
  ...,
  number_sections = TRUE,
  number_section_depth=3,
  toc = TRUE,
  toc_depth = 2,
  self_contained = TRUE,
  dev = "png",
  literasee_template = "sgp_report",
  html_template = "default",
  css = "default",
  bibliography = "default",
  csl = "default",
  md_extensions=NULL,
  pandoc_args = NULL)

Arguments

...

Passed onto html_document.

number_sections

Boolean. Should sections, subsections, and subsubsections be numbered. Default TRUE

number_section_depth

Numeric. Depth of headers to include in section numbering. Default is 3 (subsubsections).

toc

Boolean. TRUE to include a table of contents in the output

toc_depth

Numeric. Depth of headers to include in table of contents. Default is 2 (subsections).

self_contained

Produce a standalone HTML file with no external dependencies, using data: URIs to incorporate the contents of linked scripts, stylesheets, images, and videos.

dev

Graphics device to use for figure output (defaults to png).

literasee_template

Name of Literasee package style template to use for rendering. Default is ‘sgp_report’ (currently the only option available). Located at system.file('rmarkdown', 'templates', 'sgp_report', 'resources', package = 'Literasee'). Note that alternative templates must adopt the same naming conventions (‘html_report.html’, ‘pdf_report.tex’, etc).

html_template

Pandoc HTML template to use for rendering. Pass "default" to use the Literasee package default template. Note that if you do not use the default template then the features of multi_document will not be available.

css

The CSS if other that the default within the package.

bibliography

The LaTeX style bibliography file (.bib, .bibtex, etc.) to include. The default file included in the package includes references often used by the author and will likely be insufficient for most users.

csl

The CSL (citation style language) to use to format bibliography (if included). Defaults to APA 5th edition. See this Github repository for alternatives. If NULL pandoc defaults will be used.

md_extensions

Markdown extensions to be added or removed from the default definition or R Markdown.

pandoc_args

Additional command line options to pass to pandoc

Value

R Markdown output format to pass to render

Examples

## Not run: 
## Produce HTML document from My_Report.Rmd

  render("My_Report.Rmd",
      multi_document(pandoc_args = "--webtex"))


## End(Not run)

CenterForAssessment/Literasee documentation built on July 2, 2023, 6:21 p.m.