1

I am using the fancyplain page style, and still headers on pages where a chapter starts look different from headers on pages where no new chapter starts.

On normal pages, fancyhdr adds a horizontal line below the header. On pages where a new chapter starts, it does not. Does anyone know how to add this line on such pages?

Alex
  • 131

1 Answers1

1

EDIT: I didn't note that this was for fancyheadings package. However, if you look in the package documentation, you'll find that the width of the header's rule in plain pages is set through the command \plainheadrulewidth. However, if you try to run a code with the fancyheadings package, you'll get this message:

Package fancyheadings Warning: Please stop using fancyheadings!
(fancyheadings) Use fancyhdr instead.
(fancyheadings) We will call fancyhdr with the very same
(fancyheadings) options you passed to fancyheadings.

Therefore, I'd suggest you to follow this advice and convert to fancyhdr :-) !

Answer:

You don't see a line because the first page of each chapter is by default in plain style. To have a header in these pages too, you have to redefine this style:

\documentclass{report}

\usepackage{fancyhdr}
\pagestyle{fancy}

% Redefine the PLAIN style
\fancypagestyle{plain}{%
    \fancyhead{} %Clean headers
    \fancyfoot{} %Clean footers
    \renewcommand{\headrulewidth}{1pt} % Header rule's width
}
% Define the DEFAULT style
\fancypagestyle{MyStyle}{%
    \fancyhead{} %Clean headers
    \fancyfoot{} %Clean footers
    \renewcommand{\headrulewidth}{1pt} % Header rule's width
}
\usepackage{lipsum}

\begin{document}

\pagestyle{MyStyle}

\chapter{First chapter}
\lipsum

\end{document}

However, take into account that this will change all your plain pages, such as the first page of Table of Contents, and so on.

MarcoG
  • 1,437