I'm using

\enlargethispage{\baselineskip} %EITHER
\enlargethispage{\baselineskip} %OR THIS

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!

1 Answer 1


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:


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


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}.

  • First method works like a charm! Thanks a lot!
    – tim
    Jul 20, 2011 at 20:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .