[Tex/LaTex] using scrlayer-scrpage, get different header on title page

header-footerkoma-script

A place where I want to submit a paper requires the following.

  • A certain header on the title page,
  • the abstract not on the title, but the second page
  • a different header from page 2 onward
  • page number displayed on all pages including title pages (as counting title page as 1).

This sounds easy enough. I originally attempted this with fancyhdr, now switched to scrlayer-scrpage because I read that fancyhdr should not go with KOMA, but still cannot get it to work. Here is my MWE:

\documentclass[12pt, titlepage]{scrartcl}

\usepackage{geometry}
\geometry{top=1in, bottom=1in, left=1in, right=1in}

\usepackage[affil-it]{authblk}
\linespread{2}

\usepackage{scrlayer-scrpage}
    \clearpairofpagestyles

\begin{document}

\ihead{\normalfont Running Head: This header to be only on title page}
\chead{}
\ohead{\normalfont \thepage }

\setcounter{page}{1}

\title{mytitle}
\author{Donald Duck}

\maketitle


\begin{abstract}
\begin{center}
Abstract
\end{center}
Abstract text...
\end{abstract}

\newpage


\ihead{\normalfont This header to appear from abstract page onward}
\chead{}
\ohead{ \normalfont \thepage}

\section{Introduction}

Begin text here.

\end{document}

As of now, there are no headers on the title and abstract page, and the header that is supposed to start on page 2 only starts at page 3.

What are the commands necessary to display two different headers on the title page and "abstract page"?

Best Answer

With option titlepage command \maketitle uses environment titlepage that uses \thispagestyle{empty}. This is independent from using fancyhdr or scrlayer-scrpage (and even the same with article instead of scrartcl).

For the head of the title page you can use \titlehead. If it should not be part of the text area but of the page margin, you can move it up using \vspace* and \vspace with negative values.

The centered abstract head can be set automatically using option abstract. But with option titlepage the abstract environment is also a titlepage environment. So it uses \thispagestyle{empty} too. In the following example I use an explicit \thispagestyle{headings} in the abstract environment to change the page style of the abstract page.

\documentclass[12pt,abstract,titlepage]{scrartcl}

\usepackage{geometry}
\geometry{top=1in, bottom=1in, left=1in, right=1in}

\usepackage[affil-it]{authblk}
\linespread{2}

\usepackage[manualmark]{scrlayer-scrpage}
\setkomafont{pageheadfoot}{}% not special font for page head and foot
\clearpairofpagestyles
\ihead{\headmark}
\markright{This header to appear from abstract page onward}
\ohead{\pagemark}
\begin{document}

\titlehead{\vspace*{-\headsep}\vspace{-\headheight}\vspace{-\topskip}
  \usekomafont{pageheadfoot}{%
    Running Head: This header to be only on title page%
%    \hfill\pagemark% activate if page number should be shown
  }%
}
\title{mytitle}
\author{Donald Duck}

\maketitle

\begin{abstract}
\thispagestyle{headings}
Abstract text...
\end{abstract}

\section{Introduction}

Begin text here.

\end{document}

Results in:

titlepage and abstract page

An alternative would be, to change the page style of the title page. You can use again \titlehead to achieve this:

\documentclass[12pt,abstract,titlepage]{scrartcl}

\usepackage{geometry}
\geometry{top=1in, bottom=1in, left=1in, right=1in}

\usepackage[affil-it]{authblk}
\linespread{2}

\usepackage[manualmark]{scrlayer-scrpage}
\setkomafont{pageheadfoot}{}% not special font for page head and foot
\clearpairofpagestyles
\ihead{\headmark}
\ohead{\pagemark}
\begin{document}

\markright{Running Head: This header to be only on title page}
\titlehead{\thispagestyle{headings}}
\title{mytitle}
\author{Donald Duck}

\maketitle

\markright{This header to appear from abstract page onward}
\begin{abstract}
\thispagestyle{headings}
Abstract text...
\end{abstract}

\section{Introduction}

Begin text here.

\end{document}

enter image description here

Related Question