9

I'm writing a document using the Koma-Script class scrartcl (3.09a).

I want to have a header and a footer on every page, but the header of the first page should be different from the others.

So using \newpagestyle from the scrpage2 package I define two page styles, MyFirstPageStyle and MyPageStyle, and I use them like this:

\pagestyle{MyPageStyle}
\thispagestyle{MyFirstPageStyle}

Since the header of the first page is quite big, it overlaps with the content of the first page. I could fix this by passing [headinclude=true, headheight=2cm] as class options. But this also affects the headers of all other pages, where the header is just one line in height.

So my question is how can I set headheight for the first page only, without affecting the other pages?

To make more clear how it should look in the end: The white space between the top of the header and the top of the page should be the same for all pages. But the header of the first page is larger, so the content of the first page should move down a little bit.

Full minimal example:

\documentclass{scrartcl}

\usepackage[ngerman]{babel}
\usepackage{cmap}
\usepackage[T1]{fontenc}
\usepackage[ansinew]{inputenc}

\usepackage[headsepline,footsepline]{scrpage2}

\usepackage{graphicx}
\usepackage{calc}
\usepackage{lastpage}

\newpagestyle{MyTitlePageStyle}
{
  {}
  {}
  {
    \begin{minipage}{\textwidth-5.5cm}
      \normalfont\sffamily\Large\bfseries
      DigSig1 Praktikum 1 - Lösungen \\
      Signalabtastung / Zeitdiskretisierung
    \end{minipage}
    \hfill
    \begin{minipage}{5cm}
      \includegraphics[width=\textwidth]{HSR}
    \end{minipage}
  }
}
{
  {}
  {}
  {
    \normalfont
    HRO, \today
    \hfill
    \pagemark{}/\pageref{LastPage}
  }
}

\newpagestyle{MyPageStyle}
{
  {}
  {}
  {
    \normalfont
    DigSig1 Praktikum 1 - Lösungen
    \hfill
    Signalabtastung / Zeitdiskretisierung
  }
}
{
  {}
  {}
  {
    \normalfont
    HRO, \today
    \hfill
    \pagemark{}/\pageref{LastPage}
  }
}

\pagestyle{MyPageStyle}
\thispagestyle{MyTitlePageStyle}

\begin{document}

content

\end{document}

With the code provided above, the header of the first page overlaps with the content of the first page. When I use

\documentclass[headinclude=true, headheight=2cm]{scrartcl}

instead, it looks fine for the first page, but it also increases the white space above the headers of the following pages, which I don't want.

2
  • Please provide a full minimal example. You can influence options in the document body with the command \KOMAoptions. Oct 2, 2011 at 11:30
  • This MWE does not even compile...
    – Alexey
    Mar 9, 2020 at 8:02

2 Answers 2

2

Write

\AtBeginDocument{\vspace*{2\baselineskip}}

or, simply

\begin{document}
\vspace*{2\baselineskip}

The first form is more suitable if you're preparing a personalized .sty file. Change the 2 into what is best for you.

2
  • I like the solution with AtBeginDocument the most because this way I can handle the page setup completely in the preamble. Thanks! Oct 2, 2011 at 16:38
  • Thanks. But I a similar problem with a twocolumn document. In this case, that command only adds space to the first column. Is there a solution that moves down both columns?
    – Fabricio
    Aug 13, 2021 at 14:10
3

You can customize options within the document using \KOMAoption or \KOMAoptions. If you change the layout parameters, \recalctypearea recalculates the layout for you.

Example:

\KOMAoptions{headheight=3cm,headinclude=true}
\recalctypearea
content of first page
\KOMAoptions{headheight=1.25\baselineskip,headinclude=false}
\recalctypearea
\clearpage
further content

Note that you might have to do further adjustments because of the different values of headinclude. If necessary, you can make further adjustments to the textbody using \areaset.

Or consider using headinclude=true consistently in the document.

1
  • 1
    Can this be put inside custom page style or somehow automated? Or does one have to figure out where exactly the first page ends to call \recalctypearea second time?
    – Alexey
    Mar 7, 2020 at 13:49

You must log in to answer this question.

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