# Single Spacing LaTeX TOC

• LaTeX
Gold Member
I'm running in the report document class and I was wondering how does one make the table of contents single spaced? Or possibly even 1 1/2 spaced. I tried some suggestions involving the tocloft package and everything pretty much went to hell. Due to some annoying issues with how the theses need to be done (I hate my university), the table of contents is created by

\chapter*{Chapter name}

Does anyone know a simple way to single space or 1 1/2 space the entries in the TOC?

Code:
 \def\tableofcontents{\@restonecolfalse\[email protected]\@restonecoltrue\onecolumn
\@starttoc{toc}\[email protected]\twocolumn\fi}

but I'm a bit clueless as to what's going on there :)

Simon Bridge
Homework Helper
\setlength in the preamble with tocloft is the usual way to customize TOC without editing the style.

The $\LeTeX$ default is single space though - oh but you have a TOC with only chapter headings?

Code:
\documentclass{book}
\usepackage{tocloft}

\setlength\cftparskip{-2pt}
\setlength\cftbeforechapskip{0pt}

\begin{document}
\tableofcontents
\clearpage

\chapter{Test chapter one}
\chapter{Test chapter two}

\end{document}

Gold Member
I have chapters and sections :) The thesis is mainly double spaced so I declared double spacing at the very beginning of everything.

I really want to avoid using tocloft because the style file I'm using does it's own stuff to the table of contents. Tocloft makes my headings for the TOC, LOF, and LOT go a bit crazy.

D H
Staff Emeritus

Code:
\def\tableofcontents{\@restonecolfalse\[email protected]\@restonecoltrue\onecolumn
\@starttoc{toc}\[email protected]\twocolumn\fi}

but I'm a bit clueless as to what's going on there :)
It's forcing the table of contents to be single column even if the document proper is two column.

Code:
\let\@[email protected]\tableofcontents
\def\tableofcontents{\begingroup\singlespace\@[email protected]\endgroup}

Gold Member
I assume I put that after the first part that I posted? I'm pretty clueless about latex :P

I put it after and I noticed the TOC shifted but was still double spaced.

Could it be because the TOC isn't being generated automatically as expected and instead is being compiled with \addcontents{toc}{chapter}{blahblahblah}?

Simon Bridge
Homework Helper
Oh now I get you - you want to start out single space for the toc and switch to double-space for the body. That would be quite unusual as a standard, which is probably why the style doesn't support it.

How about set the document to single-space and :

\usepackage{setspace}

Then switch between different spacing options with:

\doublespacing
\singlespacing
\onehalfspacing

For other sizes use the \setstretch command like this:

\setstretch{1.8}

Double-spacing is usually only used in drafts - which is often what is requested for marking. The actual paper would use a different format.

Gold Member
Thanks for the help guys. I just realized some code after that going as

Code:
 \def\[email protected]{\par
\baselineskip 0.15in  % added for smaller spacing
\@dottedtocline{1}{0.0em}{2.6em}}
\def\[email protected]{\baselineskip 0..15in  % added for smaller spacing
\@dottedtocline{1}{2.6em}{2.3em}}
\def\[email protected]{\baselineskip 0..15in  % added for smaller spacing
\@dottedtocline{2}{4.9em}{3.2em}}
\def\[email protected]{\baselineskip 0.20in  % added for smaller spacing
\@dottedtocline{3}{8.1em}{4.1em}}
\def\[email protected]{\baselineskip 0.20in  % added for smaller spacing
\@dottedtocline{4}{12.2em}{5em}}
\def\[email protected]{\baselineskip 0.20in  % added for smaller spacing
\@dottedtocline{5}{17.2em}{6em}}

was responsible for changing the spacing upon adding things to the TOC. I didn't really see anything that made me think it was doing anything to the TOC, but apparently it is :)

AlephZero
Homework Helper
I just realized some code after that going as...

Yup, that's the right place to be. If you do
Code:
\addcontents{toc}{foo}{...}
the TOC entry is printed by the command
Code:
\[email protected]

There's nothing special about using format identifiers like "chapter", "section" etc, except those are what the \chapter{...} and \section{...} commands generate for free. If you want to do something really fancy (like including short chapter summaries in the contents or whatever) you might want to define some additional formats.

The spacing of the TOC is (almost) completely independent of the spacing of the rest of the document, so \singlespace etc won't change anything.

I didn't really see anything that made me think it was doing anything to the TOC
Look at your .toc file, then read the code of \contentsline (assuming your packages haven't renamed it as something else). \contentsline is what makes the parameter "foo" execute the command \[email protected]

Last edited: