Incorporating graphics into LaTeX

You should be able to insert almost any kind of graphics image into a LaTeX file, but there are some details to pay attention to.  Unlimited resolution images such as .eps and .pdf files can be handled, and so can fixed resolution formats such as .gif, .png, and .jpg.  You can either use all .eps or all .pdf images, but not both.  The instructions for each case are different, see below.

If you are using .eps graphics (and maybe .jpg, .png, .gif, but not .pdf)

The extension .eps is used for Encapsulated PostScript files.  These are text files which use the PostScript language to describe what to put on the page.  They contain a line describing the "bounding box" which tells where on the page the actual image is, by telling the lower left and upper right corner of the image in this format:

%%BoundingBox: 70 460 231 596

The rest of the .eps file tells what text, lines, and other symbols to put and where they should appear on the page.  You can download and install an .eps previewer on your computer.  See: ghostcript download and GSview download.  Download and install both GhostScript and GSview.  This should associate .ps and .eps files with GSview.

Here is an example of incorporating .eps graphics into LaTeX:

LaTeX documents with .eps graphics must be processed by latex.  This will produce a .dvi file which you can preview with yap.  The .dvi file will not contain the pictures, it needs to read the pictures off the disk.  So it is awkward to email a .dvi file to someone, because you also have to email the image files.  Instead, convert the .dvi file to .pdf using a program like dvipdf.  In LEd, you can do these steps by clicking the green triangle to have latex process the source file, then the blue words PDF to have dvipdf turn the .dvi file into a .pdf file.

To include graphics in .png, .gif, .jpg and other such fixed resolution formats, you need to specify the bounding box, as described in the GraphicsWithEPS.tex file.  To find the image size in Windows, it is helpful to view a folder listing using the Details option, and then click in the title bar to select that Windows should display the Dimensions of images.  One problem I have had is this.  If you use .png graphics and convert .tex -> .dvi -> .pdf, the .png graphic may get resized.  Instead you can convert .tex -> .dvi -> .ps -> .pdf (using ps2pdf in the MiKTeX/miktex/bin folder).  However, going through .ps seems to turn color images into grayscale images.

If you are using .pdf graphics (and maybe .jpg, .png, .gif, but not .eps)

.pdf graphics are essentially PostScript files that are compressed and have a few more bells and whistles like security and encryption.  They can be viewed with the widely-available Adobe Reader.  When you create a .pdf file with a graphics program such as GeoGebra, the graphic might not fill the page, so it will be helpful to crop it with a program like Adobe Acrobat.

Here is an example of incorporating .pdf graphics into LaTeX:

LaTeX documents with .pdf graphics must be processed by pdflatex.  This produces a .pdf file directly.  In LEd, you can run pdflatex by clicking the blue triangle.