# Hide listing from listoflistings [duplicate]

Possible Duplicate:
remove unwanted contents from list of listings

How can I hide a listing from the listoflistings, similar to using \section*{Title} to hide a section from the table of contents?

I want to do this in order to use a listing as an example in the preface of my thesis. As this isn't really an actual listing, I don't want it to show up in my list of listings because it doesn't really concern the content.

-

## marked as duplicate by Peter Grill, Thorsten, diabonas, Marco Daniel, percusseSep 18 '12 at 1:15

Use title=Title of this listing instead of caption=Title of this listing. Please, provide an example of what you're doing, if this is unclear or doesn't work. –  egreg Sep 17 '12 at 8:01
This is not a duplicate -- see egreg's answer. –  lockstep Sep 17 '12 at 11:27

The answer in the linked question doesn't really apply here, as the nolol=true setting will still number the listing. For an unnumbered listing one can use the keyword title.

\documentclass{article}
\usepackage{listings}
\begin{document}
\title{A title}
\author{A. U. Thor}
\date{}
\maketitle

\tableofcontents
\lstlistoflistings

\section*{Introduction}
Here we have an unnumbered listing that won't go in the list of listings.

\begin{lstlisting}[title=Preliminary listing]
Hello world
\end{lstlisting}

\section{Title}

Here we have a real listing.

\begin{lstlisting}[caption=Real listing]
Hello world
\end{lstlisting}

\end{document}


-
Perfect! Thanks! –  Florian Peschka Sep 17 '12 at 9:59