# Enlarge list of listings

I'm using

\cleardoublepage
\renewcommand{\lstlistlistingname}{Quellcodeverzeichnis}
\enlargethispage{\baselineskip} %EITHER
\lstlistoflistings
\enlargethispage{\baselineskip} %OR THIS
\cleardoublepage


but this doesn't work: I get ONE listing-reference on the new page. It has a new chapter number, thus there's probably one empty line inbetween. That's why I also tried to increase by \enlargethispage{3\baselineskip}: Doesn't work either. Any idea? Thanks!

-

Your problem seems to be of squeezing the list in one page only; neither method works:

• \enlargethispage before \lstlistoflistings only enlarges the page preceding the list, because \lstlistoflistings issuea a \cleardoublepage command;
• \enlargethispage after \lstlistoflistings enlarges the second page of the list, which is useless.

Here's a way out:

\begingroup
\cleardoublepage
\let\cleardoublepage\relax
\enlargethispage{\baselineskip}
\lstlistoflistings
\endgroup


We issue beforehand the \cleardoublepage, then we make the command a no-op, we ask to enlarge the page and then we print the list. The end of the group restores the previous meaning of \cleardoublepage.

Another method is to say

\lstlistoflistings

that adds the required commands for the next time the list is typeset. After the first compilation all should be in its place. If the list of listings is at the end of the document, issue the \addtocontents command immediately after \begin{document}.