\documentclass[reqno]{usydthesis}
\usepackage{amsthm}

\author{Andrew Mathas}
\title{Stringing words together\\{\large(with \LaTeX)}}

% pstricks is used in the commutative diagram section
\usepackage{pstricks,pst-node}
\psset{linewidth=0.4pt} % make pstricks lines the same width as TeX's

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\numberwithin{equation}{chapter}

\swapnumbers
\newtheorem{Definition}[equation]{Definition}
\newtheorem{Theorem}[equation]{Theorem}
\newtheorem{Proposition}[equation]{Proposition}
\newtheorem{Lemma}[equation]{Lemma}
\newtheorem{Corollary}[equation]{Corollary}
\newtheorem{Conjecture}[equation]{Conjecture}

\theoremstyle{remark}
\newtheorem{Remark}[equation]{Remark}
\newtheorem{Remarks}[equation]{Remarks}
\newtheorem{Example}[equation]{Example}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% personal macros

% natural numbers, real numbers
\newcommand{\N}{\mathbb{N}}
\newcommand{\R}{\mathbb{R}}

% math operators for End(X) and Hom(X,Y)
\DeclareMathOperator{\End}{End}
\DeclareMathOperator{\Hom}{Hom}

% for f:X -> Y; the default spacing isn't great
\newcommand{\map}[2]{\,{:}\,#1\!\longrightarrow\!#2}

\newcommand{\Prod}{\displaystyle\prod}
\newcommand{\Unix}{\textsc{Unix}}

% finally, change the default labels for enumerate
\renewcommand{\labelenumi}{\arabic{enumi}.}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% you can also suggest to LaTeX how it hyphenate words
\hyphenation{semi-simple direct-ory}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}    % start of the "text" in the document

\pagenumbering{roman}

\maketitle          % creates the title page
\tableofcontents    % creates the table of contents

\chapter*{Introduction}

The aim of this document is to tell you all you need to know to start
using \LaTeX\ to write your fourth year essay. I'll give you the basic
outline of the \LaTeX\ file, a run down of the commands, and a very
brief introduction to writing mathematics using \LaTeX;  at the same
time, show off some of the features of the {\it \LaTeX\ class file}
that I have written for writing fourth year essays (and indeed, theses
in general).

In writing this introduction to \LaTeX\ I've tried to illustrate (by
example) how \LaTeX\ copes with many of the basic problems you'll
encounter when you start to write your essay. This file is not
intended to be a good example of how to set out a document; for
example, there are gratuitous examples of subsections and so on.

I'm not going to tell you everything that you would like to know about
using \LaTeX; however, by the end of this document you will know
enough to start typing --- and where to look to find more information.
I also recommend looking at the source for this document to see how
some things are done (you can get it from the fourth year web page).

\bigskip % leave a space; also \medskip and \smallskip

Typesetting mathematics is second in difficulty only to typesetting
music. Most mathematical papers and books are written using \LaTeX, or
\TeX. The \TeX\ program was written by Donald Knuth specifically for
typesetting mathematics; \LaTeX\ is built on top of \TeX\ with the aim
of taking care of most of the typesetting details for you so that you
can concentrate on the content of whatever you are writing.

In my experience none of the commercial word processing programs can
really cope with complex mathematical expressions such as
$$(-1)^{a_{rL}}q^{b_{rL}}
\frac{\Prod_{1\le s<t\le r}(Q_s-Q_t)^L\ \cdot
      \prod_{1\le s,t\le r}\prod_{\alpha_s\in B_s}
      \prod_{1\le k\le\alpha_s} (q^kQ_s-Q_t)}
     {(q-1)^n(Q_1\dots Q_r)^n
      \Prod_{1\le s\le t\le r}
      \prod_{\substack{(\alpha_s,\alpha_t)\in B_s\times B_t\\
                      \alpha_s>\alpha_t\text{\ if\ } s=t}}
             (q^{\alpha_s}Q_s-q^{\alpha_t}Q_t)}.$$
(As with all of the examples in this document, this comes from a real
live mathematics paper.) This said, a friend of  mine tells me that
programs such as microsoft word are now very good at typesetting
mathematics.

You are welcome to type your fourth year essay using anything you
like; the School only stipulates that your essay must be typed. I
would recommend using \LaTeX, but the choice is yours.

\LaTeX\ (or more accurately, \TeX), is actually an incredibly powerful
(but low level) programming language which gives you complete control
over the look and feel of your document. As a consequence, you can
make it do virtually anything you want from adjusting page margins to
having it compute and print $\pi$ correct to $50$ decimal places (this
would be a silly thing to do, but you could do it if you wished).

The downside to all this flexibility is that \LaTeX\ takes a bit of
effort to learn and, when you're typing it, it does not look nearly as
nice on the screen as something like word; however, the output is
better than that produced by other programs (I think). In particular,
\LaTeX\ is not a wysiwyg language: that is, you don't automatically
see on the screen what you type into a \LaTeX\ document (like, for
example, in word). Rather, \LaTeX\ is an \textit{embedded formatting
language}; that is, you type commands into a file (using an editor),
then process the file using \LaTeX\, and then --- finally --- you can
see what it looks like using either \verb|xdvi| or by printing the
file. For example, to produce the symbol $\alpha$ you actually type
\verb|$\alpha$| into the \LaTeX\ file.

As I said at the start, this introduction is not intended to be a
complete guide to using \TeX\ and \LaTeX; for this you should consult
the many books on \LaTeX\ in the library such as \cite{lamport}
or \cite{companion}. Of these I think that Lamport's
book~\cite{lamport} is probably the most useful. In addition, see the
various short guides available from the fourth year web page.  The
really enthusiastic can also read all about \TeX\ in \cite{TeX}.

\bigskip

Finally, feel free to ask me any questions you might have about
\LaTeX. Also, if there is something that you think the
\verb|usydthesis| package should do but doesn't, or if you have any
suggestions improvements, let me know.

\vspace{10mm}  % a space of a particular size
\hfill\hbox{\begin{tabular}{r@{\qquad}}Andrew Mathas\\May 2002
            \end{tabular}}

% reset the page numbering and change numbering style to arabic
% numbers (we need to start a new page before doing this)
\newpage\setcounter{page}{1}\pagenumbering{arabic}

\chapter{Starting out}
\section{The structure of a \LaTeX\ document}

The basic layout of the \LaTeX\ file for your essay will be
something like the following:

\begin{verbatim}
  \documentclass[BSc]{usydthesis}

  \author{Your name}
  \title{Your essay title}

  \numberwithin{equation}{chapter}
  \newtheorem{Definition}[equation]{Definition}
  \newtheorem{Theorem}[equation]{Theorem}
  \newtheorem{Proposition}[equation]{Proposition}
  \newtheorem{Lemma}[equation]{Lemma}
  \newtheorem{Corollary}[equation]{Corollary}

  \theoremstyle{remark}
  \newtheorem{Remark}[equation]{Remark}
  \newtheorem{Example}[equation]{Example}

  \begin{document}    % start of the "text"

  \maketitle          % the title page
  \tableofcontents    % the table of contents

  \chapter{Introduction} % chapter 1!
  ...
  \end{document}
\end{verbatim}

All of this (and a bit more), is contained in the file
\verb|skeleton.tex| which you can download from the web
page $$\texttt{www.maths.usyd.edu.au/u/mathas/courses/pm4/}.$$

You can probably guess what most of the code above does. The first line is
not obvious: it tells \LaTeX\ to load the class file \verb|usydthesis|
which looks after such things as the title page for the essay. The
\verb|BSc| says that you are doing a Bachelor of science. The
\verb|\newtheorem| commands define \textit{environments} for stating
theorems, propositions and so on; more on this later.

