%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Subject: templates and explanation about how to use Latex  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentstyle[12pt]{article}
\newcommand{\bigcenter}[1]{\begin{center} {\Large \bf #1} \end{center}}
\newcommand{\bv}{\begin{verbatim}}
\newcommand{\ev}{\end{verbatim}}
\newtheorem{theorem}{Theorem}
\begin{document}
\bigcenter{Latex Tutorial}

This tutorial was originally prepared by Joel Wein of MIT.
You may find it helpful in preparing your notes.
Anything I send you in the template file supercedes what is written here.

\noindent --Yishay

\section{\LaTeX}

This section begins with the disclaimer that most of you probably
know quite a bit about \LaTeX.  This is also not meant to be complete,
just enough to get you started. If anyone charitable 
wants to write a section on somthing to be included feel free.

\subsection{ Text}

	\LaTeX is a document preparation system that
can do almost anything.  I will present just the bare minimum.
For more information and better explanations consult the manual.


A document must begin  with 
\begin{verbatim}  \begin{document} \end{verbatim}and ends
with \begin{verbatim} \end{document} \end{verbatim}

Before the \begin{verbatim} \begin{document}\end{verbatim}
line you may include a 
number of lines to set up new commands, change the margins, etc.
This section is called the {\em preamble}.
(I will provide all of this in the template file.)

	To get text nicely printed out in paragraphs you 
just type it in. A blank line after a block of text causes a new
paragraph to be started.  You may force a line break with a 
\begin{verbatim} \\  
\end{verbatim}
at the end of a line.

	If you want to do much else you will need to use  commands
that begin with a backslash \begin{verbatim}  \ \end{verbatim} This generally signals 
a \LaTeX \ keyword.  It may also be used in front of most
 characters that
have \LaTeX \ special meaning  to display that character.

	Two simple examples are how to center and  
emphasize italicize text.  To center a line of text use 
the center environment:

\begin{verbatim}
\begin{center}
Line of Text 1\\
Line of Text 2\\
\end{center}
\end{verbatim}



This will produce:
\begin{center}
Line of Text 1\\
Line of Text 2\\
\end{center}

\LaTeX has a large number of environments to achieve various effects.
We will see several more

To emphasize   text use 
and \begin{verbatim} \em 
\end{verbatim}

For example,
\begin{verbatim} {\em Emphasis}
\end{verbatim}
produces: {\em Emphasis}

A useful fact is that a backslash followed by a space forces a space.


\subsection{Sections}

To divide your document into sections as is done here, 
at the start of a section you include a line
\begin{verbatim}
 \section{Whatever the title of the section should be}
\end{verbatim}
Subsections can be inserted with a header of:
\begin{verbatim}
 \subsection{Title}
\end{verbatim}
(For 6.852, you will use ``topic'' and ``subtopic'' macros to put
sections in the notes. I will provide these. -Isaac)
\subsection{List of items}
If you wish to include a list of items in the text, one option is
to use the enumerate environment:

\begin{verbatim}
\begin{enumerate}
\item This is the first item in the list
\item I am the second
\item I am last
\end{enumerate}
\end{verbatim}

This will produce the following display:
\begin{enumerate}
\item This is the first item in the list
\item I am the second
\item I am last
\end{enumerate}

\subsection{Figures}

	You will probably need to include figures in your notes.
The way to include a figure is with the figure environment:

\begin{verbatim}
\begin{figure}
  \vspace{1.5in}
  \caption{This is the caption}
\end
\end{verbatim}

This will produce Figure 1 in this document. \LaTeX \ will move figures
around to where it sees fit, which is not always what you want.  You can 
force them to the top or bottom by including {\tt [t] or [b]} at the end
of the first line.
(See the template file for information on drawing pictures with latex. -Isaac)

\begin{figure}
  \vspace{1.5in}
  \caption{This is the caption}
\end{figure}


Two other useful tasks to be accomplished here are 
defining new commands and  theorem-like environments.

Theorem-like environments enable you to format lemmas, theorems, 
conjectures, in nice form such as this:
\begin{theorem}
This is where the statement of the theorem goes.
\end{theorem}
That was accomplished by including in the preamble 
\begin{verbatim}
\newtheorem{theorem}{Theorem}
\end{verbatim}
and then placing in the text:
\begin{verbatim}
\begin{theorem}
This is where the statement of the theorem goes.
\end{theorem}
\end{verbatim}
(All of this is provided in the template file so that the notes look
uniform.)


\section{Math Mode}

	\LaTeX \ has a special mode which produces pretty mathematical
expressions. The simplest manifestation of this is for a single letter;
If you have a graph $G$ it is pleasing to refer to it as $G$ as opposed
to G. You may accomplish this by typing {\tt \$G\$}.
	The pair of \$'s are what delimit math mode.  Expressions
inside are interpreted as math expressions, and text is italicized.

Most greek letters and ugly math symbols have special \LaTeX symbols
that consist of a backslash followed by some word.  I.e. the symbol 
for alpha {\tt ($\alpha$)} is \begin{verbatim}
\alpha
\end{verbatim}

Some other examples are
\begin{verbatim}
$ \forall \ \cap \ \heartsuit \ \oplus $
\end{verbatim}
which produces:

$ \forall \ \cap \ \heartsuit  \ \oplus $

Note that the string of math symbols is surrounded by two 
\$'s.  Anything between the \$`s are interpreted as math
notation.  Note the backslash- space's inserted to cause space between
the symbols.

A list of all of these and many more appears on pp. 40-46 of the \LaTeX \
manual.  These are very important pages.

Other expressions  that you will want are subscripts and superscripts.

To produce $x_{i}$ and $x^{i}$ you type:

\begin{verbatim}
$x_{i}$ and $x^{i}$.
\end{verbatim}

Things can get more complicated:

\begin{verbatim}
$x^{x^{2} + y_{y^{3}}}$
\end{verbatim} yields

$x^{x^{2} + y_{y^{3}}}$

Here are some more examples:

$x^{2} + y_{i} \geq z_{i} \forall \ x^{2}$

$M \oplus M^{*}$ is a matching if $u \in S$.

They were produced by:
\begin{verbatim}
$x^{2} + y_{i} \geq z_{i} \forall \ x^{2}$

$M \oplus M^{*}$ is a matching if $u \in S$.
\end{verbatim}

Finally, there are macros for writing programs, please use them.
An example is given in the template file.

\subsection{Running \LaTeX}

Here's how it should work. Your environment may be slightly
different --- ask a consultant.

After you have edited your file enter {\tt latex filename.tex}. 
If it signals that some of your cross-references are not right,
enter {\tt latex filename.tex} again. 

If you have no errors a .dvi file will be produced, which
can be printed by the command {\mbox {\tt lpr -d filename.dvi}}.
\footnote{If this does not work, 
try {\mbox {\tt dvips -Pprintername filename.dvi}}.}

If you have errors you will be thrown into an interactive mode
with a variety of options you can find out about by typing a 
{\tt ?}.

You may also see what the file looks by using the command
{\tt xdvi filename.dvi}. (This will only work on a machine
that supports xdvi.)

I hope these notes help you get a start in \LaTeX.  Good Luck!

\end{document}


