# How to set different line spread for table of contents than the rest of document?

I am writing my final paper on university, and we have to use double line spread and Times New Roman. If I set \linespread{1.6} in the preamble everything is fine, except that in the table of contents \sections get huge spacings. If I set the line spread after the \tableofcontents tag noting happens, line spread remains normal.

Is there any possibility to keep normal line spread in the TOC only?

-
\linespread after \begin{document} needs \selectfont to become active. See fntguide for more information about this and the answers below for recommended solutions to your question. –  Schweinebacke Dec 6 '11 at 14:40

You can use the featrures provided by the setspace package:

\documentclass{article}
\usepackage{setspace}

\doublespacing

\begin{document}

\begingroup
\singlespacing
\tableofcontents
\endgroup

\section{Section One}
\section{Section Two}
\section{Section Three}
\section{Section Four}
\section{Section Five}

\end{document}


or

\documentclass{article}
\usepackage{setspace}

\begin{document}

\tableofcontents

\doublespacing

\section{Section One}
\section{Section Two}
\section{Section Three}
\section{Section Four}
\section{Section Five}

\end{document}

-
In your second example, I would just use \usepackage[doublespacing]{setspace}, which results in exactly the same thing as your current code (\DeclareOption{doublespacing}{\AtEndOfPackage{\doublespacing}}, l. 285) , but it's more concise. –  doncherry Dec 6 '11 at 15:34
@doncherry: no, they do not produce the same result; in my second code \doublespacing does not affect the ToC. –  Gonzalo Medina Dec 6 '11 at 16:17
Sorry, I meant your first example, of course; must've been holding my laptop the wrong way round again. So, instead of \usepackage{setspace}\doublespacing, I'm suggesting \usepackage[doublespacing]{setspace}. –  doncherry Dec 6 '11 at 16:23
@doncherry: Ah. Well, yes that would be another way. –  Gonzalo Medina Dec 6 '11 at 16:42

You can use the setspace package. Simply add \usepackage{setspace} to the preamble and \doublespacing after the table of contents:

\documentclass{article}
\usepackage{setspace}
\usepackage{lipsum}
\begin{document}
\tableofcontents
\doublespacing
\section{one}
\lipsum[1-4]
\section{two}
\lipsum[5-8]
\section{three}
\lipsum[9-12]
\end{document}


-