4

I am doing a book of poetry for a friend, using Memoir and the poetry package. She would like the poems to print only on the right-hand pages. I can get poems to begin only on right-hand pages, but any poem that goes onto a second page obviously spills onto a left-hand page. How do I change this?

11
  • 1
    Use oneside option. By the way which document class you are using?
    – user11232
    Aug 18, 2012 at 23:38
  • And the left-hand pages (the ones that will not contain text) must be numbered or not? Aug 18, 2012 at 23:42
  • Gonzalo - The left-hand pages should be unnumbered.
    – Jeremy
    Aug 18, 2012 at 23:58
  • Harish - I am using memoir.
    – Jeremy
    Aug 18, 2012 at 23:58
  • 1
    I suggest you to produce various pdf files and then you can join them easily (using pdftk in linux, for example).
    – Sigur
    Aug 19, 2012 at 0:27

1 Answer 1

6

This solution is also based on package atbegshi. If an "even" poem page would be printed, then an empty page is output before. The tricky part is fixing the page counters on the page and in the .log file.

\documentclass{memoir}
\usepackage{atbegshi}
\usepackage{zref-abspage}
\usepackage{lipsum}

\newif\ifoddpoem
\newif\ifoddpoemPageInc
\AtBeginShipout{%
  \ifoddpoem
    \ifodd\value{abspage}%
      \stepcounter{page}%
      \global\oddpoemPageInctrue
      \advance\value{page} by -1\relax
    \else
      \stepcounter{abspage}%
      \global\oddpoemPageIncfalse
      \addtocounter{page}{-1}%
      \AtBeginShipoutOriginalShipout\null
      \stepcounter{page}%
    \fi
  \fi
}
\newenvironment{oddpoem}{%
  \cleardoublepage
  \oddpoemtrue
}{%
  \clearpage
  \ifoddpoemPageInc
    \addtocounter{page}{-1}%
    \global\oddpoemPageIncfalse
  \fi
}

\begin{document}

\section{Text before poem}
\lipsum[1-4]

\begin{oddpoem}
  \section{Short poem}
  \lipsum[5-8]
\end{oddpoem} 

\section{Text after short poem}
\lipsum[9-12]

\begin{oddpoem}
  \section{Long poem}
  \lipsum[13-18]
  \lipsum[22-24]
\end{oddpoem}   

\section{Text after long poem}
\lipsum[25-29]

\end{document}

enter image description here

1
  • Heiko - This works really well. There is some conflict with the poetry package that I'm using, but nothing that I can't fix. Thanks.
    – Jeremy
    Aug 19, 2012 at 19:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .