Friday, 4 November 2011

Making single eps file from latex figure

Journals, being the cash-strapped money-printing machines that they are, like to have submissions written in LaTeX, but only in the simplest LaTeX possible.

I like to use LaTeX as much as possible when annotating figures produced by other programs, as then the fonts in my document match those in my figures. This makes it sensible to compose figures within the LateX figure environment. A simple example which collects some sub-figures then labels them would be:

\caption{A multi-figure figure}

For final submission, journals like to have single eps files for each figure, so we need a way to make a single eps file from this. The trick is to use the preview and standalone environments. Create a file for the figure (e.g. fig-01.tex) with contents:


% put \picture{} here

do not include the \caption or \label, just the code for the figure itself.

Now run:

latex fig-01.tex --output-format=dvi
dvips -E -I 3c -o fig-01.eps fig-01.dvi

to produce a single eps file with cropped boundaries. This can then be included in the main document's figure directly.

1 comment:

  1. Hi, thanks for the tip! I tried this and the but the resulting eps files seem to be okay in GSView. They are not, however, visible when I'm trying to include them to a tex file. I can only see blanch space in the dvi file instead of a figure. Did you happen to face this kind of problems?