Generaldo want appendices listed in toc

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
hfarrukhn
Posts: 17
Joined: Thu Sep 04, 2008 9:57 pm

do want appendices listed in toc

Post by hfarrukhn »

Hi all,
I am Farrukh from Uni. of Innsbruck.
I am using \chapter in my appendix, cause I want to number my chapters and sections etc in appendices, but I want that my appendices to be listed in toc. I am using appendix package.

Any idea

best regards,
Farrukh

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

hfarrukhn
Posts: 17
Joined: Thu Sep 04, 2008 9:57 pm

Re: don't want appendices listed in toc

Post by hfarrukhn »

Sorry for typing mistake in my last mail. I want NOT to list appendices in toc.
Sorry again.

regards,
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

do want appendices listed in toc

Post by Stefan Kottwitz »

Hi Farrukh,

welcome to the board!
You could change the tocdepth counter:

Code: Select all

\addtocontents{toc}{\protect\setcounter{tocdepth}{-2}}
right after \appendix.

Stefan
LaTeX.org admin
hfarrukhn
Posts: 17
Joined: Thu Sep 04, 2008 9:57 pm

Re: do want appendices listed in toc

Post by hfarrukhn »

Thank you for your kind reply and welcome. But this command did not help. I still see appendices in toc :(.
Farrukh
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

do want appendices listed in toc

Post by gmedina »

Hi hfarrukhn,

that's strange. The following simple example shows that Stefan_K[/code]'s suggestion works:

Code: Select all

\documentclass{report}
\usepackage{appendix}

\begin{document}
\tableofcontents

\chapter{Dummy chapter}
\appendix
\addtocontents{toc}{\protect\setcounter{tocdepth}{-2}}
\chapter{First appendix}.
\chapter{Second appendix}

\end{document} 
Do not forget to compile your document twice since you are generating a ToC. If your problem persists then we will need more information. Could you please post a minimal working example showing the undesired bahaviour?
1,1,2,3,5,8,13,21,34,55,89,144,233,...
hfarrukhn
Posts: 17
Joined: Thu Sep 04, 2008 9:57 pm

do want appendices listed in toc

Post by hfarrukhn »

Hi,
With your example of article class it works fine. But with me not.
I am sorry I should have mentioned that I am using class svmono. Below the code how I am using it and that still generates appendices in the toc

Code: Select all

\documentclass[envcountsame,envcountchap,twoside]{svmono}
\usepackage{appendix}

\begin{document}
\tableofcontents

\chapter{Dummy chapter}
\appendix
\addtocontents{toc}{\protect\setcounter{tocdepth}{-2}}
\chapter{First appendix}.
\chapter{Second appendix}

\end{document} 
I have attached svmono class file with this reply.
Regards,
Attachments
svmono.cls
svmono class file
(60.11 KiB) Downloaded 281 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

do want appendices listed in toc

Post by Stefan Kottwitz »

Hi Farrukh,

it seems that svmono doesn't respect tocdepth. But you could disable \l@chapter (and \l@section etc.), like:

Code: Select all

\appendix
\makeatletter
\addtocontents{toc}{\protect\renewcommand\protect\l@chapter[2]{}}
\makeatother
Stefan
LaTeX.org admin
hfarrukhn
Posts: 17
Joined: Thu Sep 04, 2008 9:57 pm

Re: do want appendices listed in toc

Post by hfarrukhn »

This worked right away! Thank you very much Stefan. You are doing a great job on this community.

How one can learn these things ? ;)
Cheers,
Farrukh
Post Reply