Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a big image in PDF and I use software to split that PDF into 5 equal pieces. I am using pdflatex to insert each pdf in a separate page with \includegraphics by the same scale factor. I need to print each page separately so I can align and concatenate all the printouts in a precise way. I choose the scale such that they are maximized. However, if I enlarge the images, they will be shifted to the side and bottom too. How can I increase all images to the maximum size (in the same scale) and centralize all of them?

\documentclass[12pt]{article}
\usepackage{graphicx}

\begin{document}
  \pagestyle{empty}
  \begin{figure}[c]
    \centerline{\includegraphics[scale=1.8]{imga.pdf}}
  \end{figure}
  \newpage
  \begin{figure}[c]
    \centerline{\includegraphics[scale=1.8]{imgb.pdf}}
  \end{figure}
  \newpage
  \begin{figure}[c]
    \centerline{\includegraphics[scale=1.8]{imgc.pdf}}
  \end{figure}
  \newpage
  \begin{figure}[c]
    \centerline{\includegraphics[scale=1.8]{imgd.pdf}}
  \end{figure}
  \newpage
  \begin{figure}[c]
    \centerline{\includegraphics[scale=1.8]{imge.pdf}}
  \end{figure}
\end{document}

I think the reason why the above script doesn't centralize the figures is there are some white margins in the first two cut figures. Since I scale up all images in the same way, the white part is also magnified so the image is shifted down and right to the sides. Is that any way to absolutely translate the image (so the white part will be moved out of the edge)?

share|improve this question
    
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  Kurt Nov 21 '12 at 2:59
1  
You mention that the images are "equal pieces", yet the first two may have "white parts/margins"? So I would assume from this they are not the same size, correct? Are they the same width? Also, the floating figure environment does not accept a [c] placement specifier. You might be interested in [p] to place the image on a page-of-floats. Consider reading How to influence the position of float environments like figure and table in LaTeX?. –  Werner Nov 21 '12 at 3:07
    
Thanks for your reply. When I say margins, I don't really mean the physical margins on the edge, I mean in the original image, some plots locate in the upper-left corner and some locate in the right bottom. So when I cut that into pieces, some place in the paper are white. Well, I think that's confusing. But anyway, the size of the page could be the same or not, but to make it simple, I cut them into equal parts. I changed the specifier to [p] but still don't know how to move the figure. Now I use \hspace but I cannot shift vertical and horizontal position at the same time. –  user1285419 Nov 21 '12 at 3:19
    
Horizontal movements are possible via \hspace{<len>}, while vertical movements should be possible using \raisebox{<len>}{<stuff>}. Regardless, it's still not 100% clear what is going on here... –  Werner Nov 21 '12 at 3:24
    
Why not simply pasting the 5 pieces here so that we will have some clear picture? –  Harish Kumar Nov 21 '12 at 4:07

1 Answer 1

If I have understood the scenario correctly, then there is an image too large to print directly. Instead it is split into five equal pieces, that are printed separately and then put together. Then package pdfpages helps to fill the available space as much as possible and automatically centers the image on the page (either horizontally or vertically, depending on the ratio height/width):

\documentclass[a4paper]{article}% set the correct paper format
\usepackage{pdfpages}
\begin{document}
  \includepdf{imga}                             
  \includepdf{imgb}
  \includepdf{imgc}
  \includepdf{imgd}
  \includepdf{imge}
\end{document}

(Package pdfpages also works with bitmap files, then the extension is needed, e.g.: \includepdf{imga.png}.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.