# How can I force ToC not to end with a chapter?

So I am writing a programming book and I decided to include `\section`s in the ToC as well (see picture below). The problem I am having is that I have ugliness where `\chapter` is the last item on the page and only on the next page I have the `\section`s for that chapter (see the very end of picture).

How can I fix ToC to move this `3 Text Conversion and Substitution` to a new page rather than leaving it hanging on the current page?

I am using `memoir` class, btw.

-

insert before the third chapter:

``````\addtocontents{toc}{\protect\newpage}
``````
-
 Awesome, it worked! – Peteris Krumins May 1 '11 at 6:55 Martin's answers normally do. (:-) – Brent.Longborough May 1 '11 at 11:22 @Brent Herbert's do too. :-) – Alan Munn May 1 '11 at 11:44 @Alan: Oops, Senior Moment Alert! @Herbert: Terribly sorry. – Brent.Longborough May 1 '11 at 12:29

Another aolution is to introduce stretchability to the space above chapters in the toc, something like

``````\setlength{\cftbeforechapterskip}{1.0em plus 0.3em minus 0.1em}
``````

that is what I normally do

-
 Shouldn't that be \cftbeforechapskip? – Tom Aug 27 '12 at 20:51 if you are using `tocloft` yes, I usually use `memoir`, where it is renamed `\cftbeforechapterskip` – daleif Aug 28 '12 at 21:24