I recommend using the
graphicx
package. There is another one called graphcis
that has the same
functionality, but uses a different syntax. In my opinion, graphicx
has the better syntax. \usepackage[options]{graphicx}
Common options are:
-
Driver name, such as
dvips
,dvipdf
, andpdftex
. -
draft
: draw an empty box in place of the image.
\usepackage{graphicx}
\usepackage[dvips]{graphicx}
When compiling with latex
or texify
to create a DVI file (and then to PS or PDF using dvips
, dvipdfm
,
or ps2pdf
if needed) you can include EPS files using the command
\includegraphics[key=value, ...]{fileName}
Common key/values are
-
scale=
number -
width=
length -
height=
length -
totalheight=
length : height plus depth; generally used when rotating the graphic -
keepaspectratio=
boolean :true
orfalse
-
angle=
number : the angle to rotate the image counterclockwise, in degrees -
origin=
location : the anchor point for rotation; legal values includec
(center),t
(top),r
(right),bl
(bottom-left),B
(baseline), and certain combinations, such astr
-
draft=
boolean :true
orfalse
; draw an empty box in place of the image. -
bb=
llx lly urx ury : creates a new bounding box using the specified coordinates; default unit is bp (points) -
clip=
boolean :true
orfalse
; don't draw parts of the graphic outside the bounding box -
viewport=
llx lly urx ury : creates a bounding box relative to origin (generally ll) of the existing one -
trim=
left bottom right top : creates a new bounding box by adding or removing the given lengths to each side of the existing bounding box
\includegraphics{MyFile.eps}
\includegraphics[height=3cm,angle=45]{MyFile.eps}
\includegraphics[scale=0.55]{MyFile.eps}
\includegraphics[height=3cm,width=5cm,keepaspectratio=true]{MyFile.eps}
You can convert images to EPS files using the convert
command in
the ImageMagick tool suite. Other tools such as matlab, and
PaintShop Pro (maybe Gimp?) also let you save images as EPS files.When using
pdflatex
to create PDF files you can use the same commands above, but instead of including
EPS files, you can include PNGs, BMPs, and GIFs directly (no need to convert to EPS files first):
\includegraphics{MyFile.jpg}
\includegraphics[height=3cm,width=5cm]{MyFile.png}
References
- CTAN, CTAN graphicx package information, 2009
- D.P. Carlisle, Packages in the graphics bundle, (graphics guide for Latex3, PDF), 2005
- Including graphics in a LaTeX document, amath.colorado.edu, 2008