Is there a way to exclude a specific listing from being printed in the LoL? I put one in a figure environment for the sake of not being printed on two seperate pages. But now I have the figure as well as the listing in the toc
\documentclass{article}
\usepackage{tikz}
\usepackage{listings}
\begin{document}
\lstlistoflistings
\listoffigures
\begin{figure}
\begin{lstlisting}[caption=Listing]
\end{lstlisting}
\caption{Figure}
\end{figure}
\end{document}
Update:
I used this to have a special listing caption for all real listings.
\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{%
\parbox{\textwidth}{\colorbox{gray}{\parbox{\textwidth}{\bf\sffamily\smaller#1#2#3}}\vskip-1pt}}
\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}
\caption? And why do you use figure to avoid a page break. Maybe a minipage is better for your situation. – knut Jan 3 at 22:57[caption=Listing]option, you don't obtain an entry in the LoL (and that's not a joke)... – Werner Jan 3 at 23:36nolol:\begin{lstlisting}[caption=Listing,nolol]. Or:\begin{lstlisting}[caption={[]Listing}]which hides the Listing number and doesn’t produce a LoL entry. – Qrrbrbirlbel Jan 3 at 23:46