4

I am using the following code set my headers.

\fancypagestyle{plain}
\fancyhf{}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[L]{\textit{\sffamily\ifthenelse{\isodd{\value{page}}}{\leftmark}{\rightmark}}}
\fancyhead[R]{\textit{\sffamily\thepage}}
\fancyfoot[C]{}
%\headrulewidth{0.1pt}

\renewcommand{\headrulewidth}{0.1pt} 

The \headrulewidth (line below the head) is also appearing at the beginning of a chapter and I WANT TO DISABLE this.

How can I change the behaviour of the headrulewidth for the first page of a chapter?

2
  • 1
    Please complete your code until you get a MWE for understand better your problem.
    – Aradnix
    Aug 20, 2014 at 17:15
  • 1
    Delete the line \fancypagestyle{plain}.
    – cfr
    Aug 20, 2014 at 18:06

1 Answer 1

4

You have to redefine the plain pagestyle

\documentclass{report}
\usepackage{blindtext}
\usepackage{ifthen}
\usepackage{fancyhdr}

%Redefine plain 
\fancypagestyle{plain}{%
\fancyhf{}%
\fancyfoot[C]{\thepage}%
\renewcommand{\headrulewidth}{0.0pt}%
}

\pagestyle{fancy}
\fancyhead{}
\fancyhead[L]{\textit{\sffamily\ifthenelse{\isodd{\value{page}}}{\leftmark}{\rightmark}}}
\fancyhead[R]{\textit{\sffamily\thepage}}
\fancyfoot[C]{}
%\headrulewidth{0.1pt}

\renewcommand{\headrulewidth}{0.1pt} 
\begin{document}
\blinddocument
\end{document}

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.