1

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
\includepdf[pages=-]{twopagespread}
\lipsum
\end{document}

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

0

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]
\afterpage{\includepdf[pages=-]{twopagespread}}
\section{Foo bar}
\lipsum
\section{Bar foo}
\lipsum
\end{document}

If you look for an automatic solution you can do

\afterpage{%
\ifodd\value{page}
\afterpage{\includepdf[pages=-]{twopagespread}}
\else
\includepdf[pages=-]{twopagespread}
\fi} 

MWE

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

\usepackage{lipsum}

\begin{document}
\lipsum[1]%\lipsum[1-7]
\afterpage{%
\ifodd\value{page}
\afterpage{\includepdf[pages=-]{twopagespread}}
\else
\includepdf[pages=-]{twopagespread}
\fi}
\section{Foo bar}
\lipsum
\section{Bar foo}
\lipsum
\end{document}

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.