[Tex/LaTex] tocloft package interfering with ToC page style

header-footertable of contentstocloft

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 is plain. To change the page style of these pages to fancy, issue the command

\tocloftpagestyle{fancy}

Addendum, prompted by a comment by @egreg: You can also achieve your objective by loading the tocloft package with the titles option:

\usepackage[titles]{tocloft}

The manual of the tocloft package has the following to say about this option:

The titles option causes the titles of the ToC, LoF, and LoT lists to be typeset using the default LATEX methods. This can be useful, for example, when the tocloft and fncychap packages are used together and the 'fancy' chapter styles should be used for the ToC, etc., titles.

It turns out that the titles option is quite useful not only if the fncychap package is in use, but also if the fancyhdr package is employed.