Learn R Programming

pagedown (version 0.9)

html_paged: Create a paged HTML document suitable for printing

Description

This is an output format based on bookdown::html_document2 (which means you can use those Markdown features added by bookdown). The HTML output document is split into multiple pages via a JavaScript library paged.js. These pages contain elements commonly seen in PDF documents, such as page numbers and running headers.

Usage

html_paged(
  ...,
  css = c("default-fonts", "default-page", "default"),
  theme = NULL,
  template = pkg_resource("html", "paged.html"),
  csl = NULL,
  front_cover = NULL,
  back_cover = NULL
)

Arguments

...

Arguments passed to bookdown::html_document2.

css

A character vector of CSS file paths. If a path does not contain the .css extension, it is assumed to be a built-in CSS file. For example, default-fonts means the file pagedown:::pkg_resource('css', 'default-fonts.css'). To see all built-in CSS files, run pagedown:::list_css().

theme

The Bootstrap theme. By default, Bootstrap is not used.

template

The path to the Pandoc template to convert Markdown to HTML.

csl

The path of the Citation Style Language (CSL) file used to format citations and references (see the Pandoc documentation).

front_cover, back_cover

Paths or urls to image files to be used as front or back covers. Theses images are available through CSS variables (see Details).

Value

An R Markdown output format.

Details

When a path or an url is passed to the front_cover or back_cover argument, several CSS variables are created. They are named --front-cover and --back-cover and can be used as value for the CSS property background-image. For example, background-image: var(--front-cover);. When a vector of paths or urls is used as a value for front_cover or back_cover, the CSS variables are suffixed with an index: --front-cover-1, --front-cover-2, etc.

References

https://pagedown.rbind.io