0

In my document I want all my headers and footers to be the same, so I use this code for that purpose:

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancypagestyle{plain}
\fancyhf{}
\fancyhead[C]{}
\fancyfoot[C]{}
\fancyhead[RE,LO]{Manuel Alonso Cousido}
\fancyhead[LE,RO]{History}
\fancyfoot[RE,LO]{\thepage}
\fancyfoot[LE,RO]{\leftmark}

However, only some pages display the headers and footers. The first page of each chapter and the TOC pages have no header nor footer.

Do I have to use \thispagestyle{fancy} for every first page of chaper? In that case, how can I ensure that all the TOC pages get a footer and a header?

  • Usually, chapter start pages use \thispagestyle{plain}. , so by redefining plain it should do what you want. \fancypagestyle{plain}{\pagestyle{fancy}} should work as well – user31729 Jan 27 at 15:01
1

You can use pagestyle fancyplain instead fancy to get the same header and footer for plain and fancy pages. If there should be a headrule on plain pages too, redefine \plainheadrulewidth.

Example:

\documentclass{report}
\usepackage{fancyhdr}
\pagestyle{fancyplain}% <- pagestyle fancyplain
\renewcommand\plainheadrulewidth{.4pt}% headrule on plain pages
\fancyhf{}
\fancyhead[RE,LO]{Manuel Alonso Cousido}
\fancyhead[LE,RO]{History}
\fancyfoot[RE,LO]{\thepage}
\fancyfoot[LE,RO]{\leftmark}

\usepackage{blindtext}% only for dummy text
\begin{document}
\tableofcontents
\blinddocument
\end{document}

enter image description here

If there should be different entries for plain and fancy pages use \fancyplain.

Example:

\documentclass{report}
\usepackage{fancyhdr}
\pagestyle{fancyplain}% <- pagestyle fancyplain
\renewcommand\plainheadrulewidth{.4pt}% headrule on plain pages
\fancyhf{}
\fancyhead[RE,LO]{Manuel Alonso Cousido}
\fancyhead[LE,RO]{History}
\fancyfoot[RE,LO]{\thepage}
\fancyfoot[LE,RO]{\leftmark}

\fancyhead[C]{\fancyplain{plain page}{fancy page}}% <- added

\usepackage{blindtext}% only for dummy text
\begin{document}
\tableofcontents
\blinddocument
\end{document}

enter image description here

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.