tex_escape

Stoner.tools.tex_escape(text: str) str[source]

Escapes spacecial text characters in a string.

Parameters:

text (str) – a plain text message

Returns:

the message escaped to appear correctly in LaTeX

From Stackoverflow <http://stackoverflow.com/questions/16259923/ how-can-i-escape-latex-special-characters-inside-django-templates>