# How do I add dots in TOC?

I want to add dots that would fill the space from section/subsection name to the page number in TOC. How do I do that?

-

Try the tocloft package with something like

``````\usepackage{tocloft}
``````

in case you're using the `article` class (See the package documentation for other classes).

As an illustration, let's try it with the `sample2e.tex` file; following `pdflatex sample2e` (two times), we got

-
`\cftchapleader` is undefined. –  user1996 Dec 18 '10 at 17:56
@an_ant Sorry, fixed it with `\cftsecleader`. –  chl Dec 18 '10 at 17:59
It doesn't do it. –  user1996 Dec 18 '10 at 18:00
@an_ant It works for me :( I added instructions on how I did it. –  chl Dec 18 '10 at 18:07
I'm sorry. It did the job! I knew it was `tocloft` but just wasn't able to search for it know. Thanks! –  user1996 Dec 18 '10 at 18:11

One way of doing this is to use the memoir class, where this is the default behaviour.

Memoir incorporates an extensive set of functions borged from other useful packages; I use it as my day-to-day general-purpose style for almost everything except presentations.

-
I would prefer to stick with article for now, if this is possible. Thanks, anyway! –  user1996 Dec 18 '10 at 17:56
You're welcome. Memoir is a bit daunting at first, but once you've taken the plunge, you've got more-or-less everything you'll commonly need in one manual. –  Brent.Longborough Dec 18 '10 at 18:18