Alex Rivera | Logout

When using pdfpages in LaTeX, how to avoid page breaks before the first page ?

Asked 2010-01-09T20:10:54.673
27

I am creating a large LaTeX document, and my appendix has reproductions of several booklets that I have as PDFs. I am trying to create a section header and then include the pages at a slightly lower scale. For example:

\section{Booklet about Yada Yada Yada}

\includepdf[pages={-}, frame=true, scale=0.8]{booklet_yadayada.pdf}

However, pdfpagex does two annoying things. First, it devotes one output document page for included document page. I can live with that as I am using 80% scale. The main problem, however, is that the first page is also a new page, so I have a page with just a section title, and then a separate page with the booklet.

Is there some way to get pdfpages to be a little smarter here?

Edit
Report

1 Answer

3

Thanks for all the answers - I couldn't for the life of me figure out what logic \includepdf uses to insert blank pages; the trick with including the first page via \includegraphics solved most (but not all) of those problems; so here are some notes:

First, out of curiosity, I have also tried to use only \includepdf, but split in two parts:

\includepdf[pages=1]{MYINCLDOC.pdf} 
\includepdf[pages=2-last]{MYINCLDOC.pdf} 

... unfortunately, this has the same problem as the question in OP.

  • Since @WASE's answer, there are now multiple \newpages in the source (pdfpages.sty). I tried reading the source, but I found it quite difficult; so I tried temporarily setting \newpage to \relax only for \includepdf - and that puts all pages in the document on top of each other; so probably not a good idea to get rid of \newpage blindly.
  • Just \includegraphics[page=1,scale=0.8]{foo.pdf} works - but (as @WASE also note) it is aligned at the top-left corner of the page body, which is to say inside the margins; for a full page we'd want the pdf inclusion overlaid over the whole page, margins included.

This page: graphics - How do I add an image in the upper, left-hand corner using TikZ and graphicx - TeX - LaTeX points to several possibilities for positioning on page over the margins; but for me, the best solution for a full page PDF inclusion is to use package tikz to center it to the page:

\begin{tikzpicture}[remember picture,overlay]
  \node at (current page.center) {\includegraphics[page=1]
answered 2012-06-22T01:39:54.080

Your Answer