\documentclass[twocolumn,twoside]{article}
\usepackage{graphics,verbatim}
\title{A Quick Introduction to \LaTeX{}}
\author{Ben Pfaff $<$pfaffben@msu.edu$>$}
\date{21 June 2000}

\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{0pt}
\setlength{\evensidemargin}{0pt}
\setlength{\textheight}{8.5in}
\setlength{\topmargin}{0pt}

% Define some rules that make it easier to break URLs at line
% boundaries.
\def\/{\discretionary{/}{}{/}}
\def\_{\discretionary{\textunderscore}{}{\textunderscore}}
\def\.{\discretionary{.}{}{.}}

\newcommand{\dfn}[1]{\textbf{#1}}
\newcommand{\var}[1]{\textit{#1}}

\begin{document}
\maketitle
\tableofcontents

\section{Introduction}

Most of the time when I'm using a computer, I have little need for
pretty documents.  But from time to time, I want to produce hardcopy
that isn't just nice-looking, it's actually beautiful.  When there's
no room for a compromise, I turn to \LaTeX{}, which lets me produce
beautiful output with just a little more effort than it takes to type
my document.

\LaTeX{} is a system designed for writing technical documents,
including articles, reports, and books.  It is also useful for writing
less formal documents such as letters and even the occasional slide
presentation.  I've used it for all three purposes; this article was
written using \LaTeX{}.

Some of the features of \LaTeX{} include strong support for
mathematical formulas, figures and tables, tables of contents,
indexes, graphics, and bibliographies.  Due to its popularity, there
are numerous extension packages available for use with \LaTeX{}: if
\LaTeX{} doesn't support what you're trying to do directly, it is
probably possible to find a package to help you do it.

\subsection{Suggested further reading}

This introduction barely scratches the surface of what can be done
with \TeX{} and \LaTeX{}.  If you use \LaTeX{} much at all, then you
should consult other sources of information as well.  My favorites are
listed in the References.  I especially recommend \cite{lamport},
written by \LaTeX{}'s author, which serves as both a tutorial and
reference.

\section{Getting started}

Let's step our way through installing and running \LaTeX{}, then
previewing and printing a document, before we go on to learn how to
write \LaTeX{} files.  

\subsection{Installing \LaTeX{}}

First, make sure that you have \LaTeX{} installed on your computer.  If
you're using Debian GNU/Linux, then you can install the latest version
of \TeX{} and \LaTeX{} with one simple command:

\begin{verbatim}
apt-get install tetex-bin tetex-doc
\end{verbatim}

You can omit \verb/tetex-doc/ if you're low on disk space; it uses
about 16 MB of disk space on top of the 34 MB or so eaten up by the
basic installation.\footnote{Remember when you could fit a full
GNU/Linux install in 100 MB?}  If you're not using Debian GNU/Linux or
a derivative, then you'll have to figure out this step on your own.

\subsection{Running \LaTeX{}}

Now that we've got \LaTeX{} installed, let's run it on the sample
\LaTeX{} file shown in Figure~\ref{sample1}.  Start by typing in the
text as shown.  Be careful not to substitute forward slashes (\verb|/|)
for backslashes (\verb|\|).  Save the file as \verb|sample1.tex|.  Then,
at a shell prompt, type

\begin{verbatim}
latex sample1.tex
\end{verbatim}

\noindent and hit Enter.  \TeX{} will run and, uncharacteristically
for programs in a UNIX environment\footnote{But very
characteristically for software written by Knuth.}, spew lots of
messages to the console.  Feel free to ignore most of its output.  In
particular, the message \verb|No file sample1.aux.|, if you see it, is
not an error.

\begin{figure}
\verbatiminput{sample1.tex}
\caption{Sample input file for \LaTeX{}.}
\label{sample1}
\end{figure}

(On the other hand, if \TeX{} stops in the middle of processing and
prompts you with \verb|?|, that is indeed an error.  It's an indication
that you mistyped something in your input file.  Type \verb|x| at the
question-mark prompt, hit Enter, and compare the file you typed to
what's in the figure.  The error message from \TeX{} may or may not be
meaningful.)

The command that you just executed produced an output file called
\verb|sample1.dvi|, where \verb|dvi| stands for
``\underline{d}e\underline{v}ice-\underline{i}ndependent.''  You can use
this file to preview your results on-screen.  You can also convert it to
PostScript, or print it.

\subsection{Previewing output on-screen}

For an on-screen preview of the results, bring up a terminal window
within X11, and type

\begin{verbatim}
xdvi sample1.dvi
\end{verbatim}

\noindent then hit Enter.  In a few moments a window should pop up
showing a page that looks like Figure~\ref{sample1formatted}.  When you
run \verb|xdvi| for the first time, or if your document uses font styles
that you haven't used before, it may need to compile fonts; just be
patient.

\verb|xdvi| has plenty of features, but being a GUI they're all pretty
self-evident, so I won't go into them here.  Feel free to explore them
on your own, of course.  \verb|xdvi| also has an informative manpage.

\section{PostScript and printing}

To convert \verb|sample1.dvi| to PostScript format, use this command:

\begin{verbatim}
dvips -o sample1.ps sample1.dvi|
\end{verbatim}

If \verb|-o sample1.ps| is omitted from this command, then the
PostScript output is, in the default \verb|dvips| setup, automatically
directed to the default local printer.  In conjunction with a
PostScript printer or Ghostscript to translate to a given printer's
language, this is the most common way that \LaTeX{} is printed.

\verb|dvi| filters specific to other printer languages also exist.
Examples include \verb|dvihp| for Hewlett-Packard LaserJet printers
and \verb|dvi2fax| for Group 3 fax format.

\begin{figure}
\centering\frame{\resizebox{3in}{!}{\includegraphics{sample1.ps}}}
\caption{Formatted version of Figure~\ref{sample1}.}
\label{sample1formatted}
\end{figure}

That's all you need to know in order to run \TeX{}.  Proceed to the
section below to find out what all the gibberish in
Figure~\ref{sample1} means.

\section{High level}

At this point you may be wondering just what the hell are all those
backslashes and curly braces.  The answer is that they form \LaTeX{}
commands.  \LaTeX{} commands take the following general form:

\begin{quotation}
\verb|\|\textit{name}\verb|{|\textit{argument}\verb|}|
\end{quotation}

\noindent Above, \textit{name} represents the command name, consisting
either of a sequence of letters and digits or a single non-alphanumeric
character.  \textit{argument} is an argument to the command.

Let's see what we can learn from the commands used in
\verb|sample1.tex|.  The first command in that document is

\begin{verbatim}
\documentclass{article}
\end{verbatim}

\noindent Every \LaTeX{} document begins with such a command, which
specifies what type of document you're writing.  The possible document
classes include the following, among others:

\begin{description}
\item[article] for short articles like the one you're reading
\item[report] for technical reports and similar
\item[book] for books (duh!)
\item[slides] for presentations and slide shows
\item[letter] for letters
\end{description}

The differences between these document types mainly lie in fine points
of presentation and sectioning.  For instance, articles have titles at
the top of the first page, whereas reports have separate title pages.
Articles and reports are divided into sections at their top level, but
books have chapters at their top level.  Here, we'll discuss only
articles and reports, which are the most commonly used document classes.

The \verb|\documentclass| command can also take optional arguments, as
can several other \LaTeX{} commands.  Optional arguments are enclosed in
square brackets (\verb|[]|) and precede required arguments.  The
following options, among others, are supported by \verb|\documentclass|:

\begin{description}
\item[11pt] to set a base 11-point font (the \LaTeX{} default is 10
point)
\item[12pt] to set a base 12-point font
\item[titlepage] to request a separate title page
\item[twocolumn] to use a two-column layout, like this article
\item[twoside] to properly format the output for two-sided printing
\end{description}

This article is formatted in two columns for two-sided printing, so its
document class is specified this way:

\begin{verbatim}
\documentclass[twocolumn,twoside]{article}
\end{verbatim}

Notice how multiple option names are delimited by commas.

\medskip

Following the \verb|\documentclass| command, the next command in the
example document is this:

\begin{verbatim}
\begin{document}
\end{verbatim}

This command introduces what is called an \dfn{environment} in \LaTeX{}
parlance.  Environments affect the text and commands that they contain.
Environment commands are always paired, consisting of \verb|\begin| and
\verb|\end| commands with the same argument.  In particular,
\verb|\begin{document}| and \verb|\end{document}| enclose a \LaTeX{}
document's entire contents.  We'll see more types of environments later.

\medskip

The third command in \verb|sample1.tex| is this:

\begin{verbatim}
\section{Air-Layering}
\end{verbatim}

This command introduces a new section in the printed document, in this
case called ``Air-Layering.''  It also enters the section name into
the document's table of contents.  You can also start subsections and
subsubsections \verb|\section| by using the \verb|\subsection| and
\verb|\subsubsection| commands, respectively, in an analogous manner.

\medskip

Between the \verb|\section| command and the end of the document
environment appear the body of the section.  This consists of lines
of text typed, for the most part, the same way you would type them in
a plain-text document.  Separate paragraphs by a blank line.  You need
not neatly format your lines, because \TeX{} will reformat them
itself.

\section{Low level}

We've already covered enough to let you type up basic documents with
\LaTeX{}, but there's a lot more that you can do.  Let's quickly go
over a few low-level details:

\subsection{Dashes}

Produce dashes within a word (``GNU-riffic'') with a single dash
character: \verb|-|.  Use two dashes for numeric ranges (``2--3
inches''): \verb|--|.  For long (``em'') dashes---like this---use
three dashes in a row: \verb|---|.

\subsection{Special characters}

\LaTeX{} has ten special characters that can't appear literally in a
document, because \LaTeX{} uses them for its own purposes.  These
characters are: \verb|# $ % & ~ _ ^ \ { }|.  You produce the first
seven of these by typing a backslash in front, so that \verb|\#|
produces `\#', \verb|\$| produces `\$', and so on.  The last three
aren't characters you want in normal text; if you think that you do,
reassess your sense of taste.

To produce less than and greater than symbols, use \verb|$<$| and
\verb|$>$|, respectively.  (By themselves, \verb|<| and \verb|>| print
as ``<'' and ``>'', respectively.)

\subsection{Quotation marks}

You can produce left quotation marks like ` with \verb|`| and right
quotation marks like ' with \verb|'|.  If you use two of them, as
\verb|``| and \verb|''|, then you get double quotes, ``like this.''

You shouldn't use ASCII double quote marks \verb|"| in your input
file, because they always come out facing the same direction, "like
this."

\subsection{Special symbols}

Use the \verb|\ldots{}| command to produce an ellipsis, like
this\ldots{} To produce a \copyright{} symbol, use the
\verb|\copyright{}| command.  For the \TeX{} logo, type
\verb|\TeX{}|; for the \LaTeX{} logo, type \verb|\LaTeX{}|.

\subsection{Line breaks}

Occasionally you may want to produce a line break without beginning
a new paragraph; for instance, when specifying an address:

\begin{flushleft}
Ben Pfaff \\
12167 Airport Rd \\
DeWitt, MI 48820
\end{flushleft}

For this effect, use \verb|\\|, like so:

\begin{verbatim}
Ben Pfaff \\
12167 Airport Rd \\
DeWitt, MI 48820
\end{verbatim}

\subsection{Emphasis}

Use \verb|\emph{|\ldots{}\verb|}| to emphasize text: \verb|\emph{foo}|
produces \emph{foo}.

\subsection{Fonts}

You can select an italic font by enclosing text within the
\verb|\textit{|\ldots{}\verb|}| command: \verb|\textit{italic}| produces
\textit{italic}.  Similarly, you can get \textbf{bold} output with
\verb|\textbf{|\ldots{}\verb|}|, 
\textsl{slanted} text with \verb|\textsl{|\ldots{}\verb|}|,
\texttt{typewriter} text using \verb|\texttt{|\ldots{}\verb|}|,
\textsf{sans serif} with \verb|\textsf{|\ldots{}\verb|}|, and
\textsc{Small Caps} with \verb|\textsc{|\ldots{}\verb|}|.

If you're going to use a particular font often, it might be better to
define a macro for it that corresponds to the font's purpose, rather
than to its name.  For instance, in this article, when new terms are
introduced, they are put in \textbf{bold} using a macro
\verb|\dfn{|\ldots{}\verb|}|.  If it was ever decided that such terms
should be italicized or slanted instead, only one change would need to
be made.  See section~\ref{macros} on page~\pageref{macros} for more
details.

\subsection{Comments}

You can include \dfn{comments}, text ignored by \TeX{}, in your \LaTeX{}
file, as notes to yourself or for any other reason.  In \LaTeX{},
comments are introduced by \verb|%| and continue through the end of a
line.

\section{Middle level}

We've discussed the high level structuring of a \LaTeX{} document and
the low-level typing of text.  Now it's time to take a look at the units
that fit somewhere in between.

\subsection{Title page}

You can have \LaTeX{} automatically generate a ``title page''
appropriate for the class of document you're writing by using the
\verb|\maketitle| command.  This title page contains the document's
title, author, and date.  Before using \verb|\maketitle|, you must
declare at least the document's title and author, and optionally the
date, with \verb|\author|, \verb|\title|, and \verb|\date|,
respectively.  If \verb|\date| is not specified, the current date is
used.  For example:

\begin{verbatim}
\title{A Quick Introduction to \LaTeX{}}
\author{Ben Pfaff $<$pfaffben@msu.edu$>$}
\date{21 June 2000}
\maketitle
\end{verbatim}

\verb|\maketitle| produces a title page appropriate to the type of
document you're writing.  For reports, this is a separate page; for
articles, it is at the top of the article's first page.

\subsection{Tables of contents}

You can include a table of contents in your document by specifying
\verb|\tableofcontents| at the point you want the table of contents to
appear.  \LaTeX{} will automatically collect the entries for the table
of contents from the sectioning commands scattered throughout your
document.

Figures and tables don't appear in the table of contents.  If you have
lots of them, you can include separate tables using the
\verb|\listoffigures| and \verb|\listoftables| commands, respectively.

\subsection{Quotations}

Sometimes you want to embed a quotation inside your text.  You can use
the \texttt{quote} or \texttt{quotation} environment to do this.  For
instance, the following quotation:

\begin{quote}
``I'm always embarrassed when I see an index an author has made of his
own work.  It's a shameless exhibition---to the \emph{trained} eye.
Never index your own book.'' \\
Kurt Vonnegut, Jr., \textit{Cat's Cradle}
\end{quote}

\noindent could be produced with the following \LaTeX{}:

\begin{flushleft}
\verb|\begin{quote}| \\
\verb|``I'm always embarrassed|\ldots\verb|book.'' \\|
\verb|Kurt Vonnegut, Jr., \textit{Cat's Cradle}|
\verb|\end{quote}|
\end{flushleft}

Use the \verb|quote| environment for single-paragraph quotes;
use \verb|quotation| for multi-paragraph quotes.  The difference in
style is that whereas \verb|quotation| indents the first paragraph of
the quoted text, \verb|quote| does not.

\subsection{Lists}

You can easily produce three types of lists with \LaTeX{}: bulleted
lists, numbered lists, and descriptive lists.  All of these work the
same way: an environment surrounds the list items, and each item
begins with an \verb|\item| command.  For example:

\begin{verbatim}
\begin{enumerate}
\item A Linux-capable server.
\item One or more clients.
\item A hub.
\item A range of IP addresses.
\item A geek, for debugging purposes.
\end{enumerate}
\end{verbatim}

\noindent produces the following list:

\begin{enumerate}
\item A Linux-capable server.
\item One or more clients.
\item A hub.
\item A range of IP addresses.
\item A geek, for debugging purposes.
\end{enumerate}

As shown above, use the \verb|enumerate| environment for numbered
lists; \verb|itemize| produces a bulleted list and \verb|description|
is for descriptive or definition lists.  In the latter case, you may
supply an argument to \verb|\item| within square brackets to use as
the item ``title'':

\begin{verbatim}
\item[ln] Creates links to a file.
\end{verbatim}

\noindent for an item that appears as follows:

\begin{description}
\item[ln] Creates links to a file.
\end{description}

\subsection{Verbatim text}

Sometimes, you'll want to include verbatim text in your documents; for
example, you might want to put \LaTeX{} source as part of your
document's ouput, in the same way that this tutorial does.  This is
where the \verb|verbatim| environment comes in handy.  Within this
environment, anything goes: you can include any character literally,
including characters that normally need to be preceded by \verb|\| or
that can't be included at all.  The only text you can't include is the
exact line \verb|\end{verbatim}|, because that ends the environment.
For example, this input:

\begin{flushleft}
\verb|\begin{verbatim}| \\
\verb|\item[ln] Creates links to a file.| \\
\verb|\end{verbatim}|
\end{flushleft}

\noindent produces this output:

\begin{verbatim}
\item[ln] Creates links to a file.
\end{verbatim}

Text in a \verb|verbatim| environment is set off in a separate
paragraph.  For verbatim text within a paragraph, use the
\verb|\verb/|\ldots\verb|/| command.  Just put the verbatim text
inside the \verb|/| characters.  Instead of \verb|/|, you can
substitute any single character of your choice that doesn't appear
within the text.

\section{Advanced features}

Now let's take a look at some of the more advanced features of
\LaTeX{}.  Of course, we're only skimming the surface, but perhaps
this will serve to give you an idea of what \LaTeX{} can do.

\subsection{Macros}
\label{macros}

Use
\verb|\newcommand{\|\var{name}\verb|}[|\var{n}\verb|]{|\var{body}\verb|}|
to define a new command with \var{n} arguments named
\verb|\|\textit{name} that expands to \var{body}.  In specifying
\var{body}, refer to the argument numbered \var{n} with the syntax
\verb|#|\var{n}.  For example:

\begin{verbatim}
\newcommand{\var}[1]{\textit{#1}}
\end{verbatim}

\noindent defines a macro, \verb|\var|, that italicizes its argument,
so that after this definition, \verb|\var{text}| produces \var{text}.

\subsection{Graphics}

Suppose that you just designed a spiral in PostScript, like that shown
in Figure~\ref{spiral}, whose corresponding PostScript source is shown
in Figure~\ref{spiral-source}.  In order to hypnotize your readers,
you want to include this spiral in your document.  How can you do it?

\begin{figure}
\centering \includegraphics{spiral.eps}
\caption{The spiral whose PostScript source is shown in
Figure~\ref{spiral-source}.}
\label{spiral}
\end{figure}

\begin{figure}
\verbatiminput{spiral.eps}
\caption{PostScript source for spiral shown in Figure~\ref{spiral}.}
\label{spiral-source}
\end{figure}

The answer is the \verb|\includegraphics| command, which takes the
name of a graphics file as its argument.  Typically, this is an
Encapsulated PostScript (EPS) file.  You can use tools such as GIMP to
save graphics in EPS format.

If you use \verb|\includegraphics| then you must tell \LaTeX{} to
use the \verb|graphics| package.  Do this by inserting the command

\begin{verbatim}
\usepackage{graphics}
\end{verbatim}

\noindent between \verb|\documentclass| and \verb|\begin{document}| at
the top of your file.

You can resize a graphic arbitrarily by putting it inside a
\verb|\resizebox{|\var{width}\verb|}{|\var{height}\verb|}{|\ldots\verb|}|
construction, where \var{width} and \var{height} are the desired size.
You can specify \var{width} or \var{height} or both; if you want to
specify only one, put \verb|!| as the other, and the graphic will be
scaled proportionally.  Valid values for \var{width} include \verb|3in|
for a 3-inch width, \verb|\textwidth| for the page width within the
margins, and \verb|\columnwidth| for the width of the current column.

For example, to include \verb|x.eps|, 1 inch wide, with
proportionally scaled height, write the following:

\begin{verbatim}
\resizebox{1in}{!}{\includegraphics{x.eps}}
\end{verbatim}

\subsection{Figures}

More often than not, graphics go inside figures.  Use \LaTeX{}'s
\verb|figure| environment to produce figures.  Within \verb|figure|, you
can use \verb|\caption{|\ldots{}\verb|}| to specify a caption and
\verb|\label{|\var{name}\verb|}|, which must immediately follow
\verb|\caption|, to give the figure a symbolic name for later reference.

For instance, the figure containing the spiral above was produced with
the following \LaTeX{} code:

\begin{verbatim}
\begin{figure}
\centering \includegraphics{spiral.eps}
\caption{The spiral whose PostScript source
is shown in Figure \ref{spiral-source}.}
\label{spiral}
\end{figure}
\end{verbatim}

\verb|\centering|, which horizontally centers a figure's contents, is
another new command introduced above.

\subsection{Cross-references}

The \var{name} given in a figure's \verb|label| can be used to refer to
the figure using the \verb|\ref{|\var{name}\verb|}| and
\verb|\pageref{|\var{name}\verb|}| commands.  The former expands to
figure \var{name}'s number; the latter expands to its page number.  For
instance,

\begin{verbatim}
Figure \ref{spiral}, page \pageref{spiral}
\end{verbatim}

\noindent might appear when printed as ``Figure \ref{spiral}, page
\pageref{spiral}.''

You can also use \verb|\label| to label sections; put it after the
sectioning command (\verb|\chapter|, \verb|\section|, etc.).  References
to sections produce the section number.

\subsection{Mathematics}

\LaTeX{} has strong support for typesetting mathematics.  Enclose
mathematical expressions within \verb|\(| and \verb|\)| to embed them
within a paragraph or put them between \verb|\[| and \verb|\]| to
``display'' them.  For example, writing
\verb|\(t_p = C_t{(LL_c)}^{0.3}\)| produces the formula \(t_p =
C_t{(LL_c)}^{0.3}\), whereas writing \verb|\[t_p = C_t{(LL_c)}^{0.3}\]|
produces \[t_p = C_t{(LL_c)}^{0.3},\] set off from the rest of the
paragraph.

It is beyond the scope of this article to detail \LaTeX{}'s support
for mathematics, but it's worth noting how to do a few things.  Within
a formula, use \verb|^| for superscripts and \verb|_| for subscripts,
as shown above.  (If a subscript or superscript contains more than one
character, surround it in braces \verb|{}|.)  Use \verb|\frac| to
produce a fraction: \verb|\frac{4}{5}| prints as \(\frac{4}{5}\).
Greek letters are represented by commands corresponding to their
names: \verb|\omega| becomes \(\omega\), \verb|\Omega| becomes
\(\Omega\).  Use \verb|\sqrt| for square roots: \verb|\sqrt{n^3}|
prints as \(\sqrt{n^3}\).

\subsection{Tables}

The \verb|tabular| environment is used for tables.  Begin the
environment with a line having the form
\verb|\begin{tabular}{|\var{cols}\verb|}|, where \var{cols} is a set of
single-character column alignments, with \verb|l| for left-justified
columns, \verb|c| for centered columns, \verb|r| for right-justified
columns, and \verb#|# for a vertical rule.  Within the table, separate
columns by \verb|&| and rows by \verb|\\|; horizontal rules can be drawn
with \verb|\hline|.

For example, the following commands:

\begin{verbatim}
\begin{tabular}{r|c|c}
XOR & 0 & 1 \\ \hline
0 & 0 & 1 \\ \hline
1 & 1 & 0
\end{tabular}
\end{verbatim}

\noindent result in this table:

\medskip
\begin{center}
\begin{tabular}{r|c|c}
XOR & 0 & 1 \\ \hline
0 & 0 & 1 \\ \hline
1 & 1 & 0
\end{tabular}
\end{center}

You can put tables into running text as above, or you can put them into
figures.  Another option is to put them into a \verb|table|
environment, which works just like the \verb|figure| environment except
that it is intended to contain tables.

\subsection{Indexes and bibliographies}

Producing indexes and bibliographies with \LaTeX{} isn't all that
difficult, but there are lots of details.  There's not enough room in
this article to properly describe it.  I recommend \cite{lamport} as
the definitive guide to these aspects of \LaTeX{}.

\section{Odds and ends}

Here are some final points that didn't seem to fit anywhere else.

\subsection{Emacs and \LaTeX{}}

GNU Emacs has a special \LaTeX{} mode.  In this mode, there are several
convenient commands for editing \LaTeX{}, including the following:

\begin{list}{}{\renewcommand{\makelabel}[1]{\texttt{#1}}}

\item[C-c C-f] Saves the file and runs \LaTeX{} on it in another window.

\item[C-c C-p] Prints the \verb|.dvi| file generated by \LaTeX{}.

\item[C-c C-v] Previews the \verb|.dvi| file generated by \LaTeX{}.

\item[C-c C-r] Runs \LaTeX{} on only the currently selected region.
\end{list}

Also, typing a plain double quote \verb|"| in \LaTeX{} mode will
automatically insert \verb|``| or \verb|''|, as appropriate.

Normally, Emacs will automatically detect that a file is written in
\LaTeX{} and choose \LaTeX{} mode.  If it doesn't, use the command
\texttt{M-x latex-mode}.

\subsection{Margins}

By default, \TeX{} and \LaTeX{} have very large margins: something
like 2 inches on the left side and 1 inch on the right, with equally
large top and bottom margins.  You probably don't want them that big
for final drafts.  The following will set the margins to something
more reasonable, at approximately 1 inch on each side:

\begin{verbatim}
\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{0pt}
\setlength{\evensidemargin}{0pt}
\setlength{\textheight}{8.5in}
\setlength{\topmargin}{0pt}
\end{verbatim}

These are the margins used for this article.

\subsection{Re-running \LaTeX{}}

Quite often it's necessary to run \LaTeX{} more than once on a file to
get the references correct.  If this is true, then \LaTeX{} will print
this message:

\begin{verbatim}
LaTeX Warning: Label(s) may have changed. 
Rerun to get cross-references right.
\end{verbatim}

Just do like it says and run \LaTeX{} again if you want to make sure
that all the references refer to the right figures or pages, etc.  

Alternatively, you can use the \verb|texi2dvi| program that comes with
Texinfo.  This program will automatically re-run \LaTeX{} until all
references are properly resolved.  For more information on
\verb|texi2dvi|, see the documentation for Texinfo.

\begin{thebibliography}{9}

\bibitem{lamport}Leslie Lamport.  {\sl \LaTeX{}, A Document Preparation
System: User's Guide and Reference Manual}.  2nd ed.  Addison-Wesley
1994.  ISBN 0-201-52983-1.

\bibitem{info}Torsten Martinsen.  {\sl \LaTeX{}: The macro package for
\TeX{}}.  1996.  In Debian GNU/Linux, found at {\tt
/usr\/share\/info\/latex\.info\.gz}.

\bibitem{essential}Jon Warbrick.  {\sl Essential \LaTeX{} ++}.  1994.
In Debian GNU/Linux, found at {\tt
\/usr\/lib\/texmf\/doc\/latex\/general\/essential\.dvi\.gz}.

\bibitem{texbook}Donald~E. Knuth.  {\sl The \TeX{}book}.
Addison-Wesley 1988.  ISBN 0-201-13448-9.

\end{thebibliography}

\end{document}

Local Variables:
compile-command: "texi2dvi latex.tex; dvips -o latex.ps latex.dvi; ps2pdf latex.ps"
End:
