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 want to include some pages of a pdf file into my document and wrap them into a figure with a caption for example (with pdfpages)

\begin{figure}[h]
   \centering      
   \includepdf[pages={1,3,2},nup=2x2]{test.pdf}      
 \caption{Test}
 \label{fig:Test}
\end{figure}

However this doesn't work. So is there another way to do this?

share|improve this question
4  
Yes, you need to include these the "traditional" way, via \includegraphics on an image-by-image (or page-by-page) way. Also, \label should be after \caption always. –  Werner May 29 '12 at 12:16
    
@Werner Can \includegraphics select a particular page from a pdf-file? I also tried to to something like \includgraphics{\includepdf{...}}. –  student May 29 '12 at 12:18
3  
Yes, \includegraphics[page=1]{file}, for example. –  Werner May 29 '12 at 12:18

2 Answers 2

up vote 11 down vote accepted

As already said by others in the comments you need to use \includegraphics directly because \includepdf uses a page of its own. You can use a tabular to get the 2x2 layout and use the page=<number> key to select the page:

\documentclass{article}

\usepackage{graphicx}
\usepackage{blindtext}

\begin{document}
\blindtext

\begin{figure}[h]
   \centering
   \begin{tabular}{@{}c@{\hspace{.5cm}}c@{}}
       \includegraphics[page=1,width=.45\textwidth]{somemultipagepdf} & 
       \includegraphics[page=2,width=.45\textwidth]{somemultipagepdf} \\[.5cm]
       \includegraphics[page=3,width=.45\textwidth]{somemultipagepdf} \\
   \end{tabular}
 \caption{Test}
 \label{fig:Test}
\end{figure}

\blindtext
\end{document}
share|improve this answer

pdfpages typically inserts page breaks before inserting content, causing problems if you want to have an arrangement if pages inside a figure environment. Instead, use the page key-value of \includegraphics itself to insert the contents on a page-by-page basis. Something like this:

\begin{figure}[ht]
  \centering
  \includegraphics[page=1,width=.3\textwidth]{test} \hspace*{.25/textwidth}%
  \includegraphics[page=3,width=.3\textwidth]{test}

  \includegraphics[page=2,width=.3\textwidth]{test}
  \caption{Test}
  \label{fig:Test}
\end{figure}

If you want the last "image" (page=2) to be shown in a nup=2x2 fashion, you could add \hspace*{.55\textwidth} after it, otherwise it will be horizontally centred below the two "images" (page=1 and page=3) above it.

Of course, you can play with the width adjustment to suit your liking.

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.