I'm trying to use \beginpgfgraphicnamed
to externalise some complex figures in a large document, using the latest released version of TiKZ (2.00). This produces standalone PDF images but for me the graphic is shifted up: the top part of the image is cut off and the bottom part has unnecessary whitespace. The overall PDF that is generated by pdflatex when these externalised images are used has the same visual problem, so I'm having to drop the idea of externalising graphics for now.
As far as I can tell the overall size of the pictures is correct (when comparing to the version without externalisation). I am using a custom thesis style file that changes margins, which is probably breaking several of the l2tabu
no-no's.
How does PGF/TiKZ calculate the positioning of pictures on the page, at least as this affects positioning of externalised pictures?
In particular, are there specific things to tweak or to avoid tweaking to ensure this problem does not happen? I'm trying to not embark on a big LaTeX hacking project like redoing the style based on a more modern documentclass
than report
, so ways to steer clear of this would be especially welcome.
Best Answer
You can set the bounding box of a
tikzpicture
explicitly by using\useasboundingbox
or more TikZ'ish:in your
tikzpicture
.You will have to provide some more information if the above is not what you want. As stated above, the way to control the size of a
tikzpicture
is to set the bounding box manually if you are not happy with what TikZ is calculating. To quote the pgfmanual (section Establishing a bounding Box):You might also try using the external library
this offers some additional functionality on top of the
Alternatively, the
preview
package offers a way to extract tightly cropped parts of a document