diff options
author | Georg Brandl <georg@python.org> | 2010-08-22 15:21:36 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-08-22 15:21:36 +0200 |
commit | df70fb4e044a668758619c3a2c31dfc52aa9ca34 (patch) | |
tree | 11617a56a1c1d6cd67ed745a7de348ab3cd5b3af | |
parent | c0f5f5f8b8fec1314571e864955194ffc9ba55d6 (diff) | |
download | pygments-df70fb4e044a668758619c3a2c31dfc52aa9ca34.tar.gz |
Escape the tilde as well.
-rw-r--r-- | pygments/formatters/latex.py | 4 |
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{[} |