Escapes LaTeX reserved characters as suggested by https://en.wikibooks.org/wiki/LaTeX/Basics#Reserved_Characters.
# S3 method for character
reserve(
x,
target = c("#", "$", "%", "^", "&", "_", "{", "}", "~", "\\"),
replacement = c("\\#", "\\$", "\\%", "\\^{}", "\\&", "\\_", "\\{",
"\\}", "\\~{}", "\\textbackslash{}"),
...
)
character
sequence to find (regular expression unless fixed is false)
sequence to use
passed arguments
Other reserve:
reserve.data.frame()
,
reserve.default()
,
reserve.factor()
,
reserve.list()
,
reserve()