[texhax] Problem with orphaned heading when defining TOC layout for \part wth \usepackage{titletoc}

Niall Mansfield texhax at uit.co.uk
Wed Sep 26 15:46:13 CEST 2007

I am redefining the layout for the TOC entry for \part{}
using the titletoc package.  Code below works almost OK, but
it can give an orphan "part" line at the end of a TOC page
(shown below).

How do I fix this?

More generally, how do I "see whether there is XYZ amount
of space left on this page, and if not, start another page now"?



My definition is:

	{\@afterheading\addvspace{\baselineskip}\bf PART\ }
	{\contentspush{\thecontentslabel\ }}

============ example of problem output ================
      7.4  a section head
      7.5  another section head

   Part II  Installation instructions

------------- end of page -----------
------------- start of new page -----

      8   A new chapter
      8.1 blah blah

More information about the texhax mailing list