1

I know how to include single pages of one document as images in another document.

\documentclass{scrartcl}

\usepackage{filecontents}
\begin{filecontents*}{file.tex}
  \documentclass{scrartcl}
  \usepackage{lipsum}

  \begin{document}
  \lipsum[1-100]
  \end{document}
\end{filecontents*}

\usepackage{graphicx}
\newcommand\page[1]{
  \frame{\includegraphics[page=#1, scale=.2]{file.pdf}}
}

\begin{document}
\begin{figure}
  \centering
  \page{1}\page{2} \\
  \page{3}\page{4}
  \caption{Pages}
\end{figure}
\end{document}

But I struggle with including the whole file.pdf without knowing how many pages it consists of.

I already tinkered with pdfpages to replace graphicx, but have difficulties of containing the imported pages in the floating environment then. Wrapping \includepdf into a minipage does not alleviate this problem.

How can I display the pages of a pdf in a figure?

  • What is \frame? The beamer frame command? – user31729 Sep 25 '15 at 19:33
  • @ChristianHupfer \frame just puts a border around the pdf content so they are more clearly recognizable as pages against the white background. – XZS Sep 25 '15 at 19:35
  • 1
    What about \includepdf ? – Romain Picot Sep 25 '15 at 19:37
  • @RomainPicot see the paragraph about pdfpages. It seems \includepdf does not like to be put into floats. – XZS Sep 25 '15 at 19:39
  • 1
    @XZS Yes, but where does \frame come from? – user31729 Sep 25 '15 at 19:39

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.