Control your Table of Contents

Something I’ve been struggling a lot with in the past is the suppression of, for instance, the appendix in the Table of Contents. Mostly, it is enough to show that the appendices start at a certain page and not to show the sections/chapters that are in the appendices. But also the other way around: showing a section in the Table of Contents that is defined with a * in the document (\section*{}).

Adding the Table of Contents

The table of contents is added with the command \tableofcontents. Call this command inside your document (so after the \begin{document}), at the place where you want your Table of Contents. This is usually the beginning of the document:

\chapter{First chapter}

Removing entries

First, let’s discuss the situation where you want to hide certain entries. Let’s say that you have to chapters in your Appendix, and just want to show ‘Appendices’ in the Table of Contents. Note that you need the appendix package for adding appendices. This is what you need to add in your document:

\chapter{First appendix}
You don't want this to appear.
\chapter{Second appendix}
You don't want this to appear.

The \addcontentsline{toc}{chapter}{Appendices} adds the line ‘Appendices’ to your Table of Contents, as you wanted it! But we need to do more, because we want to suppress the chapters. This is done with the third line: \addtocontents{toc}{\protect\setcounter{tocdepth}{-1}}. This tells LaTeX to suppress the entries whose depth is above -1. Depth? Yes, \part has depth -1, \chapter 0, \section 1, and so on. Compile your LaTeX document (maybe twice to get the Table of Content correct). and you’ll see that the chapters have disappeared from the Table of Content!

Adding entries

Let’s add entries to your Table of Contents now! Say that you have defined a \subsection*{} in your document, for whatever reason that may be. Normally, starred entries do not appear in your Table of Content. Here’s how to add them:

\chapter{First chapter}
\section{First section}
\subsection*{Starred subsection}
\addcontentsline{toc}{subsection}{Starred subsection}

