Page Layoutcftpartnumwidth - TOC not responding to changes

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
ujujinsan
Posts: 1
Joined: Thu Jan 20, 2011 12:47 am

cftpartnumwidth - TOC not responding to changes

Post by ujujinsan »

I am using miktex 2.9.
Compiling with pdflatex.

I want to increase the numwidth in TOC of part entry in article class to make titles of parts aligned to one line.

The minimal example:

Code: Select all

\documentclass{article}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage[english]{babel} 

\usepackage{tocloft}
\setlength{\cftpartnumwidth}{4em}
\cftsetindents{part}{0em}{4em}

\begin{document}
\tableofcontents
\part{Part1}
\part{Part2}
\part{Part3}
\part{Part4}
\part{Part5}
\part{Part6}
\end{document}

Neither seems to work:

Code: Select all

\setlength{\cftpartnumwidth}{4em}
\cftsetindents{part}{0em}{4em}
I can easily modify numwidth of sections subsections etc. Changes are reflected in TOC.

While reading tocloft documentation it is stated:
There is no explicit numwidth for a part; instead a gap of 1em is put between the number and the title text.
However while reading tocloft.sty I see no difference between definitions of \renewcommand*{\l@part}[2] and \renewcommand*{\l@section}[2] .
All modifications to tocloft.sty concerning partnumwidth fail to deliver.

Any ideas? I will be grateful for help!

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply