Page LayoutDifferent Header Sizes

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
jjjessen
Posts: 1
Joined: Wed Apr 24, 2013 1:18 pm

Different Header Sizes

Post by jjjessen »

Dear community,

I'm struggling with the page layout of my document. I need to format a letter with a header for the first page (logo, address field etc.) and a different header for the following pages. The header section for the first page is required to have height=6cm and 4cm for the next pages.

There's a custom header for the first page, and a common header for the following pages. I can't figure out how the geometry options should be set so I get a different sized header for my two pages. I've provided an example of what I'm trying to achieve. Also the header on the first page doesn't show all the required content.

Code: Select all

\documentclass[a4paper,twoside]{report}
\usepackage[
  paper=a4paper,
  head=6cm,
  bottom=2cm,
  left=2.2cm,
  right=2.2cm
]{geometry}
\usepackage[demo]{graphicx}
\usepackage{fancyhdr}
\usepackage{lipsum}

%Clear header and footer
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyfoot[C]{Side: \thepage}

\fancypagestyle{common}{%
  \fancyhf{}
  \rhead{
    \begin{tabular}{r}
      common text 1 \\
      common text 2
    \end{tabular}
  }
  \fancyfoot[C]{Side: \thepage}
}

\fancypagestyle{firstpage}{
  \fancyhf{}
  \fancyhead[R]{
    \begin{tabular}{r}
      text1:\\
      text2\\
      phone\\
      Fax nr.:\\
      \\
      bla bla\\	 
      more text\\
      final text\\
    \end{tabular}
  }
  \fancyhead[L]{
    \begin{tabular}{l}
      \includegraphics[height=1.1cm]{translogo}\\
      \\
      \\
      Test1\\
      Address1\\
      Zip and city
    \end{tabular}
  }
  \fancyfoot[C]{Side: \thepage}
}

\begin{document}

\pagestyle{firstpage}
\lipsum
\newpage
\pagestyle{common}
\newgeometry{head=4cm, bottom=2cm, left=2.2cm, right=2.2cm}
\lipsum

\end{document}
Any help is much appreciated.


Best,
Ja

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply