Having a book document class, I am trying to achieve having different footer/headers for the first page of every chapter.

Based on this answer instructions, I have defined the following custom style, using titlesec:


And then change the chapter first page style by using:


Everything works fine for every chapter except the ToC, which outputs CONTENTS at both header and footer, like below:

enter image description here

While the expected behaviour (that works fine in the rest of chapters) is:

enter image description here

  • \tableofcontents uses \chapter* which is apparently not catched with your titlesec approach
    – user31729
    Mar 6, 2017 at 17:11
  • @ChristianHupfer Any hints on how should I approach this, then? Thanks
    – otorrillas
    Mar 6, 2017 at 17:12
  • Well, not really without seeing your full code. Fragments aren't useful. I also doubt that titlesec and a redefinition of \chapter will go well together
    – user31729
    Mar 6, 2017 at 17:18
  • The \secdef macro \def\secdef#1#2{\@ifstar{#2}{\@dblarg{#1}}} causes \chapter to execute \@chapter and \chapter* to execute \@schapter. Mar 6, 2017 at 17:29

1 Answer 1


Here is a way to adapt \thispagestyle in the \chapter command 'dynamically' by replacing it with a \@currentthispagestyle, which is set with \SetCurrentPageStyle

I used fancyhdr (because I am more familiar with that package) and tcolorbox (since I don't know where \vcenteredhbox comes from)

Since \@currentthispagestyle defaults to plain, the ToC will use the plain style.



    enhanced jigsaw,
    sharp corners, 



%Define a page style



% Perform a patch to change 'plain' to `\@currentthispagestyle`




enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .