Generalpdfpages | Strange Page Compatibility Failure

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Sarge
Posts: 2
Joined: Sun Sep 09, 2012 8:43 pm

pdfpages | Strange Page Compatibility Failure

Post by Sarge »

I'm a fairly experienced R/Sweave/Beamer/LaTeX user, but a noob here.

I've used R and Sweave to create several Beamer presentations on Mac OSX 10.7.4. I'm using pdfpages to prepare 6-up handouts and have encountered behavior that leaves me utterly mystified. My code seems to work fine, but certain combinations of pages seem to be incompatible. Hints will be greatly appreciated.

For example, I have a presentation that fails on page 15 when I try to process the full file, but compilations works fine for some combinations of page including 15. Failure seems to depend on content, but not in an obvious way. For example, removing a figure from page 15 fixes the problem, but replacing page 15 with page 6 (which contains a similar plot and compiled fine) does not. More specifically:

My preamble could not be simpler:

Code: Select all

\documentclass[a4paper]{article}
\usepackage{pdfpages}
\begin{document}
...
\end{document}
This does NOT work (all pages at once; fails on page 15):

Code: Select all

\includepdf[pages=-,nup=2x3,frame,scale=0.7]{programming.pdf}
This does work (first 14 pages are okay):

Code: Select all

\includepdf[pages=1-14,nup=2x3,frame,scale=0.7]{programming.pdf}
This does NOT work (first 15 pages) and seems to confirm that page 15 is the problem:

Code: Select all

\includepdf[pages=1-15,nup=2x3,frame,scale=0.7]{programming.pdf}
However, page 15 is fine by itself...

Code: Select all

\includepdf[pages=15,nup=2x3,frame,scale=0.7]{programming.pdf}
...and even in context with some other pages:

Code: Select all

\includepdf[pages=14-16,nup=2x3,frame,scale=0.7]{programming.pdf}
So you would think I could simply bring in page 15 by itself, but no luck. This does not work:

Code: Select all

\includepdf[pages=1-14,nup=2x3,frame,scale=0.7]{programming.pdf}
\includepdf[pages=15,nup=2x3,frame,scale=0.7]{programming.pdf}
Page 15 includes a figure that I prepared with R and Sweave. Removing the figure fixes the problem, but I think is a red herring. The same figure compiles fine on other pages, and replacing page 15 with a duplicate of page 6 (which includes an almost identical figure) does not fix the problem. Moreover, I can compile pages 6 and 15 together without problems (this works):

Code: Select all

\includepdf[pages=6,nup=2x3,frame,scale=0.7]{programming.pdf}
\includepdf[pages=15,nup=2x3,frame,scale=0.7]{programming.pdf}
When compilation fails, my console returns something like this:

Code: Select all

<use programming.pdf, page 11> <use programming.pdf, page 12> [3 <./programming
.pdf> <./programming.pdf> <./programming.pdf> <./programming.pdf> <./programmin
g.pdf> <./programming.pdf>]
<programming.pdf, id=100, page=13, 364.19562pt x 273.14648pt>
<use programming.pdf, page 13> <use programming.pdf, page 13>
<programming.pdf, id=101, page=14, 364.19562pt x 273.14648pt>
<use programming.pdf, page 14> <use programming.pdf, page 14>
<programming.pdf, id=102, page=15, 364.19562pt x 273.14648pt>
<use programming.pdf, page 15> <use programming.pdf, page 15>
<use programming.pdf, page 1> <use programming.pdf, page 1>
<use programming.pdf, page 1> <use programming.pdf, page 1>
<use programming.pdf, page 1> <use programming.pdf, page 1>
<use programming.pdf, page 13> <use programming.pdf, page 14>
<use programming.pdf, page 15> [4 <./programming.pdf> <./programming.pdf> <./pr
ogramming.pdf

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Sarge
Posts: 2
Joined: Sun Sep 09, 2012 8:43 pm

Re: pdfpages | Strange Page Compatibility Failure

Post by Sarge »

Although I would much rather find a solution that allows straight-up use of pdfpages with my Beamer output, I did find a kludgy solution: reading my PDF files created with LaTeX into Adobe Acrobat; using "save as" to create new PDFs from them; and running pdfpages on the resaved files.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10347
Joined: Mon Mar 10, 2008 9:44 pm

Re: pdfpages | Strange Page Compatibility Failure

Post by Stefan Kottwitz »

Hi Sarge,

welcome to the board!

Yes, it seems strange. It's hard to verify without a problematic pdf file. But nice to know, that you found a workaround, thanks for posting it.

Stefan
LaTeX.org admin
Post Reply