\documentclass[landscape]{slides}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}

\usepackage{graphics}
\usepackage{fancyhea}
\usepackage{lshort}
\usepackage{standard-slide-include}

\title{{\LaTeX} Math Mode}
\author{RSI {\number\year} Staff}
%\date{28 June, 2000}
\date{}

\DeclareMathOperator{\ord}{ord}
\DeclareMathOperator{\codim}{codim}
\DeclareMathOperator{\divv}{div}

\begin{document}

\begin{slide}
 \thispagestyle{empty}
 \maketitle
\end{slide}

\begin{slide}
 \begin{small}
   \tableofcontents
 \end{small}
\end{slide}

\addtocounter{slide}{-1}

\begin{slide}
  \slidetitle{Math Mode}
  {\LaTeX} has a special mode for formatting mathematical formulas.
  In addition to displaying complicated mathematical notations, this
  mode allows the use of:
  \begin{itemize}
    \item Subscripts and superscripts
    \item Greek letters and various special symbols
  \end{itemize}
  Thus, math mode is also useful for some nonmathematical text:
   \begin{quote}
     The CH$_3$COOH was irradiated with $\alpha$-rays while at a
     temperature of $350^\circ$C.
   \end{quote}
\end{slide}

\begin{slide}
\slidetitle{Types of Math Mode}
\begin{enumerate}
\item \emph{Text math mode} (\cmd{begin\{math\}}$\ldots$\cmd{end\{math\}}):
the formula appears in the middle of running text (e.g. $x^2 +
y^2$).
\item \emph{Display math mode} (\cmd{begin\{displaymath\}}$\ldots$
\cmd{end\{displaymath\}}): the formula is set off on its own line.
\[ \int_0^{\infty} \frac{\sin x}x = \frac\pi 2. \]
A special type of this mode is \emph{equation mode}
(\cmd{begin\{equation\}} $\ldots$ \cmd{end\{equation\}}), in which
the formula is numbered for reference purposes~(\ref{eqn:foo}):
\begin{equation} \label{eqn:foo}
H:I\rightarrow \pi_k(GL_{2n}(\mathbb{C})), H_t = \left(\begin{array}{cc} 0 & 1 \\
1 & 0
\end{array}\right)^t \cdot \left(\begin{array}{cc} 1 & 0 \\ 0 & B
\end{array}\right)\cdot \left(\begin{array}{cc} 0 & 1 \\ 1 & 0
\end{array}\right)^t
\end{equation}
\end{enumerate}
Long or tall or important formulae should ordinarily be displayed.
\end{slide}

\begin{slide}
  \mktitle{Using Math Mode}
  There are several shorthand techniques of using math mode.
\begin{itemize}
\item For text math mode, use \texttt{\$}\ldots\texttt{\$} (recommended) or
\cmd{(}\ldots\cmd{)}.
\item For display math mode, use \texttt{\$\$}\ldots\texttt{\$\$} or
  \cmd{[}\ldots\cmd{]}.
  \end{itemize}
  It is important to make sure that the way you end math mode matches
  the way you started it.  For example,
  \begin{center}  \cmd{begin\{math\}} \texttt{math stuff} \texttt{\$}
  \end{center}
  \textbf{will not work.}
\end{slide}

