% This is a comment because it starts with a percent sign (%)
\documentclass{beamer} % Beamer is for slides.
\usetheme{Singapore} % See all themes and color themes at: http://www.hartwork.org/beamer-theme-matrix/
\usecolortheme{rose}
\beamertemplatenavigationsymbolsempty %gets rid of the navigation bar at the bottom of each slide

% For additional functionality, you can use different packages.
\usepackage{tikz} % Used for diagrams and graphs
\usetikzlibrary{arrows}
\usetikzlibrary{calc}
\usetikzlibrary{through}
\usetikzlibrary{chains}

\usebeamercolor{structure}
\tikzset{action/.style = {
  rectangle, minimum size = 15mm, minimum height = 15mm, rounded corners = 3mm,
  very thick, draw=structure.fg!80,
  top color = white, bottom color = structure.fg!40,
  }
}
\usebeamercolor{palette primary}
\tikzset{every join/.style = {
    ->, palette primary.fg, very thick}
}
\tikzset{hv path/.style = {
    rounded corners, to path = { -| (\tikztotarget) }
  }
}

% Put your title here. You could also include a subtitle, but I don't need or
% want one. To skip the subtitle, just don't include it.
\title{Slide Presentations in \LaTeX\ and Beamer}
%\subtitle{Subtitle}

% Your name would go here. But you're not teaching the class.
% You can also include an institute after your name. I like to think of myself
% as a freelancer.
\author{Eric Dilmore}
%\institute{Institution Name}

% You can replace \today with any date you want in any format, so long as it's
% in the brackets. Technically, you don't need \date if you want it to display
% today's date; it does this by default. To remove it entirely, use \date{}
% with no argument.
\date{June 26, 2013} 

% The subject doesn't print. It's actually for metadata for the pdf. I never
% see it, but since it's in the template, I'll let you know that you can use
% it. If you want.
\subject{Latex}

\begin{document}
  \maketitle

  % \section and \subsection put the markers at the top of the page to show the
  % viewers where they are in the presentation. They could also be
  % automatically put into a table of contents with the \tableofcontents
  % command.
  \section{Introduction}
  \subsection{Introduction to \LaTeX}
  \begin{frame}
    \frametitle{What is \LaTeX?}

    \LaTeX\ is a document markup language, much like HTML or Markdown. The
    \LaTeX\ code can be compiled into many different formats, such as pdf. It
    is used to make consistent, professional-looking documents.

  \end{frame}

  \begin{frame}
    \frametitle{Why \LaTeX?}
    \framesubtitle{Or, Why Am I Even Here?}

    \begin{itemize}
      \item Code is written in plain text.
      \item Content is separate from format.
      \item Content is typeset in a professional way.
      \item Math is easy to type and looks beautiful.
      \item Documents look the same, no matter what.
      \item It's free, as in free speech and as in free beer.
    \end{itemize}
  \end{frame}

  \begin{frame}
    \frametitle{Typical \LaTeX\ Presentation Workflow}

    \makebox[\textwidth][c]{
    \begin{tikzpicture}[start chain, node distance = 5mm, > = stealth]
      \node[action](open){Open template.};
      \node[action, right=of open](make frame){Make a frame};
      \node[action, right=of make frame](compile){\begin{tabular}{c}Compile.\\
          Check for Errors.\end{tabular}};
      \node[action, below=of compile](errors){Seek and destroy errors.};

      \chainin (open);
      \chainin (make frame) [join];
      \chainin (compile) [join];
      \chainin (errors) [join];
      \chainin (make frame) [join=by {hv path}];
    \end{tikzpicture}
    }
  \end{frame}

  \section{Format}
  \subsection{Format of a Slide Presentation}
  \begin{frame}
    \frametitle{Preamble}
    \framesubtitle{We the people of the CCT and LA-SiGMA REUs...}

    The preamble is anything that comes before the main document. It is used
    for:
    \vskip 24pt
    \begin{itemize}
      \item Defining the type of document.
      \item Defining data such as the title and author.
      \item Applying global formatting.
      \item Including packages to add functionality.
    \end{itemize}
  \end{frame}

  \begin{frame}
    \frametitle{Themes}
    Complete themes are available with beamer. For previews of all available
    built-in themes, visit: \\
    http://www.hartwork.org/beamer-theme-matrix/ \\
    To change it, use \texttt{\textbackslash usetheme\{theme\}}.
    
    \only<1>{\vskip 19.5pt You can change the color of each object in the
      document. Use \texttt{\textbackslash setbeamercolor} to do so.}
    \only<2>{\vskip 15pt \makebox[\textwidth][c]{\Huge OR}}
    \only<3>{\vskip 20pt Use \texttt{\textbackslash usecolortheme} to change
      all colors to a preset theme. Color themes are in the online matrix at
      the top.}
  \end{frame}

%  \begin{frame}
%    \frametitle{Document Classes}
%
%    The preamble must begin with the \texttt{\textbackslash documentclass}
%    command, which defines the type of document you are making.
%    
%    Some common document classes are:
%    \vskip 12pt
%    \tt
%    \begin{itemize}
%      \item article
%      \item report
%      \item book
%      \item letter
%      \item beamer
%    \end{itemize}
%    \normalfont
%    \vskip 12pt
%    We will use Beamer for slide presentations.
%  \end{frame}
%
%  \begin{frame}
%    \frametitle{Packages}
%    Include packages with the \texttt{\textbackslash usepackage{}} command.
%
%    These are some packages to get to know:
%    \vskip 24pt
%    \tt
%    \begin{itemize}
%      \item geometry
%      \item amsmath
%      \item siunitx
%      \item hyperref
%      \item fancyhdr
%      \item Tikz
%    \end{itemize}
%    \normalfont
%  \end{frame}

  \begin{frame}
    \frametitle{The Document}
    The document holds everything that will be visible in the document.
    \vskip 12pt
    \texttt{\textbackslash begin\{document\}}\vskip 12pt
    \vdots \vskip 10.3pt
    \vdots \vskip 10.3pt
    \vdots \vskip 10.3pt
    \vdots \vskip 10.3pt
    \vdots \vskip 10pt
    \texttt{\textbackslash end\{document\}}
  \end{frame}

  \begin{frame}
    \frametitle{The Frame}
    The frame holds everything that will go on one slide of the presentation.
    You can define a title and subtitle for each frame.
    \vskip 12pt
    \tt
    \textbackslash begin\{document\}\vskip 12pt
    \quad \textbackslash begin\{frame\}\vskip 12pt
    \only<2>{\qquad \textbackslash frametitle\{Your Title\}\vskip 12pt}
    \only<2>{\qquad \textbackslash framesubtitle\{Your Subtitle\}\vskip 12pt}
    \only<1>{\qquad \vdots \vskip 9.1pt}
    \only<1>{\qquad \vdots \vskip 9.4pt}
    \qquad \vdots \vskip 12pt
    \quad \textbackslash end\{frame\}\vskip 12pt
    \textbackslash end\{document\}
    \normalfont
  \end{frame}

  \section{Content}
  \subsection{Content}
  \begin{frame}
    \frametitle{Line Breaks}

    % Note that double quotes are done with two single quotes, forward then
    % backwards.
    This is text on the slide. This is the first ``paragraph'' of text. It
    doesn't care about single line breaks\ldots % \ldots makes dot dot dot

    \ldots but it will break the line if there are two \ldots




    \ldots and only breaks once if there are more than two. Format your source
    however you like.\\You can also add newlines with a double backslash
    \textbackslash \textbackslash\ or with \texttt{\textbackslash linebreak}
    \linebreak like this.
    \vskip 64pt % \vskip creates vertical space.
    If you want more space, add a \texttt{\textbackslash vskip} where you want it.
    % \texttt uses a typewriter text font, good for displaying code.
  \end{frame}

  \begin{frame}
    \frametitle{Lists}
    % Itemize uses bullets to create a list.
    \begin{itemize}
      \item I am an item of the list.
      \item I am another item of the list.
        \begin{itemize}
          \item You can nest items under other items.
          \item You can go as deep as you like.
            \begin{itemize}
              \item Even this deep.
              \item Bullets and sizes will change to fit your level.
            \end{itemize}
        \end{itemize}
      \item I am yet another item of the list.
    \end{itemize}
    % Use enumerate like you use itemize. Numbers are inserted automatically.
    \begin{enumerate}
      \item I am the first item of the enumeration.
        \begin{enumerate}
          \item You can even nest in enumerations.
          \item You could have nested an itemize within this enumerate.
          \item You could have nested an enumerate in the itemize.
        \end{enumerate}
      \item I am the second item of the enumerate.
      \item I am the third item of the enumerate.
    \end{enumerate}
  \end{frame}

  \begin{frame}
    \frametitle{Columns}
    % The columns environment splits the text into columns. You specify the
    % width of the columns for each column, typically in terms of a percent of
    % the width of the text area. The [t] specifies that the columns should
    % line up at the top. Try substituting a [c] or a [b] in to see what they
    % do.
    \begin{columns}[t]
      \begin{column}{.45\textwidth}
          This is text in the first column. It is much longer than the second
          column's text. Both columns are lined up at the first line of the
          columns.
      \end{column}
      \begin{column}{.45\textwidth}
          \centering{This is centered text in a second column.}
      \end{column}
    \end{columns}
    \vskip 24pt
    \hrule % \hrule creates a bar spanning the width of the text.
    \vskip 24pt
    This text comes after and outside of the columns environment entirely.
  \end{frame}

  \begin{frame}
    \frametitle{Tables}
    \tt
      \only<1>{\textbackslash begin\{tabular\}\{lll\}}
      \only<2>{\textbackslash begin\{tabular\}\{|l|l|l|\}}
      \\
      \only<2>{ \qquad \textbackslash hline\\}
      \qquad \qquad\ \ \ \& Lorem     \&         Ipsem\textbackslash \textbackslash \\
      \only<2>{ \qquad \textbackslash hline\\}
      \qquad Mass  \ \ \&   \ \ 10g \&    \ \ \ 8g\textbackslash \textbackslash \\
      \only<2>{ \qquad \textbackslash hline\\}
      \qquad Length  \&    \ 2.0m \&      \ 7.3m\textbackslash \textbackslash \\
      \only<2>{ \qquad \textbackslash hline\\}
      \textbackslash end\{tabular\}
    \normalfont
    \only<1>{
      \vskip 60pt
      \hrule
      \vskip 6pt
    }
    \only<2>{
      \vskip 6pt
      \hrule
      \vskip 6pt
    }
    \begin{onlyenv}<1>
      \begin{tabular}{lll}
               & Lorem & Ipsem \\
        Mass   & 10g   & 8g    \\
        Length & 2.0m  & 7.3m  \\
      \end{tabular}
    \end{onlyenv}
    \begin{onlyenv}<2>
      \begin{tabular}{|l|l|l|}
        \hline
               & Lorem & Ipsem \\
        \hline
        Mass   & 10g   & 8g    \\
        \hline
        Length & 2.0m  & 7.3m  \\
        \hline
      \end{tabular}
    \end{onlyenv}
  \end{frame}
  
  \begin{frame}
    \frametitle{Equations}
    % Use the equation environment to write equations to refer back to later.
    \[
        F=\quad ma %Whitespace isn't seen in the equation environment, so use \quad or \qquad to add a tab of white space
    \]
    Greek letters and other math symbols are really easy to insert and format:
    % The underscore character '_' makes the next character or group subscript,
    % and the caret character '^' makes the next character or group
    % superscript.
    \[
      \int\limits_0^{\infty} \alpha + \beta = \phi
    \]
    \vskip 24pt
    Also note the alignment of this system of equations.
    \[
      \begin{array}{rcrcrcl}
        2x & + & 2y & - & z & = & 0 \\
        -100x & - & 30y & + & z & = & 0
      \end{array}
    \]
  \end{frame}

  \begin{frame}
    \frametitle{Math To Know}
    \framesubtitle{In No Particular Order}
    {
      \linespread{1.5}
      \setlength{\parskip}{7pt}
      \tt % Like texttt{}, except for all text afterwards
      % Use \( and \) to denote inline math
      \begin{columns}[t]
        \begin{column}{0.25\textwidth}
          \textbackslash infty: \(\infty\)\linebreak
          \textbackslash nabla: \(\nabla\)\linebreak
          \textbackslash Psi: \(\Psi\)\linebreak
          \textbackslash forall: \(\forall\)\linebreak
        \end{column}

        \begin{column}{0.23\textwidth}
          \textbackslash sum: \(\sum\)\linebreak
          \textbackslash prod: \(\prod\)\linebreak
          \textbackslash int: \(\int\)\linebreak
          x\^\,\!\!\{2y\}: \(x^{2y}\)
        \end{column}

        \begin{column}{0.33\textwidth}
          \textbackslash frac\{x\}\{y\}: \(\frac{x}{y}\)\linebreak
          \textbackslash partial\{x\}: \(\partial{x}\)\linebreak
          \textbackslash sqrt\{x\}: \(\sqrt{x}\)\linebreak
          \textbackslash sqrt[3]\{x\}: \(\sqrt[3]{x}\)
        \end{column}
      \end{columns}
      \hrule
      \vskip 10pt
      x \textbackslash pm y: \(x \pm y\)\linebreak
      x \textbackslash div y: \(x \div y\)\linebreak
      \textbackslash overline\{x\}: \(\overline{x}\)\linebreak
      \textbackslash vert a \textbackslash vert: \(\vert a \vert\)

      % The \limits command forces the limit under/over the previous command (\lim)
      \textbackslash lim\_\{a \textbackslash rightarrow \textbackslash infty\}:
        \(\lim\limits_{a \rightarrow \infty}\) \linebreak
      \normalfont % Negates \tt and resets all fonts back to normal
    }
  \end{frame}

%  \begin{frame}
%    \frametitle{Pictures}
%
%    \texttt{\textbackslash includegraphics\{dolphin.png\}}\linebreak
%    \pause % This is a control structure. We'll learn this later.
%    % \includegraphics can insert jpg, png, or pdf images. The syntax is the
%    % same for each. It will automatically detect the type.
%    \includegraphics{dolphin.png}
%  \end{frame}
%
%  \begin{frame}
%    \frametitle{Pictures}
%
%    \texttt{\textbackslash includegraphics[width=100pt]\{dolphin.png\}}\linebreak
%    % \include graphics can take optional arguments (denotated by the square
%    % brackets [ ]). You can give height, width, and angle of the image, as
%    % well as crop it.
%    \includegraphics[width=100pt]{dolphin.png}
%  \end{frame}
%
%  \begin{frame}
%    \frametitle{Pictures}
%
%    \texttt{\textbackslash includegraphics[height=7cm]\{dolphin.png\}}\linebreak
%    \includegraphics[height=7cm]{dolphin.png}
%  \end{frame}
%
%  \begin{frame}
%    \frametitle{Pictures}
%
%    \texttt{\textbackslash includegraphics[width=\textbackslash textwidth]\{dolphin.png\}}\linebreak
%    \includegraphics[width=\textwidth]{dolphin.png}
%  \end{frame}

