html_format: Output formats in YAML metadata

View source: R/format.R

html_formatR Documentation

Output formats in YAML metadata

Description

These functions exist only for historical reasons, and should never be called directly. They can be used to configure output formats in YAML, but you are recommended to use the file format names instead of these function names.

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

To configure output formats in the YAML metadata of the Markdown document, simply use the output format names such as html or latex in the output field in YAML, e.g.,

---
output:
  html:
    options:
      toc: true
    keep_md: true
  latex:
    latex_engine: pdflatex
---

You can also use litedown::html_format instead of html (or litedown::latex_format instead of latex) if you like.

Note

If you want to use the Knit button in RStudio, you must add a top-level field knit: litedown:::knit to the YAML metadata. See https://yihui.org/litedown/#sec:knit-button for more information.


litedown documentation built on April 12, 2025, 1:34 a.m.