[Tex/LaTex] geometry and fancyhdr clash

fancyhdrgeometrytitles

When I try and create a custom title page, I am having to adjust headerheight because of an Image that will go there. The same image will be in the header on the normal page, but slightly smaller, therefore I have to adjust the page settings twice.
Furthermore, the footer has to be three lines tall.

therefore I have to use fancyhdr and geometry, but fancyhdr seems to play tricks with the dimensions …

The footers on the first AND second page are misaligned (too low and too high, respectively), all following pages seem to be fine.

\documentclass[11pt,a4paper]{scrartcl}

\usepackage{lipsum} %filler text
\usepackage[showframe]{geometry} 
\usepackage{fancyhdr}

\fancypagestyle{maintext}
{
\lfoot{\small \textbf{address 1}\\address 2\\address 3}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}

\pagestyle{maintext}

\begin{document}
\begin{titlepage}
\thispagestyle{maintext}

\voffset -54pt
\headheight 100pt
\headsep 54pt
\textheight 545pt
%summe=645

\huge \textbf{\uppercase{TITLE}}


\end{titlepage}

\voffset -49pt
\headheight 60pt
\headsep 25pt
\textheight 609pt
%summe=645

\lipsum[1-12]

\end{document}

Best Answer

Additionally here is a suggestion using scrlayer-scrheadings:

\documentclass[%
  footheight=36pt% suggested by scrlayer-scrpage
]{scrartcl}
\usepackage{graphicx}
\newlength\logoheight
\usepackage{lipsum} %filler text
\usepackage[
    showframe,
    top=128pt,
    height=609pt,
    headheight=65pt,
    headsep=20pt
  ]{geometry}

\usepackage{scrlayer-scrpage}
\chead{%
  \setlength\logoheight{\dimexpr\headheight-5pt}%
  \includegraphics[height=\logoheight]{example-image.pdf}%
}
\ifoot{\textbf{address 1}\\address 2\\address 3}
\setkomafont{pagefoot}{\normalfont\small}

\begin{document}
\begin{titlepage}
\thispagestyle{scrheadings}
\newgeometry{
  top=192pt,
  height =545pt,
  headheight=105pt,
  headsep=49pt
}
\noindent\huge \textbf{\uppercase{TITLE}}
\end{titlepage}

\restoregeometry
\lipsum[1-12]
\end{document}

enter image description here

If the page number should be aligned in the same way as in the other examples remove [t]footheight=36pt[/t] and change [t]\ifoot[/t] to

\ifoot{\smash{%
  \parbox[t]{\linewidth}{\textbf{address 1}\\address 2\\address 3}}}

enter image description here

Of course it is also possible to define a new page style

\documentclass[%
  footheight=36pt% suggested by scrlayer-scrpage
]{scrartcl}
\usepackage{graphicx}
\newlength\logoheight
\usepackage{lipsum} %filler text
\usepackage[
    showframe,
    top=128pt,
    height=609pt,
    headheight=65pt,
    headsep=20pt
  ]{geometry}

\usepackage{scrlayer-scrpage}
\chead{\includegraphics[height=60pt]{example-image.pdf}}
\ifoot*{\textbf{address 1}\\address 2\\address 3}
\setkomafont{pagefoot}{\normalfont\small}

\newpairofpagestyles[scrheadings]{titlepage}{
  \ihead{\includegraphics[height=100pt]{example-image.pdf}}
  \chead{}
}

\begin{document}
\begin{titlepage}
\thispagestyle{titlepage}
\newgeometry{
  top=192pt,
  height =545pt,
  headheight=105pt,
  headsep=49pt
}
\noindent\huge \textbf{\uppercase{TITLE}}
\end{titlepage}

\restoregeometry
\lipsum[1-12]
\end{document}