## LaTeX Figures

Posted: 13th August 2009 by Tim in LaTeX
Tags: , , , , , , , , , ,

Adding figures to LaTeX documents is quite simple. Like tables, figures can be added to the List of Figures automatically.

Images need to be converted into encapsulated post script (eps) in order to be added to the document (other file types may be used with the inclusion of some external packages, which won’t be covered here). Programs such as Photoshop (windows / mac) or GIMP (linux) can convert an image into an eps for you.

Once you have the eps file (let’s call it image.eps for this example), you can include the figure like so:

\begin{figure} \centering \includegraphics{image} \caption{This is the caption which will be displayed under the image} \label{fig:image} \end{figure}

LaTeX will decide on where to place the figure in your document. Note that we did not add the .eps extension to the \includegraphics code.

The figure may now be referenced from anywhere in the document by using the label name from \label{label_name} like so:

As can be seen in Figure \ref{fig:image}, the dog is bigger than the mouse.

\ref{fig:image} will be replaced with the figure number when the document is compiled.

1. Tim says:

Remember to put the label below the caption, or the references won’t work correctly (or at all).