html_format: Output formats in YAML metadata

View source: R/format.R

html_formatR Documentation

Output formats in YAML metadata

Description

The primary output formats of litedown are HTML and LaTeX. These output formats can be configured in the output field of the YAML metadata of the Markdown document.

Usage

html_format(options = NULL, meta = NULL, template = NULL, keep_md = FALSE)

latex_format(
  options = NULL,
  meta = NULL,
  template = NULL,
  keep_md = FALSE,
  keep_tex = FALSE,
  latex_engine = "xelatex",
  citation_package = "natbib"
)

Arguments

meta, options

Arguments to be passed to mark().

template

A template file path.

keep_md, keep_tex

Whether to keep the intermediate ‘.md’ and ‘.tex’ files generated from ‘.Rmd’.

latex_engine

The LaTeX engine to compile ‘.tex’ to ‘.pdf’.

citation_package

The LaTeX package for processing citations. Possible values are none, natbib, and biblatex.

Details

The output format functions have two purposes. The main purpose is to make it possible (and easier) to configure the output formats using YAML metadata inside a document, e.g.,

---
output:
  litedown::html_format:
    options:
      toc: true
    keep_md: true
  litedown::latex_format:
    latex_engine: pdflatex
---

The secondary purpose is for rmarkdown users to render R Markdown via knitr::knit() and mark() (instead of Pandoc), and also use the Knit button in RStudio. Although you can render R Markdown to Markdown via either knitr::knit() or fuse(), please note that the two ways are not 100% compatible with each other. If you choose to use litedown, we recommend that you use fuse() instead. If you want fuse() to work with the Knit button in RStudio, you have to add a special field to YAML:

---
knit: litedown:::knit
---

Without this field, RStudio will use knitr to render R Markdown.

Value

An R Markdown output format.


litedown documentation built on Oct. 17, 2024, 1:06 a.m.