2

I am sorry if I am missing something that might be obvious, but after searching for a while I cannot find a simple solution to my problem. I have a big PDF file, from which I want to take some figures (using trim option from \includegraphics). i want to tell latex to go to page number x of the PDF file to look for the figure. Because it seems useless to dismantle the PDF file page per page, as I have so many figures.

Is that possible to do?

2

Consider the following 4-page document:

enter image description here

\documentclass{article}

\usepackage{graphicx,lipsum}

\begin{document}

\lipsum[1-5]

\begin{figure}[ht]
  \centering
  \includegraphics[width=.5\linewidth]{example-image-a}
  \caption{This is figure A}
\end{figure}

\lipsum[6-10]

\begin{figure}[ht]
  \centering
  \includegraphics[width=.5\linewidth]{example-image-b}
  \caption{This is figure B}
\end{figure}

\lipsum[11-15]

\begin{figure}[ht]
  \centering
  \includegraphics[width=.5\linewidth]{example-image-c}
  \caption{This is figure C}
\end{figure}

\end{document}

Use the page=<n> key-value to extract content from a specific page within a larger file via \includegraphics:

enter image description here

\documentclass{article}

\usepackage{graphicx}

\begin{document}

\fbox{\includegraphics[page=2,viewport=100 500 500 700,clip,width=5cm]{lipsum4}}

\end{document}

Your Answer

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

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