escape_dollar: Escape dollar sign for LaTeX

View source: R/text_formatting.R

escape_dollarR Documentation

Escape dollar sign for LaTeX

Description

Escape single backslashes in front of dollar signs (for LaTeX)

Usage

escape_dollar(txt)

Arguments

txt

A character string

Details

If a dollar sign in a character string is preceded by a single backslash, escape that to make it a double-backslash. Ignore cases where the dollar sign is already preceded by multiple backslashes.

Value

A character string with escaped backslashes in front of dollar sings.

Examples

escape_dollar("$x^2$")
escape_dollar("\\$1000.00")
escape_dollar("$\\\\$1000.00")


jonathan-g/semestr documentation built on Jan. 23, 2025, 3:10 p.m.