%  \begin{frame}
%    \frametitle{Presentation Controls}
%    \uncover<4->{Use \texttt{\textbackslash uncover<slides>} to keep spacing
%      consistent before and after revealing the results of the code.\linebreak}
%    \only<1>{Use \texttt{\textbackslash only<slides>} if you want code to be
%      evaluated  for only a part of the slide's appearance.}
%    \pause
%    \pause
%    If you want to delay the evaluation of code, you can put a
%    \texttt{\textbackslash pause} before the items to delay.
%  \end{frame}

  \begin{frame}
    \frametitle{Pictures}

    \tt
    \only<1,2>{\textbackslash includegraphics\{dolphin.png\}}
    \only<3>{\textbackslash includegraphics[width=100pt]\{dolphin.png\}}
    \only<4>{\textbackslash includegraphics[height=7cm]\{dolphin.png\}}
    \only<5>{\textbackslash includegraphics[width=\textbackslash textwidth]\{dolphin.png\}}
    \normalfont
    \linebreak
    \pause
    \only<1,2>{\includegraphics{dolphin.png}}
    \only<3>{\includegraphics[width=100pt]{dolphin.png}}
    \only<4>{\includegraphics[height=7cm]{dolphin.png}}
    \only<5>{\includegraphics[width=\textwidth]{dolphin.png}}
  \end{frame}

  \begin{frame}
    \frametitle{TikZ}

    % The boxes make sure that the image (which isn't really generated as an
    % image file) is properly centered and sized.
    \makebox[\textwidth][c]{
      \resizebox{13cm}{!}{
        % \input reads in code from another file and runs it as if it were in
        % this file.
        \input{map.tex}
      }
    }
  \end{frame}

  \begin{frame}
    \frametitle{TikZ}

    % The boxes make sure that the image (which isn't really generated as an
    % image file) is properly centered and sized.
    \makebox[\textwidth][c]{
      \resizebox{13cm}{!}{
        % \input reads in code from another file and runs it as if it were in
        % this file.
        \input{lens_diagram.tex}
      }
    }
  \end{frame}

%  \begin{frame}
%    \frametitle{Presentation Controls}
%    \uncover<4->{Use \texttt{\textbackslash uncover<slides>} to keep spacing
%      consistent before and after revealing the results of the code.\linebreak}
%    \only<1>{Use \texttt{\textbackslash only<slides>} if you want code to be
%      evaluated  for only a part of the slide's appearance.}
%    \pause
%    \pause
%    If you want to delay the evaluation of code, you can put a
%    \texttt{\textbackslash pause} before the items to delay.
%  \end{frame}
%
%  \begin{frame}
%    \frametitle{Pictures Example With Presentation Controls}
%
%    \tt
%    \only<1,2>{\textbackslash includegraphics\{dolphin.png\}}
%    \only<3>{\textbackslash includegraphics[width=100pt]\{dolphin.png\}}
%    \only<4>{\textbackslash includegraphics[height=7cm]\{dolphin.png\}}
%    \only<5>{\textbackslash includegraphics[width=\textbackslash textwidth]\{dolphin.png\}}
%    \normalfont
%    \linebreak
%    \pause
%    \only<1,2>{\includegraphics{dolphin.png}}
%    \only<3>{\includegraphics[width=100pt]{dolphin.png}}
%    \only<4>{\includegraphics[height=7cm]{dolphin.png}}
%    \only<5>{\includegraphics[width=\textwidth]{dolphin.png}}
%  \end{frame}

  \section{Review}
  \subsection{Review}
  \begin{frame}
    \frametitle{Review}

    \begin{itemize}
      \item Begin with a preamble for global formatting needs.
      \item Enclose your entire document with a \texttt{document} environment.
      \item Enclose each slide in a \texttt{frame} environment.
      \item Format frames with line breaks, lists, and columns.
      \item Include math within an \texttt{array} environments or inline
        between \textbackslash ( and \textbackslash ).
      \item Add images with \texttt{\textbackslash includegraphics}.
    \end{itemize}
  \end{frame}

  \begin{frame}
    \frametitle{Questions?}
    \makebox[\textwidth][c]{
      \includegraphics[width=\textwidth]{questions.jpg}
    }
  \end{frame}

  \begin{frame}
    \frametitle{Thank You}
    \makebox[\textwidth][c]{
      \Huge Now make something cool!
    }
  \end{frame}
	
\end{document}
