1

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{addfont}
  \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
  \xpatchcmd\epigraphhead
   {\let\@evenfoot}
   {\let\@oddfoot\@empty\let\@evenfoot}
   {}{}
  \makeatother

  \usepackage{afterpage}

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








  \begin{document}

  \chapter{One}
  \lipsum
  \cleardoublepage



  \cleartoleftpage

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

  \epigraphhead[450]{BlablablaBlabaBlablablaBlablablaBlablablaBlablabla.\par\hfill\textsc{Blabmaister}}
  \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!

4
  • 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
1

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


\epigraphhead[450]{BlablablaBlabaBlablablaBlablablaBlablablaBlablabla.\par\hfill\textsc{Blabmaister}}
\part{Part One}

\chapter{Two}
\lipsum

\end{document}

too many epigraphs

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

It does work if we precede the \epigraphhead with

\cleartooddpage[\thispagestyle{empty}]

just one

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

\epigraphhead[450]{BlablablaBlabaBlablablaBlablablaBlablablaBlablabla.\par\hfill\textsc{Blabmaister}}
\part{Part One}

\chapter{Two}
\lipsum

\end{document}

image even & epigraph odd

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

1
  • Thank you cfr! Actually, your solution did not worked out of the box, I couldn't add the nextpage package, and even copying the \cleartooddpage from the .py it still showed the quote twice. But you posted that if we preceded the ephigraphead with \cleartooddpage[\thispagestyle{empty}] it would do the trick, as it did! Thank you for posting such a detailed answer, this was driving me crazy! – M. Zuoubeer Apr 27 '17 at 21:35

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.