22

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?

0

3 Answers 3

29

What I use is

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

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

2
  • 9
    Works for me (crop doesn't change anything). With multi=page and \begin{page}... this gets more intuitive.
    – Scz
    May 4, 2018 at 7: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, 2020 at 9: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

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 
1
  • 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, 2016 at 16:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .