\documentclass[final,letterpaper,twoside,12pt]{article}
\usepackage{graphicx}
\begin{document}
\title{Example with Figures}
\author{Terry Sturtevant}
\maketitle

\section {Introduction} 
Figures can be added to \LaTeX\ documents like this:
\begin{figure}[ht!]
\begin{picture}(330,200)(0,0)
\put(-40,-490){\includegraphics[scale=1.0]{figxone.pdf}}
%\put(50,0){bl}
%\put(50,200){tl}
%\put(360,0){br}
%\put(360,200){tr}
\end{picture}
\caption{Graph of Fit to $A + B/x$}
\label{pic:feone}
\end{figure}
In Figure~{\ref{pic:feone}}, a Postscript image was converted to a pdf image using
a conversion tool, and then imported. Almost anything can produce a Postscript image
by using a \emph{print to file} feature.

\vfil
\pagebreak
\vfil

\begin{figure}[ht!]
\begin{picture}(330,200)(0,0)
\put(0,0){\includegraphics[scale=1.0]{figxtwo.png}}
%\put(50,0){bl}
%\put(50,200){tl}
%\put(360,0){br}
%\put(360,200){tr}
\end{picture}
\caption{PNG image}
\label{pic:fetwo}
\end{figure}
\noindent In Figure~{\ref{pic:fetwo}}, a PNG image has been used.
 
\begin{figure}[ht!]
\begin{picture}(330,200)(0,0)
\put(0,0){\includegraphics[scale=1.0]{figxtwo.jpg}}
%\put(50,0){bl}
%\put(50,200){tl}
%\put(360,0){br}
%\put(360,200){tr}
\end{picture}
\caption{JPEG image}
\label{pic:fethr}
\end{figure}
\noindent In Figure~{\ref{pic:fethr}} the same image, but in JPEG format, has been used.

\noindent Note in the case of the PNG and JPEG formats, the images inside the final pdf document
can be extracted by mouse clicking over them.

\subsection {Working with images}

\subsubsection{Coordinate systems}
In order to work with images, you have to understand something about where
\LaTeX\ puts things, and how sizes are measured. 

\begin{figure}[ht!]
\begin{picture}(300,150)(0,0)
\put(0,0){\includegraphics[scale=1.0]{figxtwo.png}}
\put(0,0){bl}
\put(0,150){tl}
\put(300,0){br}
\put(300,150){tr}
\end{picture}
\caption{Boundary guess}
\label{pic:fefoua}
\end{figure}
\noindent In Figure~{\ref{pic:fefoua}}, an image has been imported, and 
text has been added to mark the four corners of the image space, 
with just a wild guess about where those corners will be.

%\vfil
%\pagebreak
%\vfil

\begin{figure}[ht!]
\begin{picture}(330,100)(0,0)
\put(0,0){\includegraphics[scale=1.0]{figxtwo.png}}
\put(0,0){bl}
\put(0,100){tl}
\put(330,0){br}
\put(330,100){tr}
\end{picture}
\caption{With boundries shown}
\label{pic:fefou}
\end{figure}
\noindent In Figure~{\ref{pic:fefou}}, the boundries have been revised to the right dimensions
by basic math and trial and error.

\vfil
\pagebreak
\vfil

\noindent blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
 blah blah blah blah blah blah blah blah blah

\begin{figure}[ht!]
\begin{picture}(330,85)(0,0)
\put(0,0){\includegraphics[scale=1.0]{figxtwo.png}}
\put(0,0){bl}
\put(0,85){tl}
\put(330,0){br}
\put(330,85){tr}
\end{picture}
\caption{Not enough space}
\label{pic:fesix}
\end{figure}

\noindent The coordinates in the \textbf{picture} command determine how much space to leave for the image
and where to put it in that space. (The text has been obscured by 
Figure~{\ref{pic:fesix}}, where not enough space has been left.)

%\vfil
%\pagebreak
%\vfil

