I'm finalizing my dissertation, and they require that the "Table of Contents - Continued" heading in the ToC (that shows if it flows onto a second page) be centered.

I thought I could find the code that generates the ToC and just customize it a bit, but I can't even find what's generating it...

Anybody have any ideas how I could work this out, or where the code is?

-

## migrated from stackoverflow.comJul 23 '11 at 18:04

This question came from our site for professional and enthusiast programmers.

Maybe the fancyhdr package would help? –  mbork Jul 23 '11 at 18:37
Welcome to TeX.sx! Your question was migrated here from another stackexchange site. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  Martin Scharrer Jul 23 '11 at 19:38

If you would like to have this "continued" heading in the body text, as heading above the continued table of contents, you can use the afterpage package. Here's an example:

\documentclass{report}
\usepackage{afterpage}
\afterpage{{\normalfont\large\bfseries\centering
\begin{document}
\tableofcontents
\chapter{One}
...
\chapter{Twenty}
\section{One}
\chapter{Twenty one}
\section{One}
...
\end{document}


Here I defined a macro \contheading which prints our text on the following page. That command will be written to the .toc file, where \tableofcontents can read it. To protect this command, so that it's written to the .toc file without being expanded, I used \DeclareRobustCommand.

If necessary, it can to be repeated later for further pages. Though it's easier to use header entries for that.

If you don't want the heading in the body text, but in the page header, use features of your class or your headings package, such as fancyhdr or scrpage2. Then, for example, \markboth is useful to override the existing header entry:

\newcommand*{\contheading}{Table of Contents - Continued}% in the preamble
...
% later at the beginning of the text:


Here I used \protect to prevent the expansion of \markboth when it's written to the .toc file.

Here's a complete example:

\documentclass{report}
% Some general header style settings:
\usepackage{fancyhdr}
\fancyhf{}
\pagestyle{fancy}
% The text of our heading:
\begin{document}
% Now we write the command to the TOC: