[Tex/LaTex] Remove Appendices from table of content

appendicestable of contents

I used this code to generate appendices

\documentclass [a4paper,12pt,oneside,final]{book}
\usepackage[title]{appendix}
\begin{document}
\dominitoc 
\tableofcontents
\listoffigures \addcontentsline{toc}{chapter}{List of Figures} \mtcaddchapter
\listoftables \addcontentsline{toc}{chapter}{List of Tables} \mtcaddchapter
\begin{appendices}
\chapter{Appendix A}
\section{aaaa}
\end{appendices}
\end{document}

The appendices appear at the end of the table of contents

How i can remove them so they will not appear

any suggestion?

Best Answer

You can add

\addtocontents{toc}{\setcounter{tocdepth}{-1}}

at the very beginning of the subappendices environment.

\documentclass [a4paper,12pt,oneside,final]{book}
\usepackage[title]{appendix}
\usepackage{minitoc}

\begin{document}
\dominitoc
\tableofcontents
\listoffigures \addcontentsline{toc}{chapter}{List of Figures} \mtcaddchapter
\listoftables \addcontentsline{toc}{chapter}{List of Tables} \mtcaddchapter

\begin{appendices}
\addtocontents{toc}{\setcounter{tocdepth}{-1}}
\chapter{Appendix A}
\section{aaaa}
\end{appendices}

\end{document}

enter image description here

If chapters, in particular thise for the appendices, are beign \included, it's best to place the line

\addtocontents{toc}{\setcounter{tocdepth}{-1}}

in the subsidiary file just before the \chapter command.