escape_latex.latex: Escape Latex for Latex-formated Text

escape_latex.latexR Documentation

Escape Latex for Latex-formated Text

Description

Returns argument typically unmodified. Prevents accidental double-escaping of the same text.

Usage

escape_latex.latex(x, secondary = TRUE, primary = FALSE, ...)

Arguments

x

character

secondary

logical: whether secondary backslashes should be pre-doubled

primary

logical: whether first 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

character

See Also

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

Examples

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


tablet documentation built on July 19, 2026, 9:06 a.m.