Including images in LaTeX files

Here are the rules for including images in LaTeX files as far as I can tell.

Near the top of your document, use \usepackage{graphicx} to load the graphicx package. Then at the point where you want to include your image, use \includeimage{...} where … is the path to your file.

If you want to create a PDF file with pdflatex, your image must be in PDF, PNG, or JPEG format.

If you want to create a DVI file with latex or a PS file with dvips, your image must be in PS or EPS format.

There’s no way to include a GIF file without first converting it to another file format.

If you use \usepackage{pgf} rather than  \usepackage{graphics} at the top of the file, nothing changes except that you must chop the file extensions off image file names.

Related post: Watch what you name graphics files in LaTeX

Free bitmap to vector format software

VectorMagic is a free online tool from the Standford University AI lab for converting bitmap images to vector formats. The image below shows an example of what you might use this tool for.

bitmap to vector conversion

I just heard about the software and tried it out with a fairly complex image, a sample of Japanese calligraphy, and it did a beautiful job converting the image from bitmap to EPS (Encapsulated PostScript).

The software supports JPEG, GIF, PNG, BMP, and TIFF input. It supports EPS, SVG, and PNG output.

(In case you’re not familiar with graphic formats, a bitmap image is a matrix of dots. The format records what color each dot is. That works fine when an image is displayed at its original resolution. But if you make the image bigger, you just get bigger dots and things look grainy. A vector format stores the formulas for the curves that make up the image, not the dots, and computes the dots when it’s time to display the image. If you make an image larger, it computes new dots according to the formulas. Software for making bitmaps smaller is common. Software that does a good job of making bitmaps larger is rare.)

Update: VectorMagic has moved to a new domain. I’ve corrected the link above.

Quick TeX to graphic utility

Here’s a website where you can type in some TeX code, click a button, and get back a GIF with a transparent background. Handy for pasting equations into HTML.

http://www.artofproblemsolving.com/LaTeX/AoPS_L_TeXer.php

For example:

Gaussian integral

Update (December 2014): The site mentioned in this post doesn’t seem to exist any more. Some alternatives: