[Tex/LaTex] How to add a custom header to the Table of Contents

header-footertable of contents

Problem

I'm trying to add the header "TABLE OF CONTENTS – CONTINTUED" to every page of the TOC following the first. I've tried:

\addtocontents{toc}{\hfill TABLE OF CONTENTS -- CONTINUED \hfill ~ \newline\newline} 

Within the document right before a section that starts page 2. It succeeds in the PDF output but causes an error in the .toc. The following message is given:

Something's wrong--perhaps a missing \item. ...e {section}{\numberline {24}Section X}{26}

How can I avoid this? I have some customization in the working example that are necessary formatting for thesis submission.

Working Example

%Document Class
    \documentclass[12pt]{article}%12 Pt font, article document class
%List of Packages
    \usepackage{caption} %Flexibility in reported contents/table/figures titles
    \usepackage[left=1.5in, top=1.15in, bottom=1in, right=1in, headsep=12pt]{geometry}
    \usepackage{setspace}%single spacing, double spacing
    \usepackage{tocloft}%Custom Table of Contents   
%Formatting the Table of Contents
    \renewcommand*\contentsname{\normalsize{\normalfont{TABLE OF CONTENTS}}} %centers table of contents title and puts it in normal font
    \renewcommand{\cftsecfont}{\normalfont} %gets rid of bold font for section titles
    \renewcommand{\cftsecpagefont}{\normalfont} %gets rid of bold font for section page numbers
    \renewcommand{\cftsecaftersnum}{.} %Adds a period after section numbers in table of contents
    \renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}} %adds dots between the chapters and page numbers
    \cftsetindents{subsection}{1.1em}{2.3em}% Lines up subsection directly below section, may need adjustment
    \cftsetindents{subsubsection}{3em}{2.3em}% Indents sub subsection to properly
    \renewcommand{\cftdotsep}{.5}   %Setting Dot ``density'' between Titles and Page Numbers for TOC

%\nofiles %The nofiles command uses forces LaTeX to use pre-existing TOC, LOT, and LOF documents. I can manually edit each.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%% BEGIN DOCUMENT %%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\newpage
%TABLE OF CONTENTS PAGE
    \tableofcontents%Changes to the basic TOC format are done in the preamble; "TABLE OF CONTENTS --CONTINUED" added below
\newpage

\newcounter{counter}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
        \addtocontents{toc}{\hfill TABLE OF CONTENTS -- CONTINUED \hfill ~ \newline\newline} %HERE is the problem
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\stepcounter{counter}\newpage
\section{Section \Alph{counter}}
\end{document}

Best Answer

Why not something simple?

\documentclass[12pt]{article}
\usepackage{tocloft,fancyhdr}
\newif\iftoccont
\renewcommand*\contentsname{Table of Contents}
\renewcommand*\cfttoctitlefont{\normalsize\normalfont\MakeUppercase}
\renewcommand\cftsecfont{\normalfont}
\renewcommand\cftsecpagefont{\normalfont}
\renewcommand\cftsecaftersnum{.}
\renewcommand\cftsecleader{\cftdotfill{\cftdotsep}}
\cftsetindents{subsection}{1.1em}{2.3em}
\cftsetindents{subsubsection}{3em}{2.3em}
\renewcommand\cftdotsep{.5}
\pagestyle{fancy}
\fancyhf{}
\fancyhf[ch]{\MakeUppercase{\contentsname{} --- continued}}
\fancyhf[cf]{\thepage}
\renewcommand\headrulewidth{0pt}

\begin{document}

  \tableofcontents
  \newpage\toccontfalse

  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
  \newpage
  \section{Section \Alph{section}}
\end{document}

simple