I want to start every chapter from an odd page and the corresponding blank pages should appear with the notice "The page is intentionally left blank". I have achieved it in my MWE. But I also want to keep the last odd page (before the back cover) blank with the same 'intentionally blank' notice. I couldn't generate it.
In my MWE, there are 10 pages. The 9th page is appearing full empty. But I like to show the 'intentionally blank' notice in it, similar to the 8th page.
% !TEX program = xelatex
\documentclass[12pt, twoside]{book}
\usepackage{lipsum}
\usepackage{fancyhdr}
\fancypagestyle{plain}{
\fancyhf{}
\chead{Book's Title}
\cfoot{\thepage}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}
}
\usepackage[demo]{pdfpages}
% Commnad for blank page texts % https://tex.stackexchange.com/a/66901/114006
\newcommand*\bptext{The page is intentionally left blank}
\makeatletter
\renewcommand*\cleardoublepage{%
\clearpage\if@twoside\ifodd\c@page\else
\vspace*{\fill}
\begin{center}
\small\bptext
\end{center}
\vfill
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
\begin{document}
\title{Book's Title}
\author{Author}
\begin{titlepage}
\includepdf{front_cover} % the front cover page is added here
\thispagestyle{empty}
\maketitle
\end{titlepage}
\pagestyle{empty}
\cleardoublepage
\pagestyle{plain}
\pagenumbering{roman}
\cleardoublepage
\tableofcontents
\cleardoublepage
\pagestyle{plain}
\pagenumbering{arabic}
\chapter{First Chapter}
\lipsum[1-2]
\newpage
\pagestyle{empty}
\cleardoublepage \
\includepdf{back_cover} % the back cover page is added here
\end{document}
Basically, if my last chapter ends at an odd page, it should generate two 'intentionally blank' pages before the last page (back cover). And if my last chapter ends at an even page, it should generate one 'intentionally blank' page before the last page. So, in both cases, my book should always end with the last page (back cover) at an even page. How can I do it?
\frontmatter
,\mainmatter
and\backmatter
. After\frontmatter
, the chapters are not numbered, but appear in the TOC.\clearpagebeforebackcover
command which implements the logic you are describing in words.