TechPubs @ SLACHome (public) | Home (slaconly) | Help Pages | Organization (slaconly) | Feedback | Search
Quick Links for Authorsidoc home | Submission Instructions | Recent SLAC Publications | TechPubs Help Pages | Find a SLAC Document

Manipulating Figures in LaTeX2e or REVTeX with \includegraphics and the Graphicx Package

This guide is not meant to be a complete introduction to all graphics packages for LaTeX2e. For additional help on working with LaTeX, we recommend A Guide to LATEX: Document Preparation for Beginners and Advanced Users (3rd Edition) by Helmut Kopka, Patrick W. Daly, or search the TUGboat article archives.

Preliminaries

This page describes macros for incorporating, resizing, rotating, and placing figures in LaTeX2e, using includegraphics and the graphicx package. Also included are links to the file containing these macros and sample documents you can use as guides.

Topics

For more information, check out Using EPS Graphics in LaTeX2e Documents Part 2: Floating figures, boxed figures, captions, and math in figures.

Incorporating Figures

The following code will allow you to incorporate a figure into a LaTeX2e document. Whenever you are instructed to insert the name of your figure into the code, be sure to omit the suffix .eps from the filename.

Resizing Figures

If you need to resize a figure and cannot do it in the original authoring program, the following macro will allow you to do so in LaTeX.

Note: It is best to resize a figure in the original authoring program, as you will have better control over the size and placement of labels.

Rotating Figures

To rotate a figure, include the following code in your LaTeX code immediately after the paragraph in which the figure is first mentioned. Insert the rotation amount in the square brackets (example: [angle=90]).

\begin{figure}
\centering
\includegraphics[angle]{filename.eps}
\caption{Caption goes here}
\end{figure}

Placing a Full-Page Figure

To place a figure on a page of its own, use the following code:

\clearpage
\begin{figure}
\centering
\includegraphics{filename.eps}
\caption{Caption goes here}
\end{figure}
\clearpage

Placing Figures

To place a figure on a page:

  1. Place the figure inclusion code immediately after the paragraph in which the figure is first mentioned.
  2. By default, figures will float to the top of the page.

    Note: It is widely recommended at SLAC and elsewhere in the publishing industry that figures appear at the top of a page.

  3. LaTeX your document and review the output. If the figure does not appear on the page that you intended, try moving the figure inclusion code back or forward one paragraph, re-LaTeX it, and view again. Continue this process until you are satisfied with the placement.

To float figures to other locations on the page, after beginning the figure, specify the float location with the optional location clause until it is in the position you want:

\begin{figure}[location]

Possible values, which may be combined to allow for several possibilities, for the location are:

The default value is [tbp]

Sample Document

The sample below is a complete document that includes the code described above for incorporating, resizing, rotating, and placing figures in LaTeX.

To save a sample document to your Unix or PC directory, click on the appropriate link below, and your browser will ask you if you want to Save As.... If you're using a Mac, click and hold, and then choose the Save As... option from the pop-up menu to save the file to your hard drive. You will also need to download the sample EPS figure in order to use the sample document.