\documentclass[11pt]{article}

\usepackage{amssymb,amsmath,graphicx}

\begin{document}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{definition}[theorem]{Definition}



\parskip 1ex            % sets the gap between paragraphs
\parindent 0ex		% an ex is the width of an ex


\title{Tables and Figures in  \LaTeX}
\author{David Handron}
\date{\today}

\maketitle

In our last class, we saw many commands we can use to make \LaTeX{ }
produce the output we desire.  All the commands we saw produced a continuous 
stream of text.  If you look in (just about) any math book, however, there 
will be pictures and other information presented as figures, and referred to 
in the main body of the text.  Today we will see how this can be accomplished 
in \LaTeX.

\section{Placing Figures in \LaTeX{ }Documents}
\label{figsect}

We can use the figure environment in \LaTeX{ } to include a picture we have 
created using another program.  For example, if we want to show a graph of 
$y=x^2$ we can produce the graph using Mathematica and save it as an 
encapsulated postscript (eps) file.

Using Mathematica, you can plot the function by typing Plot[x\^2,\{x,-1,2\}].
Left click on the image to select it.  Then right click and select Edit$\to$
Save Selection As...$\to$EPS...

Then choose a name for the image that ends with ``.eps''.

% Here is how we include the image in our document:

\begin{figure}
\begin{center}
\includegraphics{xsquared.eps}
\caption{This is the graph of $y=x^2$.}\label{grph}
\end{center}
\end{figure}


The $\backslash$begin\{figure\} and $\backslash$end\{figure\} commands instruct
\LaTeX{ } to allow the material between them to ``float''.  The 
$\backslash$includegraphics command does just what it says, and 
$\backslash$caption allows us to give the figure a caption.

The command $\backslash$label allows us to refer to the figure in the main text
by using the $\backslash$ref command.  e.g. look at the nice graph in 
figure~\ref{grph}.

The command $\backslash$begin\{figure\} has a second, optional argument.
This argument governs the placement of the figure on the page.  It may read
$\backslash$begin\{figure\}[th].  This tells \LaTeX{ } to place the figure 
either at the top of the page, or exactly where it appears in the .tex file.
There are several arguments that may be used: h-here, t-top, b-bottom, or 
p-on a separate page.

\section{Using Tables}

Tables behave much the same way as figures.  For example, we can present 
the information in the last paragraph of Section~\ref{figsect} as:

\begin{table}[h]
\begin{center}
\begin{tabular}{||c|c||}
\hline
Symbol & Effect \\ \hline\hline
h      & here   \\ \hline
t      & top    \\ \hline
b      & bottom \\ \hline
p      & on a separate page \\ \hline
\end{tabular}
\caption{optional arguments for the figure and table environments.}
\end{center}
\end{table}



\end{document}