% Use \DeclareMathOperator (in the presence of AMS packages)
% instead of the construction below.  \DeclareMathOperator stuff
% has to go in the preamble.  I advise against overriding
% predefined LaTeX commands (like \div (division sign, math mode and
% \O (big O with a slash through it, text mode).  It's probably a
% good idea not to use one-letter command names in general,
% as there aren't many of them and they're likely to be taken.
% Also, \newcommand is ordinarily better than \def (at least at first)
% because it screams when you override a command that already exists.
%\def\ord{\mathrm{ord}}
%\def\codim{\mathrm{codim}}
%\def\div{\mathrm{div}}


\newcommand{\OO}{\mathscr{O}}

\begin{slide}
\mktitle{Example}
\begin{example}
For $a\in A = \OO_{V,W}$, let
\[\ord_V(a) = l_A(A/(a)) \]
denote the length of $A/(a)$
as an A-module: we extend this as
\[\ord_V\left(\frac{a}{b}\right)
= \ord_V(a) - \ord_V(b).\] Then,
for $r\in R(W_i) $, we construct
the divisor
\[
\divv(r) = \sum_{\substack{V
\subset W \\ \codim(V) = 1}}
\ord_V(r)[V].
\]
\end{example}
\end{slide}
% \begin{verbatim}
% \begin{equation}
% \oint E \cdot dA = \frac{q}{\epsilon_0}
% \end{equation}
% \end{verbatim}

% Equation mode gives numbered equations -- refer to them later with
% {\texttt label} and {\texttt ref}.  If you don't need to refer to
% equations, use:

% \begin{verbatim}
% \begin{displaymath}
% \oint E \cdot dA = \frac{q}{\epsilon_0}
% \end{displaymath}
% \end{verbatim}

% or
% \begin{verbatim}
% $$\oint E \cdot dA = \frac{q}{\epsilon_0}$$
% \end{verbatim}

% $$\oint E \cdot dA = \frac{q}{\epsilon_0}$$
%%%%

%\begin{slide}
%  \slidetitle{What Things Look Like in Math Mode}
%
%  To get numbers in math mode, just type them as you usually would. The
%  same goes for any of the symbols $=$, $+$, $-$, $<$, $>$, $($, $)$,
%  $[$, $]$, $:$, $?$, $/$.
%
%  To display a variable, just type it in. It will appear italicized,
%  which is correct. Don't use math mode just to italicize text, though,
%  or it will look ugly as sin.  (Use \verb+\textit{italic stuff}+ instead.)
%
%  For $\sin$, $\cos$, $\lim$, and similar functions, use \cmd{sin},
%  \cmd{cos}, \cmd{lim}, etc.
%
%  Spaces are completely ignored in math mode except when they end
%  command names.

%Math mode automatically handles numbers, variable names, and these
%  symbols: $=$, $+$, $-$, $<$, $>$, $($, $)$, $[$, $]$, $:$, $?$, $/$.

% \LaTeX\ italicizes variable names, but ignores spaces.

% Spaces are ignored except when they end command names.

% There are commands for most words you will need in equations: \cmd{cos}, \cmd{sin}, \cmd{csc}, \cmd{lim}.

% \begin{verbatim}
% \begin{displaymath}\lim_{ x \to \infty}    \frac{ \sin x}{x}=  1
% \end{displaymath}
% \end{verbatim}
% \begin{displaymath}\lim_{ x \to \infty}    \frac{ \sin x}{x}=  1
% \end{displaymath}
%\end{slide}

\begin{slide}
\mktitle{Typing Mathematical Expressions}
\begin{itemize}
\item Numbers, Roman variable names, and most symbols of basic
arithmetic may be typed directly:
\end{itemize}
\begin{example}
If $a + 2 = 4 + b$ and
$2(3b - a) = 43$,
then $b = 47/4$.
\end{example}
\begin{itemize}
\item Spaces are generally ignored in math mode: \verb!$abc+def$! and
\verb!$a b c  + d  e f$! both make $abc+def$.
\end{itemize}
\end{slide}

\begin{slide}
\mktitle{Typefaces in Math Mode}

Letters typed in math mode are set in an italic type, as is conventional
for Roman variables ($x$, etc.).

But do not use this as a quick way to italicize ordinary text!  Words
typed in math mode look $really freakin' ugly$
(that was \verb+$really freakin' ugly$+).  Use \verb+\emph{...}+ instead.

If you want to put text inside math mode, you can use %\verb+{\rm text}+.
\verb+\text{your text here}+.  If that doesn't work, add
\verb+\usepackage{amsmath}+ before the line \verb+\begin{document}+, or use
\verb+\textrm{your text here}+.
%!!!
% \text is definitely the correct command here, but we haven't talked
% about packages yet.  Maybe we should just tell them at the beginning
% to include \usepackage{amsmath} in every document they ever do.

For sin, cos, lim, and other notations written in upright type, use commands
\verb+\sin+, \verb+\cos+, \verb+\lim+, and so forth.

\end{slide}

\begin{slide}
  \mktitle{Super- and Subscripts}

  To get a superscript, use \verb=^{text}=. To get a subscript, use
  \verb=_{text}=.

  Both a subscript and a superscript can be placed on the same
  expression.

  To get a $'$ (prime), use \verb='= repeated as many times as needed.

  Examples:
  \vspace{-0.4\baselineskip}
  \begin{center}
    \begin{tabular}{l@{\hspace{1in}}c||l@{\hspace{1in}}c}
      Command & Result & Command & Result \\ \cline{1-2} \cline{3-4}
      \vbox to 24pt{}\verb=a^{b}= & $a^{b}$ & \verb=a^{b + c}= & $a^{b + c}$ \\
      \verb=a'= & $a'$ & \verb=a'''= & $a'''$ \\
      \verb=a_{b}= & $a_{b}$ & \verb=a_{b + c}= & $a_{b + c}$ \\
      & & & \\
      \verb=a_{0}^{n+1}= & $a_{0}^{n+1}$ & \verb=a^{n+1}_{0}= & $a^{n+1}_{0}$
      \\
      \verb=x^{y^{z}}= & $x^{y^{z}}$ & \verb=a_{b_{c}}= & $a_{b_{c}}$
    \end{tabular}
  \end{center}
\end{slide}

\begin{slide}
  \mktitle{Nonmath Uses of Math Mode}

  Subscripts and superscripts are often useful in chemical formulae and
  temperature values.

  \begin{center}
    \begin{tabular}{l@{\hspace{1in}}c}
      Text & Result  \\ \cline{1-2}
      \verb=CH$_{3}$COOH= & CH$_{3}$COOH \\
      \noalign{} \\
      \verb=180$^{\circ}$C= & 180$^{\circ}$C \\
      \noalign{} \\
      \verb=$^{238}_{92}$U= & $^{238}_{92}$U \\
      \noalign{}
    \end{tabular}
  \end{center}

  Notice that subscripts and superscripts may be attached to nothing
  (as in \verb+$_{3}$+ in the formula for acetic acid above).

\end{slide}
\begin{slide}
  \mktitle{Variables and Symbols in Math Mode}
  Greek letters: for lowercase, use \cmd{lettername} in math
  mode (\verb=$\gamma$= $\rightarrow \gamma$). Some uppercase letters
  can be obtained by \cmd{Lettername} (\verb=$\Gamma$= $\rightarrow \Gamma$).

  Assignment 1: Open {\tt math.tex} in your {\tt MiniPaper}
  directory, and typeset the following sentence into the body of the
  document.
\begin{quote}
  If $f(\omega) = \omega - e\log\omega$ then $f'(\omega) = 1 - e/\omega$
and $e^{f(\omega)} = \Omega(1)$ in positive $\omega$.
\end{quote}
\end{slide}

\begin{slide}
  \mktitle{Assignment 1 solution}
\begin{example}
If $f(\omega) = \omega -
e\log\omega$ then $f'(\omega) =
1 - e/\omega$ and $e^{f(\omega)}
= \Omega(1)$ in positive $\omega$.
\end{example}
\end{slide}


\begin{slide}
  \mktitle{Fractions and Roots}

  Fraction: use \cmd{frac\{numerator\}\{denominator\}}
  (\cmd{frac\{3\}\{5\}} $\rightarrow\frac{3}{5}$).
  (In text math mode, the slashed forms \verb+n/d+ usually look
  better.)

  Square root: use \cmd{sqrt\{$\cdots$\}}
  (\cmd{sqrt\{3x + 5\}} $\rightarrow\sqrt{3x+5}$).

  $n^{\mathrm{th}}$ power root: use \cmd{sqrt[n]\{$\cdots$\}}
  (\cmd{sqrt[3]\{x\}} $\rightarrow\sqrt[3]{x}$).

  Assignment 2: Typeset the equation
  \begin{equation}
    \frac{1}{1 + \sqrt[3]{2} + \sqrt[3]{4}} = \sqrt[3]{2} - 1
  \end{equation}

  Note that it is numbered.

\end{slide}

\begin{slide}
  \mktitle{Assignment 2 solution}

\begin{example}
  \begin{equation}
    \frac{1}{1 + \sqrt[3]{2}
    + \sqrt[3]{4}} =
    \sqrt[3]{2} - 1
  \end{equation}
\end{example}
\end{slide}

\begin{slide}
  \mktitle{Common Mathematical Functions} Most common mathematical
  functions and operators have corresponding commands which are just
  names of the functions:
  \begin{itemize}
    \item Summation ($\sum$), product ($\prod$), and integral ($\int$)
    signs are given by \cmd{sum}, \cmd{prod}, and \cmd{int} respectively.
    \item \cmd{lim}, \cmd{log}, \cmd{sin}, \cmd{cos}, \cmd{tan},
      \cmd{sec}, \cmd{csc}, \cmd{cot} yield proper formatting of these common functions.
  \end{itemize}
  \begin{center}
    \begin{tabular}{l@{\hspace{1in}}c}
      Command & Result \\ \cline{1-2}
      \noalign{}\\
      \cmd{log (3x + 5)} & $\log (3x + 5)$ \\
      \noalign{}\\
      \verb=\cos (5x + x^2)= & $\cos (5x + x^2)$ \\
      \noalign{}\\
      \verb=\sin^{2} (4x + 7)= & $\sin^2(4x + 7)$ \\
%      \noalign{}\\
%      \verb=\lim \frac{1}{n}= & $\lim \frac{1}{n}$
    \end{tabular}
  \end{center}
\end{slide}

\begin{slide}
  \mktitle{Common Mathematical Symbols}
  Most common mathematical symbols have corresponding commands related
  to the symbol name or symbol appearance.

  \begin{center}
    \begin{tabular}{l@{\hspace{1in}}c||l@{\hspace{1in}}c}
      Command & Result & Command & Result\\ \hline
      \cmd{in} & $\in$ & \cmd{nabla} & $\nabla$ \\
      \cmd{cap},\cmd{cup} & $\cap,\cup$ &
      \cmd{subset},\cmd{supset} & $\subset,\supset$ \\
      \cmd{geq},\cmd{leq} & $\geq,\leq$ &
      \cmd{ldots},\cmd{cdots} & $\ldots,\cdots$ \\
    \end{tabular}
  \end{center}
  To negate $=$ and $\in$, use \cmd{neq} and \cmd{notin}. Other symbols can be negated using the
  \cmd{not} command: \cmd{not}\cmd{leq} $\rightarrow\not\leq$,
  \cmd{not>}
  $\rightarrow\not>$.

  Assignment 3:  Typeset the following.
  \begin{quote}
  If $A,B\subset \Gamma$ then $(\Gamma - A\cup B) \subset (\Gamma -
A\cap B)$.
\end{quote}
\end{slide}

\begin{slide}
  \mktitle{Assignment 3 solution}

\begin{example}
  If $A,B\subset \Gamma$ then
  $(\Gamma - A\cup B) \subset
  (\Gamma - A\cap B)$.
\end{example}
\end{slide}

\begin{slide}
  \mktitle{Bounded Sums and Such} Sums, products, integrals, and
  the like often have written upper and lower bounds.  These can be
  indicated using \verb=_= for the lower bound and \verb=^= for the
  upper bound:

  \begin{example}
  \[ \sum_{i = -N}^{i = N}
  \sum_{j \geq 0}
  \frac{1}{i^2 + j^3} \]
\end{example}
  To best display unions and intersections that are bounded, use
  \cmd{bigcup} and \cmd{bigcap} instead of \cmd{cup} and \cmd{cap}.
\end{slide}

\begin{slide}
  \mktitle{Sum, Integral, Limit Examples}
  In text:
  \vspace{-0.9\baselineskip}
  \begin{center}
    \begin{tabular}{l@{\hspace{0.7in}}c}
      \verb|\sum_{i=1}^{\infty} i^{-2}| & $\sum_{i=1}^{\infty} i^{-2}$ \\
      \noalign{} \\
      \verb|\int_{3}^{2x} y\, dy| & $\int_{3}^{2x} y \, dy$ \\
      \noalign{} \\
      \verb|\lim_{n \to \infty} \frac{1}{n}| & $\lim_{n \to \infty} \frac{1}{n}$
    \end{tabular}
  \end{center}
  \vspace{-0.2\baselineskip}
  In displays:
  \vspace{-0.8\baselineskip}
  \begin{center}
    \begin{tabular}{l@{\hspace{1in}}c}
%      Command & Result \\ \cline{1-2}
      \verb|\sum_{i=1}^{\infty} i^{-2}| & $\displaystyle\sum_{i=1}^{\infty} i^{-2}$ \\
      \noalign{} \\
      \verb|\int_{3}^{2x} y\, dy| & $\displaystyle\int_{3}^{2x} y\, dy$ \\
      \noalign{} \\
      \verb|\lim_{n \to \infty} \frac{1}{n}| & $\displaystyle\lim_{n \to
      \infty} \frac{1}{n}$
    \end{tabular}
  \end{center}
\end{slide}

\begin{slide}
  \mktitle{Union and Intersection Examples}
  In text:
  \vspace{-0.6\baselineskip}
  \begin{center}
    \begin{tabular}{l@{\hspace{0.7in}}c}
      \verb|\bigcap_{i=0}^{\infty} U_i| & $\bigcap_{i=0}^{\infty} U_i$ \\
      \noalign{} \\
      \verb|\bigcup_{k=3}^{n} \{1, 2, \ldots, k\}| & $\bigcup_{k=3}^{n} \{1, 2, \ldots, k\}$ \\
      \noalign{} \\
%      \verb|(\bigcup_i U_i) \cup (\bigcup_i V_i)| & $(\bigcup_i U_i) \cup (\bigcup_i V_i)$
    \end{tabular}
  \end{center}
  \vspace{-0.8\baselineskip}
  In displays:
  \vspace{-1.2\baselineskip}
  \begin{center}
    \begin{tabular}{l@{\hspace{1in}}c}
      \verb|\bigcap_{i=0}^{\infty} U_i| & $\displaystyle\bigcap_{i=0}^{\infty} U_i$ \\
      \noalign{} \\
      \verb|\bigcup_{k=3}^{n} \{1, 2, \ldots, k\}| & $\displaystyle\bigcup_{k=3}^{n} \{1, 2, \ldots, k\}$ \\
      \noalign{} \\
      \verb|(\bigcup_i U_i) \cup (\bigcup_i V_i)| & $\displaystyle(\bigcup_i U_i) \cup (\bigcup_i V_i)$
    \end{tabular}
  \end{center}
\end{slide}

\begin{slide}
  \slidetitle{Assignment 7---Integrals, roots, exponents}

  Typeset the following equations:
  \begin{equation}
      \lim_{\min\{x,y\} \to \infty} \frac{x + y}{x^2 + y^2} = 0
\end{equation}
  \begin{equation}
    \int_{-\infty}^{\infty} e^{-x^{2}}dx = \sqrt{\pi}
  \end{equation}

\end{slide}

\begin{slide}
  \mktitle{Assignment 7 solution}
  \addtocounter{equation}{-1}
  \begin{example}
  \begin{equation}
  \lim_{\min\{x,y\} \to \infty}
  \frac{x + y}{x^2 + y^2} = 0
  \end{equation}
  \begin{equation}
  \int_{-\infty}^{\infty}
  e^{-x^{2}}dx = \sqrt{\pi}
  \end{equation}
\end{example}
\end{slide}

\begin{slide}
  \mktitle{Mathematical fonts}
\begin{itemize}
\item Various fonts can be used to create unique mathematical
symbols: \\
\begin{tabular}{c|c|c}
\hline Bold & \cmd{mathbf\{x\}} & $\mathbf{x}$ \\ \hline
Calligraphic & \cmd{mathcal\{A\}} & $\mathcal{A}$ \\ \hline
Blackboard bold & \cmd{mathbb\{Z\}} & $\mathbb{Z}$ \\ \hline Script
& \cmd{mathscr\{O\}} & $\mathscr{O}$ \\ \hline
\end{tabular}
\end{itemize}
Assignment 8: Typeset the following equation.
  \begin{displaymath}
    \mathbb{R}^{s} \supset \mathbf{I}
  \end{displaymath}

  Note:  the ``I'' is bold.
\end{slide}

\begin{slide}
  \mktitle{Assignment 8 solution}
\begin{example}
\begin{displaymath}
\mathbb{R}^{s} \supset \mathbf{I}
\end{displaymath}
\end{example}
\end{slide}

\begin{slide}
  \mktitle{Common Error Messages}
  \begin{verbatim}
! Missing $ inserted.
<inserted text>
                $
l.8

? \end{verbatim}

  You have forgotten to end math mode.  The line number after the
  ``\texttt{l.}'' (in this case ``8'') is the first line at which
  {\LaTeX} has realized that you have forgotten to end math mode; it is
  usually the end of the paragraph the error is in.

  Common cause:  Forgetting to put a \cmd{} before a \%.
\end{slide}

\begin{slide}
  \mktitle{Common Error Messages}
  \begin{verbatim}
! Missing $ inserted.
<inserted text>
                $
l.6 30^
       \circ
? \end{verbatim}

  You have used a command (in this case \verb=^=) which {\LaTeX}
  knows belongs only in math mode.  The line number given is the
  location of the command in question.
\end{slide}


\begin{slide}
  \mktitle{Common Error Messages}
  \begin{verbatim}
! LaTeX Error: \begin{displaymath} on input line 8 ended by
  \end{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

l.10 \end{document}

? \end{verbatim}

  You have forgotten to end display math mode.  The line number on which
  math mode began is listed (in this case, ``input line~8'').
\end{slide}

\begin{slide}
  \mktitle{Common Error Messages}
  \begin{verbatim}
! LaTeX Error: \mathbb allowed only in math mode.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

l.6 \mathbb
           {stuff}
? \end{verbatim}

The command in question (in this case \cmd{mathbb}) is only allowed in
math mode and you have tried to use it outside of math mode.
\end{slide}

\end{document}
