GeneralModify Table of Contents: Reduce Spacing Between Lines?

LaTeX specific issues not fitting into one of the other forums of this category.
douglastoy
Posts: 7
Joined: Mon Apr 06, 2009 11:07 am

Modify Table of Contents: Reduce Spacing Between Lines?

Post by douglastoy »

My table of contents is rather large and I would like to reduce the space it takes up without sacrificing any of its content.

Is there any way to reduce the spacing between the lines of the TOC i.e. reduce the vertical distance between lines? Are there any packages that can achieve this? For example, I'm looking for something similar to the \begin{enumerate*} command which reduces the vertical spacing in lists.

Thanks in advance

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10340
Joined: Mon Mar 10, 2008 9:44 pm

Modify Table of Contents: Reduce Spacing Between Lines?

Post by Stefan Kottwitz »

Hi,

you could use the setspace package. Its documentation is contained in the file setspace.sty.

Stefan
LaTeX.org admin
douglastoy
Posts: 7
Joined: Mon Apr 06, 2009 11:07 am

Modify Table of Contents: Reduce Spacing Between Lines?

Post by douglastoy »

Thanks Stefan, spot on. Here's I'm doing things now...

Code: Select all

\documentclass[11pt,a4paper]{report}
...
\usepackage{setspace}
...
\begin{document}
%\setcounter{tocdepth}{1}     (Could use this to shorten things further)
\begin{spacing}{0.1}
\tableofcontents
\listoffigures
\listoftables
\end{spacing}
And Voila! Shorter Table of Content, List of Figures and List of Tables. Found lots of useful information for squeezing more into my document here:

http://www.eng.cam.ac.uk/help/tpl/textp ... ueeze.html

Thanks for your help.
veerle
Posts: 16
Joined: Fri May 01, 2009 6:50 pm

Re: Modify Table of Contents: Reduce Spacing Between Lines?

Post by veerle »

Hy all,

I'm new here on this forum!
I had also a problem with reducing spacing between lines
I've tried

\begin{spacing}{0.1}
\tableofcontents
\end{spacing}

If you put this just after \begin{document} it works very well! But I have first the title of my thesis and a 'word before' (I don't know the word in English, sorry), and when I than put :

\begin{spacing}{0.1}
\tableofcontents
\end{spacing}

It doesn't work anymore!! Has somebody a solution??

I have another problem too in my table of contents, for my chapters I'm using Roman numbers, so i get for example VIII Appendix; but in my table of contents the A from appendix is on the I van VIII, it overlaps! Can somebody help me with that? It would be very nice!!!!

bye bye!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10340
Joined: Mon Mar 10, 2008 9:44 pm

Modify Table of Contents: Reduce Spacing Between Lines?

Post by Stefan Kottwitz »

Hi veerle,

welcome to the board!
Is there just no effect or do you get an error message?

To fix the other problem you could adjust \@pnumwidth, for example

Code: Select all

\makeatletter
\renewcommand*\@pnumwidth{3em}
\makeatother
Or use the tocloft package.

Stefan
LaTeX.org admin
veerle
Posts: 16
Joined: Fri May 01, 2009 6:50 pm

Re: Modify Table of Contents: Reduce Spacing Between Lines?

Post by veerle »

Thanks Stefan!
I don't get an error but nothing changes... It's very weird, when I put it just after \begin{document} it works, but otherwise not...

Also the following doesn't work, I don't get an error but again, nothing changes...
\makeatletter
\renewcommand*\@pnumwidth{3em}
\makeatother

I was planning to use the tocloft-package, but unfortunately when I write:
\usepackage{tocloft} then after the compilation I get two errors:
command c@lotdepth already defined
What's this?

Thank you in advance!!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10340
Joined: Mon Mar 10, 2008 9:44 pm

Modify Table of Contents: Reduce Spacing Between Lines?

Post by Stefan Kottwitz »

Hi veerle,
veerle wrote: I was planning to use the tocloft-package, but unfortunately when I write: \usepackage{tocloft} then after the compilation I get two errors: command c@lotdepth already defined
there's a conflict between tocloft and subfigure. If you are using the subfigure package then write

Code: Select all

\usepackage[subfigure]{tocloft}
and tocloft will fix it.

Stefan
LaTeX.org admin
veerle
Posts: 16
Joined: Fri May 01, 2009 6:50 pm

Re: Modify Table of Contents: Reduce Spacing Between Lines?

Post by veerle »

Thx, but it still doesn't work , no I get again two errors:

\l@subfigure undefined
\l@subtable undefined

Maybe another package which is causing a conflict?
THX!!!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10340
Joined: Mon Mar 10, 2008 9:44 pm

Modify Table of Contents: Reduce Spacing Between Lines?

Post by Stefan Kottwitz »

veerle wrote: Maybe another package which is causing a conflict?
Possibly, perhaps I will see it if you would post your document preamble showing at least the packages loaded.

Stefan
LaTeX.org admin
veerle
Posts: 16
Joined: Fri May 01, 2009 6:50 pm

Re: Modify Table of Contents: Reduce Spacing Between Lines?

Post by veerle »

Here you are:

\documentclass[11pt,a4paper]{report}

\usepackage[small,bf,hang]{caption2}
\usepackage{a4wide}
\usepackage[dutch]{babel}


\addto\captionsdutch{%
\renewcommand\chaptername{}}

\usepackage{amsmath}
\usepackage{url}
\usepackage{graphicx}
\usepackage[latin1]{inputenc}
\usepackage{xspace}
\usepackage{fancyhdr}
\setlength{\parindent}{0cm}
\setlength{\parskip}{2.3ex plus 0.3ex minus 0.3ex}
\renewcommand{\baselinestretch}{1.2}
\renewcommand{\arraystretch}{1.2}

\usepackage[version=3]{mhchem}

\usepackage[round]{natbib}
\bibliographystyle{bibliodutch}
\usepackage[nottoc]{tocbibind}

\newcommand{\ch}[1]{\ensuremath{\mathrm{#1}}\xspace}
\newcommand{\chpijlr}{\ensuremath{\hspace{1em}\longrightarrow\hspace{1em}}}
\newcommand{\chpijll}{\ensuremath{\hspace{1em}\longleftarrow\hspace{1em}}}
\newcommand{\chpijllr}{\ensuremath{\hspace{1em}\longleftrightarrow\hspace{1em}}}

\usepackage{relsize}
\usepackage{array,multicol,fancyhdr,times}
\usepackage[subfigure]{tocloft}
\usepackage{flafter}
\usepackage{float}
\usepackage{setspace}
Post Reply