From a TeXnical point of view, the two pairs of classes are largely
interchangeable, so it is easy to switch from one class to another after a
paper is finished. The only editing that may be needed is in the title
matter since this is handled differently by the two classes. Here are
the main differences:
To load a package,
add a "\usepackage{...}" instruction
after "\documentclass", with the name of the package in
braces. Multiple packages can be included in a single
"\usepackage{...}" statement, separated by commas; for
example, "\usepackage{amsmath, amsthm}".
Here are some packages that are commonly used in mathematical writing.
- amsmath, amsthm:
These packages, which are part of
amslatex, are needed to make the amslatex enhancements for typesetting
equations and theorems available. The packages are loaded
automatically if you use one of the ams document classes; if you use a
standard LaTeX document class, load the packages explicitly with
\usepackage{amsmath, amsthm}
Documentation.
Gratzer's book "Math into LaTeX" provides complete documentation for
these and other amslatex packages, and is the only book to do so.
Online documentation is available at the AMS LaTeX page;
see, in particular, the
Short Math Guide for LaTeX.
- amssymb: This package is part of
the amslatex distribution and loads additional fonts and symbols.
In particular, it loads the "amsfonts" package which, among
other things, makes
blackboard bold ("\mathbb") and fraktur
("\mathfrak") fonts
available. The "amssymb" also includes a number of
additional symbols or variants of standard LaTeX symbols, such as a
slanted "less than or equal" sign. (However, I would recommend using
the standard versions, unless there is a particular reason to use the
variant.)
Documentation:
A complete listing of the symbols provided by "amssymb",
is given in Appendix A of Gratzer's book, and in
the
Short Math Guide for LaTeX,
mentioned above.
- amscd: Also part of the amslatex distribution, this is a
package for typesetting simple commutative diagrams. It is a lightweight,
easy-to-use package, but it cannot handle diagrams with diagonal
arrows; if you need to draw diagrams with diagonal arrows, use
the "xy" package described below.
Documentation: Section 5.8 of Gratzer's book.
- xy: This is the name of the package that loads the "xy-pic" program,
a general drawing package for TeX that is especially useful for
drawing complex commutative diagrams. This is a real heavyweight
among drawing packages, and amazingly powerful and versatile; it can
do all sorts of tricks, including looping around nodes in a
commutative diagram, looping an arrow over or under another arrow
to create the impression of a 3D like image, and much more. It is hard
to image a commutative diagram that "xy" wouldn't be able
to handle.
Documentation.
There is a short guide, "xyguide", and an 80 page reference manual,
"xyrefer".
On most TeX installations you can access these locally with "texdoc xyguide"
and "texdoc xyrefer".
Despite the size of the reference manual, for simple diagrams
"xy" is fairly easy to use, and you will
likely get by using just the short guide.
- url:
A small, but extremely useful package that facilitates
the coding of email addresses and URL's. I use this package all the time, and
I usually simply tack "url" on to the "\usepackage{amsmath,amsthm}
instruction that I have in most of my documents:
\usepackage{amsmath,amsthm,url}
In contrast to heavy-duty packages like "graphicx", "url"
is a very small, benign package that does not interfere with other packages.
The following illustrates the typical usage of "url":
For more information, check out the website
\url{https://math.uiuc.edu/~hildebr/tex}
or email \url{hildebr@math.uiuc.edu}.
By enclosing a web or email address in \url{...}, the address gets printed in
the appropriate font. Moreover, linebreaking and hyphenation is handled
correctly. Finally, and perhaps most importantly, one doesn't have to worry
about addresses containing a tilde symbol or an underline. The "url" package
ensures that these symbols get handled properly.
- showkeys:
If your document has a large number of labelled items, remembering
all the labels becomes difficult. The "showkeys" package
shows these labels explicitly by putting the name of the label
referenced in a small box placed on the margin of the page, or
directly above the reference.
The labels displayed in this manner include citation labels
("\cite{...}"), equation
labels ("\eqref{...}"), and ordinary labels
("\ref{...}").
A great tool when working on a complex document.
Documentation.
The documentation file is "showkeys"; it can usually be accessed with
"texdoc showkeys".
-
fancyhdr:
The "Fancy header" package. Allows customizations of footers and
headers. This greatly extends the capabilities of the
"\pagestyle{...}" command in standard LaTeX. The package
distinguishes between even and odd numbered pages,
and for each allows specifying a left/center/right header, and a
left/center/right footer.
Documentation:
The documentation can be accessed with
"texdoc fancyhdr".
Here is an example:
\documentstyle{book}
\usepackage{fancyhdr}
\pagestyle{fancy}
%% L/C/R denote left/center/right header (or footer) elements
%% E/O denote even/odd pages
%% \leftmark, \rightmark are chapter/section headings generated by the
%% book document class
\fancyhead[LE,RO]{\slshape\thepage}
\fancyhead[RE]{\slshape \leftmark}
\fancyhead[LO]{\slshape \rightmark}
\fancyfoot[LO,LE]{\slshape Short Course on Asymptotics}
\fancyfoot[C]{}
\fancyfoot[RO,RE]{\slshape 7/15/2002}
-
verbatim:
This package is primarily intended to typeset text, such as a source
code for a program, "verbatim", i.e., literally, with no formatting
and all spacing preserved. However, its most useful feature
is a "comment" environment that allows one to comment out entire
sections of text, in much the same way as the
"\* ... *\" comment construct in the C language.
This is much safer than commenting out multiline
chunks of text by preceding each line with a TeX comment symbol (%).
Documentation:
The documentation files are named "verbatim.*", and can be accessed in
the usual way, with "texdoc verbatim".
Here is a typical usage of the verbatim package:
\usepackage{verbatim}
[....]
\begin{proof}
The result can be proved in the same way as Proposition 3.
We omit the details.
\end{proof}
%% detailed proof placed inside comment environment
\begin{comment}
Let
[...]
This proves the assertion.
\end{comment}
- graphicx:
The "graphicx" package allows inclusion of
graphics files produced by other aplications (such as
the free program "xfig", available on Unix systems,
Mathematica/Maple,
or commercial software like CorelDraw). (Note the "x" at the end;
the precursor to "graphicx"
is a package called "graphics", but this
package is obsolete and should not be used.)
The graphics files must be in eps (encapsulated postscript) format, so
be sure to save the files in this format. (All of the mentioned
applications can do this.)
Documentation. The main source of documentation is the
document "Using imported graphics in LaTeX2e", which, despite its
hefty size (86 pages), provides an excellent introduction to the
"graphicx" package, and
to the issues involved in using graphical material in TeX files.
The name of this document is "epslatex", and you can usually access it on your
local installation with the command "texdoc epslatex".
The "graphicx" package is also documented in the "LaTeX
graphics companion".
Usage.
The "graphicx" package has numerous features and options,
but the basic use is very simple:
First load the "graphicx" package with
"\usepackage{graphicx}", and then use
the "\includegraphics{...}" command (note the "s" at the
end!) for every file you want to import into your LaTeX file.
In its simplest form, you just use the "\includegraphics"
command with
the file name given inside the braces. However, you will usually
want to place this command inside a "figure" environment,
and probably also wrap it inside "\begin{center} ...
\end{center}" so that the graphics is horizontally centered.
Furthermore, you may need to scale the graphics so that it fits the
page; this can be accomplished with an optional "width"
argument,
which sets the width to a specific length (and also scales the height
proportionally).
Here is a simple, complete example, showing how to include a file,
plot.eps, in a document. Note that the .eps extension need not be
specified.
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[tbh]
\begin{center}
\includegraphics[width=.8\textwidth]{plot}
\end{center}
\caption{Plot of the function $\sin x$}
\label{sineplot}
\end{figure}
\end{document}
Here are some additional hints when using this package.
-
graphicx under the draft mode.
When the "draft" option in the "\documentclass" command
is turned on, the graphics files are not displayed;
only an
outline of the rectangular boxes containing the graphics is shown.
This is useful in order to determine the proper sizing
and placement of the graphics. To override this behavior,
use the option "final" when loading the package:
"\usepackage[final]{graphicx}."
With this option, all graphics will be displayed, regardless of
whether or not the draft option is turned on.
-
Graphics file extensions.
The .eps extension in the eps files need not be specified (but be sure
that there is a file with this extension in the current directory).
In fact, leaving out the .eps extension has the advantage that
the same LaTeX source file can be used by the pdflatex program to
create a pdf version of the document.
This requires that the graphics are available in both eps and
pdf formats. (You can use conversion programs, such as "epstopdf",
for that purpose.)
The pdflatex program expects graphics files to be in pdf format,
whereas latex expects the files to be in eps format.
Making graphics files in both versions available, but
not specifying a file extension, when including the graphics in the
document, ensures that
each of the two programs picks and finds the version appropriate for
that program.
-
Placement of figures.
Figures and tables placed inside "figure" or
"table" environment are so-called "floats"; this means that
they may be moved further down in
the document in order to avoid overlong
pages and similar problems. LaTeX tries hard to optimize the
placement, but sometimes this can result in a poor placement, such as in
the middle of a bibliography. This occurs mainly
in documents containing lots of figures.
There are several things one can do to
improve the placement of figures. The first thing to try is to
add an option like "[tbh]" to the "\begin{figure}" command,
as in the example above. This instructs Tex to try to place the figure
at the top (t) or bottom (b) of the page, or "here" (h), meaning the
place where the figure occurs in the source code. If this does not
help, try the more emphatic version "[tbh!]". As a last resort, you
could remove the "\begin{figure} ... \end{figure}" wrapper
and use manual spacing commands before and after the figure to achieve
the proper spacing. However, this is a drastic measure that is only
recommended if other attempts fail.