# List of figures NOT showing

Whenever I am using the following code

 \appendix


to avoid listing individual appendices in the table of contents the list of figures (lof) disappears. I have checked removing the above command from the appendix the lof appears.

You have to restore the tocdepth counter after the appendix with \addtocontents{toc}{\protect\setcounter{tocdepth}{2}}:

\documentclass{report}

\begin{document}
\tableofcontents
\listoffigures

\begin{figure}
\caption{figure}
\end{figure}

\appendix
\chapter{Appendix chapter that is not listed in the TOC}
...
%<end of appendix>
\end{document}


Assuming that the appendix is the very end of your document (which might not be the case, so be careful here) you could patch the end of the document like

\let\oldenddocument\enddocument
\def\enddocument{%
\oldenddocument}


Then the file

\documentclass{report}

\makeatletter
\let\ltx@enddocument\enddocument
\def\enddocument{%
\ltx@enddocument}
\makeatother

\begin{document}
\tableofcontents
\listoffigures

\begin{figure}
\caption{figure}
\end{figure}

\appendix
\chapter{Appendix chapter that is not listed in the TOC}
\end{document}


will yeld the same result as above. Note that there is also patching going on with \appendix to keep the document body clean:

\g@addto@macro\appendix{%


This should be done anyways. Finally if the appendix is not the concluding part of the document one might consider to wrap the appendix into an environment in order to have an end marker, hence an appropriate place to hook into (e.g. with the instruction \def\endappendix{\addtocontents{toc}{\protect\setcounter{tocdepth}{2}}}) and then say

\documentclass{book}

\makeatletter
\makeatother

\begin{document}
\tableofcontents
\listoffigures

\begin{figure}
\caption{figure}
\end{figure}

\begin{appendix}
\chapter{Appendix chapter that is not listed in the TOC}
...
\end{appendix}

\backmatter
\chapter{After the appendix}
\end{document}


It should be noted that this is a change of the standard interface!

• Thanks a lot! It works fine after restoring the tocdepth counter. – Physics Moron Jan 22 '17 at 13:33