The following code uses the pagestyles option and \renewpagestyle from the titlesec package to redefine the plain style:






The expected behaviour would be to clear all fields in both the header and footer; however, the result of the above example code is the following:

enter image description here

Why is the word "Contents" appearing in the header and in the footer?

  • This seems to be resolved if you formally issue a \pagestyle{plain} after setting it via \renewstyle{plain}{..}.
    – Werner
    Dec 6 '11 at 6:14
  • @Werner: but then all pages will have plain style, unless a manual change is done. Certainly that's not the desired behaviour. Dec 6 '11 at 13:24

The documentation of titlesec warns about using \markboth along with it. The \tableofcontents issues \@mkboth (which is usually equivalent to \markboth). One can cure the problem by saying


(which is something titlesec should do by itself).

  • 2
    What I don't understand is why the problem doesn't show up in report class, even though the code for \tableofcontents in the two classes is identical.
    – Alan Munn
    Dec 6 '11 at 17:00
  • In addition to Alan's comment, in both classes \@mkboth is let exactly the same, either as \markboth or as \@gobbletwo, so yes, it's strange that the problem appears with book but not with report. Dec 7 '11 at 1:51
  • @Alan. Because report has plain as the main page style while book has headings. If plain is used as a "subsidiary" style with \thispagestyle, the main page style has to be (re)defined with titlesec, too. See the manual for further info. BTW, \renewpagestyle{plain}{} is shorter. (I'll realease a new version with many new features for page styles in a few days.) Dec 7 '11 at 11:37
  • 2
    @JavierBezos I'd say that the documentation is not very clear about that: it took me a while to understand that the explanation is in footnote 21.
    – egreg
    Dec 7 '11 at 11:49
  • 2
    @JavierBezos: could you please clarify to me your last comment? According to egreg's answer it seems that the problem is \@mkboth, but you say that this is not the culprit. What is then the cause of the problem? Perhaps I am misunderstanding you previous comment?. Dec 7 '11 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.