Skip to content

List of Listings

Wolfgang Hochleitner edited this page May 25, 2021 · 1 revision

What?

A list of listings identifies all the listings (program code) that are used in the current document. Each listing is printed with its number, caption and a reference to the page where it is located.

How?

To add a list of listings, add the following lines to the backmatter of your main document (e.g., main.tex):

\addcontentsline{toc}{chapter}{List of Listings}
\listof{program}{List of Listings}

The \listof{program} command creates the list of all program environments (which contain the various code listings), whereas \addcontentsline places an entry for the list of listings in your table of contents.

Where?

The list of listings is usually placed in the back of your document, after the last chapter or the appendices but before the bibliography. Add it after the command \backmatter to ensure that it is not treated as a regular chapter or an appendix in terms of chapter headings.

Package Information

The command \listof is part of the tocbasic package which is already included in hgb.sty.

Clone this wiki locally