ThirdParty/Pygments/pygments/formatters/latex.py

changeset 2426
da76c71624de
parent 1705
b0fbc9300f2b
child 2525
8b507a9a2d40
equal deleted inserted replaced
2425:ace8a08028f3 2426:da76c71624de
3 pygments.formatters.latex 3 pygments.formatters.latex
4 ~~~~~~~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~~~~~~~
5 5
6 Formatter for LaTeX fancyvrb output. 6 Formatter for LaTeX fancyvrb output.
7 7
8 :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. 8 :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
9 :license: BSD, see LICENSE for details. 9 :license: BSD, see LICENSE for details.
10 """ 10 """
11 11
12 from pygments.formatter import Formatter 12 from pygments.formatter import Formatter
13 from pygments.token import Token, STANDARD_TYPES 13 from pygments.token import Token, STANDARD_TYPES
30 replace('<', r'\%sZlt{}' % commandprefix). \ 30 replace('<', r'\%sZlt{}' % commandprefix). \
31 replace('>', r'\%sZgt{}' % commandprefix). \ 31 replace('>', r'\%sZgt{}' % commandprefix). \
32 replace('#', r'\%sZsh{}' % commandprefix). \ 32 replace('#', r'\%sZsh{}' % commandprefix). \
33 replace('%', r'\%sZpc{}' % commandprefix). \ 33 replace('%', r'\%sZpc{}' % commandprefix). \
34 replace('$', r'\%sZdl{}' % commandprefix). \ 34 replace('$', r'\%sZdl{}' % commandprefix). \
35 replace('-', r'\%sZhy{}' % commandprefix). \
36 replace("'", r'\%sZsq{}' % commandprefix). \
37 replace('"', r'\%sZdq{}' % commandprefix). \
35 replace('~', r'\%sZti{}' % commandprefix) 38 replace('~', r'\%sZti{}' % commandprefix)
36 39
37 40
38 DOC_TEMPLATE = r''' 41 DOC_TEMPLATE = r'''
39 \documentclass{%(docclass)s} 42 \documentclass{%(docclass)s}
113 \def\%(cp)sZlt{\char`\<} 116 \def\%(cp)sZlt{\char`\<}
114 \def\%(cp)sZgt{\char`\>} 117 \def\%(cp)sZgt{\char`\>}
115 \def\%(cp)sZsh{\char`\#} 118 \def\%(cp)sZsh{\char`\#}
116 \def\%(cp)sZpc{\char`\%%} 119 \def\%(cp)sZpc{\char`\%%}
117 \def\%(cp)sZdl{\char`\$} 120 \def\%(cp)sZdl{\char`\$}
121 \def\%(cp)sZhy{\char`\-}
122 \def\%(cp)sZsq{\char`\'}
123 \def\%(cp)sZdq{\char`\"}
118 \def\%(cp)sZti{\char`\~} 124 \def\%(cp)sZti{\char`\~}
119 %% for compatibility with earlier versions 125 %% for compatibility with earlier versions
120 \def\%(cp)sZat{@} 126 \def\%(cp)sZat{@}
121 \def\%(cp)sZlb{[} 127 \def\%(cp)sZlb{[}
122 \def\%(cp)sZrb{]} 128 \def\%(cp)sZrb{]}

eric ide

mercurial