%\documentclass[11pt]{article}
% -- for printing you can save paper by commenting out the
% -- above line and uncommenting the following two lines.
\documentclass[11pt]{article}
\usepackage{ltpage}
% -- then create ltpage.sty to contain the following (less the %%'s)
%%
%%     
%%\topmargin 0pt
%%\advance \topmargin by -\headheight
%%\advance \topmargin by -\headsep
%%     
%%\textheight 8.9in
%%     
%%\oddsidemargin 0.85in
%%\evensidemargin \oddsidemargin
%%\marginparwidth 0.5in
%%     
%%\textwidth 4.8in
%%     
%%     
%%     
%%\endinput
     
     


\begin{document}
\newlength{\dcl}
\setlength{\dcl}{2.0in}
\newlength{\dsep}
\setlength{\dsep}{0.5in}
\newcommand{\nm}[1]{{\sf #1}}
\title{Getting Started with \LaTeX}
\author{C.L. Mader}
\maketitle
\section{Introduction}
\LaTeX\ is an excellent system for typsetting mathematics. It can
help you prepare articles, reports and even your thesis.
\LaTeX\ is available on the math department's unix workstations; however,
when you need to know more buying your own 
book will be necessary \cite{Hahn93,Lamp86}.
\section{Running \LaTeX}
Running \LaTeX\  involves the following steps:
\begin{enumerate}
\setlength{\itemsep}{0.0in}
\setlength{\parsep}{0.0in}
\setlength{\parskip}{0.0in}
\item Type \LaTeX\ commands into a file using your favorite editor. 
      Name the file for example: \nm{myfile.tex}
\item Run \nm{latex}  to produce a \nm{.dvi} file. \\
\verb+         euler% latex myfile.tex+ \\
      If the program pauses with an error, type \nm{R} and press return.
\item Fix any errors in the \nm{.tex} file. Sometimes the
      easiest way to do this is to look at the \nm{.dvi} file
      rather than interpret \nm{latex}'s error messages.
\item View your file on a unix workstation with \nm{xdvi}. \\
\verb+         euler% xdvi myfile.dvi &+
\item Print \nm{myfile.dvi} on your default printer.  \\
\verb+         euler% dvips myfile.dvi+ \\
If you prefer create a postscript file and print with \nm{lpr} \\
\verb+         euler% dvips -o myfile.ps myfile.dvi+\\
\verb+         euler% lpr -Plab1 myfile.ps+ 
%\begin{itemize}
%\setlength{\itemsep}{0.0in}
%\setlength{\parsep}{0.0in}
%\setlength{\parskip}{0.0in}
%\item on lab1: \verb+euler% dvips -Plab1 myfile.dvi+ 
%\item on lab2: \verb+euler% dvips -Plab2 myfile.dvi+ 
%\end{itemize}
\end{enumerate}

\section{\LaTeX\ Commands}
You begin with a file like:
\begin{minipage}[t]{2.0in}
\begin{verbatim}
\documentclass{article}
\begin{document}

\end{document}
\end{verbatim}
\end{minipage}\\
All the other commands you type will go in between the \verb+\begin{document}+
and the \verb+\end{document}+. You can use \verb+\documentclass[11pt]{article}+
or \verb+\documentclass[12pt]{article}+ if you want a larger typesize. Use \\
\verb+\documentclass{report}+ for {\bf much} longer documents.
\subsection{Title}
First you will need a title. In the example below what you type into your
\nm{.tex} file is on the right.  The \nm{latex} output is on the left.\\
{ 
  \begin{minipage}[t]{\dcl}
  \begin{center}
  {\LARGE A Great Report} \\[0.2in]
  {\large P.B. Anybody  \\[0.15in]
          \today
  }
  \end{center}
  \end{minipage}
  \hspace{\dsep}
  \begin{minipage}[t]{\dcl }
  \begin{verbatim}
  \title{A Great Report}
  \author{P.B. Anybody}
  \maketitle
  \end{verbatim}
  \end{minipage}
}
\subsection{Typing in text}
Do not worry about spacing and carriage returns. \nm{latex} will automatically 
format the text for you.  A blank line marks the end of a paragraph.
The following commands give special effects in text mode.

{ \begin{minipage}[t]{\dcl}
   you can use {\bf bold}, {\em italic}  
   and {\sf Modern} types.
   Including \\ equations  like: $a^2+b^2=c^2$ 
   is also possible.
  \end{minipage}
  \hspace{\dsep}
  \begin{minipage}[t]{\dcl }
  \vspace{-\abovedisplayskip}
  \begin{verbatim}
you can use {\bf bold}, 
{\em italic} and {\sf Modern} 
types. Including \\
equations like: $a^2+b^2=c^2$
is also possible.
  \end{verbatim}
  \end{minipage}
}\\
Note that text is grouped with \verb+{+ and \verb+}+ . Blocks of text
are key to understanding \LaTeX\  and getting it to work correctly.
Note how the \verb+\\+ is used to force a new line to begin. Also note how the
\verb+$+ are used to introduce math mode expressions into the text. 
\subsection{Footnotes}
To use a footnote \footnote{like this one.} use a command like:
\verb+\footnote{like this one.}+.
\subsection{Sections and Subsections}
The sections in the document begin with commands like 
\verb+\section{Title}+ and a subsection begins
with the \verb+\subsection{subtitle}+ command.
\subsection{Mathematics}
\LaTeX\ is best at typesetting mathematics.\\
{ \begin{minipage}[t]{\dcl}
\[ u_{xx} + u_{yy} = \lambda^2 
\]
  \end{minipage}
  \hspace{\dsep}
  \begin{minipage}[t]{\dcl }
%  \vspace{-\abovedisplayskip}
  \begin{verbatim}
\[ u_{xx} + u_{yy} = \lambda^2 
\]
  \end{verbatim}
  \end{minipage}
}\\
Note how to do subscripts and superscripts. 
You can use both together e.g. \verb+r_1^2+ gives $r_1^2$.
Use \verb+{+ and \verb+}+ when you need more than one character. 
The entire greek alphabet is available. 
\verb+\Lambda+ would have given $\Lambda$. 
\verb+\[+ and \verb+\]+ are used to change to math mode.
Each equation needs its own pair of these delimiters.  Numbered equations
are also possible.\\
{ \begin{minipage}[t]{\dcl}
\begin{equation}\label{trig1}
\cos^2\theta+\sin^2\theta=1
\end{equation}
  \end{minipage}
  \hspace{\dsep}
  \begin{minipage}[t]{\dcl }
  \vspace{-\abovedisplayskip}
  \begin{verbatim}
\begin{equation}\label{trig1}
\cos^2\theta+\sin^2\theta=1
\end{equation}
  \end{verbatim}
  \end{minipage}
}\\
The \verb+\label+
assigns a key \verb+{trig1}+ so we can refer\footnote{You can also label and
reference sections and subsections this way.}
 to the equation later.
{ \begin{minipage}[t]{\dcl}
We can solve (\ref{trig1}) as
\begin{equation}\label{trig2}
\cos\theta= 
\sqrt{1-\sin^2\theta}
\end{equation}
  \end{minipage}
  \hspace{\dsep}
  \begin{minipage}[t]{\dcl }
  \vspace{-\abovedisplayskip}
  \begin{verbatim}
We can solve (\ref{trig1} ) as
\begin{equation}\label{trig2}
\cos\theta= 
\sqrt{1-\sin^2\theta}
\end{equation}
  \end{verbatim}
  \end{minipage}
}\\
Note how \verb+\sqrt{ }+ works. In addition to $\sqrt{\ }$ other 
functions have special rules for type setting. Use special commands (like
\verb+\cos+ and \verb+\sin+) to typeset them. Examples are: \verb+\log+,
\verb+\ln+, \verb+\exp+, \verb+\lim+, \verb+\max+.  \\
{ \begin{minipage}[t]{\dcl}
\begin{equation}\label{trig3}
\lim_{x\rightarrow 0} 
\left( \frac{\sin x}{x}
\right) =1
\end{equation}
  \end{minipage}
  \hspace{\dsep}
  \begin{minipage}[t]{\dcl }
  \vspace{-\abovedisplayskip}
  \begin{verbatim}
\begin{equation}\label{trig3}
\lim_{x\rightarrow 0} 
\left( \frac{\sin x}{x} 
\right) = 1
\end{equation}
  \end{verbatim}
  \end{minipage}
}\\ 
\verb+\left(+ and \verb+\right)+ give the large parenthesis.
There must be a \verb+\right+ to match every \verb+\left+.
Note the use of \verb+\frac{a}{b}+ to give $\displaystyle \frac{a}{b}$. \\
Here is another example:
\\
{ \begin{minipage}[t]{\dcl}
\[ \int_a^{a+1} 
      \frac{1}{x} \; dx
   = \ln \frac{a+1}{a}
\]
  \end{minipage}
  \hspace{\dsep}
  \begin{minipage}[t]{\dcl }
  \vspace{-\abovedisplayskip}
  \begin{verbatim}
\[ \int_a^{a+1} 
      \frac{1}{x} \; dx
   = \ln \frac{a+1}{a}
\]
  \end{verbatim}
  \end{minipage}
}\\ 
Note the use of the subscript and super script symbols \verb+_+ and \verb+^+ to
put limits on the integral. (This trick works with $\sum$\ \verb+\sum+,
and the union and intersection symbols $\bigcup$\ \verb+\bigcup+ and
$\bigcap$\ \verb+\bigcap+). The \verb+\;+ adds extra space before the
$dx$. (\verb+\!+ removes space in an equation).
\subsection{Math Symbols}
In addition to \verb~+, -, =, >, <, (, ), [, ],~ and \verb+|+ 
which have their expected
meaning, \LaTeX\ defines a large number of special symbols. The table
bellow lists a few of the most common.\\
\begin{tabular}{lllll}
$\pm$  \verb+\pm+ &
$\leq$ \verb+\leq+ & 
$\equiv$ \verb+\equiv+ &
$\exists$ \verb+\exists+ &
$\propto$  \verb+\propto+ \\

$\mp$  \verb+\mp+ &
$\geq$  \verb+\geq+ &
$\approx$  \verb+\approx+ &
$\rightarrow$  \verb+\rightarrow+ &
$\infty$  \verb+\infty+ \\ 

$\cdot$  \verb+\cdot+ &
$\ll$  \verb+\ll+ &
$\in$  \verb+\in+ &
$\Rightarrow$  \verb+\Rightarrow+ &
$\partial$  \verb+\partial+ \\ 

$\cdots$  \verb+\cdots+ &
$\gg$  \verb+\gg+ &
$\subset$  \verb+\subset+ &
$\Leftrightarrow$  \verb+\Leftrightarrow+ &
$\nabla$  \verb+\nabla+ \\ 

$\vdots$  \verb+\vdots+ &
$\neq$  \verb+\neq+ &
$\forall$  \verb+\forall+ &
$\cap$  \verb+\cap+ &
$\cup$  \verb+\cup+ \\ 

$\{$  \verb+\{+ &
$\}$  \verb+\}+ &
$\|$  \verb+\|+ &
$\times$ \verb+\times+&
$\div$ \verb+\div+\\ 

\end{tabular}
\subsection{Math Modifiers}
In addition to many special symbols \LaTeX\ has modifiers you can use on
the symbols. The table bellow lists several of the modifiers. (note that
any letter can replace \verb+a+, but \verb+\cal+ only works on 
upper case letters \footnote{Note also that $\setminus${\tt{cal}} has 
a different syntax than the other modifiers.}).  \\
\begin{tabular}{lllll}
$\bar{a}$  \verb+\bar{a}+ &
$\dot{a}$  \verb+\dot{a}+ &
$\tilde{a}$ \verb+\tilde{a}+ &
$\hat{a}$  \verb+\hat{a}+ &
$\check{a}$ \verb+\check{a}+ \\
$\vec{a}$  \verb+\vec{a}+ &
$\ddot{a}$ \verb+\ddot{a}+ &
${\cal A}$  \verb+{\cal A}+  &
$\acute{a}$ \verb+\acute{a}+ &
$\grave{a}$ \verb+\grave{a}+ \\
\end{tabular}



\section{Using References}
The list of references at the end of this document was produced by the 
following \LaTeX\ commands:
\begin{verbatim}
\begin{thebibliography}{99}
\bibitem {Hahn93} 
         Jane Hahn,
         {\em \LaTeX\ for Everyone.}
         Prentice-Hall, Englewood Cliffs New Jersey, 1993.
\bibitem {Lamp86}
         Leslie Lamport,
         {/em \LaTeX: A Document Preparation System.}
         Adison-Wesley, Reading, Massachusetts, 1986.
\end{thebibliography}
\end{verbatim}
Each item in the references has a key, such as \verb+{Hahn93}+, which can 
be used to cite the item in the document.\\
{ \begin{minipage}[t]{\dcl}
A very good introduction to 
\LaTeX\ is \cite{Hahn93}
which makes learning easy, 
while \cite{Lamp86} is
the definitive reference
with all the gory details.
  \end{minipage}
  \hspace{\dsep}
  \begin{minipage}[t]{\dcl }
  \vspace{-\abovedisplayskip}
  \begin{verbatim}
A very good introduction to 
\LaTeX\ is \cite{Hahn93}
which makes learning easy, 
while \cite{Lamp86} is
the definitive reference
with all the gory details.
  \end{verbatim}
  \end{minipage}
}\\
  

\begin{thebibliography}{99}
\bibitem {Hahn93} 
         Jane Hahn,
         {\em \LaTeX\ for Everyone.}
         Prentice-Hall, Englewood Cliffs New Jersey, 1993.
\bibitem {Lamp86}
         Leslie Lamport,
         {\em \LaTeX: A Document Preparation System.}
         Adison-Wesley, Reading, Massachusetts, 1986.
\end{thebibliography}
      
      \hspace*{-\parindent} \rule{1.2in}{0.008in} \\
      { The author was supported by U.S. Department of
        Energy, DoE Grant \# DE-FG03-93ER25163.}

\end{document}
