this may or may not seem to be a weird thing to want, but I would like to have a customized header on all my pages, except the first one of each chapter, ToC, ….. Furthermore, I would like to have a footer in form of a simple line above the page number on each and every page, even on the first page of a chapter, ToC, …
Well, me being new to LaTeX, I was thinking it could work if I insert the \fancypagestyle{plain} command after the header, so it might not apply for the header but for the footer. Well, that did not work.
Does anyone know how to do that? Is it even possible?
Thank you so much for any advice in advance!
\documentclass[10pt,a4paper, twoside]{report}
\usepackage[latin1]{inputenc}
\usepackage{fancyhdr}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\pagestyle{fancy}
\begin{document}
\lhead[Contents]{\includegraphics[height=22pt]{Figures/WHM.eps}}
\rhead[{\includegraphics[height=22pt]{Figures/WHM.eps}}]{Contents}
\fancypagestyle{plain}{
\renewcommand{\footrulewidth}{0.4pt}}
\tableofcontents
\end{document}
Best Answer
I am not entirely sure that I understand what you want but the code below:
Rather than using
fancyhdr
etc I define the page headers and footers directly. When you type\pagestyle{mine}
what happens is that latex executes the command\ps@mine
, if it exists. The actual page headers and footers are stored in\@oddhead
,\@evenhead
,\@oddfoot
and\@evenfoot
so you just need to set these appropriately. There is also a\ps@empty
command for clearing all of the current page headers and footers.Anyway, this is what I have done:
Perhaps the most painful part of this game is working out which pagestyle controls the first pages of chapters etc. For
report.cls
this seems to be\ps@plain
, so I have changed it in order to get your line in the footer on the "first" pages as well. (Foramsart
and friends I think it is\ps@firstpage
...).If this isn't quite what you want then please explain clearly what the problems are and I will try and fine-tune.