# Remove dots in toc for a particular entry like appendix

I am writing my thesis and use the book class under PhDthesisPSnPDF.

I would like to remove the dots in table of contents only for a particular entry like "Appendix". All the entries for chapter and section in the table of contents have dots and page numbers, I need to get rid of page number and the dots for the appendix in the TOC. Is there way to do?

-
 Can You please add a link to the PhDthesisPSnPDF? Is it this one? – Kurt Sep 12 '12 at 18:45 Hi Kurt, you are right this is the one i use. – user6629 Sep 12 '12 at 19:00 But the linked PDF does not show any dots for chapters. So what packages are you including that is causing these dots to appear for chapters? – Werner Sep 12 '12 at 19:21

A heading command like \section{A} writes a line into the .toc file that looks like this:

\contentsline {section}{\numberline {1.1}A}{2}


when this is read back in \contentsline{section} simply expands to \l@section and that is then the command that picks up the remaining arguments and produces the toc entry. Most often (but not always) this command is defined as a special instance of \@dottedcontentsline, e.g., in the book class you find:

\newcommand*\l@section{\@dottedtocline{1}{1.5em}{2.3em}}


So to get rid of the dots in some cases there are different approaches possible and the depend on how things are defined and which entries you have to change in reality.

### Plan A

Assuming that your toc uses \@dottedtoclinethen to get rid of the dots we can redefine \@dotsep to have a very high number. Assuming further, that we only want to change the sections at the end of the toc and we do not need to have dots appearing later on again. Then the following in front of the appendix in the source document will do the trick:

\makeatletter
\makeatother


This will write \def\@dotsep{100} into the toc file and from that point on the dots are gone.

If you need them back at a later point issue

\makeatletter

Make the heading commands in the appendix area or whenever you want a different toc style not write \contentsline{section}but, say, \contentsline{appsection} and then define \l@appsection to format the toc entry according to the desired style.
For this one would need to look for the places in the heading commands that issue \addcontentsline and change that code.