Whenever I am using the following code
\appendix
\addcontentsline{toc}{chapter}{9 \enspace Appendices}
\addtocontents{toc}{\protect\setcounter{tocdepth}{-1}}
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.
Best Answer
You have to restore the
tocdepth
counter after the appendix with\addtocontents{toc}{\protect\setcounter{tocdepth}{2}}
: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
Then the file
will yeld the same result as above. Note that there is also patching going on with
\appendix
to keep the document body clean: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 sayIt should be noted that this is a change of the standard interface!