# Image on opposite \part page

I'm trying to place a picture on the left side of a \part section, basically what has been done here Memoir: Picture opposite part page, but with a book document class. I'm also using the epigraph package to change my \part command, which works fine.

But there is a BIG problem. When I insert the picture on the left side (even page), the epigraph shows on the picture page and on the part page, it shows twice! I want it to appear only on the part page.

Here is the code I'm using:

  \documentclass{book}

\usepackage[brazil]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amssymb, amsmath, amstext, array}
\usepackage{gensymb}
\usepackage{enumitem}
\usepackage[table]{xcolor}
\usepackage{graphicx}
\graphicspath{ {Imagens/} }
\usepackage[section]{placeins}
\usepackage[default,scale=0.75]{opensans}
\usepackage[T1]{fontenc}
\usepackage{titlesec}
\usepackage{anyfontsize}
\usepackage{lipsum}

\newcommand*\cleartoleftpage{%
\clearpage
\ifodd\value{page}\hbox{}\newpage\fi
}

\usepackage{epigraph}

\titleformat{\part}[display]
{\filleft\fontsize{40}{40}\selectfont\scshape}
{\fontsize{90}{90}\selectfont\thepart}
{20pt}
{\thispagestyle{epigraph}}

\setlength\epigraphwidth{.6\textwidth}

\usepackage{xpatch}
\makeatletter
{\let\@evenfoot}
{\let\@oddfoot\@empty\let\@evenfoot}
{}{}
\makeatother

\usepackage{afterpage}

\newcommand\blankpage{%
\null
\thispagestyle{empty}%
\newpage}

\begin{document}

\chapter{One}
\lipsum
\cleardoublepage

\cleartoleftpage

\includegraphics[scale=1]{example-image-a}

\part{Part One}

\chapter{Two}
\lipsum

\end{document}


I've already tried afterpage and a lot of other solutions on the web, but none work. Could you please give me a hand?

Thanks!

• Welcome! Note that if you use example-image-a, say, then other people will be able to compile your code (which they can't right now). – cfr Apr 27 '17 at 1:48
• @M. Zoubeer Just curious, why use book when memoir, which you mention, gives the same results as book but with extensions and more flexibility? – Peter Wilson Apr 27 '17 at 17:24
• @Peter Wilson because I didn't know memoir existed until very late in my writing. I fear converting now could take some time (although I could be wrong). – M. Zuoubeer Apr 27 '17 at 21:38
• Do you know of any way to get the same results when using scrbook/KOMA-script? – Patty-B Oct 9 '20 at 14:19

Reducing this to a more minimal example, I tried following the package epigraph's instructions on page 6. However, exactly the same problem occurs, even without titlesec and the custom definitions of page skipping and the fiddling with the page counter and so on.

\documentclass{book}
\usepackage{lipsum}
\usepackage{nextpage,epigraph,graphicx}
\makeatletter
% manual 6
\let\@epipart\@endpart
\renewcommand{\@endpart}{\thispagestyle{epigraph}\@epipart}
\makeatother

\setlength\epigraphwidth{.6\textwidth}

\begin{document}

\chapter{One}
\lipsum

\part{Part One}

\chapter{Two}
\lipsum

\end{document}


Clearly, the page style is being applied not once, but twice.

It does work if we precede the \epigraphhead with

\cleartooddpage[\thispagestyle{empty}]


but the manual doesn't mention a need to do this.

Nonetheless, this solution can be adapted to place an image on the preceding even page. That is, the following adaption of the manual's example does work.

\documentclass{book}
\usepackage{lipsum}
\usepackage{nextpage,epigraph,graphicx}
\makeatletter
% manual 6
\let\@epipart\@endpart
\renewcommand{\@endpart}{\thispagestyle{epigraph}\@epipart}
\makeatother

\setlength\epigraphwidth{.6\textwidth}

\begin{document}

\chapter{One}
\lipsum

\cleartoevenpage{\thispagestyle{empty}}
\cleartooddpage[\thispagestyle{empty}\includegraphics{example-image-a}]


[Personal motto: nothing is so difficult as with titlesec.]