Figures and Tables

Figures in LaTeX: An example

Here is an example that illustrates how to incorporate figures into LaTeX. It assumes that you have eps and pdf files, "sineplot.eps" and "sineplot.pdf", of the picture that you want to incorporate into your tex document, and placed these files into the same directory as your tex source file. Picture files are usually created with an external application, such as Mathematica or xfig (a Unix drawing program); how this is done depends on the particular application and cannot be discussed here.
\documentclass{amsart}
\usepackage{graphicx}

[...]

\begin{document}

[...]

\begin{figure}
\centering
\includegraphics{sineplot}
\caption{Plot of the function $\sin x$}
\label{sineplot}
\end{figure}

Figure \ref{sineplot} shows a plot of the sine function.

[...]

\end{document}

The main ingredients in this example are the following:

Figures in LaTeX: Additional tips

Tables in LaTeX: An example

Here is a simple example that illustrates the basic structure of a table in LaTeX.

\begin{table}
\centering

\begin{tabular}{|l||r|r|r|c|}  
\hline
Name & Exam1 & Exam2 & Exam3 & Grade\\
\hline\hline
John & 19 & 28 & 33 & C\\  
\hline
Jane & 49 & 35 & 60 & B\\
\hline
Jim & 76 & 38 & 59 & A\\
\hline
\end{tabular}

\caption{Math 500 Grades}
\label{math500grades}
\end{table}

The main ingredients in this example are the following:

Tables in LaTeX: Additional tips

Placement of figures and tables

The placement of figures and tables can be a source of much frustration; sometimes, no matter what one does, TeX doesn't seem to want to place a figure or table in a particular location. The reason for this is almost always that there is no "legal" way (e.g., in the sense of not overrunning the page) for TeX to produce the desired placement.


Back to the LaTeX Tips Page

Last modified: Tue 23 Aug 2011 05:49:36 PM CDT A.J. Hildebrand