I want to exclude ALL sections, subsections, and subsubsection in the Appendix from the table of contents. But I need to have the "Chapter"(Appendix) to be shown in the TOC.
\documentclass[a4paper,12pt,icelandic]{report}
\usepackage[toc,page]{appendix}
\begin{document}
\tableofcontents
\chapter{Chapter 1}
\section{Section 1.1}
\subsection{Section 1.1.1}
\chapter{Chapter 2}
\section{Section 2.1}
\subsection{Section 2.1.1}
\appendix
\chapter{Appendix A}
\section{Appendix A.1} % Do not show in table of content.
\subsection{Appendix A.1.1} % Do not show in table of content.
\chapter{Appendix B}
\section{Appendix B.1} % Do not show in table of content.
\section{Appendix B.2} % Do not show in table of content.
\end{document}
Best Answer
You have to write
\setcounter{tocdepth}{0}
in the.toc
file when\appendix
is issued. You might do it asbut it's better programming style doing this in the preamble: