1

I have a multipage document that has a larger header on the first page. However, it is not a titlepage, I don't know where it ends. I would like the pagebreaks to be determined automatically. This is almost solving my problem. For a better view I would like to shift downwards the header on the first page a little. This means also the textheight is decreased for this page. But by increasing the top parameter the textheight isn't adjusted and the footer disappears from the page. There are quite some questions on this issue but I just can't find the one solving my problem. Here is my code so far.

Many thanks.

\documentclass[11pt,a4paper]{article}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[showframe,left=25mm,right=25mm,bottom=25mm,top=32mm,headheight=14.0pt]{geometry}
\usepackage{fancyhdr}
\usepackage{lipsum}

\pagestyle{fancy}

\fancyhead[C]{all but 1st page}
\fancyfoot[L]{leftfooter} 
\fancyfoot[R]{rightfooter}

\fancypagestyle{firstpage}
{
\newgeometry{left=25mm,right=25mm,bottom=25mm,top=32mm,headheight=66.0pt}
\chead{1st page\\1st page\\1st page\\1st page\\1st page}
\lfoot{leftfooter}
\rfoot{rightfooter}
}

\begin{document}
\thispagestyle{firstpage}
\lipsum[1-15]
\end{document}
1

Not quite sure this is what you need, but I propose a solution which works with your example and doesn't require using \newgeometry. I took the opportunity to simplify setting the page parameters for geometry.

\documentclass[11pt,a4paper]{article}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{afterpage}
\usepackage[showframe, margin=25mm, top=32mm, headheight=14.0pt]{geometry}
\usepackage{fancyhdr}
\usepackage{lipsum}

\pagestyle{fancy}

\fancyhead[C]{all but 1st page}
\fancyfoot[L]{leftfooter}
\fancyfoot[R]{rightfooter}

\fancypagestyle{firstpage}
{
\chead{\smash{\raisebox{0.4\height}{\parbox{\linewidth}{\centering 1st page\\1st page\\1st page\\1st page\\1st page}}}}
\lfoot{leftfooter}
\rfoot{rightfooter}
}

\begin{document}

\thispagestyle{firstpage}
\leavevmode \vspace{6ex}     

\lipsum[1-15]

\end{document} 

enter image description here

  • I am afraid I don't see the difference. However, using your approach I can easily set the first page's header as I wish by playing with the top and the headheight parameter. But from the second page on the headers don't need to be that big in height. So, I would like to have a smaller top parameter from page 2 on. – user172294 Jun 12 at 16:54
  • The probelm is that \newgeometry starts a new page. My code uses the same parameters for the page as all other pages, but neutralises the warning message about headheight, just smashing the header content. How much it goes under the header base line depends on the argument given to \raisebox. You can have some empty lines at the beginning of the first page, and it won't matter if the header overflows into these empty lines – Bernard Jun 12 at 17:41
  • I've slightly modified the code. Is it something like this that you're after? – Bernard Jun 12 at 18:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.