1

I want each appendix to be under the heading Appendices in the ToC. Here is my 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}

My output is enter image description here

But I want this:enter image description here

2

I think you can use the command \addcontentline{toc} to add a line in the toc a the "part" level. It will work only if you have a document that accepts the "part" environment, which is the case here.

This is working :

\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}
2

For the ‘Appendices’ heading, since you load appendix, you simply have the [toc] option.

Also, if you don't want the appendix sections in table of contents, you can change toc depth at the beginning of the appendices environment:

\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} 

enter image description here

6
  • Thank you for this. But I want the word "Appendices" to be uppercase. Also, I want each Appendix to be indented under the heading "APPENDICES". – oa-90 Feb 19 '19 at 21:10
  • @oa-90: You want what? – Bernard Feb 19 '19 at 21:30
  • I want the word "Appendices" in ToC to be uppercase. Also, I want each appendix (i.e., TABLESS, FIGURESS) to be under the heading "APPENDICES" in an indented style like in the second picure I posted. – oa-90 Feb 19 '19 at 21:42
  • The last point should be harder. I've posted a code which indents the word APPENDICES, on the contrary. After all, appendices chapters are chapters and should be aligned with the other chapters, don't you agree? – Bernard Feb 19 '19 at 21:48
  • Thanks! My thesis is supposed to be in this format. On the other hand, I added \usepackage[colorlinks=true,breaklinks]{hyperref} in my preamble. In this case, the code which you posted to make Appendices uppercase in ToC gives an error. Do you have a solution for this issue? – oa-90 Feb 20 '19 at 6:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.
https://tex.stackexchange.com/questions/475604/how-to-form-appendix-under-the-heading-appendices-in-toc
tex.stackexchange.com
crawl=CC-MAIN-2021-25
177782
application/http; msgtype=response
sha1:AWVPIGDIHH5PUC2UZCI4JP5QY7UYEI4O
<urn:uuid:5331218e-39e1-4e8e-9d19-5edda04c574f>
2021-06-25T04:44:00Z
151.101.193.69
text/html
sha1:OY4H5TULZAFUY52CI6CVOLOXN2WVOCE7
<urn:uuid:3414470a-ffd3-4799-9cb8-304a1315c1c9>
https://tex.stackexchange.com/questions/475604/how-to-form-appendix-under-the-heading-appendices-in-toc
response
<urn:uuid:8a0a982a-d1c1-4b87-9f09-0c446e670eda>
isPartOf: CC-MAIN-2021-25
publisher: Common Crawl
description: Wide crawl of the web for June 2021
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-200.ec2.internal
software: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/