23

I have a number of figures and I want to create a document with LaTeX such that each page is one of the figures (with the page size equal to the size of the figure).

If I use

\documentclass{standalone}
\usepackage{graphicx}
\begin{document}
\includegraphics{fig1.pdf}%
\end{document}

I get a nice single page which is the size of my original .pdf file. But I'd like to plot 2 files in two separate pages, each page the size of its .pdf file.

I've tried

\documentclass[multi]{standalone}
\usepackage{graphicx}
\begin{document}
%
\includegraphics{fig1.pdf}%
\newpage
%
\includegraphics{fig2.pdf}%
\end{document}

But this produces 2 pages, but the pages are larger than the original figures (here's one page): enter image description here

Is there a way to get what I'm after?

Joel
  • 2,429

3 Answers3

30

What I use is

\documentclass[multi=my,crop]{standalone}

After this, wrap every figure into \begin{my}…\end{my}.

  • 10
    Works for me (crop doesn't change anything). With multi=page and \begin{page}... this gets more intuitive. – Scz May 04 '18 at 07:49
  • 6
    You can also use \standaloneenv{tikzpicture} to tell standalone to start a new page for every tikzpicture. This line must come after \usepackage{tikz}. – chs Mar 11 '20 at 09:31
4

I understand you already have some pdf figures, each one in an independent file and you want to obtain a booklet where each page shows one figure and each page is adjusted to figure size.

If my supposition is correct, you need incgraph package.

\documentclass{article}
\usepackage{incgraph}

\begin{document}

\incgraph{1943}

\incgraph{1842}

\end{document}

enter image description here

Ignasi
  • 136,588
2

If you want to put fig1.pdf and fig2.pdf into a single PDF with each page exactly equal to the original pdf, then I recommend you use the pdftk program.

pdftk fig1.pdf fig2.pdf cat output newfile.pdf 
James
  • 4,587
  • 1
  • 12
  • 27
  • I'm after a LaTeX solution. I'm ultimately going to be using psfrag (so .eps files) to change some labels in many figures. – Joel Apr 19 '16 at 16:27