Page Layoutfancyhdr | Header overwritten by Text Body

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
sw3quant
Posts: 76
Joined: Tue Nov 02, 2010 11:40 pm

fancyhdr | Header overwritten by Text Body

Post by sw3quant »

I am trying to use fancyhdr for the first time.

When my document compiles I see that the headers which I put in have been overwritten by the section headers (ie latex is not taking account of the fact that I am using this package and is overwriting the headers).

Can anyone tell me what I have done wrong?

My MWE is here:

Code: Select all

\documentclass{article}
\usepackage{url}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage[numbers]{natbib}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{xcolor}
\usepackage{fullpage}
%\usepackage[framed,numbered]{StyleFiles/mcode}
\newcommand{\Norm}{\mathop{\mathrm{Norm}}}
\newcommand{\tr}{\mathop{\mathrm{tr}}}
\newcommand{\vect}{\mathop{\mathrm{vec}}}
\newcommand{\diag}{\mathop{\mathrm{diag}}}
\newcommand{\argmin}{\mathop{\mathrm{argmin}}}

\pagestyle{headings}
\setcounter{page}{1}
\pagenumbering{arabic}

\usepackage{fancyhdr}
\setlength{\headheight}{15.2pt}
\pagestyle{fancy}
\fancyhf{}
\lhead{\fancyplain{}{mememmemememe, United Kingdom}}
\rhead{\fancyplain{}{\today}}
\rfoot{\fancyplain{}{\thepage}}

\usepackage{a4wide}
\begin{document}
\title{blah}
\author{mememmemememe \\ United Kingdom}
\date{\today}
\maketitle


\section*{Abstract}


\section*{Background}


\section*{Objectives}


\section*{Methodology}

\vspace{5cm}

\section*{Significance}



\section*{Evaluation}

\vspace{5cm}\vspace{5cm}

\section*{Justification}


\bibliographystyle{ieeetr}
%\renewcommand{\bibname}{Bibliography}
\bibliography{C:/Users/references}


\end{document} 

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

fancyhdr | Header overwritten by Text Body

Post by Stefan Kottwitz »

Don't load the fullpage package, then it's not overwritten, i.e. delete this line:

Code: Select all

\usepackage{fullpage}
Stefan
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

fancyhdr | Header overwritten by Text Body

Post by localghost »

The reason why this happens is because fullpage sets \headheight and \headsep to 0pt in the background. In »empty« page style it does the same with \footskip. This is not documented. From my point of view this package should be considered obsolete.


Thorsten
Post Reply