0

I've got a problem with the formatting of the following MWI. I would like to have:

  1. Page: Abstract with header and title -> done
  2. Page: completely blank -> not done, header still visible
  3. Page: Second abstract with header and title -> done
  4. Page: completely blank -> not done, header still visible
  5. Page - end: full header, titles, texts -> done

So I think it might be a problem that I have redefined the pagestyle plain, but this was necessary to obtain the header on the first chapter pages...

\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}

%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}

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

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

\newpage
\pagenumbering{arabic}

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

\chapter{Chapter 2}
\blindtext
\newpage

\section{First Section}
\blindtext
\newpage

\end{document}
1
  • 3
    Try loading titlesec with option clearempty.
    – Bernard
    May 11, 2019 at 14:33

2 Answers 2

1

EDIT : Bernard's solution works just fine, that is replacing \usepackage{titlesec} by \usepackage[clearempty]{titlesec}


You could use Martigan's solution in this thread to create a new command for a completely blank page. To do this, add

%blank page
\usepackage{afterpage}
\newcommand\blankpage{%
    \null
    \thispagestyle{empty}%
    \addtocounter{page}{-1}%
    \newpage}

to your preamble.


Now replace \cleardoublepage by the newly defined command : \afterpage{\blankpage}.

For example, for the first Abstract :

%Abstract 1
{\fontsize{16pt}{0} \selectfont {\bf Abstract 1}}
\newline \vspace{-2mm} \\
\FirstAbstract
\markboth{First Abstract}{}
\afterpage{\blankpage}
4
  • 1
    Thank you very much! This was exactly I was searching for, I just deleted \addtocounter{page}{-1} because the page numbering should continue, if anyone wonders about the same :)
    – TeXlearner
    May 11, 2019 at 15:03
  • 3
    Using the relevant option for titlesec, which is already loaded, does the same job, without additional code.
    – Bernard
    May 11, 2019 at 15:05
  • Sorry, didn't see it
    – Sileo
    May 11, 2019 at 15:09
  • @Bernard Thank you very much! I have adjusted my code to shorten it :)
    – TeXlearner
    May 13, 2019 at 13:03
2

You want to load emptypage.

I also suggest some fixes: use \chapter*{Abstract 1} instead of manually emulating the typesetting of a chapter header. I also fixed the parameters to \fontsize: if you use \fontsize{8}{5} for the header, there will be no gap between the header and the rule.

\RequirePackage{fix-cm}
\documentclass[12pt,a4paper,twoside]{report}

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

%Header
\usepackage{fancyhdr}
\usepackage{emptypage}

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

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

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

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


\begin{document}
\pagenumbering{Roman}

%Abstract 1
\chapter*{Abstract 1}%
\chaptermark{First Abstract}

\FirstAbstract

\cleardoublepage

%Abstract 2
\chapter*{Abstract 2}%
\chaptermark{Second Abstract}

\SecondAbstract

\cleardoublepage

\pagenumbering{arabic}

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

\chapter{Chapter 2}
\blindtext
\newpage

\section{First Section}
\blindtext
\newpage

\end{document}

enter image description here

1
  • Thank you very much, especially for the additional improvement proposals, I adapted them! :-)
    – TeXlearner
    May 13, 2019 at 13:09

You must log in to answer this question.

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