Based on xtable::sanitize().

ys_sanitize(x)

ys_dont_sanitize(x)

ys_mild_sanitize(x)

Arguments

x

text to sanitize

Examples

ys_sanitize("Concentration ($\\mu$g)")
#> [1] "Concentration ($\\mu$g)"
ys_sanitize("H&M")
#> [1] "H\\&M"