\input{template}
\input{macros}
\begin{document}
\lecture{0}{Manual for Scribes}{x}
You will need to use the latex document processing system.
This document is not a latex manual, but it does show you some basic tricks.
Several good latex references exist on the web, and your grad colleagues
should have books on latex. (My favorite is the {\em Latex Companion}.)
A file called {\tt template.tex}
already exists in this directory that wil take care
of formatting. A file called {\tt macros.tex} contains shorthands for
math commands as well as for frequently used formatting tricks.
%Double-check with me before editing either of these. Also,
Send me email if you have latex questions.
We are using the {\tt amsmath} package for typesetting, which does a few
things differently from standard latex.
Some tricks and tips appear below.
Look in the source file {\tt howto.tex} to understand how
to do these tricks.
\section{General Formatting Tips}
\begin{enumerate}
\item Theorems, lemmas, corollaries, proofs, definitions, examples, exercises,
remarks, etc. are typeset
inside special environments. (The environment names are
{\tt Thm, Lem, Cor, proof, Def, Exa, Ex, Rem} respectively.)
Here is how you write a theorem.
\begin{Thm} \label{einsteinthm}
If $E$ denote energy, $m$ denotes mass, and $c$ denotes the speed of light,
then
\begin{equation}
E = mc^2
\end{equation}
\end{Thm}
\item File {\tt macros.tex} also contains macros to typeset the following
(not an exhaustive list): set notation (e.g. $\set{1, 2, 3, 4}$),
cardinality of a set (e.g. $\card{\set{1,2,3}}$), Real and natural numbers
($\rea, \nat$ respectively), probabilities (e.g. $\pr[\text{coin comes up head}] =1/2$), $\var[X] = \av[X^2] - \av[X]^2$).
If you want to add a new macro to {\tt macros.tex},
{\em please send me email}. Do not edit
{\tt macros.tex}; I want all students to use the same version.
%\item
\item There are macros for writing pseudocode. Look in the
source file to see how to generate the following piece of
pseudocode.
\begin{program}
input: $G = (V,E)$, $s$, $t$ \\
output: \textsc{yes} if it discovers that $t$ is reachable from $s$,
and \textsc{no} otherwise \\
\\
\> guess the distance $k$ between $s$ and $t$\\
\> $p$ := $s$\\
\> \FOR \= $i$ := 1 to $k$ \DO \\
\> \> non-deterministically pick a neighbor $q$ of $p$ \\
\> \> $p$ := $q$ \\
\> \IF\ $p=t$ \THEN\ \ACCEPT\\
\> \> \ELSE \REJECT
\\
\end{program}
\item You can include figures by using the {\tt ffigure} command.
You first create a figure using {\tt xfig} (on Unix)
or {\tt Adobe Illustrator},
save it as a postscript file (the subscript should be {\tt .eps}) in the same
directory as the latex files. Lets say this figure is {\tt 12sets.eps}.
Look
in the source file to see how we can include this file and generate
Figure~\ref{figure:sets}.
\ffigure{12sets}{1in}{The bigger $S'$ is, the more likely $h(S')$ will
hit a given point in $\B^m$.}{figure:sets}
If you get any error messages while including figures, check that the .eps file
begins with \%! and if not, edit out the first line or two of junk.
You will probably get better results if you draw the figures (in {\tt xfig} or
another program) in landscape orientation. Make it fill the entire page,
since you can resize it when using the {\tt ffigure} command.
\end{enumerate}
\section{General Math Formatting Tips}
\begin{enumerate}
\item Use {\tt align} to typeset a series of contiguous equations
such as those occuring in a long derivation.
(Do not use the old {\tt eqnarray} command; it uses nonstandard
typographical conventions.) In the source file you will see that
an \& tells the program which symbol to align on.
\begin{align}
E & = mc^2\\
E+ H + G & = t
\end{align}
Use the {\tt equation} command for single equations.
\begin{equation}
E = mc^2
\end{equation}
To mix text into math formulae, use the {\tt text} command.
\begin{equation}
E = mc^2 \qquad \text{(Einstein)}
\end{equation}
While presenting a sequence of calculations
(using the {\tt align} command) we sometimes
need to say something briefly in the middle, say to explain a step.
We can do this with
the {\tt intertext} command.
\begin{align}
A+ B+ C + D + E & = R+ S \\
\intertext{{\em intertext:} which can be upperbounded using the inductive hypothesis by}
& \leq Q + N
\end{align}
\item If no alignment is needed, we use {\tt gather} to make the group of equations look
neat.
\begin{gather}
a+b = b+a \\
(a+b)\cdot (a-b) = a^2 -b^2
\end{gather}
\item There is also {\tt alignat} for {\tt align} type structures side by side.
\begin{alignat}{2}
L_1 & = R_1 & \qquad L_2 & = R_2 \\
L_3 & = R_3 & \qquad L_4 &= R_4
\end{alignat}
\item Equations that do not fit into a line are typeset using the {\tt split} environment,
which allows alignment between lines using \& as usual.
\begin{equation}
\begin{split}
(a+ b)^3 - (c+d)^3 - (a+ d)^3 & = a^3 + b^3 +3ab(a+b) + c^3 +d^3 +3cd(c+d) \\
& \quad - (a^3 + d^3 +3ad(a+d))
\end{split}
\end{equation}
\item To refer later to an equation, you need to label it with a {\tt label} command.
The command {\tt notag} will make the equation unnumbered. The command {\tt tag} will
replace the equation number with some other designated symbol.
\begin{align}
x^2 -y^2 &= (x-y)\cdot(x+y) \label{eq:r1} \\
x^3 -y^3 & = (x-y)(x^2 +xy + y^2). \tag{$*$} \label{mystar}\\
\intertext{Using \eqref{eq:r1} and \eqref{mystar} we obtain}
a + b &= d \\
\intertext{Now we give an unnumbered equation; note that the numbering resumes below}
d+ e & = f \notag
\end{align}
\item You can typeset equations involving ``case'' situations with the {\tt cases}
environment.
\begin{equation}
\delta_{i,j} = \begin{cases}
1 & \text{if $i =j$} \\
-1 & \text{if $i