sanitize: Escape text for various formats

View source: R/misc.R

sanitizeR Documentation

Escape text for various formats

Description

This escapes a string for LaTeX, HTML, Typst or RTF.

Usage

sanitize(str, type = c("latex", "html", "typst", "rtf"))

Arguments

str

A character object.

type

"latex", "html", "typst" or "rtf".

Details

HTML and LaTeX code was copied over from xtable::sanitize().

Value

The sanitized character object.

Examples

txt <- "Make $$$ with us"
sanitize(txt, type = "latex")

huxtable documentation built on Aug. 19, 2025, 1:12 a.m.