%%
%% This is file `beamer-reveal-example.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% beamer-reveal.dtx  (with options: `example')
%% 
%% This is a generated file.
%% 
%% Copyright (C) Walter Daems <walter.daems@uantwerpen.be>
%% 
%% This work may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3 of this license
%% or (at your option) any later version.  The latest version of this
%% license is in:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% and version 1.3 or later is part of all distributions of LaTeX version
%% 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status `maintained'.
%% 
%% The Current Maintainer of this work is Walter Daems.
%% 
%%
\documentclass[11pt,aspectratio=169,t]{beamer}%
\setbeamertemplate{navigation symbols}{}

\usepackage[width=1920,autoslide=4000]{beamer-reveal}
\usepackage{tikz}
\usepackage{siunitx}

\newcommand\eu{\mathrm{e}}
\newcommand\ju{\mathrm{j}}

\title{Test slide deck}
\subtitle{\textsc{beamer-reveal}}
\author{Walter Daems}

\setbeamertemplate{note page}{\insertnote}

\begin{document}

\begin{frame}[titleslide]
  \titlepage
\end{frame}

\AtBeginSection{
  \begin{frame}[sectionslide]{Overview}
    \tableofcontents[currentsection]
  \end{frame}
}
\AtBeginSubsection{
  \begin{frame}[subsectionslide]{Overview}
    \tableofcontents[currentsection,currentsubsection]
  \end{frame}
}

\section{Introduction}
\subsection{Slide making}

\begin{frame}
  {Good news}
  {}
  You can keep on making your slides the way you are used to!
  \begin{itemize}
  \item all the nice \LaTeX{} stuff at your fingertips
  \item no tempation to use too much unnecessary animation
  \end{itemize}
  \bigskip

  Indeed, there are no tools that can typeset equations like the tools form the \TeX-ecosystem:
  \begin{equation}
    \eu^{-\ju\pi}+1=0
  \end{equation}

  \note[item]{Make joke about fingertips}
  \note[item]{Don't speak about your personal temptations!}
\end{frame}

\begin{frame}[transition=concave,embed,autoslide=2000]
  {Pr\^et-\`a-porter}
  {A dummy slide}
  \vfill
  Showing off the 'concave' slide transition animation. Not recommended!
  \vfill
\end{frame}

\begin{frame}[transition=convex]
  {Très chique}
  {A dummy slide}
  \vfill
  Showing off the 'convex' slide transition animation. Not recommended!
  \vfill
\end{frame}

\subsection{Pimping your slides}

\begin{frame}
  {And even more good news}
  {\ldots almost seems to good to be true\ldots}
  \small
  However, now you can pimp your slides like never before. You can incorporate:
  \begin{itemize}
  \item videos and audio fragments
  \item animated GIFs and LaTeX animations
  \item iframe content
  \end{itemize}
  without being tied to Acrobat reader.
  In addition, there are some extra features
  \begin{itemize}
  \item press '?' for keyboard help, amongst which you will find:
  \item press 'm' to open the slide menu on the left
  \item press 'o' to get an overview of the slides
  \item press 's' to start a speaker view
  \item press 'g' to go to a specific slide by typing its slide number
  \end{itemize}
  The pancake menu on the bottom left also opens the menu.
\end{frame}

\note{
  Don't spend too much time on this slide
}

\begin{frame}[transition=zoom]
  {A dymmy slide}
  {number three}
  \vfill
  Showing off the 'zoom slide transition animation. Not recommended!
  \vfill
\end{frame}

\section{In detail}

\subsection{Candy for the eye}

\begin{frame}
  {Placing videos}
  {}
  \only<1>{On this first slide there is nothing to see. On the next animation frame, a video will appear.}
  \only<2>{Here it is!}
  \video<2>[above,draw,autoplay,height=0.7,aspectratio=16/9,
            background=yellow,fit=contain]
  (myvid) \at (0.5,0.1) {Media/beamer-reveal-testvideo.mp4}
  \tikz[remember picture,overlay] \node<2>[anchor=north,font=\tiny] at (myvid.south)
       {An example video (C) Walter Daems};
\end{frame}

\begin{frame}
  {Placing images (possibly animated)}
  {}
  \begin{columns}
    \column[T]{0.45\textwidth}
    Below you will find a png (for which you don't need reveal, BTW).
    \vspace*{1cm}

    Of course, you can exploit the transparency of the background layer in the PNG!
    \vspace*{2cm}

    And on the top right you will find a swinging pendulum (an animated GIF).
    \column[T]{0.45\textwidth}
    % this is a image whose box consumes area on your slide
    \image[width=0.33,aspectratio=1,fit=contain,draw] (myimage) {Media/beamer-reveal-AnimatedPendulum.gif}
  \end{columns}
  % this is an overlayed image (not consuming any space)
  \image[width=0.25,aspectratio=1,fit=contain] \at (0.1,0.6) {Media/beamer-reveal-WiresTp.png}
\end{frame}

\begin{frame}
  {Placing iframe material (possibly animated)}
  {e.g. generated with asymptote}

  Click and drag on the iframe below. You can manipulate it! Use your mouse
  scroll-wheel to zoom in or out.
  \iframe[draw,anchor=north,height=0.6,aspectratio=16/9,embed,
          fit=cover] \at (0.5,0.7) {Media/beamer-reveal-PCB.html}
\end{frame}

\note{
  Don't mention the amount of hours that went into this iframe!
}

\subsection{Resonance for the ear}

\begin{frame}
  {Adding audio to your slides}
  {}
  Below, there is an audio block
  that automatically starts playing.\\
  \audio[autoplay,controls,width=0.1,aspectratio=16/9,
    background=blue,fit=cover] {Media/beamer-reveal-AudioSample.ogg}
\end{frame}

\subsection{Make (video) animations with LaTeX}

\newcommand\myanimation{%
      \begin{tikzpicture}[font=\footnotesize,transform shape,scale=0.75]
        \pgfmathsetmacro\angle{\progress*540}%
        \clip (-2,-5.25) rectangle (8,2);
        \node[below left,inner sep=1pt] at (0,0) {\tiny 0};
        \node[below left,inner sep=1pt] at (2.5,0) {\tiny 0};
        \node[above right,inner sep=1pt] at (0,-2) {\tiny 0};

        \begin{scope}[every node/.style={right}]
          \node[thick,draw,rectangle] at (2.5,-2)
               {\large $x(t) = A \cdot \eu^{j\omega t}$};
               \node at (3.5,-3)
                     {\large $\eu^{j\alpha} = \cos\alpha+j\sin\alpha$};
                     \node at (2.5,-4)
                           {\large $x(t) = \underbrace{A \cos \omega t}_{\text{\textcolor{orange}{real}}}
                             + \underbrace{j A \sin \omega t}_{\text{\textcolor{olive}{imaginary}}}$};
        \end{scope}
        \draw[->,thick] (3,-2.4) -- (3,-3.4);
        \draw[blue,thick] (0,0) circle (1);

        \draw[->] (-1.25,0) -- (1.25,0) node[below] {Re};
        \draw[->] (0,-1.25) -- (0,1.25) node[left] {Im};

        % circle
        \draw[olive,very thick] (0,0) -- (0,{sin(\angle)});
        \draw[orange,very thick] (0,0) -- ({cos(\angle)},0);
        \draw[blue,thick,->] (0,0) -- node[left,font=\tiny] {A} +(\angle:1);
        \draw[->] (0.4,0) arc (0:\angle:0.4);
        \node at (0.5*\angle:0.7) {\scriptsize $\omega \tilde t$};

        % right graph
        \draw[very thick,olive] ({2.5+\angle/180},0) -- +(0,{sin(\angle)});
        \draw[densely dotted] ({min(0,cos(\angle))},{sin(\angle)})
        -- ({2.5+\angle/180},{sin(\angle)});
        \draw[thick] ({2.5+\angle/180},0) +(0,1pt) -- +(0,-1pt) node[below] {$\tilde t$};

        % bottom graph
        \draw[very thick,orange] (0,{-2-\angle/180}) -- +({cos(\angle)},0);
        \draw[densely dotted] ({cos(\angle)},{max(0,sin(\angle))})
        -- ({cos(\angle)},{-2-\angle/180});
        \draw[thick] (0,{-2-\angle/180}) +(1pt,0) -- +(-1pt,0) node[left] {$\tilde t$};

        % right graph
        \foreach \y/\l in {-1/-A,1/A} {
          \draw[gray,densely dotted] (2.5,\y) -- (6.25,\y);
          \draw (2.5,\y) +(+1pt,0) -- +(-1pt,0) node[left] {$\l$};
        }
        \draw[->] (2.0,0) -- (6.5,0) node[below] {$t$};
        \draw[->] (2.5,-1.25) -- (2.5,1.25) node[left] {$Im(x(t))$};
        \draw[olive,thick,domain=-0.25:3.5,samples=30,smooth] plot
        ({\x+2.5},{sin(pi*\x r)});

        % bottom graph
        \foreach \y/\l in {-1/-A,1/A} {
          \draw[gray,densely dotted] (\y,-2) -- (\y,-4.5);
          \draw (2.5,\y) +(+1pt,0) -- +(-1pt,0) node[left] {$\l$};
        }
        \draw[->] (-1.25,-2) -- (1.25,-2) node[above] {$Re(x(t))$};
        \draw[->] (0,-1.5) -- (0,-5) node[left] {$t$};

        \draw[orange,thick,domain=-0.25:2.6,samples=30,smooth] plot
        ({cos(pi*\x r)},{-2-\x});
      \end{tikzpicture}%
}

\begin{frame}
  {Making animations with LaTeX (using TikZ as example)}
  {It is easier than ever before}
  \small The animation content is exported to a standalone \LaTeX-document that creates a
  loop over it, for a \texttt{duration} seconds at
  \texttt{framerate} frames per second providing a \texttt{\textbackslash{}progress}
  variable that goes gradually from 0 to 1 in \texttt{duration} $\times$
  \texttt{framerate} frames. The beamer-reveal.pl script transforms it
  to mp4 maximally exploiting your multi-core CPU.

  \begin{center}
    \animation<1|handout:1-3>[framerate=25,duration=7.5,autoplay,
      progress={0.1|handout:1/0,2/0.2,3/0.5},expand once] {\myanimation}
  \end{center}
\end{frame}

\begin{frame}
  {Making animations with LaTeX (using TikZ as example)}
  {Another slide with just a 'still' - but with some music!}
  \small The animation content is exported to a standalone \LaTeX-document that creates a
  loop over it, for a \texttt{duration} seconds at
  \texttt{framerate} frames per second providing a \texttt{\textbackslash{}progress}
  variable that goes gradually from 0 to 1 in \texttt{duration} $\times$
  \texttt{framerate} frames. The beamer-reveal.pl script transforms it
  to mp4 maximally exploiting your multi-core CPU.

  \begin{center}
    \still[progress=0.75,expand once] {\myanimation}
  \end{center}
  \audio[width=0.1,aspectratio=16/9,fit=cover,autoplay] \at (0,0)
        {Media/beamer-reveal-AudioSample.ogg}
\end{frame}

\end{document}

\endinput
%%
%% End of file `beamer-reveal-example.tex'.
