2

This is my document:

\documentclass[12pt,a4paper,twoside]{report}

%Layout
\usepackage[top=2.5cm, bottom=3cm, left=2.5cm, right=2.5cm,paper=a4paper]{geometry}

%Header
\usepackage{fancyhdr}

%Chapter adjustments
\usepackage{titlesec}
\titleformat{\chapter}{\normalfont\fontsize{16pt}{0}\bfseries}{\thechapter.}{9pt}{}
\titlespacing*{\chapter}{0pt}{0pt}{16pt}
\usepackage{blindtext}

%Arial - ATTENTION: Compile with XeLaTeX (not PDFLaTeX)!
\usepackage{fontspec}
\defaultfontfeatures{Scale = MatchLowercase}
\setmainfont{Arial}[Scale = 1.0]

%Formatting the header
\pagestyle{fancy}
\fancyhf{}
\fancyhead[EL,OR]{\fontsize{8}{5} \selectfont \thepage}
\fancyhead[ER,OL]{\fontsize{8}{5} \selectfont \leftmark}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}

\fancypagestyle{plain}{
\fancyhf{}
\fancyhead[EL,OR]{\fontsize{8}{5} \selectfont \thepage}
\fancyhead[ER,OL]{\fontsize{8}{5} \selectfont \leftmark}
}

%Abstracttexts
\newcommand{\FirstAbstract}{This is Abstract 1.}
\newcommand{\SecondAbstract}{This is Abstract 2.}


\begin{document}

\pagenumbering{Roman}

{\fontsize{16pt}{0} \selectfont {\bf Abstract 1}}
\newline \vspace{-2mm} \\
\FirstAbstract

\newpage 
{\fontsize{16pt}{0} \selectfont {\bf Abstract 2}}
\newline \vspace{-2mm} \\
\SecondAbstract

\newpage
\pagenumbering{arabic}

\chapter{Chapter 1}
\blindtext \blindtext \blindtext \blindtext \blindtext
\newpage

\chapter{Chapter 2}
\blindtext
\newpage

\section{First Section}
\blindtext
\newpage

\end{document}

I would like to adjust the header of my document - the two first pages should also contain the title of the pages. For the rest of the document it already works, but I have no idea how to just adjust the first two ones without interfering with the other following pages. I already tried the following code:

\usepackage{ifthen}
\lhead{\ifthenelse{\value{page}=1}{\fontsize{8}{5} \selectfont Kurzfassung}}

but with this the header of the following pages are disordered. Thanks A LOT in advance :)!

2
  • 3
    Welcome to tex.sx. I'm unable to test at the moment, but if I understand your request correctly, the fancy page style is what you want on the first two pages. If that's correct, you can specify \thispagestyle{fancy} on each of those two pages, with \markboth{<desired header text>}{<desired header text>}` to set the text you want in the header. May 11, 2019 at 3:14
  • @barbarabeeton Yes, \markboth did the trick! Thank you very much! :)
    – TeXlearner
    May 11, 2019 at 13:29

1 Answer 1

1
[...]
\begin{document}
\markboth{Kurzfassung}{Kurzfassung}
\pagenumbering{Roman}
[...]
1
  • Thank you very much! :) \markboth was what I was searching for!
    – TeXlearner
    May 11, 2019 at 13:29

You must log in to answer this question.

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