\documentclass[12pt,twoside]{article}
\usepackage{fullpage}
\usepackage{comment}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}

\newenvironment{symlist}[1]{\hfill\begin{tabular}{r|l}\multicolumn{2}{c}{{\Large #1}}\\%
\textbf{Code}&\textbf{Result}\\}{\end{tabular}\hfill}
\newcommand{\bs}{\ensuremath{\backslash}}

\title{\LaTeX{} Course Handout - Math Mode}
\author{Alan Davidson \\ \texttt{adavidso@cs.hmc.edu}}

\begin{document}
\maketitle

\section*{Resources}
On the web:
\begin{itemize}
\item \texttt{http://www.cs.hmc.edu/$\sim$mac/latexcourse}
\item \texttt{http://www.cs.hmc.edu/qref/latex/qref}
\item \texttt{http://www.math.hmc.edu/computing/support/tex}
\end{itemize}
Tutorials:
\begin{itemize}
\item \emph{The Not-so-short Guide to \LaTeX2e{}} (posted on the website)
\end{itemize}
Books:
\begin{itemize}
\item \emph{Guide to \LaTeX} by Kopka and Daly
\item \emph{The \LaTeX{} Companion} by Mittelbach et al.
\end{itemize}
E-mail:
\begin{itemize}
\item \texttt{latex-l@hmc.edu}
\item Subscribe by sending an email to \texttt{listkeeper@hmc.edu} with the phrase 
``subscribe latex-l'' in the body
\end{itemize}

\section*{Environments}
\begin{tabular}{ll}
\parbox[b]{7cm}{
\texttt{%
\bs begin\{itemize\}\\%
\bs item First item\\%
\bs item Second item\\%
\bs begin\{itemize\}\\%
\bs item Nested itemization\\%
\bs item \bs ldots with two entries\\%
\bs end\{itemize\}\\%
\bs item Last item\\%
\bs end\{itemize\}
}
}
&
\parbox[b]{7cm}{
\begin{itemize}
\item First item
\item Second item
\begin{itemize}
\item Nested itemization
\item \ldots with two entries
\end{itemize}
\item Last item
\end{itemize}}\\\\
\parbox[b]{7cm}{
\texttt{\bs begin\{enumerate\}\\
\bs item First item\\
\bs item Second item\\
\bs begin\{enumerate\}\\
\bs item Nested enumeration\\
\bs item \bs ldots with two entries\\
\bs end\{enumerate\}\\
\bs item Last item\\
\bs end\{enumerate\}}}&
\parbox[b]{7cm}{
\begin{enumerate}
\item First item
\item Second item
\begin{enumerate}
\item Nested enumeration
\item \ldots with two entries
\end{enumerate}
\item Last item
\end{enumerate}}\\\\
\parbox[b]{7cm}{
\texttt{\bs begin\{eqnarray*\}\\
a+b \& = \& d \bs\bs\\
a+b+c \& = \& e \bs\bs\\
\& = \& d+c\\
\bs end\{eqnarray*\}
}}&
\parbox[b]{7cm}{
\begin{eqnarray*}
a+b&=&d\\
a+b+c&=&e\\
&=&d+c
\end{eqnarray*}
}\\\\
\parbox[b]{7cm}{
\texttt{\bs begin\{proof\}
Proof denies faith, and without faith God is nothing. 
\bs end\{proof\}}}
&
\parbox[b]{7cm}{
\begin{proof}
Proof denies faith, and without faith God is nothing.
\end{proof}}\\\\
\parbox[b]{7cm}{
\texttt{\bs begin\{proof\}[Quick Note]
The proof environment requires the \bs texttt\{amsthm\} package. 
\bs end\{proof\}}}&
\parbox[b]{7cm}{
\begin{proof}[Quick Note]
The proof environment requires the \texttt{amsthm} package.
\end{proof}}
\end{tabular}

\begin{tabular}{ll}
\parbox{7cm}{
\texttt{\% Note: this must be \\
\% in math mode. 
sign(x)=\\
\bs begin\{cases\}
-1 \& x<0 \bs\bs\\
0 \& x=0 \bs\bs\\
1 \& x>0 \\
\bs end\{cases\}
}
}&
\parbox{7cm}{
$sign(x)=\begin{cases}-1&x<0\\0&x=0\\1&x>0\end{cases}$
}\\\\
\parbox{7cm}{
\texttt{\% Note: this must be \\
\% in math mode. \\
\bs left[\\
\bs begin\{array\}\{cc\}\\
1 \& 2 \bs\bs\\
3 \& 4 \\
\bs end\{array\}\\
\bs right]
}
}&
\parbox{7cm}{
$\left[\begin{array}{cc}1&2\\3&4\end{array}\right]$
}\\\\
\parbox{7cm}{
\texttt{\bs begin\{tabular\}\{c$| |$r$|$l\}
centered \& right \& left \bs\bs\\
\bs hline first \& row \& here \bs\bs\\
and \& second \& row here\\
\bs end\{tabular\}
}}&\parbox{7cm}{
\begin{tabular}{c||r|l}
centered&right&left\\\hline
first&row&here\\
and &second & row here\end{tabular}
}\\\\
\end{tabular}

\section*{Fonts}
\begin{tabular}{lll}
Normal Text&
\texttt{\bs emph\{}\emph{Emphasis}\texttt{\}}&
\texttt{\bs textbf\{}\textbf{Bold Face}\texttt{\}}\\
\texttt{\bs textsc\{}\textsc{Caps/Small Caps}\texttt{\}}&
\texttt{\bs texttt\{}\texttt{Typewriter Text}\texttt{\}}&
\texttt{\bs textrm\{}\textrm{Roman Font}\texttt{\}} \\
\texttt{\bs mathcal\{}$\mathcal{A,~B,~C}$\texttt{\}}&
\texttt{\bs mathbb\{}$\mathbb{R,~Z}$\texttt{\}}
\end{tabular}

\texttt{textrm} is useful in Math Mode. \texttt{mathcal} and \texttt{mathbb} can
only be used in Math Mode. 

\newpage 
\section*{Symbols for \emph{Math Mode}}
For many more symbols than this, see the \emph{Not So Short Guide to \LaTeXe}. \\~\\

\begin{tabular}{cc}
\begin{symlist}{Accents}
\texttt{\bs hat\{c\}}&$\hat{c}$\\
\texttt{\bs hat\{longer\}}&$\hat{longer}$\\
\texttt{\bs widehat\{longer\}}&$\widehat{longer}$\\
\texttt{\bs bar\{x\}}&$\bar{x}$\\
\texttt{\bs bar\{longer\}}&$\bar{longer}$\\
\texttt{\bs overline\{longer\}}&$\overline{longer}$\\
\texttt{\bs bar\{h\}}&$\bar{h}$\\
\texttt{\bs hbar}&$\hbar$\\
\texttt{\bs vec\{f\}}&$\vec{f}$\\
\texttt{\bs overrightarrow\{longer\}}&$\overrightarrow{longer}$\\
\texttt{\bs dot\{\bs theta\}}&$\dot{\theta}$\\
\texttt{\bs ddot\{x\}}&$\ddot{x}$
\end{symlist}
&
\begin{symlist}{Comparison Operators}
\texttt{\bs le}&$\le$\\
\texttt{\bs ge}&$\ge$\\
\texttt{\bs ne}&$\ne$\\
\texttt{\bs subset}&$\subset$\\
\texttt{\bs subseteq}&$\subseteq$\\
\texttt{\bs supset}&$\supset$\\
\texttt{\bs supseteq}&$\supseteq$\\
\texttt{\bs in}&$\in$\\
\texttt{\bs notin}&$\notin$\\
\texttt{\bs parallel}&$\parallel$\\
\texttt{\bs perp}&$\perp$\\
\end{symlist}\\
\\
\begin{symlist}{Logical Operators}
\bs exists&$\exists$\\
\bs forall&$\forall$\\
\bs vdash&$\vdash$\\
\bs to&$\to$\\
\bs lor&$\lor$\\
\bs land&$\land$\\
\bs lnot&$\lnot$\\
\bs iff&$\iff$\\
\bs Leftrightarrow&$\Leftrightarrow$\\
\bs Rightarrow&$\Rightarrow$\\
\bs Leftarrow&$\Leftarrow$
\end{symlist}
&
\begin{symlist}{Other Operators}
\texttt{\bs pm}&$\pm$\\
\texttt{\bs mp}&$\mp$\\
\texttt{a\bs cdot b}&$a\cdot b$\\
\texttt{f\bs circ g}&$f\circ b$\\
\texttt{\bs star}&$\star$\\
\texttt{\bs cap}&$\cap$\\
\texttt{\bs cup}&$\cup$\\
\texttt{\bs sqrt\{x\^{}2+y\^{}2\}}&$\sqrt{x^2+y^2}$\\
\texttt{$<$x$>$}&$<x>$\\
\texttt{\bs langle x \bs rangle}&$\langle x \rangle$\\
\end{symlist}\\
\\
\begin{symlist}{Calculus, etc.}
\texttt{\bs int\_a\^{}b}&$\int_a^b$\\
\texttt{\bs partial \bs phi}&$\partial \phi$\\
\texttt{\bs sin x}&$\sin x$\\
\texttt{\bs cos x}&$\cos x$\\
\texttt{\bs tan x}&$\tan x$\\
\texttt{\bs log x}&$\log x$\\
\end{symlist}
&
\begin{tabular}{r|lc}\multicolumn{3}{c}{\Large{Requires Extra Packages}}\\
\textbf{Code}&\textbf{Result}&\textbf{Package}\\
\texttt{\bs iint}&$\iint$&\texttt{amsmath}\\
\texttt{\bs iiint}&$\iiint$&\texttt{amsmath}\\
\texttt{\bs iiiint}&$\iiiint$&\texttt{amsmath}\\
\texttt{\bs nexists}&$\nexists$&\texttt{amssymb}\\
\end{tabular}
\end{tabular}
\end{document}
