Skip to contents

Allows programmatic creation of a Pandoc ATX-style header with attributes. The currently supported set of Pandoc header attributes is: explicit identifier, numbered-unnumbered, listed-unlisted.

Usage

pandoc_header(text, level = 1, identifier = NA, number = TRUE, list = TRUE)

Arguments

text

character; Text of the header.

level

integer; Level of the header.

identifier

character; Text used for specifying an explicit anchor link.

number

logical; Should the header be numbered or unnumbered? Default to TRUE (numbered).

list

logical; Should heading be included in the table of contents? Default to TRUE (listed).

Value

None (invisible NULL). Returns the Pandoc ATX-style header using the `cat` function.

Details

[`pandoc` extension-header_attributes](https://pandoc.org/MANUAL.html#extension-header_attributes)

Examples

pandoc_header("TR-001", 2)
#> 
#> ## TR-001 {}