I am working on a book-type document in which I would like to start each chapter in an open-right manner with the title on the right-hand page (odd). However, I would also like to add a background image to both the left (even) and right page (odd) that contains the chapter number and title.
My current approach is to force open-left, and add the background figures with a combination of titlesec and eso-pic with \titleformat.
This approach works well, however an unwanted side-effect is that the TOC now always refers to the left (even) page. I would however like the TOC to point to the right (odd) page that contains the chapter number and title. See below two figures to clarify this issue.
My current approach in a MWE:
Code: Select all
\documentclass[10pt,openany,twoside,titlepage]{book}
% change openright to openleft. i.e. chapter starts on even page
\makeatletter
\renewcommand*\cleardoublepage{\clearpage\if@twoside
\ifodd\c@page \hbox{}\newpage\if@twocolumn\hbox{}%
\newpage\fi\fi\fi}
\makeatother
% include some required packages
\usepackage{blindtext}
\usepackage{titlesec, titletoc, xcolor}
\usepackage{graphicx}
\usepackage{eso-pic}
\usepackage{hyperref}
\usepackage{geometry}
\geometry{inner=40mm}
% new command for even/odd background figures
\newcommand\BackgroundPicEven
{ \includegraphics[height=\paperheight , width=\paperwidth]{example-image-a} }
\newcommand\BackgroundPicOdd
{ \includegraphics[height=\paperheight , width=\paperwidth]{example-image-b} }
% add two-page title format as chapter title-page. Uses clearpage
\titleformat{\chapter}
[block]
{ \flushright \thispagestyle{plain} }
{ }
{40 pt}
{\LARGE \bfseries \AddToShipoutPicture*{\BackgroundPicEven}
\clearpage
\AddToShipoutPicture*{\BackgroundPicOdd}
Chapter \thechapter \\ \vspace{50mm} }
[\newpage]
\titleformat{\section}[hang]{\large\bfseries}{\thesection}{1em}{}
\begin{document}
\pagestyle{plain}
\tableofcontents
\chapter{First very long chapter title} \label{chapters:01}
\section{First section}
\blindtext[6]
\chapter{Second very long chapter title} \label{chapters:02}
\section{First section}
\blindtext[10]
\chapter{Third very long chapter title} \label{chapters:03}
\section{First section}
\Blindtext[3]
\end{document}
Cheers,
Hyb