summaryrefslogtreecommitdiff
path: root/pygments/formatters/latex.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/formatters/latex.py')
-rw-r--r--pygments/formatters/latex.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pygments/formatters/latex.py b/pygments/formatters/latex.py
index fe2aa2d0..6d9f9e02 100644
--- a/pygments/formatters/latex.py
+++ b/pygments/formatters/latex.py
@@ -28,7 +28,8 @@ def escape_tex(text, commandprefix):
replace('_', r'\%sZus{}' % commandprefix). \
replace('#', r'\%sZsh{}' % commandprefix). \
replace('%', r'\%sZpc{}' % commandprefix). \
- replace('$', r'\%sZdl{}' % commandprefix)
+ replace('$', r'\%sZdl{}' % commandprefix). \
+ replace('~', r'\%sZti{}' % commandprefix)
DOC_TEMPLATE = r'''
@@ -108,6 +109,7 @@ STYLE_TEMPLATE = r'''
\def\%(cp)sZsh{\char`\#}
\def\%(cp)sZpc{\char`\%%}
\def\%(cp)sZdl{\char`\$}
+\def\%(cp)sZti{\char`\~}
%% for compatibility with earlier versions
\def\%(cp)sZat{@}
\def\%(cp)sZlb{[}