4

Consider the following MWE:

\documentclass[a4paper, twoside, 11pt]{report}
\usepackage{fancyhdr}
\pagestyle{fancy}
    \fancyhead{}
    \fancyfoot{}
    \renewcommand{\sectionmark}[1]{\markright{\thesection~ - ~#1}}
    \renewcommand{\chaptermark}[1]{\markboth{\chaptername~\thechapter~ - ~#1}{}}
    \fancyhead[RO]{\textsc\rightmark}
    \fancyhead[LE]{\textsc\leftmark}
    \fancyfoot[C]{\thepage}
\fancypagestyle{plain}
    {
        \fancyhf{}
        \renewcommand{\headrulewidth}{0pt}
        \fancyfoot[C]{\thepage}
    }
\begin{document}
\begin{titlepage}
Nice titles and all
\end{titlepage}
\thispagestyle{empty}

\cleardoublepage
\pagenumbering{roman}
\begin{abstract}
\thispagestyle{plain}
    This is a very nice abstract.
\end{abstract}
\thispagestyle{plain}
\cleardoublepage
\tableofcontents
\thispagestyle{plain}
\cleardoublepage
\thispagestyle{plain}
\cleardoublepage
\thispagestyle{plain}

There is one problem: after the table of contents (which is now one page and I think will stay one page) the doubleclearpage makes the empty page I want, but it keeps the header with contents in it, even though I tell him to take the plain pagestyle. It seems that tableofcontents likes his own pagestyle. How can I fix this? Note: I have considered other questions regarding similar questions (Table of contents with page style empty) but none of the solutions worked for me.

  • you don't need all these \thispagestyle{plain} only one \pagestyle{plain} before abstract and then \pagestyle{fancy} before your first chapter. – touhami Jun 21 '16 at 17:16
  • by the way, you can use \documentclass[a4paper, 11pt]{book} or \documentclass[a4paper, twoside, openright, 11pt]{report} and avoid \cleardoublepage – touhami Jun 21 '16 at 17:17
3

You can use scrextend. Then you can set the page style used on blank pages (pages inserted by \cleardoublepage) as package option cleardoublepage=<value>. Possible values are empty (default), plain, current or the name of another page style.

The value of the option can be changed inside the document using \KOMAoptions{cleardoublepage=<value>}.

There are also new commands like \cleardoubleemtypage, \cleardoubleplainpage, \cleardoublestandardpage to set the page style just for this single blank page.

In the following example I use option cleardoublepage=plain and a \cleardoubleemptypage after the title page and the abstract.

\documentclass[a4paper, twoside, 11pt]{report}
\usepackage[cleardoublepage=plain]{scrextend}
\usepackage{fancyhdr}
\setlength\headheight{13.6pt}% as suggested by fancyhdr
\pagestyle{fancy}
    \fancyhead{}
    \fancyfoot{}
    \renewcommand{\sectionmark}[1]{\markright{\thesection~ - ~#1}}
    \renewcommand{\chaptermark}[1]{\markboth{\chaptername~\thechapter~ - ~#1}{}}
    \fancyhead[RO]{\textsc\rightmark}
    \fancyhead[LE]{\textsc\leftmark}
    \fancyfoot[C]{\thepage}
\fancypagestyle{plain}
    {
        \fancyhf{}
        \renewcommand{\headrulewidth}{0pt}
        \fancyfoot[C]{\thepage}
    }
\usepackage{blindtext}% dummy text
\begin{document}
\begin{titlepage}
Nice titles and all
\end{titlepage}
\cleardoubleemptypage
\pagenumbering{roman}
\begin{abstract}
\thispagestyle{plain}
    This is a very nice abstract.
\end{abstract}
\cleardoubleemptypage
\tableofcontents
\cleardoublepage
\pagenumbering{arabic}
\blinddocument
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.