Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is it possible to get it without using package titletoc? I'm using special chapter style which doesn't work with this package.

share|improve this question
    
And the tocloft package is an option? –  Gonzalo Medina May 19 '12 at 22:27
    
Yes, it's possible. Perhaps provide further information, such as you preamble or even better a small compilable example with your class, packages and settings. –  Stefan Kottwitz May 19 '12 at 22:28

2 Answers 2

up vote 15 down vote accepted

There are so many options... without further information, one possible option would be to use the setspace package and one of its commands of environments; for example,

\documentclass{report}
\usepackage{setspace}

\begin{document}

\doublespacing
\tableofcontents
\singlespacing

\chapter{Test Chapter One}
\section{Test Section One One}
\section{Test Section One Two}
\chapter{Test Chapter Two}
\section{Test Section Two One}
\section{Test Section Two Two}

\end{document}

enter image description here

This approach will increase evenly the space between all sectional units. The following three options allow you to control separately the spacing for each group of sectional units.

Another option would be to use the tocloft package and redefine the \cftXafterpnum family of commands:

\documentclass{report}
\usepackage{tocloft}

\renewcommand\cftchapafterpnum{\vskip10pt}
\renewcommand\cftsecafterpnum{\vskip15pt}

\begin{document}

\tableofcontents

\chapter{Test Chapter One}
\section{Test Section One One}
\section{Test Section One Two}
\chapter{Test Chapter Two}
\section{Test Section Two One}
\section{Test Section Two Two}

\end{document}

enter image description here

Yet another option, this time using the etoolbox package to patch the sectional units commands to add vertical space to the ToC:

\documentclass{report}
\usepackage{etoolbox}

\makeatletter
\pretocmd{\chapter}{\addtocontents{toc}{\protect\addvspace{15\p@}}}{}{}
\pretocmd{\section}{\addtocontents{toc}{\protect\addvspace{5\p@}}}{}{}
\makeatother

\begin{document}

\tableofcontents

\chapter{Test Chapter One}
\section{Test Section One One}
\section{Test Section One Two}
\chapter{Test Chapter Two}
\section{Test Section Two One}
\section{Test Section Two Two}

\end{document}

enter image description here

A fourth option not requiring any packages would be to redefine the \chapter and \section commands as implemented in the used document class to add the vertical space to the ToC; an example with report:

\documentclass{report}

\makeatletter
\renewcommand\chapter{\addtocontents{toc}{\protect\addvspace{5\p@}}%
  \if@openright\cleardoublepage\else\clearpage\fi
  \thispagestyle{plain}%
  \global\@topnum\z@
  \@afterindentfalse
  \secdef\@chapter\@schapter}
\renewcommand\section{\addtocontents{toc}{\protect\addvspace{20\p@}}%
  \@startsection {section}{1}{\z@}%
  {-3.5ex \@plus -1ex \@minus -.2ex}%
  {2.3ex \@plus.2ex}%
  {\normalfont\Large\bfseries}}
\makeatother

\begin{document}

\tableofcontents

\chapter{Test Chapter One}
\section{Test Section One}
\section{Test Section Two}
\chapter{Test Chapter One}
\section{Test Section One}
\section{Test Section Two}

\end{document}

enter image description here

share|improve this answer
1  
Thank you for detailed answer. –  Jane May 20 '12 at 12:12

While the other suggestions so far allow increasing the line spacing of the Table of Contents, it seems they don't allow decreasing it, for example to fit a ToC on one page.

A simple

\renewcommand{\baselinestretch}{0.75}\normalsize
\tableofcontents
\renewcommand{\baselinestretch}{1.0}\normalsize

will allow setting any line spacing.

It might be necessary to find out what your baselinestretch size is by default as the style seems to set this.

share|improve this answer

Your Answer

 
discard

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.