escape_latex.default: Escape Special Characters for Latex by Default

escape_latex.defaultR Documentation

Escape Special Characters for Latex by Default

Description

Escapes text characters that have special meaning in latex. Adapted with gratitude from KableExtra internals. I.e. inactivates material that otherwise looks like latex.

Usage

## Default S3 method:
escape_latex(x, secondary = TRUE, ...)

Arguments

x

typically inherits character

secondary

logical: whether secondary backslashes should be pre-doubled

...

ignored

Details

This function is used in as_kable.tablet in preparation for a call to kbl. At kableExtra 1.3.4, sim_double_escape() only doubles primary (leading) backslashes; the secondary argument by default pre-doubles later backslashes to prevent certain display errors. Behavior may change if kableExtra changes.

Value

latex

See Also

Other escape: escape_latex.latex(), escape_latex()

Examples

escape_latex('([#$%&_{}])')

tablet documentation built on April 30, 2022, 1:07 a.m.