Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Without a compilable example or at least a link to your class file, it's hard to say what's going on. The \@tableof macro isn't the culprit -- it temporarily switches to \onecolumn, changes the page margins and sets up the headers for even and odd LoF/LoT pages. I suggest to have a look at the definition of \appendix in your class file -- if this macro includes a line like

\addtocontents{lof}{Appendix}

copy the \appendix definition into the preamble of your document (to be sure, enclose it within \makeatletter/\makeatother) and comment out the above-mentioned line.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.