# Includepdf as a figure

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?

-
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
Yes, \includegraphics[page=1]{file}, for example. –  Werner May 29 '12 at 12:18

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}

-

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.

-