Document Classes ⇒ \tableofcontents in book class space issue
\tableofcontents in book class space issue
Hi,
I am currently using the Book.cls to create my table of contents but after adjusting a few things I see that the section number is overlapping into the title. I have uploaded an image so you can see for youself.
Does anyone have any idea where the latex is that controls the spacing bettween the section number and the tile?
Thanks
I am currently using the Book.cls to create my table of contents but after adjusting a few things I see that the section number is overlapping into the title. I have uploaded an image so you can see for youself.
Does anyone have any idea where the latex is that controls the spacing bettween the section number and the tile?
Thanks
- Attachments
-
- TitleMerge.jpg (12.48 KiB) Viewed 7481 times
NEW: TikZ book now 40% off at Amazon.com for a short time.

\tableofcontents in book class space issue
use tocloft package, you can play with every possible setting concerning toc.
\tableofcontents in book class space issue
Thanks for the suggestion,
It seems I need this
With an exmaple being:
I am fairly new to Latex so when I try and include that line I just get
Thanks
EDIT:
I managed to fix it by doing this:
It seems I need this
Code: Select all
\@dottedtocline{seclevel}{indent}{numwidth}
Code: Select all
\newcommand*{\l@section}{\@dottedtocline{1}{1.5em}{2.3em}}
Any ideas what I am doing wrong?! LaTeX Error: Command \l@section already defined.
Or name \end... illegal,.
Thanks
EDIT:
I managed to fix it by doing this:
Code: Select all
\makeatletter
\renewcommand*\l@section{\@dottedtocline{1}{0em}{3em}}
\makeatother
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
\tableofcontents in book class space issue
This could have been done much easier.
Adapt the length if necessary.
Best regards and welcome to the board
Thorsten
Code: Select all
\setlength{\cftsecnumwidth}{3em}
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: \tableofcontents in book class space issue
Thanks for the suggestion but that pushes the page number to the right as well.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
\tableofcontents in book class space issue
That's an issue I can't comprehend. Consider the following example.4fingers wrote:Thanks for the suggestion but that pushes the page number to the right as well.
Code: Select all
\documentclass[11pt,a4paper,english]{book}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[includeheadfoot,margin=2cm]{geometry}
\usepackage{tocloft}
\usepackage{blindtext}
\setlength{\cftsecnumwidth}{3em}
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\Blinddocument
\end{document}
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: \tableofcontents in book class space issue
Its Ok, as long as my previous method works I dont mind if your suggested method returns different results that you might expect.
One thing I have found is that I really only need to adjust the numwidth on the first table of contents. To save space am I able to detect if I am on the first table of contents, in which case apply a differnt numwidth to all the other table of contents?
THanks
One thing I have found is that I really only need to adjust the numwidth on the first table of contents. To save space am I able to detect if I am on the first table of contents, in which case apply a differnt numwidth to all the other table of contents?
THanks
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
\tableofcontents in book class space issue
As long as my method yields unexpected results in your document, your code is flawed.4fingers wrote:Its Ok, as long as my previous method works I dont mind if your suggested method returns different results that you might expect. [...]
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10