Reputation: 89729
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?
Upvotes: 27
Views: 61659
Reputation: 1
I'm a little late, but the following solution worked for me:
\includepdf[pages={-},angle=90, scale=0.7]{lorem-ipsum.pdf}
All pages are imported, scaled and rotated by 90 degrees. Works with Texmaker 5.0.4
Upvotes: 0
Reputation: 51
Use the minipage environement :
\chapter*{Sujet du stage}
%\fbox{
\begin{minipage}{\textwidth}
\includepdf[scale=0.8]{../sujet-stage/main.pdf}
\end{minipage}
It doesn't add any extra page and it works with includepdf.
Upvotes: 5
Reputation: 61279
For me the following worked just fine:
\includepdf[pages=1,pagecommand=\section{Section Heading}]{testpdf}
\includepdf[pages=2-,pagecommand={}]{testpdf}
Upvotes: 13
Reputation: 38619
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.
\newpage
s 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. \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]{MYINCLDOC.pdf}};
\end{tikzpicture}
\includepdf[pages=2-last]{MYINCLDOC.pdf}
After this is done, as a bonus, I have also experienced:
pax
, the data seems to be included also for the \includegraphics
standalone first page, so no difference therepdfpages
, with the above split of the first page in \includegraphics
, will now (seemingly) correctly insert the equivalent of \cleardoublepages
between pdfs that are included back to back (so I don't have to insert such a command manually). Hope this helps someone,
Cheers!
Upvotes: 3
Reputation: 81
I tried this solution too, but \includepdf
keeps the advantage of outputting the file over the margin (the output is centered from the edges of the page).
So I openned pdfpages.sty, and I searched for \newpage
command. I deleted the first occurance (line 326), just to try, and after saving then compiling again, there were no page break anymore.
Upvotes: 8
Reputation: 177574
\includepdf
uses \includegraphics
internally, so something like
\section{Foo}
\fbox{\includegraphics[page=1,scale=0.8]{foo.pdf}}
would include the page without starting a new one, although it only does one page at a time.
Upvotes: 19