%% ================================================================%%
%% latextips.tex - template for an honors thesis in mathematics %%
%% ================================================================%%
%% Save this page to a file named "latextips.tex" %%
%% ================================================================%%
\documentclass[12pt]{report}
% Import standard math macro packages
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{amsfonts}
% Import graphics package
\usepackage{graphics}
% Declare theorem types.
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem*{uconj}{Uniform Boundedness Conjecture}
\theoremstyle{definition}
\newtheorem{definition} [theorem] {Definition}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{example} [theorem] {Example}
\newtheorem{remark} [theorem] {Remark}
% Set margins and spacing. THESE DO NOT FIT THESIS REGULATIONS!!!!
\setlength{\evensidemargin}{0in}
\setlength{\oddsidemargin}{0in}
\setlength{\textwidth}{6.5in}
\setlength{\topmargin}{0in}
\setlength{\textheight}{9in}
\setlength{\footnotesep}{14pt}
% User-defined macros.
\newcommand{\C}{{\mathbb{C}}}
\newcommand{\F}{{\mathbb{F}}}
\newcommand{\N}{{\mathbb{N}}}
\newcommand{\Q}{{\mathbb{Q}}}
\newcommand{\PP}{{\mathbb{P}}}
\newcommand{\R}{{\mathbb{R}}}
\newcommand{\Z}{{\mathbb{Z}}}
\newcommand{\cF}{{\mathcal{F}}}
\newcommand{\cK}{{\mathcal{K}}}
\newcommand{\fp}{{\mathfrak{p}}}
\newcommand{\Cp}{\C_p}
\newcommand{\Cv}{\C_v}
\newcommand{\Dbar}{\overline{D}}
% User-defined math operators. Add, subtract, modify as you wish.
\DeclareMathOperator{\Tr}{Tr}
\DeclareMathOperator{\curl}{curl}
\DeclareMathOperator{\divop}{div}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Just for this tutorial file, I needed the
% typewriter-text backslash, curly brackets,
% quotes, double quote, and tilde symbols, to
% display LaTeX commands nicely. You almost
% certainly % will NOT need the following macros
% for a math thesis.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\bsl}{\texttt{\symbol{92}}}
\newcommand{\lbr}{\texttt{\symbol{123}}}
\newcommand{\rbr}{\texttt{\symbol{125}}}
\newcommand{\lqu}{\texttt{\symbol{18}}}
\newcommand{\rqu}{\texttt{\symbol{13}}}
\newcommand{\dqu}{\texttt{\symbol{34}}}
\newcommand{\til}{\texttt{\symbol{126}}}
%%%%%%%%%%%%%%%%%%%%%
% Let's get started %
%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{center}
{\Huge Some Tips and Tricks for Using LaTeX
in Math Theses}
\vspace{0.2in}
{\Large by Rob Benedetto}
\end{center}
\vspace{0.5in}
\section*{How to Use the files
\texttt{samplethesis.tex}, \texttt{thesis.tex},
and \texttt{latextips.tex}}
{\LARGE WARNING!!!!} This document (\texttt{latextips.tex})
is {\Large \textbf{NOT}}
a good model to build a math thesis from. The margins
are wrong, the spacing is wrong, and the style of
writing is far too colloquial. (For example, you
should avoid contractions and the pronouns
``I'' and ``you,'' avoid using quotation marks
unless you're actually \emph{quoting} something,
minimize the use of parenthetical
comments and the word ``so,'' and generally use
a more formal writing style than you'll find in
this \texttt{latextips.tex} document.)
Instead, you should use the file \texttt{samplethesis.tex} as
a model for your thesis. That file has all the margins
and spacing set properly, and it is written in a style
appropriate for a math thesis. To actually write your
own thesis, start with the file \texttt{thesis.tex},
which has all the correct structure and formatting commands
you will need but no written content.
Still, I hope you will find this \texttt{latextips.tex}
document useful as well. It is intended to give suggestions
for how to use LaTeX effectively, to give a wider variety
of examples of LaTeX tricks than appeared in \texttt{samplethesis.tex},
and to explain some of the inner workings of \texttt{samplethesis.tex}
and \texttt{thesis.tex}.
That is, you should use \texttt{thesis.tex} for its structure,
\texttt{samplethesis.tex}
and
\texttt{samplethesis.pdf}
as an example,
and \texttt{latextips.tex} and \texttt{latextips.pdf} for advice.
I'd recommend you look not only at the three raw \texttt{.tex} files,
but also at the LaTeX-ed and printed documents they generate. There are
a lot of little tricks and techniques embedded in them,
and you should familiarize yourself with both the raw LaTeX
code and the resulting printed display. Quite a few of those
tricks, like how to make the double-bar norm symbols
$\|\cdot\|$ that appear later, are not explicitly mentioned
in the text of this document, so be ready to scroll back
through the \texttt{.tex} file to learn how some symbol was
generated.
Of course, there's much more to LaTeX than what
you'll find here; so
get yourself a good LaTeX book, such as
G.~Gr\"{a}tzer,
\emph{Math into LaTeX,} 3rd ed.,
Birkh\"{a}user, Boston, 2000.
There are online sources, too.
For example, the LaTeX Wikibook may be found at
\begin{verbatim}
http://en.wikibooks.org/wiki/LaTeX
\end{verbatim}
More links to a number of online LaTeX manuals and tutorials at
\begin{verbatim}
http://www.tug.org/interest.html#latexmanuals
\end{verbatim}
\chapter{Some LaTeX Examples}
\label{ch:latex}
First,
a quick comment that can only go here,
even though it is topically out of place:
if I put a Subsection here (before the first Section
of a Chapter), I get a weird number, like this:
\subsection{Subsection Numbers Involving Zero}
See, it looks strange to refer implicitly
to Section Zero.
The same thing happens\footnote{That's because
I numbered Theorems by Section in \texttt{samplethesis.tex}.
You'd also get zeros if for some reason
you put a Theorem
before Chapter~1,
even if you number your
Theorems by Chapter.}
with Theorems (or Definitions, etc.)
appearing before
the first Section of a Chapter;
see, e.g.,
Theorem~1.0.1 in \texttt{samplethesis.tex}.
Avoid numbering involving zeros in a thesis.
\section{Math Commands}
\label{sec:math}
Multiline equations
can be generated with the \texttt{align*} environment,
using \texttt{\&} for alignment points and column breaks,
and \texttt{\bsl\bsl} for newlines:
\begin{align*}
\psi_i(\log r) & =
(p^i + 1) \log\|f\|_{\nu(x,r)} -
2p^i ( \log r + \log \|f'\|_{\nu(x,r)} )
\\
& = (1 - p^i) \log\|f\|_{\nu(x,r)} - 2p^i \log \delta(f,\nu(x,r))
\\
& \geq \log\|f\|_{\nu(x,r)} - p^i \Delta(f,\nu(x,r)).
\end{align*}
If you want labels on that kind of equation, try the
\texttt{align} environment.
\begin{align}
\log \|f\|_{\nu(x,\tilde{R})}
& \geq \log \|f\|_{\nu(x,R'')}
+ \frac{2p}{p - 1}
[\delta(r,\nu(x,R'')) - \delta(r,\nu(x,\tilde{R}))]
\notag \\
\label{eq:neato}
& \geq
\frac{1}{p - 1}
\left[ p \log |\alpha| + 2 p \log \mu - \log \|f\|_{\nu(x,R'')} \right].
\end{align}
Note that since I only wanted the second line, and not both lines,
of inequality~\eqref{eq:neato} to have a label, I used
the \texttt{\bsl notag} command
in the \texttt{.tex} file on the first line.
You can refer to labelled equations,
like equation~\eqref{eq:neato} or sequence~\eqref{eq:orbit},
from anywhere in the paper, even before they appear.
But make sure to use
\texttt{\bsl eqref}
rather than
\texttt{\bsl ref} when referencing equations;
\texttt{\bsl ref} gives us
equation~\ref{eq:neato} rather than the nicer
equation~\eqref{eq:neato}.
If you want just a regular one-line displayed equation labelled,
use the \texttt{equation} environment. For example,
here's a sequence of ones and zeros.
\begin{equation}
\label{eq:orbit}
\underbrace{0,\ldots,0}_{m_0},
\underbrace{1,\ldots,1}_{M_1},
\underbrace{0,\ldots,0}_{m_1},
\underbrace{1,\ldots,1}_{M_2},
\underbrace{0,\ldots,0}_{m_2},
\ldots.
\end{equation}
For matrices, use the \texttt{matrix} environment,
again using
\texttt{\&} for column breaks
and \texttt{\bsl\bsl} for newlines.
Use
\texttt{\bsl left} and
\texttt{\bsl right} to make brackets big enough to fit
around whatever is between them.
Use
\texttt{\bsl cdots},
\texttt{\bsl vdots}, and
\texttt{\bsl ddots} to get various directions of dots:
$$
A=\left(
\begin{matrix}
1 & 1 & \cdots & 1
\\
x_1 & x_2 & \cdots & x_n
\\
x_1^2 & x_2^2 & \cdots & x_n^2
\\
\vdots & \vdots & \ddots & \vdots
\\
x_1^{n-1} & x_2^{n-1} &\cdots & x_n^{n-1}
\end{matrix}
\right),
\quad
\langle \mathbf{a}, \mathbf{b} \rangle
= \mathbf{a}^T \left[
\begin{matrix} 1 & 2 \\ 3 & 4 \end{matrix}
\right] \mathbf{b},
\quad
\text{and}
\quad
\nabla \times \vec{F} = \left|
\begin{matrix}
\vec{i} & \vec{j} & \vec{k}
\\
\frac{\partial}{\partial x} &
\frac{\partial}{\partial y} &
\frac{\partial}{\partial z}
\\
P & Q & R
\end{matrix}
\right|.$$
If you want,
you can skip typing out the
\texttt{\bsl left(} and
\texttt{\bsl right)} parentheses commands
for matrices by
replacing the \texttt{matrix} environment with
\texttt{pmatrix} for regular (round) parentheses,
\texttt{bmatrix} for square brackets,
\texttt{vmatrix} for vertical lines,
\texttt{Vmatrix} for double vertical lines, or
\texttt{Bmatrix} for curly brackets.
For example,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Remember that we ourselves defined
% \Tr in the preamble!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$$\Tr
\begin{pmatrix}
1 & 0 & -4 \\
-2 & 5 & 1 \\
-1 & -1 & 8
\end{pmatrix}
= 1 + 5 + 8 = 14,
$$
and
$$
\det
\begin{bmatrix}
1 & 1 & \cdots & 1
\\
x_1 & x_2 & \cdots & x_n
\\
x_1^2 & x_2^2 & \cdots & x_n^2
\\
\vdots & \vdots & \ddots & \vdots
\\
x_1^{n-1} & x_2^{n-1} &\cdots & x_n^{n-1}
\end{bmatrix}
=
\begin{vmatrix}
1 & 1 & \cdots & 1
\\
x_1 & x_2 & \cdots & x_n
\\
x_1^2 & x_2^2 & \cdots & x_n^2
\\
\vdots & \vdots & \ddots & \vdots
\\
x_1^{n-1} & x_2^{n-1} &\cdots & x_n^{n-1}
\end{vmatrix}
= \prod_{1\leq i < j\leq n} (x_j-x_i) .
$$
You can use
\texttt{\bsl left(}
and
\texttt{\bsl right)}
(or
\texttt{\bsl left[}
and
\texttt{\bsl right]},
or
\texttt{\bsl left\bsl\lbr}
and
\texttt{\bsl right\bsl\rbr},
or
\texttt{\bsl left|}
and
\texttt{\bsl right|},
or even
\texttt{\bsl left(}
and
\texttt{\bsl right]}--- they don't have to match)
to make brackets around any clump of math symbols.
But sometimes you may
want big but not huge brackets. For example, the parentheses
around
$$\left( \sum_{\substack{ 1\leq i \leq n \\ i\neq 5}} i^2 \right)^3
\qquad\text{and}\qquad
(\sum_{\substack{ 1\leq i \leq n \\ i\neq 5}} i^2)^3$$
are way too big and way too small, respectively.
Instead, the expression
$$\bigg(\sum_{\substack{ 1\leq i \leq n \\ i\neq 5}} i^2\bigg)^3$$
looks much better, even if the
subscript sticks out the bottom a little.
You can make parentheses like these, anywhere from
one to four specific sizes bigger, using the
\texttt{\bsl big},
\texttt{\bsl Big},
\texttt{\bsl bigg}, or
\texttt{\bsl Bigg} commands just before the parentheses.
For integrals, try using
the \texttt{\bsl,} spacing command to get just the
right amount of space before the $dx$ (or in this case, $d\theta$):
$$L_{\C}(r)= r\int_0^{2\pi} f^{\#}(r e^{i\theta}) \,d\theta
\quad\text{instead of}\quad
L_{\C}(r)= r\int_0^{2\pi} f^{\#}(r e^{i\theta}) d\theta.$$
For multiple integrals, you can do
$$\iint_S (\curl\vec{F}) \cdot d\vec{S} = \oint_C \vec{F}\cdot d\vec{r}
\qquad \text{or} \qquad
\iiint_E \divop \vec{G}(x,y,z) dV
=\iint_S \vec{G}\cdot d\vec{S},$$
but if you want iterated multiple integrals, just use
\texttt{\bsl int} multiple times:
$$\int_0^1 \int_0^{1-x} \int_0^{1-x-y^2}
\frac{dz \, dy \, dx}{x\sin(yz) + 3}.$$
As you may have noticed, for certain symbols like sums and products,
LaTeX treats subscripts and superscripts differently in
displayed versus in-line mathematics.
For example,
$$\int_a^b f(x)\, dx = \lim_{n\to\infty} \sum_{i=1}^n f(x_i) \Delta x_i.$$
becomes
$\int_a^b f(x)\, dx = \lim_{n\to\infty} \sum_{i=1}^n f(x_i) \Delta x_i$
in in-line math mode, so that it will fit vertically.
You can use the \texttt{\bsl displaystyle} command
to get
$\displaystyle
\int_a^b f(x)\, dx = \lim_{n\to\infty} \sum_{i=1}^n f(x_i) \Delta x_i$
in in-line math mode.
But either way, if an in-line math equation is too big,
it can make the paragraph hard to read.
Big equations should be displayed.
The same sizing issue comes up with fractions, even in displayed math.
For example,
$$\lim_{h\to 0} \frac{\frac{x+h+2}{(x+h)^2} - \frac{x+2}{x^2}}{h}
\quad
\text{and}
\quad
f(x,y) = \begin{cases}
\frac{x^2 + 3xy^2}{x^2 + y^2} & \text{if } (x,y)\neq (0,0)
\\
0 & \text{if } (x,y)=(0,0)
\end{cases}
$$
have tiny, unreadable fractions. You can force those fractions
to be bigger by using \texttt{\bsl dfrac}
instead of \texttt{\bsl frac}, to obtain
$$\lim_{h\to 0} \frac{\dfrac{x+h+2}{(x+h)^2} - \dfrac{x+2}{x^2}}{h}
\quad
\text{and}
\quad
f(x,y) = \begin{cases}
\dfrac{x^2 + 3xy^2}{x^2 + y^2} & \text{if } (x,y)\neq (0,0)
\\
0 & \text{if } (x,y)=(0,0).
\end{cases}
$$
Here are some other miscellaneous LaTeX commands to be aware of:
\begin{itemize}
\item
\texttt{\bsl varepsilon} gives a different-looking
epsilon: $\varepsilon$ instead of the default $\epsilon$.
\item
\texttt{\bsl varphi} gives a different-looking
phi: $\varphi$ instead of $\phi$.
\item
\texttt{\bsl smallsetminus} gives a smaller
set subtraction sign than
\texttt{\bsl setminus}--- compare
$A\smallsetminus B$ with $A\setminus B$.
\item
\texttt{\bsl varnothing} gives a more circular
nullset sign than \texttt{\bsl emptyset}---
compare $\varnothing$ with $\emptyset$.
\item
\texttt{\bsl nmid} gives the ``does not divide'' sign.
In general, if you want to put a slash through a symbol,
precede the symbol with
\texttt{\bsl not}, as in $x\not\in A$ or $x\not\leq 5$.
(For example,
\texttt{\bsl neq} is effectively just an
abbreviation for
\texttt{\bsl not =}, albeit a very useful one.)
But if you try
\texttt{\bsl not |} or
\texttt{\bsl not \bsl mid}, you get
the ugly
$\not |$ or $\not\mid$, whereas
\texttt{\bsl nmid} gives the much nicer $\nmid$.
\item
\texttt{\bsl binom\lbr n\rbr \lbr m\rbr} makes
the ``n choose m'' binomial coefficient symbol, giving
$$\binom{n+1}{k+1} = \binom{n}{k} + \binom{n}{k+1}$$
for displayed math mode, and $\binom{7}{5}$ for in-line math mode.
\end{itemize}
The bullet list above was produced by an
\texttt{itemize} environment.
(To get the symbol $\bullet$ by itself,
use \texttt{\bsl bullet} in math mode.)
LaTeX also has two other built-in list environments:
\texttt{enumerate}, which gives
numbered lists, and \texttt{description}, which gives lists
where each item begins with a different label.
There's also the much more flexible (but harder to use)
\texttt{list} environment, but you are unlikely
to need it for a thesis.\footnote{I used
a \texttt{list} environment
to get the alphabetically enumerated list in the
statements of Proposition~2.1.2 and Lemma~3.2.2
of \texttt{samplethesis.tex}.}
\section{Sectioning Commands and Other Comments}
\label{sec:other}
\subsection{Subsections}
Besides chapters and sections, there are also subsections.
But don't have only one subsection in a section,
or only one section in a chapter. Why break something
up into one piece?\footnote{The hierarchy of sectioning
commands actually continues further to subsubsection,
paragraph, and subparagraph. But let's not get carried away.
Besides, these lesser cousins of sections aren't numbered,
so you can't refer to them
with \texttt{\bsl label}
and \texttt{\bsl ref}.
By the way, \texttt{\bsl label} assigns to
that label-name the number of
the current structure--- chapter, section, subsection,
theorem, equation, etc.--- that we're deepest
inside \textbf{and that has a number}.
If you use \texttt{\bsl label} in a lesser cousin like a subsubsection,
you'll get the number of the subsection it's inside.}
\subsection{Hats and Bars}
\label{ssec:hats}
To put a hat on a math symbol, use
\texttt{\bsl hat}, as in $\hat{h}(x)$
or $\hat{f}(\zeta)$.
But sometimes \texttt{widehat} looks better,
as in $\widehat{G}$ or $\widehat{\R}$.
Similarly, \texttt{\bsl bar} gives $\bar{f}$,
but \texttt{\bsl overline}, like \texttt{\bsl widehat},
will stretch, as in
$\overline{f}$, or even $\overline{abcd}$.
\subsection{Quantifiers}
Although LaTeX provides the $\exists$ and $\forall$ symbols, you should
\emph{not} use them, unless you're actually writing a logic thesis
and they appear as part of symbolic sentences,
or something like that.
If you want to say that there is some $x\in \R$ such that blah blah blah,
then actually \textbf{write out} ``there is some $x\in\R$ such that\ldots,''
not ``$\exists x\in\R$ s.t.\ldots.''
\subsection{Punctuating Mathematics}
Don't forget that you need to punctuate math.
All of the math in
\texttt{samplethesis.tex} and \texttt{latextips.tex},
whether in-text or displayed,
includes punctuation (period, comma, or whatever) when
appropriate. For displayed math, make sure the punctuation
is \textbf{inside} the math mode delimiters; LaTeX is pretty
smart and will (usually) do a good job in putting the punctuation
in the right place, with the right amount of spacing. For in-line math,
it can be \emph{either} inside or outside math mode; but if it's
outside, you can't leave a space between the ending \texttt{\$}
or \texttt{\bsl )} and the punctuation.\footnote{Note
that this paragraph contains both \emph{italicized} and \textbf{boldfaced}
text, produced with \texttt{\bsl emph} (short for ``emphasis'')
and \texttt{\bsl textbf}, respectively.
Although you can also use \texttt{\bsl textit} to get italics, it is usually
better to use \texttt{\bsl emph}. For example,
using \texttt{\bsl emph} inside a theorem environment, where the
surrounding text is already italicized, makes the following
text \textbf{non}-italicized, so that it actually stands out
as intended; look at Proposition~2.1.2.d of \texttt{samplethesis.tex}.
Other related commands include
\texttt{\bsl texttt} for \texttt{typewriter text}
(useful for displaying program code)
and \texttt{\bsl textsl} for \textsl{slanted text}.
FYI, in case you see it somewhere:
there are also legal but older-style LaTeX commands
\texttt{\bsl bf}, \texttt{\bsl em}, \texttt{\bsl tt},
\texttt{\bsl sl}, etc., but they are a little clunkier
and are used slightly differently. Still,
\texttt{\bsl textbf\lbr hello world\rbr} and
\texttt{\lbr \bsl bf hello world\rbr} both produce
\textbf{hello world}, for example.}
\subsection{Spacing}
LaTeX is generally very good about getting
spacing correct. For example, it puts a more space
after a period than it does after a comma or between words,
regardless of how many times you hit the space bar.
However, if you only want a regular space after a period
(say, because you're using an abbreviation), put a backslash
just before the space. For example,
\begin{verbatim}
Serre et al. proved
\end{verbatim}
prints as ``Serre et al. proved'', whereas
\begin{verbatim}
Serre et al.\ proved
\end{verbatim}
prints as ``Serre et al.\ proved''.
Meanwhile, to prevent LaTeX from breaking a
line between two words, use a tilde \texttt{\til}
instead of a space. For example, a linebreak
in the middle of a reference to, say,
Section \ref{sec:other} just looks weird. Instead, I've been using
tildes whenever I make a \texttt{\bsl ref}
reference to Chapters, Sections,
equations, etc., so as to force LaTex to print such references as
Section~\ref{sec:other}.
Note that the spacing between words on the last few lines was
a little wider than usual; that's LaTeX rearranging things to avoid the
forbidden linebreak.
\subsection{Tables}
\label{ssec:tables}
If you need a table in your thesis,
you can make one with the \texttt{tabular} environment.
I'll put one right here.
\begin{table}
\begin{center}
\begin{tabular}{|r||c|l|}
\hline
\textbf{Week of} & \textbf{Sections} & \textbf{Topics and Comments} \\ \hline
Feb 2 & 13.5, 13.6, 14.1 & Lines, Planes, Quadrics,
Vector-valued Functions \\ \hline
Feb 9 & 14.2--14.4 & Calculus for Vector-valued Functions \\ \hline
Feb 16 & 15.1, 15.2 & Multivariable Functions, Limits \\
& & \textbf{FIRST MIDTERM: Wednesday, Feb 18} \\ \hline
Feb 23 & 15.3--15.5 & Partial Derivatives, Chain Rule \\ \hline
Mar 2 & 15.6, 15.7 & Gradient, Extreme Values \\ \hline
Mar 9 & 15.8, 16.1, 16.2 & Lagrange Multipliers, Double Integrals \\ \hline
Mar 16 & \hfil --- \hfil & (Spring Break; no classes) \\ \hline
\end{tabular}
\end{center}
\caption{A portion of a Math 13 syllabus}
\label{tab:m13}
\end{table}
(Well, I'm \emph{typing} it here, but LaTeX decided to put it at
the top of this page; more on that in a second.)
The letters \texttt{l}, \texttt{c}, and \texttt{r} inside the brackets
right after
\texttt{\bsl begin\lbr tabular\rbr} specify whether each
particular column of text is left-justified, centered, or
right-justified. The $|$ symbols, of course, say where the
vertical lines go.
Note that because I put Table~\ref{tab:m13} inside a \texttt{table}
environment, LaTeX automatically gave it a table number, so
it would show up in the list of tables (if I had a
\texttt{\bsl listoftables} command in the front matter;
see Section~\ref{sec:front}), and I
can refer to it with \texttt{\bsl ref}, as I did earlier in this
sentence. In addition, I was able to give it a caption.
The \texttt{table} environment also turns the table into
a ``floating object'', meaning that LaTeX will put it
where it thinks best,
which will probably be in a different place or even
on a different page.
For example, Table~\ref{tab:m13} appears at the top
of the page, even though I typed the code that created the table
immediately after the second sentence of this section. You
can (try to) force LaTeX to put the table in a particular place
by putting an option right after that
\texttt{\bsl begin\lbr table\rbr} command:
\texttt{[h]} to put it right here,
\texttt{[b]} to put it at the bottom of the page,
\texttt{[t]} to put it at the top of the page,
or
\texttt{[p]} to put it on a different page.
(But if the table simply won't fit where you want it,
LaTeX will just do the best it can.)
If you use the \texttt{tabular} environment
without the \texttt{table} environment, the
table will appear just where you put it,
but with no label, caption, or appearance in a
list of tables, like this:
\begin{center}
\begin{tabular}{|c||c|c|c|}
\hline
$x$ & $(-\infty,-1)$ & $(-1, 1/\sqrt[3]{2})$ &
$(1/\sqrt[3]{2},\infty)$ \\ \hline \hline
$f'(x)$ & $+$ & $+$ & $-$ \\ \hline
$f(x)$ & $\nearrow$ & $\nearrow$ & $\searrow$ \\ \hline
\end{tabular}
\end{center}
\subsection{Figures}
\label{ssec:figs}
If you need figures in your thesis, use the
\texttt{figure} environment and the
\texttt{\bsl includegraphics} command.
You'll also need to have the command
\texttt{\bsl usepackage\lbr graphics\rbr}
somewhere in your preamble
(see Section~\ref{sec:pream}), so
that LaTeX actually \emph{knows} the \texttt{\bsl includegraphics} command.
More importantly, you'll need
to create an appropriate \texttt{.eps}
(Encapsulated PostScript) file using
a graphics package or by learning the PostScript
graphing language and writing a raw \texttt{.eps}
file yourself. Figure~\ref{fig:disks} gives
an example.
\begin{figure}[h]
\begin{center}
\includegraphics{sample_fig}
\end{center}
\caption{An Example of a Figure.}
\label{fig:disks}
\end{figure}
Figures, like tables, are also floating objects.
As with the \texttt{table} environment, you can use
the \texttt{[h]}, \texttt{[b]}, \texttt{[t]}, and \texttt{[p]}
options with the \texttt{figure} environment, if you want.
I used the \texttt{[h]} option
on Figure~\ref{fig:disks}, to prod LaTeX into putting
it just where I typed it.
I also put Figure~\ref{fig:big} later in this document.
Figure~\ref{fig:big} uses the same graphics file
as Figure~\ref{fig:disks}
(namely, \texttt{sample\_fig.eps}).
However, for the sake of variety, I had LaTeX
rescale the size of Figure~\ref{fig:big} with the
\texttt{\bsl scalebox} command; specifically,
I used \texttt{\bsl scalebox\lbr 0.8\rbr}, to
make the figure 80\% of its actual size.
\appendix
\chapter{Other little things}
\section{How to make appendices}
\label{sec:app}
Just put \texttt{\bsl appendix} in the \texttt{.tex} file,
and presto, all ``chapters'' that follow are Appendices!
\section{Comments}
As you've probably noticed, lines in the \texttt{.tex} file beginning with
\texttt{\%}
are comments. LaTeX ignores everything from the \texttt{\%}
symbol until the end of the line.
So for one thing,
you can leave yourself notes explaining
what various technical declarations do, or to
highlight where various chapters or sections start.
For another thing,
if you decide to cut some chunk of
your thesis that you've already written, it's probably safer to
comment it out (i.e., precede each line of it with a \texttt{\%} symbol)
rather than delete it. That way, if you decide later that you
actually want to keep some or all of what you cut, it's easy
to recover.
\section{Linebreaks}
LaTeX treats a linebreak (i.e., hitting the Enter key)
essentially the same as a space.
The only real exception is that two or more consecutive linebreaks
(i.e., leaving at least one blank line in the \texttt{.tex} file) tells LaTeX
to make a paragraph break.
I think it's a good thing to have a lot of linebreaks in your
\texttt{.tex} file. Linebreaks make the file itself
much easier to read and to edit, without changing the
appearance of the printed version.
\vspace{0.3in}
However, a clump of seven consecutive blank lines is treated the same
as one. If you want extra vertical space for some reason, use the
\texttt{\bsl vspace} command. For example, I got the
big space just above by putting
\texttt{\bsl vspace\lbr 0.3in\rbr} between two paragraphs.
Incidentally, paragraph breaks (i.e., double linebreaks)
are not allowed in the
middle of math mode; they will give you an error message.
Single linebreaks in math mode are perfectly fine, though--- as
noted above, they are treated just like spaces.
Oh, by the way, I'm going to put Figure~\ref{fig:big},
which I promised back
in Subsection~\ref{ssec:figs}, right here.
\begin{figure}
\begin{center}
\scalebox{0.8}{\includegraphics{sample_fig}}
\end{center}
\caption{Another random figure.}
\label{fig:big}
\end{figure}
Recall that it's a floating object; LaTeX decided to put
it on the next page.
\section{Dashes, Ellipsis, and Quotes}
LaTeX handles these punctuation marks
a little differently than you might expect.
There are three kinds of dashes: the hyphen -, for
intra-word dashes; the en~dash --, for
number or letter ranges, like ``pages~55--70'' or
``parts~(b)--(f)''; and the em~dash ---, which is,
of course, a
punctuation mark--- the kind that's used in much the
same way as a semicolon. Code them in LaTeX with
\texttt{-}, with
\texttt{--}, and with
\texttt{---}, respectively.
An ellipsis is the ``dot-dot-dot'' punctuation \ldots, used
for partial quotatations. (For example, you will probably need
it when writing the ``Corrections'' portion of your thesis.)
Three periods like this... gives the screwy spacing found
in the middle of this sentence. Instead,
use the \texttt{\bsl ldots} command, to get\ldots, as desired.
For double quotes, do \textbf{not} use
the \dqu\ symbol.
(About the only LaTeX use of \dqu\
is for umlauts;
\texttt{H\bsl\dqu\lbr o\rbr lder} produces H\"{o}lder.)
Instead, open
with two \textbf{left} single-quotes \lqu\ (found
to the left of the 1~key on most keyboards) and
close with two \textbf{right} single-quotes \rqu. Similarly,
for single quotes, use the left and right quotes
as appropriate. For example,
\hspace{.3in}
\texttt{Cohen notes, \lqu\lqu These \lqu G\bsl\dqu\lbr o\rbr del
numbers\rqu\ are large.\rqu\rqu}
\noindent
gives: Cohen notes, ``These `G\"{o}del numbers' are large.''
However, both
\hspace{.3in}
\texttt{Cohen notes, \rqu\rqu These \rqu G\bsl\dqu\lbr o\rbr del
numbers\rqu\ are large.\rqu\rqu}
\noindent
and
\hspace{.3in}
\texttt{Cohen notes, \dqu These \rqu G\bsl\dqu\lbr o\rbr del
numbers\rqu\ are large.\dqu}
\noindent
give the ugly: Cohen notes, ''These 'G\"{o}del numbers' are large.''
%\noindent
%gives: Cohen notes, "These 'G\"{o}del numbers' are large."
I'd recommend you edit your \texttt{.tex} file using the
\texttt{emacs} text-editor.
Among its many advantages, \texttt{emacs} automatically does what you
want when you hit the \dqu\ key; it figures it out whether
you need the umlaut symbol, two left quotes, or two right quotes,
based on whether the previous character was a backslash, space,
or something else. So you actually end up using the
\texttt{\dqu} \emph{key}
after all, even if you don't end up using the
\texttt{\dqu} \emph{symbol}.
\chapter{LaTeX File Structure}
The \texttt{.tex} file has roughly four parts:
the \textbf{preamble} (setting margins, etc.),
the \textbf{front matter} (title page, abstract, etc.),
the \textbf{main matter} (the thesis itself and appendices),
and the \textbf{back matter} (bibliography and, in the corrected version,
list of corrections).
In this Appendix, we'll describe the four parts in more detail.
In particular, we'll explain how the commands found in
\texttt{samplethesis.tex} and \texttt{thesis.tex}
make thesis documents that
conform to the College's
and the department's regulations.
\section{Preamble}
\label{sec:pream}
First, we specify the type of document
(\texttt{report} class for Amherst math theses),
set the font (11~point),
and format for two-sided printing.
\begin{verbatim}
\documentclass[11pt,twoside]{report}
\end{verbatim}
%\hspace{.3in}
%\texttt{\bsl documentclass[11pt,twoside]\lbr report\rbr}
%
%\noindent
If you're planning to print single-sided, then
replace \texttt{[11pt,twoside]} with \texttt{[11pt]}.
(See Footnote~\ref{fn:double} on page~\pageref{fn:double}
for more information.)
Next, we import certain packages with
fancier symbols and theorem styles we'll need.
\begin{verbatim}
\usepackage{amsmath}
...
\end{verbatim}
% \usepackage{amsfonts}
(If you're going to have figures, don't forget to add the
line \texttt{\bsl usepackage\lbr graphics\rbr}, as noted
in Subsection~\ref{ssec:figs}).
After that, we define the theorem types to be used in the thesis.
\begin{verbatim}
\newtheorem{theorem}{Theorem}[section]
...
\end{verbatim}
% \newtheorem{remark} [theorem] {Remark}
The \texttt{\bsl newtheorem} command takes two \emph{arguments}
(in curly brackets): the first is what we'll call
that theorem type in the \texttt{.tex} file,
and the second is the actual text to appear in print.
Meanwhile, the \emph{option}
(in square brackets) specifies
the numbering; \texttt{[section]} means that, for example,
the first Theorem of Section 4.1 would be
numbered 4.1.1, and the first Theorem of
Section 4.3 would be 4.3.1.
If I had put \texttt{[chapter]} instead of \texttt{[section]},
then those two Theorems would be simply 4.1 and 4.2.
Or, if I omitted that option entirely, the first Theorem
of the \textbf{whole thesis} would be numbered 1,
the second 2, and so on.
Note that I put the option \texttt{[theorem]},
and in a different place,
for the other theorem types,
to number them as if they
were \texttt{theorem}s.
So if Section 2.3 has a lemma, a theorem,
a definition, and then another lemma,
they would be numbered as Lemma~2.3.1, Theorem~2.3.2,
Definition~2.3.3, and Lemma~2.3.4.
If instead you want definitions to be counted
separately from the others,
change the proclamation line for definition to
\begin{verbatim}
\newtheorem{definition}{Definition}[section]
\end{verbatim}
Then the same set of theorems and definitions
would now be labelled Lemma~2.3.1, Theorem~2.3.2,
Definition~2.3.1, and Lemma~2.3.3.
Meanwhile, the \texttt{\bsl newtheorem*} command is
just like the other \texttt{\bsl newtheorem} commands,
except that the \texttt{*} says that there should be
no number attached. (Obviously, there is no
square-bracketed option to describe the numbering in this case.)
Finally, \texttt{\bsl theoremstyle}
changes the style of all \texttt{\bsl newtheorem} types
that follow, at least until the next
\texttt{\bsl theoremstyle} command.
There are three theorem styles to choose from:
\begin{enumerate}
\item \texttt{plain} style is the most emphatic, with
boldface labels and italicized text. It's also
the default, so we didn't need to declare it explicitly.
\item \texttt{definition} style has boldface labels
but regular (Roman) text.
\item \texttt{remark} style is the least emphatic, with
italicized labels and regular text.
\end{enumerate}
I happened not to use \texttt{remark} style for any
theorem types in \texttt{samplethesis.tex},
but you can if you
want to. And, of course, there's no requirement that
you have to put definitions in \texttt{definition} style
or remarks in \texttt{remark} style.
\hfill\hrulefill\hfill {}
Next we set margins and things like that; you probably shouldn't mess
with these settings:
\begin{verbatim}
\setlength{\evensidemargin}{0in}
...
\end{verbatim}
% \setlength{\footnotesep}{14pt}
These are all length variables, which are allowed to be negative
but which must have units (even when
their value is \texttt{0}). LaTeX
units include
inches (\texttt{in}), centimeters (\texttt{cm}), points (\texttt{pt}),
and many others.
%a lot of which you've probably never heard of.
Most of the commands above set the margins,
by giving the location and size
of a rectangle on the page where LaTeX is
allowed to put text, figures, etc.
More precisely, the
upper left corner of this rectangle is \emph{one inch plus}
\texttt{\bsl topmargin} from the top of the page,
and \emph{one inch plus} \texttt{\bsl oddsidemargin}
from the left edge of the page.\footnote{LaTeX
ignores \texttt{\bsl evensidemargin} \label{fn:double}
if you use
the option \texttt{[11pt]} instead of \texttt{[11pt,twoside]}
in the first line of the document.
On the other hand, if you \textbf{do} use \texttt{twoside},
then on even-numbered pages,
LaTeX uses \texttt{\bsl evensidemargin}
instead of \texttt{\bsl oddsidemargin}.
That's handy, since thesis regulations require a wider margin
on the binding side---
but if you double-side, the binding
alternates between the left and right sides.
Please note that whether or not your thesis physically prints
on both sides of the page has \textbf{nothing} to do with
LaTeX's \texttt{twoside} option, but instead only with your
printer settings.}
The rectangle itself is then
\texttt{\bsl textwidth} wide by \texttt{\bsl textheight} high.
Meanwhile,
\texttt{\bsl footnotesep} is the gap just above a footnote,
but footnotes are rarely used in math theses.
Next we start to declare some macros, or
keyboard shortcuts.
If you want $\C$ to appear, the LaTeX command is
\texttt{\bsl mathbb\lbr C\rbr}. But if you're going
to use that symbol a lot,
it'd be easier to
to type something shorter like \texttt{\bsl C}.
So, use \texttt{\bsl newcommand} to define
whatever macros you want.
Incidentally, besides blackboard-bold,
\texttt{\bsl mathcal} gives a calligraphic font,
\texttt{\bsl mathfrak} gives a fraktur (Germanic) font,
and there are many more.
In addition,
although LaTeX has a bunch of built-in math operators (like $\sin$ and $\log$),
you might want to define your own. If so,
then to get the spacing right and make sure the
letters appear in regular type rather than italics,
use the \texttt{\bsl DeclareMathOperator} command.
\begin{verbatim}
\newcommand{\C}{{\mathbb{C}}}
...
\DeclareMathOperator{\divop}{div}
\end{verbatim}
You can name your macros and math operators
whatever you want, as long as they
begin with a backslash and don't conflict with other
commands or macros.\footnote{For example,
LaTeX already has
the commands \texttt{\bsl P} and \texttt{\bsl div}
to make the symbols $\P$ and $\div$.
So, after I got an error message the first time I tried
each of them, I chose new macro names:
\texttt{\bsl PP} and \texttt{\bsl divop}.}
\hfill\hrulefill\hfill {}
Finally, \texttt{samplethesis.tex}
also includes the technical line
\texttt{\bsl newcounter\lbr bean\rbr}, but
it doesn't appear in \texttt{thesis.tex},
because you won't need it
unless you use a fancy enviroment like \texttt{list}
in your thesis,
as I did in Proposition~2.1.2 and Lemma~3.2.2 of
\texttt{samplethesis.tex}.\footnote{The
\texttt{list} environment requires a user-defined variable
called a counter, so I initialized one
with the \texttt{\bsl newcounter} command.
Any old variable name will work, but the joke
choice of ``bean'' is borrowed from George
Gr\"{a}tzer, who uses both ``bean'' and ``sheep''
as counter names in his LaTeX manuals.}
\hspace{.3in}
\section{Front Matter}
\label{sec:front}
The preamble is now done. It's time to start the actual
document, so we have:
\begin{verbatim}
\begin{document}
\end{verbatim}
(There is also an
\texttt{\bsl end\lbr document\rbr } command at the end of the file.)
Then we need to
declare double-spacing (\texttt{\bsl baselineskip} is how much
space to leave between lines), and, at least for the front matter,
have page numbers appear as roman numerals.
\begin{verbatim}
\setlength{\baselineskip}{21pt}
\pagenumbering{roman}
\end{verbatim}
At last, something to actually print: the title page.
\begin{verbatim}
\begin{titlepage}
...
\end{titlepage}
\end{verbatim}
It's not important what the commands
here mean.\footnote{\texttt{\bsl vspace} makes
a vertical space, and
\texttt{\bsl mbox\lbr\rbr} makes an empty ``box'' for
\texttt{\bsl vspace} to push off of.
The \texttt{\bsl\bsl}
commands are linebreaks in the \texttt{center} environment,
sometimes with an option specifying an extra amount of
space to skip.
\texttt{\bsl vfill} is a vertical ``spring'' of whitespace,
pushing everything above as high as it will go, and everything
below as low as it will go; the two springs have equal strength.}
The only things in the title page you should change are:
\hspace{.3in}
1. Your name in the \textbf{two} obvious places.
\hspace{.3in}
2. Your advisor's name in the one obvious place.
\hspace{.3in}
3. The thesis title (with linebreaks as you see fit).
\hspace{.3in}
4. The due date.
\hspace{.3in}
5. The year in the copyright line.
\smallskip
\noindent
Next is the abstract.
Obviously, write something appropriate to your thesis.
And use \texttt{\bsl chapter*}
rather than \texttt{\bsl chapter}, since we don't want
a chapter number here.
\begin{verbatim}
\chapter*{Abstract}
This short example thesis meets all of the formatting
...
\end{verbatim}
Acknowledgements are similar:
\begin{verbatim}
\chapter*{Acknowledgements}
Thanks to Mom and Dad for everything.
...
\end{verbatim}
LaTeX will automatically generate a table of contents,
based on all the \texttt{\bsl chapter}, \texttt{\bsl section}, etc.\ commands
that appear in the document, with the simple command:
\begin{verbatim}
\tableofcontents
\end{verbatim}
If you have figures or tables in your thesis, it might
be helpful to provide lists of them. LaTeX will generate
such lists
with the
\texttt{\bsl listoffigures}
and
\texttt{\bsl listoftables}
commands. (These are present but commented out
in \texttt{thesis.tex} and \texttt{samplethesis.tex}.)
It's also helpful for the reader
if you include a list of notation, giving
the page number at which the notation
in question is defined.
Because your page numbers are certain to change
as you edit, mark the first
appearance of each symbol in the \texttt{.tex} file
with the \texttt{\bsl label}
command, and then get the page number to appear
here with the \texttt{\bsl pageref} command.
\begin{verbatim}
\chapter*{List of Notation}
\noindent
\hspace{0.8in}
$\PP^1(\Q)$\dotfill p.\ \pageref{not:P1Q}
\hspace{1.5in}
...
\end{verbatim}
Next, for technical reasons, we throw in the ugly LaTeX code
\begin{verbatim}
\makeatletter
\if@twoside \ifodd\value{page}
\clearpage\mbox{}\thispagestyle{empty} \fi \fi
\makeatother
\end{verbatim}
because if the front matter has
an odd number of pages, then LaTeX and the
printer will disagree on whether each successive page of the
main thesis is odd or even.
So if you are
printing two-sided, that disagreement will mess up your side
margins; see Footnote~\ref{fn:double} on
page~\pageref{fn:double}. The code above fixes this
problem by inserting an extra blank page in that case.\footnote{You
don't need to know how this bit of code works, but if
you're curious, \texttt{\bsl if \ldots \bsl fi}
is just like an \texttt{if} statement in a programming language;
\texttt{@twoside} is a boolean variable
(set to true if we are using the \texttt{twoside} option),
and \texttt{page} is a counter (i.e., integer variable)
storing the current page number;
\texttt{\bsl value} retrieves its value.
So the if statements do nothing
unless we are
using the \texttt{twoside} option
and currently on an odd page.
In that case, \texttt{\bsl clearpage} ends the
current page, \texttt{\bsl mbox\lbr\rbr}
(which is a blank placeholder) starts a new one,
and \texttt{\bsl thispagestyle\lbr empty\rbr}
prevents the new page from displaying a page number.
Meanwhile, the
\texttt{\bsl makeatletter} command makes
LaTeX read \texttt{@} as a letter, i.e., a legal character
in a variable name; then when we're done,
\texttt{\bsl makeatother} changes it
back to its usual status as an ``other'' symbol,
like \texttt{\bsl} or \texttt{\$}.}
Finally, end the current page and
switch back to normal (arabic) page numbers.
%to get ready for the main matter.
\begin{verbatim}
\clearpage
\pagenumbering{arabic}
\end{verbatim}
\section{Main Matter}
Start with \texttt{\bsl chapter\lbr Introduction\rbr}, or whatever
you call the first chapter, and write.
Remember that appendices
(see Section~\ref{sec:app} for how to make them)
are ignored when the department determines grades
and honors levels for theses.
\section{Back Matter}
\subsection{Bibliography}
Begin the bibliography with the lines\footnote{First,
\texttt{\bsl clearpage} ends the previous page,
so that the correct page number appears in the contents
when we invoke \texttt{\bsl addcontentsline}, which is
needed because LaTeX doesn't want
to list the bibliography in the table of contents
(since it's an unnumbered chapter, like the Abstract).
The string \texttt{toc} appears because
the table of contents filename ends with
\texttt{.toc}, \texttt{chapter} makes the desired text
appear like a chapter in the contents,
and \texttt{\bsl numberline\lbr\rbr} leaves
a blank chapter number. The technical command
\texttt{\bsl protect} ensures
that \texttt{\bsl numberline} behaves as it should even
though we're having LaTeX copy it into another file.
Meanwhile,
the \texttt{9} after
\texttt{\bsl begin\lbr thebibliography\rbr}
just means LaTeX should leave enough room
for one-digit labels for the bibliography entries.
It has to do with the
width of the symbol \texttt{9}, not the
actual number 9 itself---
if you have more than nine but still fewer than 100
sources, use \texttt{99} instead of \texttt{9}.}
\begin{verbatim}
\clearpage
\addcontentsline{toc}{chapter}{\protect\numberline{}{Bibliography}}
\begin{thebibliography}{9}
\end{verbatim}
Then list all works cited.
It should be pretty easy to understand how the bibliography works
if you look at the \texttt{samplethesis.tex} file. The lines
\begin{verbatim}
\bibitem{MS1}
P.~Morton and J.~Silverman,
Rational periodic points of rational functions,
\emph{Inter. Math. Res. Notices} \textbf{2} (1994), 97--110.
\end{verbatim}
make a bibliography entry that you can cite
in the main text with \texttt{\bsl cite\lbr MS1\rbr}.
Note the different styles used
for papers versus books (especially italics and publication years);
follow those styles in your own bibliography.
Finally, end the bibliography with
\begin{verbatim}
\end{thebibliography}
\end{verbatim}
\subsection{List of Corrections}
A few weeks after theses are due, you may hand in a corrected version,
along with a list of the corrections you made.
(So this final section will \textbf{not} be part of the original
thesis document you hand in.)
Just start a new unnumbered chapter (\emph{after} the bibliography) with
\begin{verbatim}
\chapter*{Corrections}
\end{verbatim}
and begin with, ``When originally submitted, this honors
thesis contained some errors which have been corrected in the current
version. Here is a list of the errors that were corrected.''
(The \texttt{\bsl chapter*} command and the two sentences are present
but commented out in \texttt{thesis.tex}; so if you
started from \texttt{thesis.tex}, you can just uncomment them.)
Then list the changes; the \texttt{description} environment is good
for this. You can mention \emph{really} minor changes (like
spelling) with a rough count, but no specifics. However, any
other changes (which should still be fairly minor) should be
listed explicitly. Refer to page numbers and line numbers from
the \emph{corrected} version, since any future reader will
probably be reading from the library copy,
which will be the corrected version:
\begin{verbatim}
\begin{description}
\item[Various places in the thesis.]
Approximately 20 spelling errors were corrected,
10 missing periods or commas were added in mathematical formulae,
and approximately 30 spacing and sizing changes
were made to mathematical formulae.
\item[Other changes:]
...
\item[p.~5, l.~4.]
The formula ``$ab\in\fm_v$'' was changed to ``$ba=ab\in\fm_v$''.
...
\end{description}
\end{verbatim}
\vfill
\noindent
\hrulefill
\noindent
{\footnotesize The figure \texttt{sample\_fig.eps}
originally appeared in
J.~Benedetto and R.~Benedetto,
A wavelet theory for local fields and related groups,
\emph{J. Geom. Anal.} \textbf{14} (2004), 423--456.
Large portions of the text of
the accompanying \texttt{samplethesis.tex} document were taken
from
R.~Benedetto,
Preperiodic points of polynomials over global fields,
\emph{J. Reine Angew. Math.} \textbf{608} (2007), 123--153.
Many thanks to David Cox for suggestions
and improvements to \texttt{samplethesis.tex}
and to this \texttt{latextips.tex} document.}
\end{document}