I'm preparing a document using the book
class. In the table of contents, the space between the subsection number and title is too wide. How to reduce it?
[Tex/LaTex] How to modify the space between the numbers and text of sectioning titles in the table of contents
spacingtable of contents
Best Answer
Without any packages:
In the standard documentclass without the influence of a package like
titletoc
you have to redefine the command\l@subsection
. In the filebook.cls
you find the following settings:The command
\@dottedtocline
expects the following parameters:To reduce the indentation of
subsection
you can do:Example:
The method is equal for floating environments. The standard class
book.cls
provides\l@figure
and and\l@table
with the following settings:Package titletoc
By using the package titletoc you can set the indentation using
\dottedcontents
:Example
The argument
<section>
can be somewhat irritating. The argument allows the name without a leading backslash so thatfigure
andtable
are allowed, too.Package tocloft
The package tocloft offers more than the following setting. The indentation is set by the length
\cftXindent
. TheX
stands for:\part
titles\chapter
titles\section
titles\subsection
titles\subsubsection
titles\paragraph
titlesfigure \caption
titletable \caption
titlesExample:
KOMA-Script
With a recent version of KOMA-Script one can use
\RedeclareSectionCommand
to change the entries in the table of contents as well. You can use that for all defined sectioning commands.The modification of
figure
andtable
is equal to the standard class and defined as follow:Package tocstyle (link in German)
With recent versions of KOMA-Scrpt, many parts of
tocstyle
are unneeded. It will be completely incorporated in KOMA-Script in the future.To manipulate the toc (or other list of ...) in combination with a class of the KOMA bundle you should use the package
tocstyle
. The package is part of the KOMA bundle but with a separate documentation. The influence of the indentation is given indirectly byentryhook
which can be set by\settocfeature
One of the benefits of
tocstyle
is the automatic calculation of the needed indentation.Example: