2

I'm trying to insert a pdf with multiple images into my LaTeX document using \includepdf but either no image shows up (for page={1} or page={1-4} etc.) or it stacks them all on top of each other and I'm not sure how to fix it.

I've been using \includegraphics for other images (pdf and png) but for files like this, where there are 40+ images (one per page) in a single pdf file I can't use the graphics package but pdfpages doesn't seem to be working either. I'm using Sublime to compile on a Mac.

Here is the preamble I have (which is mostly copied from a astronomy paper example):

\documentclass[iop,revtex4,twocolappendix]{emulateapj}   
\usepackage{natbib}  
\usepackage{epsfig}  
\usepackage{lscape}  
\usepackage{hyperref}   
\usepackage{graphicx}  
\usepackage{float}  
\usepackage[final]{pdfpages}
\begin{document}
\includepdf[pages=-,nup=2x2,column=true,columnstrict=true,lastpage=36]{XDGNIRS_v20.pdf}
\end{document}

This creates something similar to the following image. I can't take a picture of my real file since it's unpublished data and my mentor would be not be happy. But I think it's clear that pages are over-plotting and creating ugly. (Multiple pages are created that all look similar to this jibberish.)

Example messed up image

Ideally this is in a picture environment such that I can add a title, caption, and reference. I want a "picture array" which nup does do, but maybe using that, the images can't be transferred over multiple pages which is why it just plots the images on top of each other? Except, it's the first three images that are stacked on top of each other and then the next three for the second image in the nup array, and so on. I'm pretty new to LaTeX so I'm confuddled.

  • Welcome! Note that you can format code blocks by highlighting and hitting ctrl+k or the {} button. Could you post a complete small document which demonstrates the problem? You could use a standard PDF (like a manual) in place of your file. It is easier to help if people can see exactly what is going on by reproducing the problem. pdfpages does not normally behave as you describe. – cfr Jul 29 '15 at 22:34
  • 1
    Edited. Is that what you meant? I ran just those small blocks of code all on their own and it does the same thing as in my larger document (which has a bunch of sections/subsections/pictures etc.). The image is just of a manual I have, but it should be the same for any multiple-page pdf file. – Rainbow Jul 29 '15 at 23:22
  • Yes. Thanks. That's crucial information. If I use \documentclass{article}\usepackage{pdfpages}\begin{document}... it works just fine. So the rest is needed to reproduce the problem. I've just made it into a single code block as it is easier for people to copy-paste that way. – cfr Jul 29 '15 at 23:28
  • Don't use epsfig. It is obsolete. The only package your example actually needs is pdfpages. I can reproduce the problem with just that and the class.... – cfr Jul 29 '15 at 23:30
  • 1
    Not that I know of. I just meant that it was good you added that to the question because it is important you are using that class. If we don't know that, we can't reproduce the problem. Once we know you are using that class, we can. Does tex.stackexchange.com/questions/227385/… help? The basic problem is that the class uses revtex4 which is incompatible with a lot of packages, including pdfpages, it seems. Basically, an answer there suggests including the pages using a loop rather than pdfpages multi-page commands. – cfr Jul 30 '15 at 0:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.