2

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}
3
  • 1
    Welcome! Don't set the dimensions manually if using geometry. If you can, use KOMA's facilities rather than geometry/fancyhdr but, if not, stick to those - don't mix in the manual stuff. Read the console output for warnings about the sizes fancyhdr needs. Don't change these for the title page or first pages of chapters/sections. Just format titlepage as you want - it is unlikely you need to change the page layout dimensions.
    – cfr
    Commented Jul 21, 2015 at 12:48
  • Thanks for the quick answer! Two questions though: 1) isn't geometry made to manually fiddle with the dimensions? and 2) if I leave geometry be, then the fist page's footer is still misaligned, also the header image takes up much more space, since the inch of clearance it has to the top of the page just means tons of white space around the image gets wasted Commented Jul 21, 2015 at 13:08
  • geometry is used to customise the page dimensions. When you specify them manually, the package doesn't know that, it cannot track your changes and it will calculate things in ways which ignore those changes. When you say \setlength{\headheight}{100pt} (LaTeX syntax since you are using LaTeX), geometry can't take account of the change. When you say \geometry{headheight=100pt}, it can. Normally, you don't change the layout of the page for the title page or whatever. Although, as Bernard says, you can. But use geometry's commands.
    – cfr
    Commented Jul 21, 2015 at 15:42

3 Answers 3

1

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}
1
  • Thank you! The \newgeometry and \restoregeometry commands solved the problem immediately. I'm still using fancyhdr though since The footer of titleps produces errors when the tabular environment is moved to the right. Left and Center footers accept tables without a problem... weird. Commented Jul 23, 2015 at 13:33
2

You have the \newgeometry and restoregeometry commands, but you have to compute the topmargin key. The titleps package (from the titlesec bundle) works better than fancyhdr in this situation. Here isq a simple code. The pagestyles definition with fancyhdr is comment. To give a try to the fancyhdr solution, uncomment the corresponding lines, and comment those using pagestyle:

\documentclass[11pt,a4paper]{scrartcl}

\usepackage{lipsum} %filler text
\usepackage{array, graphicx}
\usepackage[showframe]{geometry}
\geometry{top=128pt, height=609pt, headheight=60pt, headsep=25pt}
%\usepackage{fancyhdr}
%\fancypagestyle{maintext}
%{
%\lfoot{\small \textbf{address 1}\\address 2\\address 3}
%\renewcommand{\headrulewidth}{0pt}
%\renewcommand{\footrulewidth}{0pt}
%}
%
%\fancypagestyle{titlepage}
%{
%\chead{\includegraphics[height=100pt]{Piero_di_Cosimo_1}}
%\lfoot{\small \textbf{address 1}\\address 2\\address 3}
%\renewcommand{\headrulewidth}{0pt}
%\renewcommand{\footrulewidth}{0pt}
%}
\usepackage{titleps}
\newpagestyle{titlepage}{%
\sethead{}{\includegraphics[height=100pt]{Piero_di_Cosimo_1}}{}
\setfoot{\small\begin{tabular}[t]{@{}l} \textbf{address 1}\\address 2\\address 3\end{tabular}}{}{}
}%
\newpagestyle{maintext}{%
\setfoot{\small \begin{tabular}[t]{@{}l}\textbf{address 1}\\address 2\\address 3\end{tabular}}{}{}
}%
\pagestyle{maintext}

\begin{document}
\begin{titlepage}
  \thispagestyle{titlepage}
  \newgeometry{top=192pt, height =545pt, headheight=100pt, headsep=54pt}

  \huge \textbf{\uppercase{TITLE}}
\end{titlepage}

\restoregeometry

\lipsum[1-12]

\end{document} 

Fancyhdr solution:

enter image description here

Titleps solution:

enter image description here

0

It is not necessary to change the page geometry and/or change the header dimensions if you want to place a figure on the title page. You can simply use a 0pt height/width picture environment to position your figure and then the rest of your title, e.g. (Code borrowed from Bernard):

\documentclass[11pt,a4paper]{scrartcl}

\usepackage{lipsum} %filler text
\usepackage{array, graphicx}
\usepackage[showframe]{geometry}
\geometry{top=128pt, height=609pt, headsep=25pt}

\usepackage{titleps}

\newpagestyle{maintext}{%
  \setfoot{%
    \small 
    \begin{tabular}[t]{@{}l}
      \textbf{address 1}\\ address 2\\ address 3
    \end{tabular}}
  {}
  {{\includegraphics[width=7mm,keepaspectratio]{example-image-1x1}}}
}%
\pagestyle{maintext}

\begin{document}

\begin{titlepage}

  \begin{center}
    \setlength{\unitlength}{1mm}%
    \begin{picture}(0,0)
      \put(0,8){%
        \makebox(0,0)[b]{%
          \includegraphics[width=20mm,keepaspectratio]{example-image-1x1}%
        }%
      }%
    \end{picture}
  \end{center}

  \vspace*{2em}

  \huge \textbf{TITLE}
\end{titlepage}

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

enter image description here

1
  • thanks for that tip .. it was very useful at a different location! Commented Jul 23, 2015 at 13:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .