General ⇒ Don't want to have sections in Appendices in TOC
Don't want to have sections in Appendices in TOC
Regards,
Sabiha
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Don't want to have sections in Appendices in TOC
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}
Re: Don't want to have sections in Appendices in TOC
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: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Don't want to have sections in Appendices in TOC
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}
Don't want to have sections in Appendices in TOC
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
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).
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Don't want to have sections in Appendices in TOC
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
Re: Don't want to have sections in Appendices in TOC
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