I use the trick from How to get header and footer over ToC, LoF and Nomeclature? to ensure that all pages[1] (including the 1st page of the Table of Contents) have headers and footers:
\tableofcontents\thispagestyle{fancy}
That works fine. However, I then use the trick from TOC Text – numbers alignment to widen the space reserved for section numbers (so that section "10.10" doesn't cause overlapping text)
\usepackage{tocloft}
\setlength{\cftsubsecnumwidth}{3em}
Adding the tocloft command seems to reverse the 'fancy page style' command, so that the ToC no longer has headers and footers.
Do these commands need to be in some specific order to work correctly?
Alternatively, is there some other (non-tocloft) way to fix ToC numbers and text that overlap?
[1] Actually, we want the title page to not have header/footer, so can't just redefine \fancypagestyle{plain}
like in Header and Footer on multipage listoffigures
Best Answer
If the
tocloft
package is loaded, the page style of pages in the ToC, LoT, and LoF is governed by the package's\tocloftpagestyle
macro. Tocloft's default page style isplain
. To change the page style of these pages tofancy
, issue the commandAddendum, prompted by a comment by @egreg: You can also achieve your objective by loading the
tocloft
package with thetitles
option:The manual of the
tocloft
package has the following to say about this option:It turns out that the
titles
option is quite useful not only if thefncychap
package is in use, but also if thefancyhdr
package is employed.