Formatter for LaTeX fancyvrb output.
copyright: | Copyright 2006-2013 by the Pygments team, see AUTHORS. |
---|---|
license: | BSD, see LICENSE for details. |
Format tokens as LaTeX code. This needs the fancyvrb and color standard packages.
Without the full option, code is formatted as one Verbatim environment, like this:
\begin{Verbatim}[commandchars=\\{\}]
\PY{k}{def }\PY{n+nf}{foo}(\PY{n}{bar}):
\PY{k}{pass}
\end{Verbatim}
The special command used here (\PY) and all the other macros it needs are output by the get_style_defs method.
With the full option, a complete LaTeX document is output, including the command definitions in the preamble.
The get_style_defs() method of a LatexFormatter returns a string containing \def commands defining the macros needed inside the Verbatim environments.
Additional options accepted:
The LaTeX commands used to produce colored output are constructed using this prefix and some letters (default: 'PY'). New in Pygments 0.7.
New in Pygments 0.10: the default is now 'PY' instead of 'C'.