\documentclass{article}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{graphicx}
%include these lines if you want to use the LaTeX "theorem" environments
\newtheorem{theorem}{Theorem}[section]
\newtheorem{definition}[theorem]{Definition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
%include lines like this if you want to define your own commands
%to save typing
%\newcommand{\PROOF}{\noindent {\bf Proof}: }
\newcommand{\REF}[1]{[\ref{#1}]}
\newcommand{\Ref}[1]{(\ref{#1})}
\newcommand{\dt}{\mbox{\rm dt}}
\newcommand{\phat}{\hat{p}}
\begin{document}
\title{How to write a paper in \TeX}
\author{Curtis Greene\thanks{Research supported in part by
N.S.F. Grant DMS 12-345678}}
\date{\today}
\maketitle
\begin{abstract}
In this brief paper we illustrate some simple \TeX\
and \LaTeX\ commands which facilitate writing a mathematics paper.
All you have to do is supply the mathematics! Start with this document,
change my name to your name and my title to your title, and you're off
and running.
\footnote{Early versions of this document were written almost $25$ years ago.
It has been updated many times to keep pace with improvements in TeX. This is the
2010 edition, with updates by Curtis Greene and David Lippel.}
\end{abstract}
\section{Introduction}
The best way to learn \TeX\ is by imitation. This paper
illustrates the basic steps for typesetting mathematics in \TeX, and
a few of the most important ``document-managing'' commands provided
in \LaTeX. There is much more to be learned, but very little
else you {\it must} learn to do a satisfactory job.
\LaTeX\ is a system which ``sits on top of'' \TeX, and makes its
features easier to use. \TeX nically this document is showing you
how to use \LaTeX\ rather than \TeX, but it's not too important
to understand the distinction.
\section{Workflow}
Running \TeX\ (or \LaTeX\ ) requires a text-editor (any one will do) for
creating a source file and a
\TeX\ ``engine'' for compiling the source into typeset output. There
exist many nice integrated systems that facilitate combining these two
steps, e.g. viewing the source in one window and the typeset output in
another. Examples are WinEdT or WinShell (combined with MiKTeX) for
Windows machines and TeXShop for the Mac. All provide a single
button called ``PDFLaTeX'' which allows you to produce a nice pdf file
with a single click. This workflow is highly recommended.
\section{Advice: How to Use This Paper}
Find a \TeX\ system that allows you to view the source and output simultaneously. Compare each item
in the source with the output it produces. Experiment by making small changes. To learn new tricks, ask
a friend who knows \TeX\ slightly better than you do\footnote{This is the single most effective technique
for building up your \TeX\ skills.}.
\section{Definitions and Terminology}
This section doesn't have any mathematical definitions, but if you have some, they might look like this.
\begin{definition}
A {\em definition} is a concise explanation of the meaning of a word or phrase or symbol.
\end{definition}
\section{Typesetting Simple Mathematics}
It's a general rule in \TeX\ that anything preceded by a backslash
(for example \verb.\section. or \verb.\item.) does not appear as
written, but rather is a ``command'' instructing \TeX\ to do something
else. In addition, anything you type between dollar signs \verb,$.....$,
is treated as ``mathematics'', and given very special treatment as to
spacing, type size, etc. Expressions typed as \verb.$\alpha$. and \verb.$X_i^2$.
(for example) appear as $\alpha$ and $X_i^2$. Material between double dollar
signs \verb,$$......$$, appears as ``displayed mathematics'', for example:
$$
\sum_0^\infty x^i = \frac{1}{1-x}
$$
If you want to have displayed equations numbered, replace the double
dollar signs by \verb,\begin{equation}......\end{equation},:
\begin{equation}
f(x) = \int_0^x e^{-t} \dt
\end{equation}
% Note: in the above section I've used the \verb command to make certain
% things appear 'verbatim'. These lines are 'comments' and do not
% appear at all in the final version.
\section{Lists and Numbered Environments}
\LaTeX\ provides especially nice features for making lists, with
automatic numbers and cross-referencing. This might be used for
example in making up questions on an exam. The commands to produce
a numbered list are
\begin{verbatim}
\begin{enumerate}
.
.
\end{enumerate}
\end{verbatim}
Individual items on the list are preceded by the command \verb.\item..
The following illustrates problems on a math exam. Extra space
can be added between problems using commands like \verb.\bigskip. and
\verb.\vspace{1in}..
\begin{enumerate}
\item Solve: $y'' + x y' + y = \sin(x)$, if $y(0) = y'(0) = 0$.
\item Compute the indefinite integral:
$$
\int \frac{1}{\sqrt{1-t^2}} \dt
$$
\item Find the maximum value of $f(x) = x(x-1)(x-2)$ over the interval $0 \leq x \leq 3$.
\end{enumerate}
\section{More Complicated Mathematics}
This section is included to indicate how much more complex
mathematical expressions are composed. The source text may look
formidable at first, but one gets used to it.
$$
\int_0^\infty \frac{dx}{(1+x^2)(1+r^2x^2)(1+r^4x^4)\cdots} = \frac{\pi}{2(1+r+r^3+r^6+r^{10}+\cdots)}
$$
The next equation is numbered:
\begin{equation}
\sum_{n \geq 0} \frac{q^{n^2}}{(1-q)(1-q^2)\cdots(1-q^n)}
=
\prod_{n \geq 0} \frac{1}{(1-q^{5n+1})(1-q^{5n+4})}
\end{equation}
Another numbered equation:
\begin{equation}
\lim_{x \rightarrow \infty} (1+\frac{\alpha}{x})^x = e^\alpha
\end{equation}
And another:
\begin{equation}
\zeta(s) = \sum_{n \geq 0} \frac{1}{n^s} = \prod_{p \mbox{ }prime}
\frac{1}{1 - p^s}
\end{equation}
And I'll bet you didn't know this one:
\begin{equation}
\sum_{0 \leq k \leq n-1} {{n-1}\choose{k}} n^{n-1-k} (k+1)! = n^n
\end{equation}
Even expert \TeX ers often work with a manual beside them, to look
up obscure math commands if necessary. The manuals are good, and
easy to use for this purpose.
\section{Theorems}
There is a really nice way to have theorems typeset automatically,
with numbers and labels, which can be referenced symbolically\footnote{For technical reasons,
if your document contains numbered theorems,
equations, definitions, etc., you have to run PDFLateX {\em twice} in order to
have the numbers appear correctly. }. For example.
\begin{theorem}\label{maintheorem}
$\pi$ is irrational.
\end{theorem}
\begin{proof}
Left to the reader.
\end{proof}
\begin{definition}\label{odd-def}
An integer $n$ is odd if $n=2k+1$ for some integer $k$.
\end{definition}
The main result of this section was Theorem \ref{maintheorem}, although
Definition \ref{odd-def} has nothing to do with it. A very
interesting but completely unrelated reference is \cite{Di}.
\section{Other Tricks}
It's absolutely
irrelevant how you break lines within paragraphs of your
source text: \TeX\ takes over and fills lines
into
well-spaced paragraphs
at the compiling stage.
(You can override line- and page-breaking using the
\verb.\newline. and \verb.\newpage. commands if absolutely necessary.)
A paragraph is simply defined as whatever occurs between two successive
blank lines of the source text. One secret to efficient \TeX ing is
not to worry at all
about how the source text looks --- cut and copy fragments
to suit
your convenience, and don't bother
to clean things up.
If you find yourself typing something frequently, it is possible to
define a ``macro'' which lets you type an abbreviation instead. Macros
are defined at the beginning of the document, with a statement like
\begin{verbatim}
\newcommand{\phat}{\hat{p}}
\end{verbatim}
Now typing \verb.$\phat$. is equivalent to typing \verb.$\hat{p}$. (and the
result is $\phat$). Some other examples appear at the top of this
source document. For example \verb.\REF. is used instead of
\verb.\ref. to but brackets around the reference.
One can create diagrams using programs such as Mathematica or Photoshop and include them in a document.
For more information on including figures in your paper, look at the ``figureshell'' template available on math department webpage.
\section{Including Graphics in your Document}
Including graphics in a TeX document used to be very complicated, but now it is extremely easy: anything
you can save as a pdf file can be ``included'', using a command like
\begin{verbatim}
\includegraphics[scale=.4]{myfile.pdf}
\end{verbatim}
The example shown here is a little rough, because it was saved as a screenshot and then converted to pdf. It could be tweaked in a variety of ways to produce nicer output. But it illustrates that {\em anything} you can can save as a screenshot can be included in your \TeX\ document. In Mathematica you can generate pdf output directly, and the
results are nice and sharp. But the
file sizes are sometimes quite large.
\bigskip
\includegraphics[scale=.4]{myfile.pdf}
\begin{thebibliography}{1}
% You can put you bibliographic information in a section like this.
% Note the mandatory {n} after the \begin{thebibiography} command, which tells LaTeX
% much space to allocate for the labels of your bibliography.
\bibitem{Ch}
L. Chihara, On the zeroes of Askey-Wilson polynomials,
with applications to coding theory, S.I.A.M. Jour. Math.
Anal. {\bf 18} (1987) 183-207.
\bibitem{Di}
P. Diaconis, {\it Group Representations in Probability and Statistics},
Inst. Math. Statistics, Hayward CA, 1988.
\bibitem{DiGr}
P. Diaconis and R.L. Graham,
The Radon transform on $Z_2^k$, Pacific Journal of Math. {\bf 118} (1985), 323-345.
\end{thebibliography}
\end{document}