TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I remove the vertical spacing before each section in the table of contents from a 'article' documentclass?

share|improve this question
the question's title means chapter, the question's body refers to section. Btw. before sections there's no space, but before chapters there is. – Stefan Kottwitz Mar 14 '11 at 19:58
Hugo, please also update the title if you want change the spacing of section lines instead of chapter lines. Note that simple changing \l@section to \l@chapter in Gonzalo's answer might not work. – Martin Scharrer Mar 14 '11 at 19:59
It actually works... I meant about referring to section, because chapter does not exist in the 'article' documentclass. Yes, I made a lot of mistakes in this question, but the answer's still valid. – Hugo S Ferreira Mar 14 '11 at 20:15
up vote 4 down vote accepted

You can redefine \l@section as implemented in article.cls and suppress (or comment out) the line \addvspace{1.0em \@plus\p@}% responsible for the extra space. Simply add these lines to the preamble of your document:

  \ifnum \c@tocdepth >\z@
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode \bfseries
      \hskip -\leftskip
      #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
share|improve this answer

You can do this easily with the tocloft package:


will do what you want.

share|improve this answer
Not only did that work, it also solved a problem I had with styles! Thx! – Hugo S Ferreira Mar 14 '11 at 21:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.