I'd like to have my header appear on every page except the first (title page). However, it's not appearing on the first page of my table of contents(regardless of where it appears in the document). The preable to my script is as follows:

\documentclass[12pt]{report}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{fancyhdr}
\usepackage{textpos}
\usepackage{datetime}
\pagestyle{fancy}
\usepackage{lastpage}

\fancypagestyle{plain}
\fancyhf{}
\renewcommand{\footrulewidth}{0.1pt}
\fancyfoot[L]{\today, \ampmtime}
\fancyfoot[R]{Page \thepage\ of \pageref{LastPage}}

\setcounter{secnumdepth}{-1}

\begin{document}


Any help is much appreciated.

-
\tableofcontents is based on \chapter, which in turn invokes \thispagestyle{plain}, so it's necessary to intervene in the basic definition of \chapter to impose your header on the first page. i'll leave the details to someone else; there's probably something in the etools package that would help, but i'm not as familiar as i should be with that package. –  barbara beeton Jul 8 '12 at 17:26

The \fancypagestyle macro takes two arguments. First is the style to be (re)defined, while the second is the (re)definition itself:

\fancypagestyle{plain}{%
\fancyhf{}
\renewcommand{\footrulewidth}{0.1pt}
\fancyfoot[L]{\today, \ampmtime}
\fancyfoot[R]{Page \thepage\ of \pageref{LastPage}}
}


You did not supply the second (or it was considered empty in this case). See the example on p 8 of the fancyhdr documentation (section 7 Redefining plain style).

Follow this (re)definition with \pagestyle{plain} to "re-initialize" it.

-
Seems like a step in the right direction, but it's inverted the problem: Now I get the correct header on the first page of the table of contents, but the wrong header on every page after that. –  Liam M Jul 8 '12 at 17:33
... unless I add the header twice: once inside the fancypagestyle, once outside. Is this usual? –  Liam M Jul 8 '12 at 17:40
@LiamM You also have to say \pagestyle{plain} after the \fancypagestyle{plain}{...} stuff, so that the style is reinitialized. –  egreg Jul 8 '12 at 17:51
Thanks guys, that's solved it. –  Liam M Jul 9 '12 at 4:43