Page LayoutFancyhdr footer appearing on previous page

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
gkamel
Posts: 25
Joined: Thu Oct 30, 2008 1:53 pm

Fancyhdr footer appearing on previous page

Post by gkamel »

Hello,
I am having a bit of a problem with fancyhdr footers. If I set the footer at the end of a paragraph occupying no more than a single line on the current page, the footer gets placed from the previous page on which the footer is set. If I set the footer at the end of a paragraph occupying more than a single line on the current page, it is placed on the same page on which the footer is set. I would like the header to be placed always on the same page on which it is set.

The following is an MWE:

Code: Select all

\documentclass{article}

\usepackage{lipsum}
\usepackage{fancyhdr}
\pagestyle{fancy} \fancyhf{}
\renewcommand{\footrulewidth}{0.1pt}

\begin{document}
\lipsum[1-5]
If this paragraph occupies only one line on the following page, and the fancyhdr footer is set, the footer appears from the previous page onwards. %If you uncomment this part to let the text occupy more than a single line on the second page, the footer will begin appearing from the second page, as it should.

\fancyfoot[L]{Test}
\end{document}
If you compile this with the bit of paragraph in the code commented, then again with the text uncommented, you can observe the behaviour of the footnote on the first page.

Many thanks in advance.
George Kamel

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Post Reply