CTAN Comprehensive TeX Archive Network

listings – Typeset source code listings using

The package enables the user to typeset programs (programming code) within ; the source code is read directly by —no front-end processor is needed. Keywords, comments and strings can be typeset using different styles (default is bold for keywords, italic for comments and no special style for strings). Support for hyperref is provided.

To use, \usepackage{listings}, identify the language of the object to typeset, using a construct like: \lstset{language=Python}, then use environment lstlisting for inline code. External files may be formatted using \lstinputlisting to process a given file in the form appropriate for the current language. Short (in-line) listings are also available, using either \lstinline|...| or |...| (after defining the | token with the \lstMakeShortInline command).

Sources/macros/latex/contrib/listings
Documentation
Version1.10c
LicensesThe Project Public License 1.3c
Copyright1996–2004 Carsten Heinz
2006–2007 Brooks Moses
2013–2024 Jobst Hoffmann
MaintainerJobst Hoffmann
Carsten Heinz (inactive)
Brooks Moses (inactive)
Contained inTeX Live as listings
MiKTeX as listings
TopicsVerbatim
Listing
Macro Demonstration
Syntax highlight
See alsolisting

Download the contents of this package in one zip archive (3.4M).

Community Comments

Loading...

Announcements

Here you can see a respective diagram in newer browsers.

more

Guest Book Sitemap Contact Contact Author