listings – Typeset source code listings using LaTeX
Typeset programs (programming code) within LaTeX. The source code is read directly by TeX. Keywords, comments and strings can be typeset using different styles (default is bold for keywords, italic for comments and no special style for strings). Includes support for hyperref. To use, simply \usepackage{listings}, identify the language with \lstset{language=Python}, then employ the \begin{lstlisting} ... \end{lstlisting} environment or the \lstinputlisting{filename.py} command. Short (in-line) listings are also available, using either \lstinline|...| or | ... | (after defining the | token with the \lstMakeShortInline command).
| CTAN path | /macros/latex/contrib/listings |
|---|---|
| Documentation |
Package Readme Package documentation |
| Version | 1.4 |
| License | The LaTeX Project Public License |
| Copyright | 2006,2007 Brooks Moses |
| Maintainer | Brooks Moses Carsten Heinz (inactive) |
| Contained in | TeXLive as listings |
| MiKTeX as listings | |
| Topics |
code listing, syntax highlighting highlight syntax of computer code, etc. |
| See also |
listing |
