LaTeX forum ⇒ 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?

Postby douglastoy » Mon Apr 27, 2009 5:46 pm

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

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7804
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Mon Apr 27, 2009 6:02 pm

Hi,

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

Stefan
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

douglastoy
Posts: 7
Joined: Mon Apr 06, 2009 11:07 am

Postby douglastoy » Mon Apr 27, 2009 8:34 pm

Thanks Stefan, spot on. Here's I'm doing things now...
  1. \documentclass[11pt,a4paper]{report}
  2. ...
  3. \usepackage{setspace}
  4. ...
  5. \begin{document}
  6. %\setcounter{tocdepth}{1} (Could use this to shorten things further)
  7. \begin{spacing}{0.1}
  8. \tableofcontents
  9. \listoffigures
  10. \listoftables
  11. \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/textprocessing/squeeze.html

Thanks for your help.

Link:
BBcode:
HTML:
Hide post links
Show post links

veerle
Posts: 16
Joined: Fri May 01, 2009 6:50 pm

Postby veerle » Fri May 01, 2009 6:55 pm

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!

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7804
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Fri May 01, 2009 7:32 pm

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
  1. \makeatletter
  2. \renewcommand*\@pnumwidth{3em}
  3. \makeatother

Or use the tocloft package.

Stefan
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

veerle
Posts: 16
Joined: Fri May 01, 2009 6:50 pm

Postby veerle » Sat May 02, 2009 10:44 am

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!!

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7804
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Sat May 02, 2009 2:00 pm

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
  1. \usepackage[subfigure]{tocloft}

and tocloft will fix it.

Stefan
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

veerle
Posts: 16
Joined: Fri May 01, 2009 6:50 pm

Postby veerle » Sat May 02, 2009 2:10 pm

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!!!

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7804
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Sat May 02, 2009 2:30 pm

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
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

veerle
Posts: 16
Joined: Fri May 01, 2009 6:50 pm

Postby veerle » Sat May 02, 2009 3:31 pm

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}

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “General”

Who is online

Users browsing this forum: Bing [Bot] and 6 guests