5

I'm writing my final report in LaTeX for my bachelor's degree. I'm aiming at having a document similar to the .doc template used normally.

I want to have my customs headers and footers applied on pages when I'm starting a new chapter.

I'm using documentclass report with fancyhdr and lastpage packages.

My headers are defined like this:

\lhead{\myTitle}
\rhead{\today}
\cfoot{\thepage\ of \pageref{LastPage}}

My chapters are created using standard \chapter{title} macro.

On pages with new chapters, the only headers/footers I see is the standard page number at the bottom.

What should I do?

EDIT: I've finally gone with Peter Breitfeld's solution. I'Ve gone a step further and created my own chapter command:

\newcommand{\myChapter}[1]{
    \chapter{#1}
    \thispagestyle{fancy}
}

Thanks for the help!

4

LaTeX by default switches to \pagestyle{plain} on pages with \chapter{...}. You have to overwrite this:

\documentclass{report}
\usepackage{fancyhdr}
\usepackage{lastpage}

\pagestyle{fancy}  

\lhead{myTitle}
\rhead{\today}

\begin{document}

\chapter{Introduction}
\thispagestyle{fancy}    %% <---- switch
some Text

\newpage
 some more text


\end{document}
  • 3
    You should better redefine the plain pagestyle as described in the documentation of fancyhdr – Ulrike Fischer Mar 30 '12 at 20:36

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.