Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

The following code adds a wrong line to the list of listings

enter image description here

\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}[caption={LaTeX Listings}]
\begin{document}
\chapter{Introduction}
Some text ...
\chapter{Theory}
\end{document}
\end{lstlisting}

\lstlistoflistings

\end{document}

How can I prevent this entry?

share|improve this question
    
Related Question: Hide listing from listoflistings. –  Peter Grill Sep 17 '12 at 9:44
add comment

1 Answer

up vote 7 down vote accepted

Use the nolol=true option to remove that entry from the \listoflistings:

 \lstinputlisting[nolol=true]{democodefile}

This yields:

enter image description here

share|improve this answer
    
Works, thank you. –  Matthias Pospiech Jan 25 '12 at 19:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.