Have you ever submitted a LaTeX paper to a journal that wants separate figures? When you want to include a figure composed of a table of images, you must build it separately.
When I run latexpdf
, I get an entire 8.5 x 11 page, even when I remove the page number.
Is there a way to "autocrop" my built pdf as I compile it from LaTeX? I suppose I could open it in inkscape and crop and save it, but I'd really like to learn how to do this the right way.
Best Answer
I have been using the
standalone
package exactly for this purpose. You create a standalone tex file for each figure and use:and the main files which
include
this standalone file will need to have the complete preamble including\usepackage{standalone}
. Martin Scharrer, the package author provides a good example here.Alternatively you could use the
preview
package. Add\usepackage[active, graphics]{preview}
, and use the\PreviewEnvironment
to specify which environments you want to be extracted.Here is an example that extracts the two
tikzpicture
environments on separate pages: