Skip to contents

Fetch a single named option from the active ksTFL settings. This is a convenience wrapper around tfl_get_options() that returns one element or throws a friendly error if the option does not exist.

Usage

tfl_get_option(name)

Arguments

name

Character(1). Name of the option to fetch. Common options: "page", "styles", "footnotePlace", "isContinues", "contentWidth", "missings", "autoColWidth", "minColWidth", "insertTOC", "tocTitle", "output_directory", "meta_directory".

Value

The value associated with name (type depends on the option).

Examples

# Get the current page settings (NULL until set via set_page_style/options)
tfl_get_option("page")
#> NULL

# Check whether TOC generation is enabled
tfl_get_option("insertTOC")
#> [1] FALSE
tfl_get_option("tocTitle")
#> [1] "Table of Contents"

# An unknown option name errors with a friendly message
if (FALSE)  tfl_get_option("nonexistent_option")  # \dontrun{}