# Changing \headheight pushes footer off page

Preface: NOT a duplicate of My footer disappears when I increase headheight - I tried the accepted answer here and still ran into issues.

I am using Overleaf to create some documentation for software, and using fancyhdr to customize the header and footers. My header contains images which makes the header somewhat large, so I get an error from LaTeX to increase headheight to a larger value. When I do increase this to the recommended 67pt, it removes the error, but pushes the footer off the page. At first glance, the question at the link I referenced above is a 1-for-1 mirror image of what I need, but I tried includeheadfoot, setting all to 1in margins through geometry, and the footer still runs off the page. I've looked at the fancyhdr documentation exhaustively and cannot find a solution. Below is a MWE, which pushes the footer off the page:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{lastpage}
\pagestyle{fancy}
\fancyhf{}

\fancyfoot[R]{\small ~Page \thepage~of \pageref{LastPage}}
\lfoot{\small Collections Guide \\ Last Updated: 07/28/2017}
\renewcommand{\footrulewidth}{0.4pt}

\begin{document}

First line of the document.

Second line of the document.

\end{document}


How do I get rid of the \headheight warning while also keeping a footer which is at a 1 inch margin from the bottom?

Note: I've only been using LaTeX for about 2 years and for really simple reports, so this is one of the more sophisticated projects I've done so far. I appreciate insight on how I can avoid this issue again in the future, and please let me know how I can edit this question to be more concise.

• Welcome to TeX.SE! Please make your code example an MWE (emphasis on minimal, i.e. remove unnecessary packages, options and definitions). – schtandard Aug 8 at 13:19

give geometry the chance to know the headheight you are using by setting it with the geometry options:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{lastpage}
\setcounter{secnumdepth}{0}
\setlength{\parskip}{4pt}
\titlespacing*{\section}{0pt}{2pt}{2pt}
\pagestyle{fancy}
\fancyhf{}

\fancyfoot[R]{\small ~Page \thepage~of \pageref{LastPage}}
\lfoot{\small Collections Guide \\ Last Updated: 07/28/2017}
\renewcommand{\footrulewidth}{0.4pt}

\begin{document}

First line of the document.

Second line of the document.

\end{document}


• Brilliant! I added the includeheadfoot and moved the headheight to geometry as you suggested, and it worked beautifully. When I included the headheight outside of geometry, was I essentially overwriting the parameters I initially ascribed within the geometry package? – GeoMoon Aug 8 at 13:07
• The overwriting is not the main problem. The values not independant: when you enlarge the headheight you also need to shorten the textheight. geometry is doing this for you, but only if you give it all the values. – Ulrike Fischer Aug 8 at 13:12