[Tex/LaTex] Headings of 2nd abstract page in KOMA

abstractheader-footerkoma-script

I'm writing my thesis with scrartcl, using the KOMAoption abstract=true. My abstract has two pages, and while on the 1st page, the pagestyle is empty, on the 2nd page of the abstract all the additional elements (headsepline, footsepline, page number, heading) are shown. The whole text of the abstract is written within the abstract environment. Here is an MWE:

\documentclass[oneside]{scrartcl}

\KOMAoptions{titlepage=true, abstract=true}

\usepackage[automark]{scrpage2}
\pagestyle{scrheadings} 
\chead[]{}
\ihead[]{}
\lehead[]{}
\ohead{\headmark}
\setheadsepline{.6pt}
\setfootsepline{.6pt}

\usepackage{lipsum}

\begin{document}

\title{My Thesis}
\author{It's me}
\maketitle

\thispagestyle{empty}
\addsec{Plagiarism Statement}
I'm not a plagiarist     \newpage

\begin{abstract}    
\lipsum
\end{abstract}

\end{document} 

I'd like the second page of the abstract to have the same layout as the first one (probably keeping the headings would be better, but I'm not sure yet). I don't understand why the pages are different now as the abstract text is enclosed within the same environment. Does anyone have an idea?

Best Answer

Use \pagestyle{scrheadings} after end{abstract} and you will get no headings for the title and abstract pages.

If you want to get headings at the abstract page you can patch the environment abstract with \etoolbox:

\usepackage{etoolbox}
\patchcmd\abstract{\titlepage}%
  {\titlepage
    \thispagestyle{scrheadings}%
   \markboth{\abstractname}{\abstractname}%
 }{%
  \typeout{*******patching \string\abstract\space done*******}%
 }{%
  \typeout{*******patching \string\abstract\space fails*******}%
}

The command \markboth is need to get the correct heading.

\documentclass[oneside]{scrartcl}

\KOMAoptions{titlepage=true, abstract=true}

\usepackage[automark]{scrpage2}
\pagestyle{scrheadings} 
\chead[]{}
\ihead[]{}
\lehead[]{}
\ohead{\headmark}
\setheadsepline{.6pt}
\setfootsepline{.6pt}

\usepackage{lipsum}
\usepackage{etoolbox}
\patchcmd\abstract{\titlepage}%
  {\titlepage
    \thispagestyle{scrheadings}%
   \markboth{\abstractname}{\abstractname}%
 }{%
  \typeout{*******patching \string\abstract\space done*******}%
 }{%
  \typeout{*******patching \string\abstract\space fails*******}%
}


\begin{document}



\title{My Thesis}
\author{It's me}
\maketitle

\thispagestyle{empty}
\addsec{Plagiarism Statement}
I'm not a plagiarist
\clearpage
\begin{abstract}    
\lipsum
\end{abstract}
\section{foo}
\lipsum
\end{document} 
Related Question