13  Including graphics

Beamer recognizes images in any of the pdf, png and jpg formats. (Note that PostScript is not among these.)

In the following sample we include three pictures side-by-side in a slide.

% graphics.tex 
Here we include three images, one each of PDF, PNG, and JPG types. 

Here is the result:


Converting graphics

When you create an image with the intention of including it in a Beamer document, it is best if you save it in one of the pdf, png or jpg formats that are recognizable by Beamer.4 This is sometimes not possible. For instance, you may have downloaded the image from somewhere and it is in the gif format.

The department’s computer facilities provide a large number of utilities for converting and modifying graphical images.

eps to pdf

To convert an Encapsulated PostScript image to pdf, do:

epstopdf filename.eps 

This will produce a file named filename.pdf.5

All other conversions

The general-purpose convert6 command converts from any graphics format to any other graphics format. For instance, to convert a gif file to the png format, do:

convert filename.gif filename.png 

Similarly, to convert a tiff file to jpg, do:

convert filename.tiff filename.jpg 

In fact, we can have convert take over the job of epstopdf as well, as in:

convert filename.eps filename.pdf 

however in my experience epstopdf produces better results.

4 The png format works best for line drawings, such as graphs of functions in 2D. The jpg format works best with gradually varying shades, such as the photograph of a person’s face.

5 The epstopdf utility is a perl script that calls ghostscript to do the actual conversion. In many Linux distributions it is bundled with the main TeX/LaTeX package.

6 The convert utility is a part of ImageMagick suite of graphics manipulation utilities.