Cómo formar un Apéndice bajo el título Apéndices en ToC

Cómo formar un Apéndice bajo el título Apéndices en ToC

Quiero que cada apéndice esté bajo el título Apéndices en el ToC. Aquí está mi MWE:

\documentclass[12pt,oneside]{book}
\usepackage{titletoc}
\usepackage{appendix}

\begin{document}
   \tableofcontents
   \chapter{CHAPTERR}
   \section{Sectionn}
    Some stuff.
   \chapter{CHAPTERRR}
   \section{Sectionnn}
    Other stuff.
\begin{appendices}
   \chapter{TABLESS}
   \section{DATA}
   \chapter{FIGURESS}
   \section{CODE}
\end{appendices}

\end{document}

Mi salida esingrese la descripción de la imagen aquí

Pero quiero esto:ingrese la descripción de la imagen aquí

Respuesta1

Creo que puedes usar el comando \addcontentline{toc} para agregar una línea en el toc al nivel "parte". Sólo funcionará si tiene un documento que acepta el entorno "parte", como es el caso aquí.

Esto está funcionando:

\documentclass[12pt,oneside]{book}
\usepackage{titletoc}
\usepackage{appendix}

\begin{document}
   \tableofcontents
   \chapter{CHAPTERR}
   \section{Sectionn}
    Some stuff.
   \chapter{CHAPTERRR}
   \section{Sectionnn}
    Other stuff.

    \addcontentsline{toc}{part}{Appendix}%
    \appendix

   \chapter{TABLESS}
   \section{DATA}
   \chapter{FIGURESS}
   \section{CODE}

\end{document}

Respuesta2

Para el encabezado 'Apéndices', desde que cargas appendix, simplemente tienes la [toc]opción.

Además, si no desea que las secciones del apéndice aparezcan en la tabla de contenido, puede cambiar la profundidad del tema al comienzo del appendicesentorno:

\documentclass[12pt,oneside]{book}
\usepackage{titletoc}
\usepackage[toc]{appendix}
\usepackage{xpatch}
\xpatchcmd{\addappheadtotoc}{%
\appendixtocname}{%
\hspace{1.32em}\MakeUppercase{\appendixtocname}}{}{}

\begin{document}

   \tableofcontents
   \chapter{CHAPTERR}
   \section{Sectionn}
    Some stuff.
   \chapter{CHAPTERRR}
   \section{Sectionnn}
    Other stuff.
\begin{appendices}
\addtocontents{toc}{\setcounter{tocdepth}{0}}
   \chapter{TABLESS}
   \section{DATA}
   \chapter{FIGURESS}
   \section{CODE}
\end{appendices}

\end{document} 

ingrese la descripción de la imagen aquí

información relacionada