Standalone LateX

A common approach for using images in latex documents is adding \usepackage{graphicx} to the preamble and of myfile.tex inserting image in the following text with \includegraphics{my_image.eps} ( the image type can be different including png, jpg and even .pdf).

If the image type is a some kind of mathematical graph or drawing/scheme one could use  TikZ or PSTricks to draw it. However, this approach results in “double work”,  e.g. even on a minor change one needs first to compile my_image.tex to my_image.eps, then recompile myfile.tex to update picture in the resulting pdf. Additionally this method has  drawbacks, such as changing font size of the text in on resizing the my_image.eps.

One of the possible ways to solve this problem is using standalone package. It allows inserting  my_image.tex file in a myfile.tex as an image, while keeping the possibility to compile  my_image.tex as a standalone image. Example file listings can be seen in a dedicated gists.

This text is mostly based on the following discussion on tex.stackexchange.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s