My list of tables and list of figures are showing correctly for my main document, but after the main list I get a header for the appendix that looks like:
4.1 Last Figure...................................whatever page
Appendix
Figure
I do not have any figures in any of my appendices, but the header still shows. If I add a fake figure to an appendix it appears after the header.
I have tried using \addtocontents{lof}{\protect\setcounter{tocdepth}{0}}
to turn off the list of figures in appendices, and it works in that no more figures are shown after the header, but the header is still there.
I'm using a thesis .cls that I didn't write, so I'm not sure what everything does. The section that covers the list of tables/figures/contents looks like this:
\def\tableofcontents{\@tableof{TABLE OF CONTENTS}{}{tocpage}{toc}{}}
\def\listoffigures{
\@tableof{LIST OF FIGURES}{Figure}{lofpage}{lof}
{\protect\addcontentsline{toc}{chapter}{LIST OF FIGURES}}}
\def\listoftables{
\@tableof{LIST OF TABLES}{Table}{lotpage}{lot}
{\protect\addcontentsline{toc}{chapter}{LIST OF TABLES}}}
\def\@tableof#1#2#3#4#5{
{ % limit scope of following declarations!!
\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn\fi
\addtolength{\textheight}{-40pt} % -24-16
%\addtolength{\majorheadskip}{-40pt} % -24-16
\addtolength{\headheight}{52pt} % 36+16
\addtolength{\headsep}{-12pt} % -12
\begin{center}
\chapter*{#1}
\end{center}
#5
\relax\markboth{#1}{#1}
\hbox to \hsize{#2 \hfil Page}
\singlespace
\setcounter{#3}{0}
\setcounter{listofheading}{1} % change from 0 to 1
\def\@oddhead{\vbox to \headheight{\vspace{4pt}
\hbox to \hsize{\hfil\rm\thepage} \vfil
\ifnum\value{#3}=1
\ifnum\value{listofheading}=2
\hbox to \hsize{Appendix\hfil} \vspace{4pt} \fi
\ifnum\value{listofheading}=1
\stepcounter{listofheading} \fi
\hbox to \hsize{#2 \hfil Page}
\else
\setcounter{#3}{1}
\fi
}}
\def\@evenhead{\vbox to \headheight{\vspace{4pt}
\hbox to \hsize{\rm\thepage\hfil} \vfil
\ifnum\value{#3}=1
\ifnum\value{listofheading}=2
\hbox to \hsize{Appendix\hfil} \vspace{4pt} \fi
\ifnum\value{listofheading}=1
\stepcounter{listofheading} \fi
\hbox to \hsize{#2 \hfil Page}
\else
\setcounter{#3}{1}
\fi
}}
\@starttoc{#4} \if@restonecol\twocolumn\fi
% \newpage
}}
I have tried removing everything in the @tableof
definition except the @starttoc
line and the header still appears. How do I get the lists to not show headers for sections that are empty?