3

I am using the fancyhdr package in the article document class. I would like all pages (including the table of contents page) to have the header and footer that I prescribe in the preamble.

I would also like to modify the table of contents name with the following command:

\renewcommand\contentsname{\centering\bf TABLE OF CONTENTS}

With this \renewcommand in the preamble, LaTeX stops at \tableofcontents (no error given). I can either leave the \renewcommand in and change to plain pagestyle, or I can remove the command and use my fancy header and footer, but I cannot do both.

Does anyone know of a command that will remove/avoid the conflict between the renewcommand and the fancy pagestyle?

closed as unclear what you're asking by user31729, user13907, Andrew Swann, Mensch, Przemysław Scherwentke Oct 21 '14 at 12:07

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Jun 25 '14 at 6:42
  • I think, \centering is the source of the error. \bf is outdated and should be avoided, use \textbf{...} instead. Besides, the \contentsname is printed in bold font usually – user31729 Jun 25 '14 at 6:43
  • The next problem could be, that \tableofcontent uses a \thispagestyle{plain} (as far as I know), such that headers/footers are disregarded. – user31729 Jun 25 '14 at 6:47
  • Please try the first code block (the one with \let\LaTeXStandardToc\...) I used in this answer: tex.stackexchange.com/questions/185782/…. This should prevent the empty or plain pagestyle of the TOC. – user31729 Jun 25 '14 at 6:50
  • 1
    That's a really bad way to do this. If you would add an MWE as mentioned above, somebody would be happy to help you find a better solution. – cfr Jun 26 '14 at 2:12