\documentclass{beamer}

\usetheme{default}

\title{A very brief introduction to \LaTeX \, and beamer}
\author{Doug Drinen}
\date{Summer 2010}

\begin{document}

\begin{frame}
\titlepage
\end{frame}


\begin{frame}{Typesetting Equations}
This is some text with some math right in the middle of a regular paragraph: $\int_{0}^{\pi} x^2 dx = \pi^3 / 3$.  Look at that!  This is said to be an {\it inline} equation.  

% the equation is enclosed within dollar signs.  
% \int creates the integral sign
% \pi typesets a good-looking pi
% the underscore character (_) creates a subscript.  The caret (^) creates a superscript
% if you want something italicized, note the word "inline" above

\end{frame}




\begin{frame}{More on inline equations}
If you don't use math mode, people will laugh at you:

\vfill
% \vfill leaves some vertical space.  Take it out and see what happens

{\bf RIGHT}:  Let $m$ and $n$ be integers with $m = n$.

\vfill

{\bf WRONG}:  Let m and n be integers with m = n.

\end{frame}




\begin{frame}{Still more on inline equations}

There are a few special cases, though.  Note that the name of the sine function looks silly in math mode.

\vfill

{\bf RIGHT}:  $\sin(x)$.

\vfill

{\bf WRONG}:  $sin(x)$.

\vfill

The same is true of natural log (use \textbackslash ln), cosine (\textbackslash cos), and a few others.

\end{frame}





\begin{frame}{Displayed Equations}

If an equation is important, you can put it in {\it display} mode instead of inline mode.  This gives it a little more prominence.  Here, for example, is an important fact.

$$
\frac{x}{y} + \frac{w}{z} = \frac{xz + wy}{yz}.
$$

\end{frame}



\begin{frame}{Watch out for plain text in displayed equations!}

This is pretty ugly:

$$
For all \theta, \theta  + 2\theta = 3\theta.
$$

\end{frame}


\begin{frame}{What to do about it}

Do this:
$$
\hbox{For all } \theta, \theta  + 2\theta = 3\theta.
$$

\vfill

Or maybe even this:
$$
\hbox{For all } \theta, \,\,\,\, \theta  + 2\theta = 3\theta.
$$


%  Any regular text within a displayed equation should be put inside an \hbox

% NOTE:  LaTeX handles all spacing automatically, so if you feel you need a little extra space somewhere, you need to add it manually (that's what the \, stuff is for)


\end{frame}




\begin{frame}{Lots and lots of symbols are available in \LaTeX}
$$
\ln\left(\prod_{\xi=1}^{\nu} \vartheta_{\xi}\right) = \sum_{\iota=1}^{\sqrt{\nu^2}} \ln(\vartheta_{\iota}).
$$
\end{frame}

% handy tip:  \left( and \right) will automatically size your parentheses to fit what's inside them.  If you just use regular parentheses here, it will look bad.




\begin{frame}{A bulleted list}
\begin{itemize}
\item $1^1 + 6^1 = 7^1$
\item $3^2 + 4^2 = 5^2$
\item Are there nonzero integeters $a$, $b$, and $c$ such that $a^3 + b^3 = c^3$?
\end{itemize}
\end{frame}




\begin{frame}{A numbered list}
\begin{enumerate}
\item $1^1 + 6^1 = 7^1$
\item $3^2 + 4^2 = 5^2$
\item Are there nonzero integeters $a$, $b$, and $c$ such that $a^3 + b^3 = c^3$?
\end{enumerate}
\end{frame}




\begin{frame}{A numbered list with customized ``numbers"}
\begin{enumerate}
\item[One] $1^1 + 6^1 = 7^1$
\item[B] $3^2 + 4^2 = 5^2$
\item[Third] Are there nonzero integeters $a$, $b$, and $c$ such that $a^3 + b^3 = c^3$?
\end{enumerate}
\end{frame}




\begin{frame}{An aligned equation}
\begin{align*} 
   (x+y)(x-y)  & =  x^2 + xy - xy -y^2 \\
& =  x^2 - y^2\\
& \leq  x^2\\
\end{align*}
\end{frame}

% this looks scary, but it's not so bad
% the double backslashes denote the end of a line
% the ampersand (&) denotes the place of vertical alignment.


\begin{frame}{A table of data}

I stole these examples from {\tt http://en.wikibooks.org/wiki/LaTeX/Tables} which you are encouraged to visit


\vfill

\begin{tabular}{ l c r }
  1 & 2 & 3 \\
  4 & 5 & 6 \\
  7 & 8 & 9 \\
\end{tabular}
\end{frame}

% the 'l c r' on the first line indicates that the first, second, and third columns should be left-justified, centered, and right-justified, respectively.
% double backslashes (\\) tell LaTeX where the end of a row is
% the ampersand (&) marks the dividing line between columns.


\begin{frame}{A more complicated table of data}
\begin{center}
  \begin{tabular}{ l | c || r | }
    \hline
    1 & 2 & 3 \\ \hline
    4 & 5 & 6 \\ 
    7 & 8 & 9 \\
    \hline
  \end{tabular}
\end{center}
\end{frame}

% note the centering
% other notes:  the '\hline' produces horizontal lines.  The vertical bars between the l, c, and r produce vertical lines between columns



\begin{frame}{Even more complicated}
\begin{center}
\begin{tabular}{|r|l|}
  \hline
  7C0 & hexadecimal \\
  3700 & octal \\ \cline{2-2}
  11111000000 & binary \\
  \hline \hline
  1984 & decimal \\
  \hline
\end{tabular}
\end{center}
\end{frame}




\begin{frame}{Adding a graphic}
\includegraphics{xsq.pdf}
\end{frame}

% this graphic was created in Mathematica and saved as a .pdf in the same directory where this file lives.




\begin{frame}{Now let's do some beamer}

\pause

The most common effect you'll need is to be able to reveal just a bit at a time.

\vfill

\pause
Fortunately, \pause this is easy.

\end{frame}



\begin{frame}{More complicated reveals}

\pause

\begin{center}
  \begin{tabular}{ l | c || r | }
    \hline
    \onslide<2-6,8>{1} & \onslide<3-6>{2} & \onslide<4-6,9>{hello} \\ \hline
    \onslide<5-6>{4} & \onslide<5-6,8,9>{5} & \onslide<5-6>{6} \\ 
    \onslide<6,9>{7} & \onslide<6>{8} & \onslide<6,8>{9} \\
    \hline
  \end{tabular}
\end{center}
\end{frame}

% anything that is revealed only part of the time must be put in an \onslide thing.
% the "views" within a slide are implicitly numbered 1 through whatever
% the text in the upper right hand corner of the matrix has this:  \onslide<4-6,9>{3} .  This means that the hello (the thing in curly braces) should appear 
% on views number 4 through 6, and also number 9.




\begin{frame}{Columns}

\pause

\begin{columns}

\begin{column}{.5\textwidth}    
Left column 

blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
\end{column}

\pause

\begin{column}{.5\textwidth}
Right column 

blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
\end{column}

\end{columns}
\end{frame}



\begin{frame}{More Columns}

\begin{columns}

\begin{column}{.2\textwidth}    
Skinny column 

blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
\end{column}


\begin{column}{.5\textwidth}
Wide column 

blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
\end{column}

\end{columns}
\end{frame}




\begin{frame}{More Columns}

\begin{columns}

\begin{column}{.33\textwidth}    
Left column 

blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
\end{column}


\begin{column}{.33\textwidth}
Middle column 

blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
\end{column}

\begin{column}{.33\textwidth}
Right column 

blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
blah blah blah blah 
\end{column}

\end{columns}
\end{frame}





\begin{frame}{More Columns}

This is some comment that applies to all the junk in all the columns.  Therefore, it spans the entire slide.

\vfill

\begin{columns}

\begin{column}{.33\textwidth}    
Left column 

blah blah blah blah 
\end{column}


\begin{column}{.33\textwidth}
Middle column 

blah blah blah blah 
\end{column}

\begin{column}{.33\textwidth}
Right column 

blah blah blah blah 
\end{column}

\end{columns}

\vfill

Isn't it nice that we can make things span the entire slide?


\end{frame}







\begin{frame}{More Columns}


\vfill

\begin{columns}
\begin{column}{.33\textwidth}    
Left column 

blah blah blah blah 
\end{column}


\begin{column}{.33\textwidth}
Middle column 

blah blah blah blah 
\end{column}

\begin{column}{.33\textwidth}
Right column 

blah blah blah blah 
\end{column}
\end{columns}

\vfill

\begin{columns}
\begin{column}{.5\textwidth}    
Bottom Left column 

blah blah blah blah 
\end{column}


\begin{column}{.5\textwidth}
Bottom Right column 

blah blah blah blah 
\end{column}

\end{columns}


\end{frame}




\begin{frame}{Sizing images}

\includegraphics[width=.1\textwidth]{xsq.pdf}

\vfill

\includegraphics[width=.2\textwidth]{xsq.pdf}

\end{frame}




\begin{frame}{Sizing images II}     

\begin{columns}
\begin{column}{.33\textwidth}    
\begin{center}
Small

\includegraphics[width=.5\textwidth]{xsq.pdf}
\end{center}

\end{column}


\begin{column}{.33\textwidth}
\begin{center}
Medium

\includegraphics[width=.7\textwidth]{xsq.pdf}
\end{center}
\end{column}


\begin{column}{.33\textwidth}
\begin{center}
Large

\includegraphics[width=.9\textwidth]{xsq.pdf}
\end{center}
\end{column}
\end{columns}

\end{frame}





\end{document}
