I'm having a problem placing footers on my document. On the first page it shows ok, but in the next pages it doesn't show at all. A bit of thinkering made me realize that the footer was indeed appearing, but out of page boundaries, so it wasn't visible. So the question is, how can I fix the height at which the footer is expected to appear? my code (part of it) is as follows:
\documentclass[10pt,letterpaper]{article}
.......
\usepackage[margin=4.5cm,headheight=28pt]{geometry}
\usepackage{fancyhdr}
.......
\hoffset-2.8cm
\voffset-2.3cm
\setlength{\textwidth}{18cm}
\setlength{\textheight}{22.5cm}
\renewcommand{\baselinestretch}{1.2}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{1pt}
%\renewcommand{\footrulewidth}{0.3pt}
\fancyhead[C]{
\hspace*{-1cm}\begin{tabular}{>{\centering\arraybackslash}p{3cm}b{12cm}>{\centering\arraybackslash}p{3cm}}
% & \\[0.05ex]
\hspace*{0.5cm}\includegraphics[width=2.5cm]{logo.png} & \hspace*{-2.5cm} Some random text I need... & \includegraphics[width=3cm]{LogoONAC.png} \\
\end{tabular}
}
\fancyfoot[C]{ - Some text I need to appear as footer on every page - }
Thanks in advance!
EDIT:
Ok, so I've reproduced my problem as suggested by Werner. The code is as follows:
\documentclass{article}
\usepackage[margin=1.5cm,headheight=10pt]{geometry}
\usepackage{fancyhdr,graphicx}
\usepackage{lipsum}
\usepackage{array}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{1pt}
\fancyhead[C]{
\hspace*{-1cm}\begin{tabular}{>{\centering\arraybackslash}p{3cm}b{12cm}>{\centering\arraybackslash}p{3cm}}
% & \\[0.05ex]
\hspace*{0.5cm}\includegraphics[width=2.5cm]{logo.png} & \hspace*{-2.5cm}\begin{tabular}{>{\centering\arraybackslash}b{17cm}} \\[5ex] \textbf{XXXXXXXXXXXXXXXX}\\ \textbf{XXXXXXXXXXXXXXXXXXXXXXX}\\ \textbf{\footnotesize XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}\\ \end{tabular} & \includegraphics[width=3cm]{LogoONAC.png} \\
\end{tabular}
}
\fancyfoot[C]{ - OPERADOR - }
\begin{document}
\lipsum[1-20]
\end{document}
Best Answer
There are a couple of things that need to change in your code:
Don't set the page layout with
geometry
and then add other page layout settings manually. Do one or the other.I'd suggest using and sticking with only
geometry
and leave out settings like this:You're probably trying to create a somewhat contradictory situation in terms of the page layout. Setting
margin=4.5cm
and having a\textwidth
set to22.5cm
doesn't make it fit within aletterpaper
size.Listen to the warning issued by
fancyhdr
:The value following "Make it at least ..." may differ depending on the size of the actual images you're including. This might be the root cause of your problem, as thing are adjusted for all pages following the first.
Here is a toned-down version of your example code where I've removed any manual setting of the page layout: