General ⇒ Don't want to have sections in Appendices in TOC
Don't want to have sections in Appendices in TOC
I am using the package \usepackage{appendix} in my thesis. The problem is that I get all the sections included in Appendices in TOC. I want to show only "Appendices" in TOC. Another thing is that before the heading of Appendices it is putting "A" both in TOC and in text. How can I get rid of this?
Regards,
Sabiha
Regards,
Sabiha
NEW: TikZ book now 40% off at Amazon.com for a short time.

Don't want to have sections in Appendices in TOC
Hi sabina,
you could use the starred versions of the sectioning commands along with \addcontentsline as the following example suggests:
you could use the starred versions of the sectioning commands along with \addcontentsline as the following example suggests:
Code: Select all
\documentclass{report}
\usepackage{appendix}
\begin{document}
\tableofcontents
\appendix
\chapter*{Dummy appendix}
\addcontentsline{toc}{chapter}{Dummy appendix}
\section*{First section in appendix}
\section*{Second section in appendix}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: Don't want to have sections in Appendices in TOC
Hello gmedina,
I have tried this but it has removed the Appendix number in the text as well. Also the "A" is still there. I want to have the numbered headings of each appendix in Appendices but I dont want to have these in TOC.
Still confused.
Sabiha
I have tried this but it has removed the Appendix number in the text as well. Also the "A" is still there. I want to have the numbered headings of each appendix in Appendices but I dont want to have these in TOC.
Still confused.
Sabiha
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Don't want to have sections in Appendices in TOC
Hi Sabiha,
you could change the tocdepth counter, try this example:
Stefan
you could change the tocdepth counter, try this example:
Code: Select all
\documentclass{report}
\usepackage{appendix}
\begin{document}
\tableofcontents
\chapter{Test chapter}
\section{Test section}
\appendix
\cleardoublepage
\addcontentsline{toc}{chapter}{Appendix}
\addtocontents{toc}{\protect\setcounter{tocdepth}{-2}}
\chapter{Chapter in appendix}
\section{Section in appendix}
\end{document}
LaTeX.org admin
Don't want to have sections in Appendices in TOC
Hi,
worked fine and now I see my customized heading in toc as "Appendix"
but
made no effect to chapter headings in toc?? this means I still see chapter headings and toc. (section headings are gone from toc now)
Regards,
Code: Select all
\addcontentsline{toc}{chapter}{Appendix}
but
Code: Select all
\addtocontents{toc}{\protect\setcounter{tocdepth}{-2}}
Regards,
Don't want to have sections in Appendices in TOC
Hi sabina,
then we will need some more information. Can you please post a minimal working example showing the undesired bahaviour? (if you follow the link, you will find instructions to build such an example).
then we will need some more information. Can you please post a minimal working example showing the undesired bahaviour? (if you follow the link, you will find instructions to build such an example).
1,1,2,3,5,8,13,21,34,55,89,144,233,...
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Don't want to have sections in Appendices in TOC
Hi sabiha,
compile two times to get the updated toc, if necessary follow gmedinas link to provide a mwe.
The more information the quicker and better the advice. In some minutes I'll be away for the weekend but there are more helpful people in the community.
Stefan
compile two times to get the updated toc, if necessary follow gmedinas link to provide a mwe.
The more information the quicker and better the advice. In some minutes I'll be away for the weekend but there are more helpful people in the community.
Stefan
LaTeX.org admin
Re: Don't want to have sections in Appendices in TOC
Hi all!
I have some how managed to solve this problem (actually compromised
) due to time constraints.
But I really appreciate your efforts to take me out this problem.
Regards.
Sabiha
I have some how managed to solve this problem (actually compromised

But I really appreciate your efforts to take me out this problem.
Regards.
Sabiha