rxn.utilities.strings.escape_latex

rxn.utilities.strings.escape_latex(text)[source]

Escape special LaTex characters in a string.

Adapted from https://stackoverflow.com/a/25875504.

Example: will convert “30%” to “30%”.

Parameters

text (str) – string to escape.

Return type

str

Returns

The message escaped to appear correctly in LaTeX.