use_latex_packages: Declare LaTeX packages needed by kableExtra

View source: R/util.R

use_latex_packagesR Documentation

Declare LaTeX packages needed by kableExtra

Description

Declares all of the LaTeX packages that may be used by kableExtra functions so that they will be loaded when the document is produced.

Usage

use_latex_packages()

Details

When kableExtra loads, it calls this function if it detects that knitr is running and producing LaTeX output. However, sometimes kableExtra is loaded before knitr runs, and then these packages can end up being missed, leading to LaTeX errors such as "Undefined control sequence." (See Github issue #721 for an example.)

Our kbl() wrapper for knitr::kable() calls this function for LaTeX output, so an explicit call is not necessary.

Examples

use_latex_packages()

haozhu233/kableExtra documentation built on April 13, 2024, 6:49 p.m.