As a general rule, anything  in \TeX\ which begins with a \verb|\| is
a command. Braces \verb|{...}| are used to group things; for example
to put ``a word'' into italics you would type \verb|\textit{a word}|.
Percentage signs \verb|%| are comments: anything after them on the
same line is ignored. (Use \verb|$\backslash$|, \verb|\{| and
\verb|\%| to type \verb|\|, \verb|{| and \verb|%| respectively.)

\section{Taking command}

At the top of your essay (before the \verb|\begin{document}|), you
will probably want to define some \textit{macros}. For example, you
might include the following lines:

\begin{verbatim}
  % natural numbers, real numbers
  \newcommand{\N}{\mathbb{N}}
  \newcommand{\R}{\mathbb{R}}

  % macros for End(X) and Hom(X,Y)
  \DeclareMathOperator{\End}{End}
  \DeclareMathOperator{\Hom}{Hom}

  % for f:X -> Y - the default spacing isn't great
  \newcommand{\map}[2]%
    {\,{:}\,#1\!\longrightarrow\!#2}
\end{verbatim}

Let me explain these. First, unsurprisingly, \verb|\newcommand| is
used to define a new \LaTeX\ command; the new commands
above are called \verb|\N|, \verb|\R|, \verb|\End| and so on. In the
first two macros, \verb|\mathbb| changes the font into the {\it
blackboard font} so that \verb|$\N$| produces $\N$ --- the dollar
signs put  \LaTeX\ into
\textit{math\footnote{\TeX\ was written by an American} mode} which is
necessary because the blackboard fonts only work inside equations.
Similarly, \verb|\DeclareMathOperator| is used to define mathematical
operators; so \verb|$\End(X)$| and \verb|$\End_A(X)$| produce
$\End(X)$ and $\End_A(X)$, respectively.

The last macro is more complicated because it takes two
\textit{arguments}; this accounts for the \verb|[2]| in its
definition. Given this macro you can type \verb|$f\map XY$| to produce
$f\map XY$; or, for a more complicated example,
\verb|$$\varphi\map{\End_A(X)}{\End_A(Y)}$$| to produce
$$\varphi\map{\End_A(X)}{\End_A(Y)}.$$
(The \textit{double dollar signs} tell \TeX\ to display the equation,
centred on a line by itself.) The \textit{braces} are necessary in the
second example because we want \verb|\End_A(X)| and \verb|\End_A(Y)|
each to be treated as a single argument by \verb|\map|. In the first
use of \verb|\map| we could have written \verb|$f\map{X}{Y}$|;
however, the braces are not necessary here so I omitted them.

In the \verb|usydthesis| class file there is also a \verb|\set| macro
for making sets. Its definition is complicated so I am not going to
explain it; however, as it is in the class file you can use it. For
example, you can type \verb!$\set{x\in\R|x^2=1}$!  to produce
$\set{x\in\R|x^2=1}$.

I'm actually departing a little from standard \LaTeX ese above because
\LaTeX\ tries to encourage you to type
\verb!\(...\)! and \verb!\[...\]! for in--text and displayed
mathematics respectively; I don't like this and use the \TeX\
primitives \verb!$...$! and \verb!$$...$$! instead.

Finally, I should remark that there is a \verb|\renewcommand| for
redefining commands which already exist; this is necessary because
\verb|\newcommand| gives an error if the command already exists.  If
this happens, I suggest that you call your command something else.

\section{\TeX ing the document}

For the impatient the basic run down is that you:
\begin{enumerate}
\item Edit the file; say it's called \verb|essay.tex|.
\item Type \verb|latex essay| to \LaTeX\ it.
\item Type \verb|xdvi essay| to preview it on the screen.
\item Type \verb|dvips essay| to print it.
\end{enumerate}
Here, and below, I'm assuming that you are using \Unix. In particular,
when I say \textit{Type} I mean \textit{type at the \Unix\ shell prompt}.

In order to use \TeX\ you must first create a text file which contains
what you want to typeset (i.e.~your essay). There are various editors
available on the School computers; of these the easiest to use is
probably \verb|nedit|. In addition, you will also find \verb|vi| and
\verb|emacs| and their extensions \verb|gvim| and \verb|xemacs|
respectively.

In order to use the \verb|usydthesis| class file \LaTeX\ must be able
to find the file \verb|usydthesis.cls|. This will happen automatically
on the linux machines within the School. From outside the school you
will have to download the class file from the web page
$$\texttt{www.maths.usyd.edu.auu/mathas/courses/pm4/}.$$
If you put a copy of this file  onto the directory containing your
essay everything should work fine. (You can borrow an installation CD
from Robert Pearson if you are interested in putting \TeX\ onto your
computer; if you are using Linux then \TeX\ should already be
installed.)

When you first start working with \LaTeX\ you are often going to find that
\verb|essay.tex| contains errors. The most common errors are due to
\textit{missing braces} or \textit{missing dollar signs}; these must always
occur in matching pairs. As with all programs, \LaTeX's error messages
are sometimes informative; however, most of the time they tend
to be slightly cryptic and the errors can take some time to track down
and fix. When in doubt, just press \verb|r| (for ``run'') and \LaTeX\
will skip over all of the errors (if it can) and then you can look
at the file using \verb|xdvi| which will often help you spot the
mistake.

The best strategy is to \LaTeX\ the file often so that not so much
changes between \TeX ing; this helps you isolate the errors. After a
bit of practise you'll find that most of the time the document \TeX s
first time.

Finally, in order to save paper, you shouldn't print the file too
often.

\subsection{System caveats}

The following comments only apply if you are using \Unix. If you have
a PC then you may have an editor which combines the edit--latex--xdvi
cycle. Actually, it is also possible to do this using \Unix\ editors;
but I've never thought it worth the trouble.

\subsubsection{xdvi}

Rather than typing ``\verb|xdvi essay|'' as above you are much better
off typing ``\verb|xdvi essay &|'' as this way xdvi runs in
background; as a consequence, you will still be able to type commands
into the \Unix\ shell window. Better still, put the line
$$\verb|alias xdvi 'xdvi \!* &'|$$
into your \verb|.cshrc| file and you can just type
``\verb|xdvi essay|'', but with this added functionality. Actually,
you can do better than this; I have \verb|xdvi| aliased to something
like
$$\verb|alias xdvi 'xdvi -s 6 -geo 540x890-0+0 \!* &'|$$
For a complete description of the options to \verb|xdvi| see the
\Unix\ manual page (i.e.~type \verb|man xdvi|).

\subsubsection{dvips}
All of the options to \verb|dvips| are again described in the manual.
If you type \verb|dvips --help| you'll see a compact listing of all of
these options. The most useful option is \verb|-pp|; for
example, if you type
$$\verb|dvips -pp 3-5,16 essay|$$
then \verb|dvips| will only print only pages 3--5 and page 16 of
\verb|essay.tex|. Another useful variant is the alias
$$\verb@alias dvim 'dvips -f \!* | mpage -2'@.$$
which will make \verb|dvim essay| print your essay with two pages to a
page.

\section[Long titles]%
{How to cope with really long section (or chapter) titles that go on
and on and on and on and never seem to stop}

There is no real problem in using long titles. The only thing that you
need to keep in mind is that such titles will be too long for the
running headers at the top of the page. To get around this the
commands \verb|\chapter|, \verb|\section| $\dots$ all take an
optional argument which defines a shorter title to be used by
the headings. The syntax is
$$\verb|\chapter[short title]{Long title}|.$$
For example, the running header on this page is ``Long titles'' rather
than the long title of the section.

(The running header on even numbered pages is the title of the chapter
and on odd numbered pages it is the title of the section.)

\chapter{Typing mathematics}

I'm not going to give an in depth tutorial on how to type mathematics
using \TeX; for this see \cite{lamport,TeX,companion}. The basics are
that:
\begin{enumerate}
\item[$\bullet$]
Mathematics that appears in the middle of text is typed in
between dollar signs: \verb|$...$| --- or \verb|\(...\)|.
\item[$\bullet$]
Equations that you want displayed on a separate line are typed in
between double dollar signs: \verb|$$...$$| --- or \verb|\[...\]|.
\item[$\bullet$]
Groups of symbols etc.~are treated as a single entity by enclosing
them in between \textit{matching} braces: \verb|{...}|.
\item[$\bullet$]
Subscripts are done using an underscore \verb|_| and superscripts using
a caret \verb|^|; for example, to write $\sum_{i=1}^n$ you type
\verb|$\sum_{i=1}^n$|. Note that the subscript $i=1$ is surrounded by
matching braces; you could also write \verb|^{n}| rather than
\verb|^n| but there is no need.
\item[$\bullet$]
Mathematics symbols have names like
\verb|\alpha|$=\alpha$, \verb|\oplus|$=\oplus$,
\verb|\dots|$=\dots$ and so on. For a reasonably complete list see
the ``list of \TeX\ symbols'' link on the fourth year web page.
\end{enumerate}

The next few sections describe how to align equations in \LaTeX;
actually, I'm going to describe various commands provided by some
A.M.S.\footnote{American Mathematical Society} packages; these are
loaded for you by the \verb|usydthesis| class file.

\section{Mathematical alignment}

One way to align equations is to use the \verb|align| environment.
\textit{Environments} are \LaTeX's way of grouping large blocks of
text; they always take the form \verb|\begin{align}...\end{align}|.

For example if you wanted to write
\begin{align*}
(v,v)&=(a\alpha_r+b\alpha_s,a\alpha_r+b\alpha_s)
      =a^2-2ab\cos(\frac\pi m)+b^2\\
     &=\begin{cases}
        \big(a-b\cos(\frac\pi m)\big)^2+b^2\sin^2(\frac\pi m),
                    &\text{if\ } m<\infty,\\
            (a-b)^2,&\text{otherwise}.
       \end{cases}
\end{align*}
then you could type
\begin{verbatim}
  \begin{align*}
  (v,v)&=(a\alpha_r+b\alpha_s,a\alpha_r+b\alpha_s)
        =a^2-2ab\cos(\frac\pi m)+b^2\\
       &=\begin{cases}
           \big(a-b\cos(\frac\pi m)\big)^2
                 +b^2\sin^2(\frac\pi m),
                      &\text{if $m<\infty$},\\
              (a-b)^2,&\text{otherwise}.
         \end{cases}
  \end{align*}
\end{verbatim}

A few comments. First, \verb|&| is used to mark where you want the
equations aligned and \verb|\\| is used to mark the end of a line.

Next, I have actually used the \verb|align*| environment here and not
the \verb|align| environment; without the star these equations  (each
line of them in fact) would also be given an equation number. As a
general rule, in \LaTeX\ the star forms of commands suppress (equation)
numbers. For a second example, see the \verb|\chapter*{Introduction}| in
the introduction to this document.

Next, if you just type \textit{text} in mathematics it doesn't come out
the way you would like it to; compare ``$if m<\infty$'' with
``$\text{if\ }m<\infty$ which was produced with
\verb|$\text{if\ }m<\infty$|.  The way to insert text into equations
is to use the \verb|\text| command; this command is also provided by
the A.M.S. packages. Note that above we have \verb|\text{if\ }|; the
\verb*|\ | in the \verb|\text| is to put a space between the ``if''
and what follows after it. The \verb|\text| command is also
intelligent enough to use the correct font.

Another command in the example above is \verb|\frac|; as you see this
produced fractions. The general usage is \verb|\frac{A}{B}| where, as
usual, the braces can be omitted when ``A'' or ``B"' is only a single
character or command. Another interesting command is \verb|\big| which
makes the following bracket bigger. There are also \verb|\bigg|,
\verb|\Big| and \verb|\Bigg| variants; each of these can be applied to
any delimiters: for example, to \verb|(|, \verb|)|, \verb|[|,
\verb|]|, \verb|\{| and \verb|\}|.

Finally, the \verb|cases| environment is also used above. Notice that
\verb|cases| environment also aligns formulae and that the ampersands
in the cases environment do not affect the outer
\verb|align*| environment.

Similarly, there is also an \verb|alignat| environment which is useful
for putting comments after your equations. For example, to produce

\begin{xalignat}{2}
(T_s-q)(T_s+1)&=0, &&\text{for\ } s\in S,\\
(T_rT_s\dots)_{m_{rs}}&=(T_sT_r\dots)_{m_{rs}},
           &&\text{for\ } r\ne s\in S,
\end{xalignat}
you could type
\begin{verbatim}
  \begin{xalignat}{2}
  (T_s-q)(T_s+1)&=0, &&\text{for\ } s\in S,\\
  (T_rT_s\dots)_{m_{rs}}&=(T_sT_r\dots)_{m_{rs}},
             &&\text{for\ } r\ne s\in S,
  \end{xalignat}
\end{verbatim}
This time I have used the \verb|alignat| environment rather than its
*--form; hence the equation numbers. For a description of these two
environments see the ``Introduction to AMSLaTeX'' on the web page.

\section{Intertext} You can actually accomplish the alignments above
using \LaTeX's arrays; however, there is a feature (which I like a
lot) in the A.M.S.~alignment environments which allows you to
insert lines of text in between equations without losing the alignment.
This is done with the \verb|\intertext| command. For example, to achieve
\newcommand{\res}{\operatorname{res}}
{\it\begin{align*}
f_{us}T_i&=\begin{cases}
    \frac{(q-1)\res_t(i)}{\res_t(i)-\res_{s}(i)}f_{us}
       +f_{ut},& \text{if\ } s\unrhd t,\\[5pt]
    \frac{(q-1)\res_t(i)}{\res_t(i)-\res_{s}(i)}f_{us}
    +\frac{(q\res_s(i)-\res_t(i))(\res_s(i)-q\res_t(i))}
         {(\res_t(i)-\res_{s}(i))^2}f_{ut},& \text{if\ } t\unrhd s.
   \end{cases}\\
\intertext{If $t$ is not standard then}
f_{us}T_i&=\begin{cases}
  qf_{us}, &\text{if $i$ and $i+1$ are in the same row of $s$},\\
  -f_{us}, &\text{if $i$ and $i+1$ are in the same column of $s$.}
\end{cases}\end{align*}}
you would type the following
{\small\begin{verbatim}
  \begin{align*}
  f_{us}T_i&=\begin{cases}
    \frac{(q-1)\res_t(i)}{\res_t(i)-\res_{s}(i)}f_{us}
      +f_{ut},& \text{if\ } s\unrhd t,\\[5pt]
    \frac{(q-1)\res_t(i)}{\res_t(i)-\res_{s}(i)}f_{us}
  +\frac{(q\res_s(i)-\res_t(i))(\res_s(i)-q\res_t(i))}
       {(\res_t(i)-\res_{s}(i))^2}f_{ut},& \text{if\ }
         t\unrhd s.
   \end{cases}\\
  \intertext{If $t$ is not standard then}
  f_{us}T_i&=\begin{cases}
    qf_{us}, &\text{if $i$ and $i+1$ are
                      in the same row of $s$},\\
    -f_{us}, &\text{if $i$ and $i+1$ are
                      in the same column of $s$.}
  \end{cases}\end{align*}
\end{verbatim}}

Note that the two equals signs match up and that line in between the
two equations (which is typed inside the \verb|\intertext{...}|), is
flush with the left margin. I agree that this isn't pretty, but that's
how it's done.

\section{Bold statements}\label{theorems}

The file \verb|skeleton.tex| contains a number of
lines of the form
$$\verb|\newtheorem{Theorem}[equation]{Theorem}|.$$
For a description of what this is really doing again see the
AMS\LaTeX\ introduction on the web page.  These commands all
create ``theorem like'' environments. For example,

\begin{Theorem}[Fermat with some help from Wiles]\leavevmode\newline
\label{Fermat}
Suppose that $n$ is a positive integer such that $a^n+b^n=c^n$ for some
positive integers $a,b$ and $c$. Then either $n=1$ or $n=2$.
\end{Theorem}

\begin{proof} Damn, I should have made the margins bigger.
%\marginpar{Actually, the margin is not that small\dotfill}
\end{proof}

\noindent was produced by the \LaTeX\ source

\begin{verbatim}
  \begin{Theorem}
  [Fermat with some help from Wiles]
  \leavevmode\newline
  \label{Fermat}
  Suppose that $n$ is a positive integer such that
  $a^n+b^n=c^n$ for some positive integers $a,b$
  and $c$.  Then either $n=1$ or $n=2$.
  \end{Theorem}

  \begin{proof}
  Dam, I should have made the margins bigger.
  \end{proof}
\end{verbatim}

A couple of points. The ``Fermat with some help from Wiles'' is an
optional argument to the theorem environment; you can leave it out.
The proof environment produces both the initial ``Proof'' and the
square which ends the proof. It took me quite a while to work out how
to make \LaTeX\ start a new line after the Wiles (most things you try
give an error message). This trick is accomplished by
\verb|\leavevmode\newline|.

For the meaning of \verb|\label{Fermat}| see
section~\ref{cross referencing}.

Finally, for definitions I recommend using
\textsf{sans serif fonts}; these are made with
\verb|\textsf{sans serif fonts}|.

\section{Cross referencing}
\label{cross referencing}

\LaTeX\ provides \verb|\ref| and \verb|\label| commands for cross
referencing. To refer to Fermat's Theorem~\ref{Fermat} above one simply
types \verb|\ref{Fermat}|. This works because of the
\verb|\label{Fermat}| inside the theorem environment. In a similar way
I produced the ``section~\ref{cross referencing}'' at the end of
section~\ref{theorems}. When you insert a new label you must \LaTeX\
the document twice before it will have any effect. (Note:
\verb|\ref{...}| does \textit{not} print ``Theorem \ref{Fermat}'';
only \ref{Fermat}!)

There is a similar mechanism for citing references. At the end of
this file you will find a bibliography section. \LaTeX\ has an
automatic way of citing references. For example,  to refer
to the \TeX book in the bibliography I type \verb|\cite{TeX}|. The
\textit{key} used by the command \verb|\cite| is the first argument
of the corresponding \verb|\bibitem| command in the bibliography. For
more details see \cite{lamport}. The more adventurous might also want
to look at Bib\TeX.

\section{Commutative diagrams and pictures}

The easiest way that I know of to do (general) commutative diagrams or
pictures is to use the \verb|pstricks| package. To learn how to use
this you'll have to read the documentation which can be found in
{\small
  $$\verb|/usr/local/texlive6/texmf/source/generic/pstricks/doc/|.$$
}
To use \verb|pstricks| you need the line
\verb|\usepackage{pstricks}| at the top of your document; some parts
of \verb|pstricks| also require you to load other packages (see the
documentation). I'll give one example. The commutative diagram
$$%\begin{array}{c}\\[-6pt]
\psmatrix[colsep=1cm,rowsep=1cm]
  F_k   & F_k \\
  F^+_k & F^+_k
  \psset{nodesep=3pt,arrows=->}
  \everypsbox{\scriptstyle}
  \ncline{1,1}{1,2}^{\mathcal V_m}
  \ncline{2,1}{2,2}_{\mathcal V^+_m}
  \ncline{1,2}{2,2}\trput{\Theta}
  \ncline{1,1}{2,1}\tlput{\Theta}
\endpsmatrix\\[5pt]
$$%\end{array}$$
was created using the \verb|pstricks| commands
\begin{verbatim}
  $$\begin{array}{c}\\[-6pt]
  \psmatrix[colsep=1cm,rowsep=1cm]
    F_k   & F_k \\
    F^+_k & F^+_k
    \psset{nodesep=3pt,arrows=->}
    \everypsbox{\scriptstyle}
    \ncline{1,1}{1,2}^{\mathcal V_m}
    \ncline{2,1}{2,2}_{\mathcal V^+_m}
    \ncline{1,2}{2,2}\trput{\Theta}
    \ncline{1,1}{2,1}\tlput{\Theta}
  \endpsmatrix\\[5pt]\end{array}$$
\end{verbatim}
All that is happening here is that the \verb|psmatrix| command sets up
a matrix and later commands refer to the coordinates of this matrix;
\verb|pstricks| calls these coordinates ``nodes'' and to use them you
also need the \verb|pst-node| package (so you'd have
\verb|\usepackage{pstricks,pst-node}| at the top of your document).

In the example above the arrows are either horizontal or vertical;
however, they don't have to be. For example, to draw a dotted arrow
from $F_k$ to $F^+_k$ you just add the line
\verb|\ncline[linestyle=dashed]{1,1}{2,2}|
to the diagram above.

\section{Tying things together}

\TeX\ occasionally breaks lines so that a single (mathematical)
character begins a new line; this doesn't look so good. You can force
\TeX\ to tie two characters together using \verb|~|. For example, if
you want to ensure that a line break does not occur in the middle of
``an $X$'' you would type \verb|an~$X$|.

\section{Extra p's and q's}

When we mark your essay, in addition to the mathematics in your essay
being correct we would also like to read well constructed and
grammatically correct sentences! Correct spelling and punctuation
throughout are also much appreciated by the markers. Proof reading is
a hard job, so there are bound to be some typos; however, spelling
mistakes shouldn't appear in your essay because there are various
programs available for checking spelling. For example, try
\verb|ispell -t essay.tex|; this program ignores some (but
unfortunately not all) \LaTeX\ commands.

You can also try \verb|~mathas/bin/same essay.tex|; this will find any
repeated words in your document.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\appendix
\chapter{Including files}

As fourth year essays are not very long (usually around 40--60 pages),
you can get away with putting the whole document into a single file;
however, you may find it easier to break the document up into separate
files; for example, having one file for each chapter.

The easiest way to do this is to have a \textit{main} file, which is
essentially the \verb|skeleton| file we started with, together
with any macros you define and any other general formatting
commands. Let's suppose that the main file is still called
\verb|essay.tex| and that in addition we also have
\verb|intro.tex|, \verb|chapt1.tex| and so on for the chapters.
The file \verb|essay.tex|  will look something like the
following:
\begin{verbatim}
  \documentclass[BSc]{usydthesis}

  \author{Your Name}
  \title{Your title}

  % theorem definitions, macros etc
  ....

  \begin{document}    % start of the "text"
  \maketitle          % creates the title page
  \tableofcontents    % table of contents

  \pagenumbering{roman}
  \include{intro}

  \newpage
  \setcounter{page}{1}\pagenumbering{arabic}
  \include{chapt1}
  ...

  \end{document}

\end{verbatim}

\noindent
The chapters are included using \verb|\include{...}|.
Each of the chapter files would start very simply; for example,
\verb|intro.tex| might begin as follows:

\begin{verbatim}
  \chapter*{Introduction}
  Typesetting mathematics is second in difficulty
  only to typesetting music. Most mathematical
  papers and books are written using \LaTeX, an
  extension of \TeX, which is a program which was
  written by Donald Knuth specifically for
  typesetting mathematics.
\end{verbatim}

\noindent
To \LaTeX\ the essay you type \verb|latex essay| as before (typing
\verb|latex intro| will generate an error message because most of the
formatting information for \verb|intro.tex| is contained in
\verb|essay.tex|). \LaTeX\ will find all of the chapters and also
keep track of things like page and chapter numbering for you
automatically this way.

Finally, there is also an \verb|\includeonly| command which
tells \LaTeX\ to only include certain chapters. For example,
if you put
$$\verb|\includeonly{chapt2}|$$
at the top of \verb|essay.tex| then \LaTeX\ would only process the
contents of chapter 2; however, \LaTeX\ still remembers the
page numbers and the referencing information for the other chapters.
This is very useful if your document is quite large and you are only
working on a small piece of it.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter{Class file options}

\section{What to do if you're not pure}

By default the \verb|usydthesis| class file assumes that you are a
student in Pure Mathematics. You can also use it if you are doing a
Bachelor of arts. For example, if you're in applied (doing a
bachelor of arts) or statistics (doing a bachelor of science)  then
you can tell the package this by modifying the \verb|documentclass|
statement at the top of the \TeX\ file as follows:

\verb|\documentclass[BA,applied]{usydthesis}|

\verb|\documentclass[BSc,stats]{usydthesis}|

\section{Staying in the past}

In a similar way, if you want to set the ``publication'' date of your
essay (see the title page) then you should redefine \verb|\Today|
before \verb|\maketitle| is called in the preamble. For example, you
might want

\verb|\renewcommand{\Today}{October 1342}|

\section{Changing times}

By default \verb|usydthesis| uses the {\it times} fonts as I think
that these look a little better than the {\it computer modern fonts}
which come with \TeX. There is a \verb|notimes| option to the class
file just in case you don't want to use these fonts. For example, if
you are in statistics you would call \verb|usydthesis| with the
following line.

\verb|\documentclass[BA,stats,notimes]{usydthesis}|

\section{Indoctrination}

The class file also allows for masters and Ph.D.'s. For example,

\verb|\documentclass[PhD]{usydthesis}| Ph.D.

\verb|\documentclass[MA]{usydthesis}| Master of Arts

\verb|\documentclass[MPhil]{usydthesis}| Master of Philosophy

\verb|\documentclass[MSc]{usydthesis}| Master of Science

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{thebibliography}{10}

\bibitem{BM:redwds}
{\sc K.~Bremke and G.~Malle}, {\em Reduced words and a length
  function for {$G(e,1,n)$}}, Indag. Math., {\bf 8} (1997), 453--469.

\bibitem{CR}
{\sc C. W. Curtis and I. Reiner},
\textit{Representation Theory of Finite Groups and Associative Algebras},
Interscience, New York, 1962.

\bibitem{DJ:Schur}
{\sc R.~Dipper and G.~James}, {\em The $q$--{Schur} algebra},
   Proc. L.M.S. (3), {\bf 59} (1989), 23--50.

\bibitem{DJ:qWeyl}
\leavevmode\vrule height 2pt depth -1.6pt width 23pt, {\em $q$--{Tensor} space
  and $q$--{Weyl} modules}, Trans. A.M.S., {\bf 327} (1991), 251--282.

\bibitem{companion}
{\sc M.~Goossens et.~al},
\textit{The Latex companion}, Addison-Wesley, USA, 1994.

\bibitem{TeX}
{\sc D.~E.~Knuth}, \textit{The \TeX Book}, Addison-Wesley, USA, 1988

\bibitem{lamport}
{\sc L.~Lamport}, \textit{\LaTeX: A document preparation system},
Addison--Wesley, USA, 1986.

\end{thebibliography}

\end{document}
