GeneralModify Table of Contents: Reduce Spacing Between Lines?

LaTeX specific issues not fitting into one of the other forums of this category.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10342
Joined: Mon Mar 10, 2008 9:44 pm

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

Post by Stefan Kottwitz »

This preamble doesn't load subfigure, that's why you don't need the option [subfigure] for tocloft.
Without that your code doesn't produce the error "command c@lotdepth already defined" mentioned above. How did that error happen? Using this preamble?

Stefan
LaTeX.org admin

Recommended reading 2024:

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

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

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

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

Post by veerle »

Oh okay! Now I understand you have to put \usepackage{subfigure} as well as \usepackage[subfigure]{tocloft}! Okay my problem is solved, except the problem with my roman numbers... Could you help me on that and than I will be a very happy person :D
THANK YOU VERY MUCH!!!!!
veerle
Posts: 16
Joined: Fri May 01, 2009 6:50 pm

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

Post by veerle »

It must be something with numwidth but I don't know exactually how I have to do it
User avatar
Stefan Kottwitz
Site Admin
Posts: 10342
Joined: Mon Mar 10, 2008 9:44 pm

Modify Table of Contents: Reduce Spacing Between Lines?

Post by Stefan Kottwitz »

Ah, I can see, at first I've understood the problem incorrectly. Try this quick fix without tocloft, changing \numberline:

Code: Select all

{\let\stdnumberline\numberline
\renewcommand*\numberline[1]{\stdnumberline{#1}\quad}
\tableofcontents}
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 »

Thank you!! It's working excellent!!!
Now I want the name 'table of contents' in the same lay-out like my other chapters , I've tried this:

\renewcommand{\cftZtitlefont}{
\hrule
\vspace{5pt}
\Huge \bfseries {Inhoudsopgave}
\vspace{5pt}%
\hrule }

but again an error... 'cftZtitlefont' is undefined
I'm sorry, I hope that it's my last question!!
Thank you

Veerle
User avatar
Stefan Kottwitz
Site Admin
Posts: 10342
Joined: Mon Mar 10, 2008 9:44 pm

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

Post by Stefan Kottwitz »

Hi Veerle,

perhaps just don't load tocloft, everything would be ok (but keep the redefiniton of \numberline) - or not?
Do you still need tocloft? Does the toc title font really need adjustment?

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 »

If I don't use the package tocloft than is my table of contents too big, there is too much space between the rules, and
\begin{spacing}{0.1}
\tableofcontents
\end{spacing}
doesn't work :? I would really like to change the style of the title 'table of contents'....
User avatar
Stefan Kottwitz
Site Admin
Posts: 10342
Joined: Mon Mar 10, 2008 9:44 pm

Modify Table of Contents: Reduce Spacing Between Lines?

Post by Stefan Kottwitz »

Then try

Code: Select all

\usepackage[titles]{tocloft}
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 »

I have already tried it
when I put \usepackage[subfigure][titles]{tocloft} I get an error: missing begin document
When I put \usepackage[subfigure,titles]{tocloft} then I get no errors but nothing is changing, everything is back like it was before (no space in between the lines)
When I put \usepackage[subfigure]{tocloft} \usepackage[titles]{tocloft} I get an error: Option clash for tocloft
:?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10342
Joined: Mon Mar 10, 2008 9:44 pm

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

Post by Stefan Kottwitz »

In that case forget the titles option.

Instead of \cftZtitlefont use \cfttoctitlefont. Z stands for toc, lof or lot according to the documentation.

Stefan
LaTeX.org admin
Post Reply