Learn R Programming

kableExtra (version 1.4.0)

use_latex_packages: 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()

Arguments

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

Run this code
use_latex_packages()

Run the code above in your browser using DataLab