TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|improve this question
up vote 3 down vote accepted

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

share|improve this answer
First method works like a charm! Thanks a lot! – tim Jul 20 '11 at 20:09

Your Answer


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.