\noindent On the other hand, we can get extra white space.
\nobreak
\begin{figure}[ht!]
\begin{picture}(330,200)(0,0)
\put(0,0){\includegraphics[scale=1.0]{figxtwo.png}}
\put(0,0){bl}
\put(0,200){tl}
\put(330,0){br}
\put(330,200){tr}
\end{picture}
\caption{Too much space}
\label{pic:fesev}
\end{figure}
\nobreak
\noindent In Figure~{\ref{pic:fesev}}, extra space has been left.

\vfil
\pagebreak
\vfil

\noindent The image can be shifted by adjusting the coordinates in the \textbf{put} command.
\begin{figure}[ht!]
\begin{picture}(330,100)(0,0)
\put(50,0){\includegraphics[scale=1.0]{figxtwo.png}}
\put(0,0){bl}
\put(0,100){tl}
\put(330,0){br}
\put(330,100){tr}
\end{picture}
\caption{Shifted image}
\label{pic:feeig}
\end{figure}
%In Figure~{\ref{pic:feeig}}, text has been added to mark the four corners of the image space.

\noindent The image can also be shifted by adjusting the coordinates in the \textbf{picture} environment.
\begin{figure}[ht!]
\begin{picture}(330,100)(0,40)
\put(50,0){\includegraphics[scale=1.0]{figxtwo.png}}
\put(0,0){bl}
\put(0,100){tl}
\put(330,0){br}
\put(330,100){tr}
\end{picture}
\caption{Picture shifted in figure environment}
\label{pic:fefiv}
\end{figure}
\noindent In Figure~{\ref{pic:fefiv}}, note how the caption has moved, and in what direction.

\noindent (I rarely adjust this second coordinate in the \textbf{picture} environment.)

\vfil
\pagebreak
\vfil

\begin{figure}[ht!]
\begin{picture}(165,50)(0,0)
\put(0,0){\includegraphics[scale=0.5]{figxtwo.png}}
\put(0,0){bl}
\put(0,50){tl}
\put(165,0){br}
\put(165,50){tr}
\end{picture}
\caption{Scaled image}
\label{pic:fenin}
\end{figure}
\noindent In Figure~{\ref{pic:fenin}}, the image has been scaled down by a factor of two,
with coordinates adjusted accordingly. You'd probably want to shift this.

\begin{figure}[ht!]
\begin{center}
\begin{picture}(165,50)(0,0)
\put(0,0){\includegraphics[scale=0.5]{figxtwo.png}}
\put(0,0){bl}
\put(0,50){tl}
\put(165,0){br}
\put(165,50){tr}
\end{picture}
\caption{Scaled and centred image}
\label{pic:feten}
\end{center}
\end{figure}
\noindent In Figure~{\ref{pic:feten}}, the image has been scaled and centred. In this case, I used the 
\textbf{center} environment.

\vfil
\pagebreak
\vfil

\subsubsection{Adding text to images}
One useful option is to anotate images with text. You might be tempted,
if drawing the image yourself, to add text in the original
drawing. However in that case you may not have the same fonts available.
Adding them in \LaTeX\ will keep fonts consistent with the document. (It 
also
avoids size problems if you scale the image up or down.)


\begin{figure}[ht!]
\begin{picture}(330,100)(0,0)
\put(0,0){\includegraphics[scale=1.0]{figxtwo.png}}
\put(150,70){$x_6 - x_1$}
\put(0,0){bl}
\put(0,100){tl}
\put(330,0){br}
\put(330,100){tr}
\end{picture}
\caption{Image with text}
\label{pic:feele}
\end{figure}
\noindent In Figure~{\ref{pic:feele}}, text (in math mode, in this case) has been added.

\begin{figure}[ht!]
\begin{picture}(330,100)(0,0)
\put(0,0){\includegraphics[scale=1.0]{figxtwo.png}}
\put(150,70){$x_6 - x_1$}
%\put(0,0){bl}
%\put(0,100){tl}
%\put(330,0){br}
%\put(330,100){tr}
\end{picture}
\caption{Final version}
\label{pic:fefin}
\end{figure}
\noindent Figure~{\ref{pic:fefin}} shows the final result with the corner text commented out.


\end{document}

