\documentclass{article}
\usepackage{local} % a couple of local macros I'm using
\usepackage{amssymb,latexsym,amsmath,graphicx}
\pagestyle{empty}

\begin{document}
\filename          % this macro is defined in local.sty

\noindent
An example of including a graphic in a \LaTeX\ document:

\begin{center}
\fbox{\parbox{2in}{\setlength{\hfuzz}{2pt}\ttfamily
\noindent
\bsl documentclass\{article\}\\  % \bsl is defined in local.sty
\bsl usepackage\{graphics\}\\
\bsl begin\{document\}\\
Here, we illustrate the phenomenon known as ``beats.''\par
\noindent
\bsl begin\{figure\}[h]\\
\hspace*{5pt}\bsl scalebox\{.5\}\\
\hspace*{5pt}\{\bsl includegraphics\{fig.eps\}\}\\
\hspace*{5pt}\bsl caption\{\$\bsl sin(x/2)\\
\hspace*{10pt}\bsl sin(5x)\$\}\\
\hspace*{5pt}\bsl label\{Fig:beats\}\\
\bsl end\{figure\}\\
\bsl end\{document\}
}}\quad
\fbox{\parbox{2in}{\noindent\hspace*{5pt}
Here, we illustrate the phenomenon known as ``beats.''
\\[10pt]
% \begin{figure}[h]
  \scalebox{.5}{%\includegraphics{fig.eps}}
 \includegraphics[scale=.65,viewport=72 72 230 230]{fig}} % this works
  \begin{flushright}                                       % for pdflatex
    Figure 1: $\sin(x/2)\sin(5x)$
  \end{flushright}
%  \caption{$\sin(x/2)\sin(5x)$}\label{Fig:beats}
% \end{figure}
}}
\end{center}

\noindent
Some key points to notice:
\begin{itemize}
\item
  We included the \texttt{graphics} package with a \texttt{\bsl
  usepackage} command in the head of the document, to make the
  graphics macros available,\footnote{There is also a package called
  \texttt{graphicx}, which is generally more powerful than the
  \texttt{graphics} package.}
\item
  The command that imports the graphic is 
  \texttt{\bsl includegraphics\{\emph{filename}\}}.  The rest of the
  commands around that govern the appearance of the included graphic
  and the context it appears in the page, 
\item
  The file that we're included is called \texttt{fig.eps} and is
  located in the same directory that we're working in.  This is an
  \emph{Encapsulated PostScript} file.
\item
  We used the \texttt{\bsl scalebox\{\emph{amount to
  scale}\}\{\emph{stuff to scale}\}} command to reduce the size of the
  included graphics to 50\%.  Without linebreaks, this is (from above)
%  \\                % I started putting this on a separate line, but 
%  \hspace*{.5in}   % decided against it
  \texttt{\bsl scalebox\{.5\}\{\bsl includegraphics\{fig.eps\}\}}.
%  \hfill
\item
  The \texttt{figure} environment makes a reasonable guess as to where
  the graphic should be placed in the document; we can specify a place
  with an optional argument---we used \texttt{[h]} (put the figure
  ``here''), and other options are \texttt{[b]} (at the bottom of the
  page), \texttt{[t]} (at the top of the page) and \texttt{[p]} (on a
  separate page).  You can give multiple options (say, \texttt{[ht]})
  to put the figure either ``here'' or at the top of the page. Note
  that regardless of the order of the arguments; the precedence is
  always \texttt{htb}.  Without the optional argument, the command
  would just be
 % \\
 % \hspace*{.5in}
  \texttt{\bsl begin\{figure\}}
 % \hfill
\item
  The \texttt{\bsl caption} macro keeps track of a figure counter, and
  puts the figure caption in as shown.  Notice that we used
  \texttt{\bsl label} to be able to refer figure~1  % ok, we're cheating
  here with the \texttt{\bsl ref} command \texttt{\bsl
  ref\{Fig:beats\}}. 
\end{itemize}


\end{document}
