GeneralNo space in table of contents

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
tufflax
Posts: 12
Joined: Mon Jul 07, 2008 12:34 am

No space in table of contents

Post by tufflax »

Hey!

I've got a small problem with my latex document. I don't know how to describe the problem so here is a picture:
Image

Does anyone know a fix to this problem?

Recommended reading 2024:

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

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

Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

No space in table of contents

Post by Juanjo »

In the preamble, put

Code: Select all

\makeatletter
\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.8em}}
\renewcommand*\l@subsubsection{\@dottedtocline{3}{4.3em}{3.2em}}
\makeatother
Adjust the value 2.8em to fit your needs. If you change it, make sure that you also change 4.3em accordingly (the two lengths in the definition of \l@subsection should sum up the first one in the definition of \l@subsubsection). In the above definitions, the first lenght is the indentation of numbers in the TOC (so 1.5em for subsections and 4.3em for subsubsections). The second length is the space reserved for the numbers (by default, 2.3em for subsections, which is not enough in your case).
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
tufflax
Posts: 12
Joined: Mon Jul 07, 2008 12:34 am

No space in table of contents

Post by tufflax »

Ok, thank you!

Edit: By the way, I tried putting in a new line for the sections, like so:

Code: Select all

\makeatletter
\renewcommand*\l@section{\@dottedtocline{1}{0em}{1.5em}}
\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.8em}}
\renewcommand*\l@subsubsection{\@dottedtocline{3}{4.3em}{3.2em}}
\makeatother
But that removed the bold face from the sections. Can I do that and still have bold face somehow? I realize that this way (with BF) it looks just like before, but I thought about having a bigger indent, because the subsubsection indent is so large in comparison.

Also, if anyone knows a good place to start learning about .sty files and creating new commands and other advanced features of tex and latex---I would like to know about it.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

No space in table of contents

Post by localghost »

tufflax wrote:[...] But that removed the bold face from the sections. Can I do that and still have bold face somehow? I realize that this way (with BF) it looks just like before, but I thought about having a bigger indent, because the subsubsection indent is so large in comparison. [...]
Take a look at the tocloft package. A search for that package here in the forum will yield some useful results.


Best regards and welcome to the board
Thorsten¹
tufflax
Posts: 12
Joined: Mon Jul 07, 2008 12:34 am

No space in table of contents

Post by tufflax »

Thank you!

And in the case anyone else has the same problem, here is what I did:

Code: Select all

\usepackage{tocloft}

\renewcommand{\cftsecindent}{0 em}
\renewcommand{\cftsecnumwidth}{1.9 em}

\renewcommand{\cftsubsecindent}{1.9 em}
\renewcommand{\cftsubsecnumwidth}{2.8 em}

\renewcommand{\cftsubsubsecindent}{4.7 em}
\renewcommand{\cftsubsubsecnumwidth}{3.2 em}
Post Reply