I am writing my thesis in Latex and a have problem when I add all sections together, I cannot have them in the order I wish and appear in the table of contents. Is there a trick to this? I am fairly new to this so any hints or corrections would be great.

I would like to have a table of contents like this:


lists of tables etc (not numbered)

Chapters (numbered)

Appendix (not numbered)

Bibliography (not numbered)

I can have all sections print in this order i.e. the pdf compiles in the right order but the bibliography does not appear in the table of contents. If I switch the code around so that the bibliography is printed before the appendix then all appear in the table of contents.

Here is a MWE. Just switch the bibliography to before and after the appendix to see the results.

\usepackage{amsmath, amsfonts, amssymb, pifont, float, color, url}
\usepackage[pdftex, plainpages=false, pdfpagelabels, bookmarks=true]{hyperref}
\pretolerance=10000 %% prevents words from being hyphenated when the line splits.
\pdfpageattr {/Group << /S /Transparency /I true /CS /DeviceRGB>>} %correct viewing in adobe reader

%%%%%%%%%%%%%%%%%%%%%%%%%%%% Use packages above and set them up %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\pagestyle{fancy} %\pagestyle{plain} to have just page numbers restate fancy afterwards or all pages from that point will be plain.
\graphicspath{ {Pictures/} }
\newcommand{\etal}{\textit{et al. }}
\renewcommand{\nomname}{List of Abbreviations}

%% an equation caption solution from the web by Heiko Oberdiek
\newcommand{\capequ}[1]{\begin{center} #1 \end{center}}



\newcommand{\listequationsname}{List of Equations}
\setlength{\cftmyequationsnumwidth}{2.5em}% Width of equation number in List of Equations

%%%%%%%%%%%%%%%%%%%%%% Document variables above and user defined commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%



        %Thesis Subtitle

        A logo


        \normalsize This thesis is submitted in partial fulfilment for the degree of\\ Doctor of Philosophy\\ 

        School of Chemistry\\
        University of St Andrews\\




In this thesis

For my Family and Friends

........... Declares that ......  

I would like to thank ......

Publication 1 ......

\phantomsection\addcontentsline{toc}{chapter}{\protect\numberline{}List of Figures}

\phantomsection\addcontentsline{toc}{chapter}{\protect\numberline{}List of Tables}

\phantomsection\addcontentsline{toc}{chapter}{\protect\numberline{}List of Equations}

\addcontentsline{toc}{chapter}{\protect\numberline{}List of Abbreviations}





\chapter{Theory and Methods}
\label{chap:Theory and Methods}






After some quick changes and a useful comment below, this can be fixed simply by adding \addtocontents{toc}{\protect\setcounter{tocdepth}{0}} before the bibliography is printed.

  • 1
    You need to give some input. Run the Code as is, there is no bibliography as nothing is citet. Why do you set the counter tocdepth to minus one?
    – Johannes_B
    Commented Oct 1, 2014 at 13:00
  • Hi Johannes, The problem is not printing the bibliography if one is provided it is printed in the pdf, the issue is having the bibliography listed in the table of contents. Using the code as is a Chapter_2, Introduction and appendix file is additionally required to see the issue. The $tocdepth$ is set to -1 so that the only line added to the table of contents is appendix.
    – James
    Commented Oct 1, 2014 at 13:11
  • @Johannes_B, thanks for pointing out the tocdepth, I hadn't considered it before. I have fixed the code by resetting the tocdepth to 0. Thanks for your comment.
    – James
    Commented Oct 1, 2014 at 13:22
  • A little hint, when something seems strange and you can't figure out the reason. Try to boil down the code by commenting out parts of the document. At the end, there are only a few lines left and the reason gets obvious. This is called making a Minimal working example.
    – Johannes_B
    Commented Oct 1, 2014 at 13:24
  • 1
    @James Can you make that final paragraph into a proper answer?
    – Joseph Wright
    Commented Nov 1, 2014 at 23:00

1 Answer 1


Sorry for answering my own question after a pointer from Johannes_B. I have fixed the code by resetting the tocdepth to 0. Thanks Johannes_B for your comment. The changes is,


  • I think it is perfectly fine to answer your own question :)
    – Zero3
    Commented Dec 17, 2015 at 5:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .