\documentclass[11pt]{article}
    
% "Packages" add extra capabilities to LaTeX that are not part
% of the basic system.  Here are a few that are often used.
% It doesn't hurt to include them, even if you don't use them.

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[mathscr]{eucal}
\usepackage{amsthm}
\usepackage[dvips]{graphics}


\pagestyle{plain}   % Page number at bottom (this is the default).
                    % Use \pagestyle{empty} for no numbers
                    % Use \pagestyle{headings} for top-of-page headings


\renewcommand{\baselinestretch}{1}  % Change 1 to 2 for double-space,
                                    % to 1.5 for one-and-a-half space, etc.

\renewcommand{\arraystretch}{1.2}

% Many lengths can be set to affect the appearance of the
% document.  The following two commands make the text
% on the page longer from top to bottom:

\setlength{\topmargin}{0in}
\setlength{\textheight}{8in}


% Fill in your own tile, author and date.  These are printed out
% later in the document, where it says \maketitle:

\title{A Short Introduction to \LaTeX}
\author{David J. Eck}
\date{October 22, 2003}

\begin{document}   % This is the beginning of the actual document contents.

\maketitle  % Puts title, author, and date, as defined above, here.

\begin{abstract}
  \textit{This paper is a very short introduction to the essentials of
  \LaTeX, a document-preparation system that is an alternative
  to typical word-processing programs.  \LaTeX\ is particularly
  good at mathematical typesetting, but it has features that 
  make it nice for almost any kind of writing.  Most of the
  information in this paper is taken from {\rm A Guide to \LaTeX},
  by Helmut Kopka \& Patrick W. Daly.}
\end{abstract}

\section{The Basics of \LaTeX}

The \TeX\ typesetting system was created by the well-known
computer scientist Donald Knuth because he wasn't satisfied with
the way  his books looked when they were published by existing
means.  \TeX\ produces beautiful output, especially of 
mathematics, but it is hard to use directly.  Mathematician
Leslie Lamport built \LaTeX\ on top of \TeX\ to provide
easier access to fine typesetting.

Writing papers with \LaTeX\ is very different from writing
with a word processor.  With a word processor, you have to be
concerned with many minute details of the format and layout
of your paper.  \LaTeX\ takes care of many of these details
for you.  On the other hand, to use \LaTeX, you have to learn
something that will look to many people like a programming
language (although HTML, the layout language of the Web,
is a better analogy).  Fortunately, you can learn the basics
in a very short time.  This short paper aims to cover enough to
get you to the point of producing attractive documents
with \LaTeX.

Maybe the first thing to note is that the actual typing of
a \LaTeX\ paper is done in a plain text editor rather than
in a word-processing program.  The text file is then processed
to produce the actual output.  The output can then be printed
or can be viewed on-screen with a special viewing program.
You can also convert \LaTeX\ output to other formats such
as HTML or PDF.

\subsection{Special Characters} 

Certain characters have special
meaning in \LaTeX.  Typing these characters doesn't make them
appear in the output.  For example, the character \% is used
to add comments to \LaTeX\ input files:  A~\%~and everything
that follows it on the line is ignored by \LaTeX.

The most important special character
is the backslash,~\verb=\=.  The backslash is used to give
special commands to \LaTeX.  For example, the \LaTeX\ logo
itself is actually produced by the command \verb=\LaTeX=.
A command consists of a backslash followed by a sequence of
letters.  Also, a command can consist of a backslash followed
by a \emph{single} non-letter character.  For example,
if you want the special character \% to appear in the output,
you can type it as \verb=\%=.  \verb=\%=~is a command that tells
\LaTeX\ to put a \% into the output.

Other special characters include \$, \#, \&, \_, \{, and
\}. These can be types at \verb=\$=, \verb=\#=, \verb=\&=, \verb=\_=, 
\verb=\{=, and \verb=\}=.  The dollar sign is particularly
important in \LaTeX:  It is used to enclose mathematics.
For example, the mathematical inequality $x<y$ is
typed as \verb=$x<y$=.  This is called \textit{math mode}.
There are three special characters that only come out 
correctly in math mode: $<$, $>$, and~$|$.  These
characters can be typed between dollar signs.  For
example:~\verb=$<$=.  The backslash
itself can be generated using the command \verb=\backslash=
in math mode; that is, \verb=$\backslash$= yields~$\backslash$
in the output. There are two more special characters,
\verb=~= and \verb=^=, that we will get to later.\footnote{All
this might seem like a big deal, but in fact, these characters
are rarely used in normal text.  You should just be aware
that some characters have special meaning so you aren't
surprised when you do happen to use them.}

Some characters that appear in documents can't be typed
at all.  An example is the left double quote mark,~``.
In \LaTeX, this symbol is inserted into the output by typing
two single left quotes:~\verb=``=.  You can type a right
quote as two right single quotes,~\verb=''= (although in fact
typing the usual double quote character will give the same thing).
Similarly, there are actually three types of dashes:
the hyphen~(-), the n-dash~(--) that is used in number
ranges such as 2003--2004, and the m-dash~(---) that is
used to separate text---like this---from the rest of
the sentence.  In \LaTeX, you type -, --, and --- as
\verb=-=, \verb=--=, and~\verb=---=.

There are many more special characters, especially when you
consider mathematical symbols.  These are entered into 
\LaTeX\ output using special commands.  For example,
the command \verb=\copyright= gives~\copyright,
and \verb=\dag= gives~\dag.  There are a lot of commands
that are valid only in math mode, and we will see some of 
these later.  The command \verb=\dots= gives the three
dots that are usually used to represent an ellipsis;
you need this because typing three periods gives ... and
that doesn't look as good as~\dots

And finally, there are characters that are accented or
otherwise decorated, such as the \"o in co\"operate.
The most common accents are input as single-character
commands in front of the letter that is to be accented.
Type \verb=\'e=, \verb=\`e=, \verb=\"u=, \verb=\~n=, \verb=\^o=, and \verb.\=a., 
for \'e, \`e, \"u, \~n, \^o, and \=a.




\subsection{Commands and Environments}

As I've already mentioned, \LaTeX\ commands begin with the
special character~\verb=\=.  Some commands can be followed
by \textit{parameters} that provide information used by
the command.  An example is \verb=\footnote=, which is
used to insert a footnote into a paper.  The text of the
footnote is the parameter to the command.  The parameter
follows the command and is enclosed between \{ and~\}.\footnote{When
you insert a footnote, a little superscript appears in the text,
and the footnote is placed at the bottom of the page.  This
footnote was created by typing: \texttt{$\backslash$footnote\{When you insert
a footnote\dots\}}}   In fact, you can
leave out the \{ and \}, but in that case the parameter will
be the \emph{single character} that follows the command.
This is what is done with the accenting commands above,
so that \verb=\'e= is equivalent to \verb=\'{e}=.

Some commands can include extra, \emph{optional} 
information that is enclosed between [ and ] and placed
between the command and the parameter.  For example:
\verb=\documentclass[11pt]{article}=.  And it's possible
for a command to have several parameters, each enclosed
in its own pair of braces.  For example:
\verb=\setlength{\parindent}{2cm}=.

There is one annoying thing about commands that consist
of a sequence of letters:  \LaTeX\ will ignore any
spaces that follow the command.  This means that if
you type ``\verb=\LaTeX is fun!='', it will come
out on the page as ``\LaTeX is fun!''.  To fix this,
you can add an explicit space command.  The command
``\verb=\ ='' (that's a backslash followed by a space)
represents a space that \LaTeX\ won't ignore.  So,
to get ``\LaTeX\ is fun!'' to come out right,
you should type ``\verb=\LaTeX\ is fun!=''.

\LaTeX\ gets a lot of milage out of two general commands,
\verb=\begin{name}= and \verb=\end{name}=,
where \textit{name} is the name of an ``environment''
such as \textit{itemize} or \textit{quotation}.
These commands always occur in a begin/end pair, using
the same name in both places.  Anything between begin
and end is treated in a special way that depends on
which particular environment you are using.  For example,
\verb=\begin{center}= \dots \verb=\end{center}=
is used to center things horizontally on the page.  Many environments
have special commands that only apply inside that
environment.  We will see some examples of environments
later.


\subsection{Spacing}

In \LaTeX\ input, words are separated by spaces, and paragraphs are
separated by blank lines.  However, adding extra spaces will not
increase the space between words in the output, and adding extra blank lines 
will not increase the space between paragraphs.  Spaces at
the beginning of a paragraph are ignored---paragraph indentation
is inserted automatically whether there are spaces in the input 
or not. 

\medskip

There are commands that you can use to insert extra space 
in the output.  To insert some extra vertical space, for example
between paragraphs, use the commands \verb=\smallskip=,
\verb=\medskip=, and \verb=\bigskip=.  There is a \verb=\medskip=
just before this paragraph, so you can get an idea of the size.
You can insert a specific amount of vertical space with a
command such as \verb=\vskip{0.5 in}=
The units of measurement---which can be in for inches, cm for
centimeters, or pt for points---must be specified.

If you would like to leave out the indentation at the
beginning of a particular paragraph, put the command
\verb=\noindent= at the beginning of the paragraph.
You can insert horizontal space with \verb=\hspace=, which
works similarly to \verb=\vspace=.  The commands 
\verb=\quad= and \verb=\qquad= also insert horizontal
space.  (``Quad'' is a printer's term; qquad is a double quad.)

\LaTeX\ also ignores line breaks inside paragraphs.  The text
in the paragraph is automatically broken into lines in an optimal
way.  \LaTeX\ even breaks words and inserts hyphens if necessary.
However, you can force a line break by typing the command~\verb=\\=.
This command works almost anywhere.  For example, you can use
it in the title of the document, even though that is not
an ordinary paragraph.

Sometimes, you want to tell \LaTeX\ \emph{not} to break a
line at a certain space.  For this, you can use the
\verb=~= character as a \textit{non-breaking space}.  The
\verb=~= does not appear in the output---it becomes a space.
However, \LaTeX\ will definitely avoid breaking the line at
that space.


\subsection{Text Styles}

Italic, bold-face, and other text styles are easy in \LaTeX.
For example, you can use \verb=\textit{this text in italic}= 
to output \textit{this text in italic}.  Similarly,
the \verb=\textbf= will apply boldface to its parameter.
Here is a table of text styles that can be used:

\begin{center}
   \begin{tabular}{|l|l|l|}
      \hline
      \textbf{Command}& \textbf{Meaning}& \textbf{Output}\\
      \hline\hline
      \verb=\textit{sample text}=& Italics& \textit{sample text}\\
      \hline
      \verb=\textbf{sample text}=& Bold face& \textbf{sample text}\\
      \hline
      \verb=\textsl{sample text}=& Slanted& \textsl{sample text}\\
      \hline
      \verb=\texttt{sample text}=& Typewriter style& \texttt{sample text}\\
      \hline
   \end{tabular}
\end{center}

You can combine these commands to get effects such as \textbf{boldface that is
also \textit{italic} or \textsl{slanted}}.


\subsection{Verbatim Output}

Sometimes you would like \LaTeX\ to output things exactly as you type them,
without interpreting special characters in the input.  This would be
particularly useful when including some programming source code in your
document, for example.  You can do this with the \textit{verbatim} 
environment.  That is, if you put the command \verb=\begin{verbatim}= at
the beginning of some text and \verb=\end{verbatim}= at the end,
then \LaTeX\ will reproduce the text in the output, in typewriter style, exactly
as it is typed in the input.  Spaces and ends-of-line are copied to the output as well as 
other special characters.

If you want to include just a few words of verbatim output in the middle
of a paragraph (as I do many times in this paper), you can use \verb=\verb=.
This command takes a special form:  \verb+\verb=verbatim text=+.  The
text between the two equal signs is copied directly to the output in
typewriter style.  This text can contain any character except an equal sign,
but cannot extend over more than one line.  (If the text you want to output
does contain a =, you can replace the = in the \verb=\verb= command with any other character.)
One problem with \verb=\verb= is that it doesn't work inside the parameters
of other commands, such as \verb=\footnote=.



\section{Mathematics}

One of the main advantages of using \LaTeX\ is that it so good at typesetting
mathematics.  Mathematical input in \LaTeX\ is typed in what is called
\textit{math mode}.  To type math that is to appear as part of a paragraph
or other piece of text, enclose the math input between a pair of dollar signs,
such as \verb=$x<y$=.  If you use a pair of double dollar signs,
\verb=$$x<y$$=, you get \textit{display math mode} where the mathematics
is displayed on a line by itself and centered horizontally on the page.
A careful mathematical typist will use math mode even for a thing
as simple as a one-character variable.  This is because a variable such
as $x$ should properly be printed in italics.  Math mode will take care 
of this.  This means that you should type the variable as \verb=$x$= rather
than simply as~\verb=x=.  


\subsection{Basic Math}

In general, quality typeset mathematics looks
quite a bit different than plain typeset text.  \LaTeX\ will take care
of most of the little details---such as the amount of space to leave around
a plus sign---for you.  Since \LaTeX\ decides on the proper spacing, it
\textit{completely ignores spaces} in math mode. (If you are 
in math mode and want to include some regular text with regular spacing, 
you can use the \verb=\text= command.  The parameter of this command
is typeset as regular text.)  You can also use the ``\verb=\ ='' command
(backslash followed by a space) in math mode for a space that
won't be ignored.  And there are a few commands for adding smaller
amounts of space in math mode: \verb=\,= and~\verb=\;=.

Mathematical operators such as $+$, $-$, $*$, $/$, $<$, $=$, and $>$
will behave as you expect in math mode.  Set braces in math mode,
as in regular text mode, must be types as \verb=\{= and \verb=\}=.
The Greek letters are specified by commands that are the same
as the name of the letter: \verb=\alpha=, \verb=\beta=, \verb=\gamma=, 
\verb=\delta=, \verb=\epsilon=, \verb=\theta=, and \verb=\gamma= will
output $\alpha$, $\beta$, $\gamma$,  $\delta$, $\epsilon$, $\theta$, and $\gamma$,
for example.  Capitalized Greek letters use capitalized commands so that 
$\Sigma$ and $\Phi$ are typed as \verb=\Sigma= and \verb=\Phi=.
There are many commands that produce special mathematical characters.
A sample is shown in this table:


\begin{center}
  \begin{tabular}{|l|c||l|c||l|c|}
     \hline
     \verb=\le=& $\le$& \verb=\ge=& $\ge$& \verb=\ne=& $\ne$\\
     \hline
     \verb=\to=& $\to$& \verb=\cup=& $\cup$& \verb=\cap=& $\cap$\\
     \hline
     \verb=\in=& $\in$& \verb=\subset=& $\subset$& \verb=\emptyset=& $\emptyset$\\
     \hline
     \verb=\wedge=& $\wedge$& \verb=\vee=& $\vee$& \verb=\lnot=& $\lnot$\\
     \hline
     \verb=\forall=& $\forall$& \verb=\exists=& $\exists$& \verb=\oplus=& $\oplus$\\
     \hline
     \verb=\rightarrow=& $\rightarrow$& \verb=\Rightarrow=& $\Rightarrow$& \verb=\therefore=& $\therefore$\\
     \hline
     \verb=\infty=& $\infty$& \verb=\partial=& $\partial$& \verb=\approx=& $\approx$\\
     \hline
  \end{tabular}
\end{center}

Subscripts and superscripts are specified using the special characters
\verb=_= and \verb=^=.  These commands act like commands whose parameters
are put into the subscript and superscript positions.  For example,
\verb=$a_{i}$= is typeset as $a_i$, while \verb=$x^{17}$= yields $x^{17}$.
You can combine subscripts and superscripts: \verb=$x_{i}^{n}$=
comes out as $x_i^n$.  (Note that you can omit the \{ and \} around
the parameter if the parameter consists of a single character.   However,
be aware that if you type \verb=$x^17$=, you will get $x^17$ because only
the 1 is in the superscript.)  Subscripts and superscripts can be
complicated and can even include other levels of scripting.
So, you can have $x_{b^2+a_i^j}$, which is typed as \verb=$x_{b^2+a_i^j}$=.

To take the square root of something, use \verb=\sqrt=, which applies the
square root sign to its parameter.  For example, type \verb=$\sqrt{x^2+1}$=
to get $\sqrt{x^2+1}$.  The \verb=\frac= command takes two parameters
and makes them into a fraction in which the first parameter is the numerator
and the second is the denominator.  So, \verb=$\frac{n+1}{n}$= will
give $\frac{n+1}{n}$.  \verb=\frac= is the first example we've encountered
that looks different in display math mode.  Typing \verb=$$\frac{n+1}{n}$$=
will give the displayed fraction $$\frac{n+1}{n}$$ in which the characters
are much larger.  In some cases, you would like to have some in-line
math look like displayed math.  You can get this effect by adding
the \verb=\displaystyle= command.  So, you can get
$\displaystyle\frac{n+1}{n}$ by typing \verb=$\displaystyle\frac{n+1}{n}$=.
Similarly, you can use \verb=\textstyle= to force display mode math
to be rendered in the style of in-line math.

The summation, product, and integral signs are written as
\verb=\sum=, \verb=\prod=, and \verb=\int=.  Subscripts and
superscripts work in a special way with these symbols to add
the usual ``decorations'' at the top and bottom of the symbol.
For example, \verb+$$\sum_{n=1}^{\infty}\,\frac{x^n}{n!}=e^{x}$$+
is rendered as $$\sum_{n=1}^{\infty}\,\frac{x^n}{n!}=e^{x}$$
Rendered as in-line math, this would be
$\sum_{n=1}^{\infty}\,\frac{x^n}{n!}=e^{x}$.  This is one
case where I definitely prefer to use display style.

The names of mathematical functions such as sin and ln should
properly \emph{not} be in italics.  \LaTeX\ defines commands
for many function names so that they can be typeset properly.
So, for example, you should type \verb=\sin(x)= to get
$\sin(x)$.  Certain commands, such as \verb=\lim=, use
subscripts in the same way as the \verb=\sum= command.
For example, \verb+$$\lim_{x\to\infty}x^{-x}=0$$+ gives
$$\lim_{x\to\infty}e^{-x}=0$$

Mathematics makes extensive use of bracketing symbols such as
(, ), [, ], \{, \}, $|$, and~$\|$.  (The $\{$,~$\}$, and $\|$ are
typed as \verb=\{=, \verb=\}= and \verb=\|=.  You can only
use \verb=|= and \verb=\|= in math mode.)
All these symbols should change size according to the size
of the stuff inside the brackets.  \LaTeX\ uses the 
commands \verb=\left= and \verb=\right= to make bracketing
symbols that will change size.  These commands are used
with bracketing symbols: \verb=\left(=, \verb=\right]=,
\verb=\left\{=, \verb=\right\|=.  \verb=\left= and
\verb=\right= must always occur as a pair, although the
type of bracketing symbol on the left and right don't
have to match.  \LaTeX\ will choose the appropriate size 
of the brackets.\footnote{If you are not happy with the size,
you can use commands like {\tt$\backslash$big(},
{\tt$\backslash$Big[}, {\tt$\backslash$bigg)}, and
{\tt$\backslash$Bigg]} to get various specific sizes.}

There are many other, more sophisticated aspects of
mathematical typing.  Some of these are provided by
\LaTeX\ environments.  I give one example here.
If you want to learn more, you will have to consult 
a reference.  The array environment can be
used to typeset arrays.  An array environment begins
with something like \verb=\begin{array}{ccc}=.  The ``ccc''
says that the array will have three columns and that the
items of the array will be centered in each column.  Replace
a c with an l or an~r to get left- or right-justified items.
The end of the array is marked with \verb=\end{array}=.
In the array environment, lines of the array are separated by
\verb=\\=, and the items on a line are separated by~\verb=&=.
The array is not automatically enclosed in parentheses.
Use \verb=\left(= and \verb=\right)= to get that effect.
Here is an array example:
\medskip
\begin{center}
  \begin{tabular}{|c|c|}
  \hline
     \textbf{Input}& \textbf{Output}\\
   \hline
\hbox{$\vcenter{\halign{\strut#\hfil\cr
\verb=$$\left(=\cr
\verb=  \begin{array}{ccccc}=\cr
\verb=  x_{11}& x_{12}& \cdots& x_{1n}\\=\cr
\verb=  x_{21}& x_{22}& \cdots x_{2n}\\=\cr
\verb=  \vdots& \vdots&& \vdots\\=\cr
\verb=  x_{m1}& x_{m2}& \cdots& x_{mn}\\=\cr
\verb=  \end{array}=\cr
\verb=\right)$$=\cr
}}$}&
\hbox{$\left(
   \begin{array}{ccccc}
   x_{11}& x_{12}& \cdots& x_{1n}\\
   x_{21}& x_{22}& \cdots& x_{2n}\\
   \vdots& \vdots&& \vdots\\
   x_{m1}& x_{m2}& \cdots& x_{mn}\\   
   \end{array}
\right)$}\\
  \hline
  \end{tabular}
\end{center}

This array uses \verb=\cdots= and \verb=\vdots=
to represent groups of three dots.  These commands
are treated just like other array items.  The blank
space in the middle of the array is an empty item.
Note that in the source code this blank item
is indicated by two \verb=&='s with nothing between
them.


\section{Document Structure}

We've covered some of the essential facts about what
you can put into a \LaTeX\ document, but we still need
to look at how the document must be organized as a
whole.

Every \LaTeX\ document should begin (except possibly for 
some comments) with a \verb=\documentclass=
command.  This command has a parameter that specifies
the type of document: article, report, letter, or book.
The  command can also specify
some options for the document.  The basic font size
can be specified with the 10pt, 11pt, or 12pt options.
The default is 10pt.  Specify 11pt or 12pt for larger-sized
characters.  The twocolumn option will cause text to
be set in a double-column format.  Here is a
typical example: \begin{center}\verb=\documentclass[11pt,twocolumn]{article}=\end{center}

Following the \verb=\documentclass= command comes
the \textit{preamble}, which can contain commands that
influence the contents or appearance of the
document.  The preamble does not itself produce any
output.  The preamble often starts with some
\verb=\usepackage= commands.  A package makes available
a set of extra, non-standard commands for use in the document.
For example, \verb=\usepackage{amsfonts}= and
\verb=\usepackage{amssymb}= make a large number of 
extra mathematical symbols available.  (In fact, the
\verb=\therefor= command, which was listed in a table
earlier in this paper, requires these packages.)
The preamble command \verb=\usepackage[dvips]{graphics}=
makes it possible to include graphics, as discussed
later in this paper.

Commands that specify the title, author, and date of the
paper are often given in the preamble.  For example:

\begin{verbatim}
            \title{A Short Introduction to \LaTeX}
            \author{David J. Eck}
            \date{October 22, 2003}
\end{verbatim}

The information in these commands is actually used later,
in the body of the paper, when you give the
\verb=\maketitle= command.

Page layout in a document is partially controlled by
the value assigned to various lengths, such as
the size of the margins and the distance from one line
of text to the next.  The preamble can contain
commands for customizing some of these lengths
using the \verb=\setlength= command.  For example,
for this paper, I use the commands

\begin{verbatim}
            \setlength{\topmargin}{0in}
            \setlength{\textheight}{8in}
\end{verbatim}

\noindent to increase the vertical size of the text on
the page from its default value.  The first parameter is
the name of the length that is being set.  The second
parameter is the value, which must be give in units such
as in, cm, or pt.  The distance between lines of text---the
so-called \textit{baselineskip}---is handled a little
differently.  You have to specify a factor by which
the default baselineskip is multiplied.  A factor of
2 will give double-spaced text, although a factor of
about 1.8 probably looks better.  The command
that you would use in the preamble for double-spacing is:
\verb=\renewcommand{\baselinestretch}{1.8}=.
You can actually use this command anywhere in
your document to change the baselineskip for
the following paragraphs.




\medskip
\LaTeX\ is actually a programming language, in which you can
define your own commands.  The preamble often includes
definitions of new commands that will be used in the
paper.  However, this aspect of \LaTeX\ will not be 
discussed here.

\medskip

After the preamble comes the document content.  The body
of the document begins with \verb=\begin{document}=
and ends with \verb=\end{document}=.  The actual content
of the document is typed between these commands.
A document of any length is typically divided into
parts, chapters, sections, subsections, and subsubsections.  In
\LaTeX, an article can have only sections, subsections,
and subsubsections, while books and reports can
also have parts and chapters.  To start a new
section, just say \verb=\section{title}= where
\textit{title} is the title of the section.  The
same thing works for parts, chapters, subsections, 
and subsubsections.  You can use \verb=\\= in
a title to force a line break.

Sections, subsections, and so on will be automatically
numbered for you by \LaTeX.  If you don't want the
numbering, you can add a $*$ after the name of the
command: \verb=\section*{title}=.  This will suppress
the numbering.

If you include the command \verb=\pagestyle{headings}=
in the preamble of the document, \LaTeX\ will add running
headings to the top of each page.  The headings will 
contain the section or chapter titles.  Sometimes, the
heading will be too long to fit.  In that case, you
can provide a short title for the headings.  The
short title is given as an option to the command:
\verb=\section[short-title]{long-title}=.



\section{Fancy Stuff}

\LaTeX\ is used to produce typeset documents of great
complexity, and this paper can only give you an idea
of the possibilities.  In this last section, I will
look briefly at a few of \LaTeX's other features.

\subsection{Lists}

Numbered and bulletted lists are very common in documents.
The \textit{enumerate} and \textit{itemize} environments
are used for creating such lists.  Thus, a numbered
list begins with \verb=\begin{enumerate}= and ends
with \verb=\end{enumerate}=.  The items of the list
go between these.  The start of each item should be
marked with the command \verb=\item=, which can
be thought of as generating the item number.  \verb=\begin{itemize}= and
\verb=\end{itemize}= are used in exactly the same way to 
create bulletted lists.  Lists can be nested inside one another,
and \LaTeX\ will indent the lists properly to show the
nesting.  For numbered lists, the style of numbering
(numbers, letters, or roman numerals) changes depending
on the level of nesting.

\subsection{Tables}

Tables are very similar to arrays in mathematics, but
tables often contain words and have lines separating rows
and columns.  \LaTeX\ has a \textit{tabular} environment that is almost
identical to the array environment.  As with arrays,
the command that begins the environment has an extra
parameter that specifies the format of the columns.
This format uses l, r, and c to for left-, right- and
center-justified columns.  It can also include \verb=|=
characters to indicate where vertical lines are
to be drawn in the table.  For example,
\verb=\begin{tabular}{|r||cc|}=
Will produce a table with three columns.  The entries
in the first column are right-justified; the other two
columns are center-justified.  There is a vertical line
on each side of the table, a double vertical line
between the first and second column, and no line
between the second column and the third.

In the data for the table, the end of a row is marked
with \verb=\\=.  Items on a row are separated with~\verb=&=.
You can also put the command \verb=\hline= before the
first row, after the last row, or between rows to indicate
places where a horizontal line is supposed to be drawn
across the table.  If you want to draw a horizontal
line just across columns 2 through 4, use
\verb=\cline{2-4}=.

Sometimes, you would like to have one item span several columns.
You can do this by using a \verb=\multicolumn= command
in your table data.  This command takes the form
\verb=\multicolumn{ct}{fmt}{item}= where \textit{ct}
is a number that says how many columns should be covered;
\textit{fmt} contains exactly one r, l, or c to say how
the item should be justified (and can also contain one or more
\verb=|= characters to draw vertical lines); and
\text{item} is the actual text of the item.

The standard look of tables is a bit cramped vertically
for my taste.  Adding the command
\verb=\renewcommand{\arraystretch}{1.2}= to the
document preamble will stretch arrays and tables
vertically by a factor of 1.2, giving them a
less cramped appearance.

Note: To center a table on the page, put it in a \textit{center}
environment, that is, between \verb=\begin{center}=
and \verb=\end{center}=.

\subsection{Graphics}

It's actually very easy to include graphics in your document,
as long as you use the \textit{graphics} package as discussed
above.  This package makes available the 
\verb=\includegraphics= command, which takes the name
of a graphics file as a parameter.  For example:
\verb=\includegraphics{logo.eps}=
Graphics files can be in
EPS (Encapsulated PostScript) format, and other
formats such as GIF or JPEG might also work.
EPS is especially good for diagrams.
Many graphics
and drawing programs can export images as EPS.
If you want to center an image on the page, put
it into a \textit{center} environment. Here, for
example, is the \LaTeX\ lion, scanned from Leslie Lamport's
original \textit{\LaTeX\ User's Guide and Reference Manual}:

\begin{center}
   \resizebox{1.5in}{!}{\includegraphics{latex_lion.eps}}
\end{center}

\subsection{Cross References, Etc.}

In a long paper, you will often want to say things
like ``See Subsection~2.5.''  This is called 
a \textit{cross-reference}.  If you actually
type numbers like ``2.5'' into the paper, though,
you run into a problem when you add or delete 
sections, since that will change the numbering.
You would have to hunt down all the
cross-references in your paper and change
the numbers. 

\LaTeX\ has a cross-referencing
system that makes this unnecessary.  The idea is
to associate a label or name to each place that you
might want to reference.  You do this with
the \verb=\label= command, which can immediately
follow any command that uses automatic numbering,
such as \verb=\section=.  The parameter to
\verb=\label= is a mnemonic name for the reference.
\LaTeX\ will associate the actual number with this
mnemonic name.  For example, \verb=\section{Introduction}\label{S-intro}=
associates the mnemonic name \texttt{S-intro} with the section
number for a section named ``Introduction.''  Later, you can retrieve the number
by using the \verb=\ref= command.  This command
takes the mnemonic name as a parameter.  \LaTeX\ replaces
the \verb=\ref= command with the actual number associated
with the mnemonic name.  In our example, 
\verb=\ref{S-intro}= would be replaced in the output
with the section number of the ``Introduction'' section.

One fine point:  When you use cross-references, you should
process the \LaTeX\ input file \textit{twice}.  The first
time allows \LaTeX\ to gather the reference numbers.  The
second time through, \LaTeX\ will insert the correct
numbers in the correct places.  (The numbers are actually
stored in a separate file that \LaTeX\ creates automatically.)


\LaTeX\ is capable of helping with other bookkeeping
chores as well.  It can make a table of contents.
It can number figures and tables and make cross-references
to them.  It provides a fairly easy way of creating an index
for the document.  And it has a bibliography environment that
makes it easy to include citations to your references.
If you are interested in any of this, it's time
to start looking for a more comprehensive
\LaTeX\ reference\dots



\end{document}
