# How to insert pdf double spread (without blank pages or odd page breaks)?

I'd like to insert a two-page pdf as a double-spread, i.e. on facing pages, but with page breaks otherwise unaffected. I realise that I could do this just by inserting the pdf pages into the latex-produced pdf, but I'd prefer to do this from with latex. This shows the problem:

\documentclass{book}
\usepackage{pdfpages,lipsum}
\begin{document}
\lipsum
\lipsum
\end{document}


Here twopagespread.pdf is a two-page pdf file.

You can do this with the command \afterpage from afterpage package. \afterpage{\includepdf[pages=-]{twopagespread}}.

MWE

\documentclass{book}
\usepackage{pdfpages}
\usepackage{afterpage}

\usepackage{lipsum}

\begin{document}
\lipsum[1]
\section{Foo bar}
\lipsum
\section{Bar foo}
\lipsum
\end{document}


If you look for an automatic solution you can do

\afterpage{%
\ifodd\value{page}
\else
\fi}


MWE

\documentclass{book}
\usepackage{pdfpages}
\usepackage{afterpage}

\usepackage{lipsum}

\begin{document}
\lipsum[1]%\lipsum[1-7]
\afterpage{%
\ifodd\value{page}