What is done now is exactly the same as the previous case, but in a different situation. LaTeX is told to add an entry with subsection depth and to name is ‘Starred subsection’.


  1. Kemal says:

    Hello .
    I have a question related to the list of figures.
    I have written my dissertation in latex.
    The page numbers of the fidures are not bold in list of the fidures.
    How can I change the page numbers of the figures to bold (only page numbers) ?

  2. Marie says:


    Great tips for the toc! however when I use this trick: \appendix \addcontentsline{toc}{chapter}{Appendices} \addtocontents{toc}{\protect\setcounter{tocdepth}{-1}}

    the List of Figures and List of Tables disappear! They only come back when I comment on the table of contents…

    Could you shed some light on this problem?

  3. Others include aging process, underlying diseases, swimming in chlorinated water, harsh soaps, chemicals and harsh cosmetics.
    In addition, a lot of common substances may be utilized to
    fight dry skin. Pure genuine pearl powder does not totally dissolve in water or liquid, so be sure you stir as you drink.

  4. It’s awesome in support of me to have a web site,
    which is valuable in favor of my know-how. thanks admin

  5. Vinch says:

    I’ve experienced the solution you provide, with


    right before \appendix, and it works perfect for the toc.
    However if you’re using package hyperref, it messes with the pdf’s toc, setting it down to chapter level for the whole document (except for manual \bookmark s).

    I worked this out this way:
    right before \appendix
    And then
    right before \end{document}.

    PdfLatex and hyperref seem to like it, worked out for me !

  6. Johnd124 says:

    Greetings! Very useful advice within this article! It is the little changes that make the most important changes. Many thanks for sharing! dadfdedfggbg

  7. Kim says:

    I used the

    \appendix \addcontentsline{toc}{chapter}{Appendices} \addtocontents{toc}{\protect\setcounter{tocdepth}{-1}}

    But now my List of Figures and List of Tables contents are also gone… They are stil in the table of contents, but the figures and pages are not shown anymore.

    Does anybody know why?

  8. Ju says:

    Question: How can add \listoffigures and \listoftables in the appendix section having the Prefix “Appendix” before the headline “List of Figures”?

    \documentclass[11pt, a4paper, oneside]{book}

    \chapter{And so on}


    %\chapter{List of Figures} % to get the correct title
    %\renewcommand\listfigurename{} % to delete the title
    %Problem with the previous two commands: I either get too much space between the headline and the first entry in the list of figures.

    \addcontentsline{toc}{chapter}{List of Figures}



    Thanks a lot

  9. Chandra says:

    You really make it seem really easy together with
    your presentation however I in finding this topic to be
    actually something that I think I’d never understand. It seems too complicated and extremely large for me. I’m taking a look
    ahead to your next submit, I’ll attempt to get the hang of it!

  10. Alan says:

    Is there anyway to “hide” rows within a table when a condition is met, for example when the row total = 0?

  11. marie says:

    Hi, you have a very nice and generous blog with lots of usefull information. Thanks!

    I have a tricky question from France (must be tricky since I’ve been browsing the web for 3 days without finding an answer to it??).
    How can I remove the entry “Contents” from my table of contents? It appears automatically and I don’t find it useful to see it printed there (when we are looking at the table of contents we don’t need to know what page it is on, it is written in the page foot…).
    I’m using the command \tableofcontents as every one else. (I’ve tried adding an asterix at the end of the command but it doesn’t change a thing of course;-)
    Thanks if you can help in that matter,

  12. André says:

    Nice blog! i have a question, i am using \tableofcontents and after that \listoffigures and \listoftables, but in the table of content doesnt show the title of the list of figures and list of tables. How can i do that? thanks in advance!

    • André says:

      Sorted out! For those who has the same issue, u have to add this to ur code:

      \addcontentsline{toc}{chapter}{List of Figures}
      \addcontentsline{toc}{chapter}{List of Tables}

      Have fun!

  13. Hanne says:

    Tanks! That fixes the page numbers.

    It did mak my TOC have two lines at the bottom like this:

    A Appendix 1: List of species…………………….31


    But the problem was fixed by using \section*{Appendix 1}, so I’m happy.

    Thanks again.

  14. Hanne says:

    Hi, great tip about appendices. Only one problem when I use your commands, the page number in the TOC is places right after “Appendices” like this: “Appendices34”. How can I get it aligned with the others?

    This is (parts of) my document:






    \chapter{Appendix 1}


    Thanks in advance!

    • Frits says:

      Hi Hanne,
      This is because you use the documentclass article, which doesn’t support \chapter. Try changing the \addcontentsline to this:


      And to be complete, you’ll probably want your Appendix to look like this:

      \section{Appendix 1}

      Instead of the \chapter command.

  15. Chris says:


    Thanks for the nice tutorial. However, your method for hiding an appendix chapter from the ToC does not work for me. It ends up erasing all the chapters (and lower) from the ToC.

    Any idea why this happens?


    • Frits says:

      Hi Chris,

      I have no idea right now, but if you want you can email me (part of) your LaTeX document, so I can have a look at it. Email me via the contact form. I know the form is not perfect, I’ll hope to add a feature to send attachments soon.

  16. td287 says:

    When I use this approach to suppress the individual listings of each appendix, it then deletes my list of figures, which follows my table of contents. Do you know how to address this?

    • Ced says:


      I had the same problem and find a way to correct it. At the end of my appendices, I’ve reset the depth of the toc to its original value (3 in my case).
      I don’t see why it works, but it works anyway :)

  17. David says:

    Thanks again, but I couldn’t get it to work, perhaps because of the way the template cls file was. However, I found a cheat;

    The thesis generates a .toc and and .lof file; I merely edited these, removing the last entry in both. I then made them read only and recompiled; it annoyed winedt, but it used the now protected ones and bingo, it worked. Messy, but achieves the goal :P

  18. David says:

    Thanks for that! Sadly it’s not working for me – though I suspect because the template Im using takes use of parts rather than section / chapters.. like this…

    \printnomenclature %% Print the nomenclature


    \part{Literature Review}
    \part{Research and investigation}


    Any ideas what else one could try ?!

    • Frits says:

      Okay I see, but is every appendix (1 to 6) in a different \part? If so, you should set the tocdepth to -2 instead of -1.

      -2 suppresses \part and lower than that (\chapter, \section, etc.) from the ToC.
      -1 keeps \part and suppresses \chapter and lower
      … and so on

      Note that you have to compile your documents twice before the changes in the ToC are made visible.

  19. David says:

    Hey, great blog. I have a related, but oddly strange question. I have 6 appendices in a document, like this;


    All of these are listed in the TOC. However, for my own purposes, I want to HIDE only appendix 6; so that anyone viewing the contents would only think there are 5 appendices and the last one is a surprise. Is this possible ? I also have a table of figures, and there is one figure in appendix 6 i would also not like to show up on TOC….

    Thanks in advance!

    • Frits says:

      Hi David, if you only want to hide your last appendix you can try the following:


      The value -1 between the brackets depends on wether you use \chapter or \section (if you use the latter you can also set it to 0).

      I’m not sure how to this in you List of Figures (LoF), but I presume that it can be done in a similar fashion:


  20. Srinivas says:

    thanks. I have a question:

    How to I add a text to the TOC? This text (a single word) is not present in any of the chapters going forward. Example:

    Table of Contents

    Acknowledgement ………………………………………………….ii

    Abstract …………………………………………………………………..V

    Chapter ( i want to add this “Chapter”) here..
    1 Introduction ………………………………………………………..1

    • Frits says:

      Hi Srinivas, that is also treated in the article (for the word ‘Appendices‘):
      \addcontentsline{toc}{chapter}{Your Text} adds the line ‘Your Text’ to the ToC. Depending on the documentclass you are using you might want to use:
      \addcontentsline{toc}{section}{Your Text}.

      If you don’t want the pagenumbering behind the added text, there’s another command:
      \addtocontents{toc}{Your Text \par}

      Have a go with it! If you can’t get it to work, please say so :-)

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>