The following code adds a wrong line to the list of listings
\documentclass{scrbook}
\usepackage{listings}
\usepackage{filecontents}
\begin{document}
\begin{filecontents*}{democodefile}
\begin{Verbatim}[frame=lines]
Verbatim line.
\end{Verbatim}
\end{filecontents*}
\lstinputlisting{democodefile}%
\begin{lstlisting}
\begin{document}
\chapter{Introduction}
Some text ...
\chapter{Theory}
\end{document}
\end{lstlisting}
\lstlistoflistings
\end{document}
How can I prevent this entry?
Best Answer
Use the
nolol=true
option to remove that entry from the\listoflistings
:This yields: