% Example of CPMtalk package for screen presentation in CMP, Prague
% 2001-05-11, (c) Vit Zyka, zyka@cmp.felk.cvut.cz
% 2001-12-13 v2.0
% 2002-01-18 v2.1
% 2002-02-12 v2.2 multicolored marker
% 2002-06-26 v2.53 \maketalktitle
% 2002-10-08 v2.60
% 2002-11-13 v2.61 Printing handouts
% 2003-01-07 v2.62 videoPar + \mbox{} correction (V. Hlavac)
% 2003-05-12 v2.7  absolute placement + texpower (for R. Sara)
% 2003-06-12 v2.71 Appendix; keyboard navigation

\documentclass[cmpitalkstyle]{cmptalk}
%\documentclass[cmpitalkstyle,printout]{cmptalk}
%\documentclass[cmpitalkstyle,noloadhyperref]{cmptalk}
%\documentclass[basetalkstyle,noloadhyperref]{cmptalk}

\hypersetup{pdfstartpage=1}%,pdfpagemode=FullScreen} % pdfpagemode=None
%\hypersetup{pdftitle=,pdfauthor=,pdfsubject=,pdfkeywords=}

\usepackage{bigfig,thumbpdf}
\usepackage[coloremph,colormath,display]{texpower}

\newdimen\tmpd
\newbox\verbbox

\begin{document}

%------------------------------------------------------------------- Title page
%-- specifications
\authorname{V\'\i t Z\'yka}
\author{%
  V\'\i t Z\'yka\\
  Center for Machine Perception\\
  \href{http://www-cmp.felk.cvut.cz/software/tex/textips.html\#PDFpresentation}
       {http://www-cmp.felk.cvut.cz/software/tex/textips.html\#PDFpresentation}}
\title{\TeX\ package CMPTalk, version 2.xx}
\acknowledgement{Acknowledgement: Thanks to CMP members}
\talklogo{\includegraphics[width=4cm]{cmp}}

% only for code visibility
\setbox0=\vbox{
\begin{verbatim}
\authorname{V\'\i t Z\'yka}
\author{%
  V\'\i t Z\'yka\\
  Center for Machine Perception\\
  \href{http://www-cmp.felk.cvut.cz/software/tex/textips.html\#PDFpresentation}
       {http://www-cmp.felk.cvut.cz/software/tex/textips.html\#PDFpresentation}}
\title{\TeX\ package CMPTalk, version 2.xx}
\acknowledgement{Acknowledgement: Thanks to CMP members}
\talklogo{\includegraphics[width=4cm]{cmp}}

\maketalktitlepage % or put text of title to environment talktitlepage
\end{verbatim}
}
\placeat{
  \put(0,0){\box0}
}

%-- realization
%\maketitle
%\slidetitle{%
%  Department of Cybernetics, Faculty Electrical Engineering\\
%  Czech Technical University, Prague}
%-- or
\maketalktitlepage
%-- or
% \begin{talktitlepage}
%                    \mbox{}             \\
%   {\Large\bfseries \thetitle          }\\[2\baselineskip]
%                    \theauthor          \\
%                    \vfill
%                    \thetalkaffiliation \\[\baselineskip]
%   {\itshape        \thetalklogo       }
% \end{talktitlepage}

% --------------------------------------------------------------------------- 1
Changes to version 1.x (now \texttt{cmptalkv1}):
\begin{itemize}
  \item No border, screen ratio 3:4
  \item Pages in two columns if $>21$
  \item \hyperlink{mouseNavig}{Mouse navigation}, Acrobat menu
  \item \shyperlink{absPlace}{Absolute placement}
  \item \hyperlink{cmpiistyle}{New talkstyle CMPii}
  \item Bugs decrement; psfrag compatibility (for latex$\rightarrow$dvips)
\end{itemize}
\setbox\verbbox=\vbox{\parbox{.5\textwidth}{\subhead{Package options:}
      cmpitalkstyle, cmpiitalkstyle,\\
      cakitalkstyle, cakiitalkstyle,\\
      cggitalkstyle, cggiitalkstyle,\\
      basetalkstyle, 17pt, 20pt, 25pt, 30pt,\\
      noloadhyperref, noloadgraphicx\\[1ex]
      Change inside documents:\\
      {\ttfamily$\backslash$talkhead[$\backslash$basetalkstyle]\{...\}}}}
\placeat{\Put(.5,.05)[lb]{\box\verbbox}}

% --------------------------------------------------------------------------- 2
\talkhead{\LARGE Environment \textcolor{red}{narrow}}
%\talkhead{Environment narrow}
Without narrow environment
\begin{itemize}
  \item First item
  \item Second item
  \item Last item
\end{itemize}
and with both left and right margin of dimmension 4\verb+\parindent+
\begin{narrow}[4]
\begin{itemize}
  \item First item
  \item Second item
  \item Last item
\end{itemize}
\end{narrow}
\setbox\verbbox=\vbox{\begin{verbatim}
\begin{narrow}[4]
  \begin{itemize}
    \item ...
  \end{itemize}
\end{narrow}
\end{verbatim}}
\placeat{\put(.6,.32){\box\verbbox}}
\vfill

% --------------------------------------------------------------------------- 3
\talkhead{BigFig package, text and background colors}
\pagemarkerbgr
\subhead{Bigfig}
\pagemarker{\string\small\space B}
%\pagemarker{\string\textcolor\string{darkred\string}\string{B\string}}
%\label{marker}
%\pagemarker{\string\textcolor\string{red\string}\string{%
%  $\string\pageref\string{marker\string}^E$\string}}
\begin{verbatim}
\usepackage{bigfig}
...
\includegraphics[height=2cm]{cmp}
\bigfigfalse
\includegraphics[height=2cm]{cmp}
\bigfigtrue
\includegraphics[height=2cm]{cmp}
\end{verbatim}
\includegraphics[height=2cm]{cmp}
\bigfigfalse
\includegraphics[height=2cm]{cmp}
\bigfigtrue
\includegraphics[height=2cm]{cmp}

\subhead{Colors:}
\def\clrdemo#1{\textcolor{#1}{#1}}
\clrdemo{cmporange}, \clrdemo{cakorange}, \clrdemo{darkgray}, \clrdemo{darkred},
\clrdemo{darkyellow}, \clrdemo{darkgreen}, \clrdemo{darkblue}

\subhead{Backgrounds:}
\def\bgrdemo#1{\colorbox{#1}{\strut\bfseries #1}}
\bgrdemo{lightgray}, \bgrdemo{lightred}, \bgrdemo{lightyellow},
\bgrdemo{lightgreen}, \bgrdemo{lightblue}

\setbox\verbbox=\hbox{\verb+\subhead{Colors:}+}
\setbox100=\vbox{\begin{verbatim}
\usepackage{color} \textcolor{darkblue}{text}
\colorbox{lightblue}{\strut\bfseries text}
\end{verbatim}}
\setbox101=\vbox{\begin{verbatim}
\pagemarker{B}
\pagemarker{\string\small\space B}
\end{verbatim}}
\placeat{\put(.7,.41){\box\verbbox}
         \put(.35,0){\box100 }
         \put(.5,.9){\box101 }}

% --------------------------------------------------------------------------- 4
\talkhead[\basetalkstyle]{Transparency over several pages; Margins}
A\vfill B C\newpage\mbox{}\vfill D\newpage E

% ------------------------------------------------------------ Mouse navigation
\talkhead[\cakitalkstyle]{Mouse navigation}\hypertarget{mouseNavig}{}
Use \textcolor{cmporange}{invisible vertical buttoms} at left and
right screen edge.

They are done via Acrobat functions:
\begin{verbatim}
\Acrobatmenu{PrevPage}{Prev page}
\Acrobatmenu{NextPage}{Next page}
\Acrobatmenu{GeneralInfo}{Document information}
\Acrobatmenu{Print}{Print}
\end{verbatim}
\placeat{
  \put(.72,.82){\Acrobatmenu{PrevPage}{Prev page}}
  \put(.72,.77){\Acrobatmenu{NextPage}{Next page}}
  \put(.72,.72){\Acrobatmenu{GeneralInfo}{Document information}}
  \put(.72,.67){\Acrobatmenu{Print}{Print}}
}

\textcolor{cmporange}{Keyboard navigation}\par
\begin{tabular}{ll}
  \bf Key & \bf Description \\ \hline
  CTRL+l  & full screen \\
  z       & zoom mode (magnifying glass) \\
  h       & shift mode (paw) \\
  shift+click & zoom over link area \\ 
  CTRL+n  & go to page \\
  CTRL+left & go previous view \\
  F5        & bookmarks \\
  F6        & thumbnails \\
  CTRL+d    & document info \\
\end{tabular}

% ---------------------------------------------------------------------- Video
\talkhead{Video}\hypertarget{video}{}
\setbox\verbbox=\vbox{\begin{verbatim}
\video{5cm}{.5}{cmp.avi}
\video{5cm}{.2}{cmp.avi}
\def\videoShowControls{false}\video{5cm}{.5}{cmp.avi}
\def\videoShowControls{true}\def\videoPar{/Rate 0.1 }
\video{5cm}{.5}[cmp]{cmp.avi}
\end{verbatim}}
\placeat{
  \put(.35,0){\box\verbbox}
}

\hbox to.81\textwidth{%
  \video{5cm}{.5}{cmp.avi}\hfil%
  \video{5cm}{.2}{cmp.avi}\hfil%
  \def\videoShowControls{false}\video{5cm}{.5}{cmp.avi}%
  \def\videoShowControls{true}\def\videoPar{/Rate 0.1 }
     \video{5cm}{.5}[cmp]{cmp.avi}%
}

% ------------------------------------------------------------------ Thumbnails
\talkhead[\cmpiitalkstyle]{New talk CMPii talk style, Thumbnails}
\hypertarget{cmpiistyle}{}
\subhead{CMPii talk style:}
Margins, GoToPage and CMP web link.

\begin{itemize}
\item
\end{itemize}

\subhead{Thumbnails:}
Source file:
\begin{verbatim}
  \usepackage{thumbpdf}
\end{verbatim}

Run (perl+ghostscript):
\begin{verbatim}
  pdflatex file.tex
  thumbpdf file
  pdflatex file.tex
\end{verbatim}
%\pdfbookmark[0]{Outlines}{outlinebla}

% ---------------------------------------------------------- Absolute placement
\talkhead[\cmpitalkstyle]{Absolute placement}\hypertarget{absPlace}{}
\def\pagemarkerbgrcolor{lightred}\def\thepagemarkerbgrcolor{darkred}
\pagemarkerbgr
\setbox\verbbox=\hbox{\verb+\pagemarkerbgr+}
\def\sp#1{\strut#1\ }
\placeatmm{
  \put(0,0){A}
  \put(15,5){B}}
\placeat{
  \put(.5,.9){\framebox(15,10)[bl]{C}}
  \put(.3,0){\includegraphics[width=3cm]{cmp}}
  \put(1,1){Z}
  \Put(1,1)[rt]{\textcolor{black}{Z}}
  \Put(.85,.75)[lt]{\strut\framebox(35,20)[tr]{\sp{lt}}}
  \Put(.85,.75)[lc]{\strut\framebox(35,20)[tr]{\sp{lc}}}
  \Put(.85,.75)[lB]{\strut\framebox(35,20)[tr]{\sp{lB}}}
  \Put(.85,.75)[lb]{\strut\framebox(35,20)[tr]{\sp{lb}}}
  \Put(.85,.75)[rt]{\strut\framebox(35,20)[tr]{\sp{rt}}}
  \Put(.85,.75)[cc]{\strut\framebox(35,20)[tr]{\sp{c}}}
  \Put(.85,.75)[c]{\strut\framebox(35,20)[tr]{\sp{c}}}
  \Put(.85,.75){\strut\textcolor{red}{\framebox(35,20)[tr]{\sp{c}}}}
  \put(.85,.75){\textcolor{red}{\circle*{3}}}
  \put(.6,0){On this page is \copy\verbbox.}
  }%
%
\begin{verbatim}
\placeatmm{
  \put(0,0){A}}
  \put(15,5){B}}
\placeat{
  \put(.5,.9){\framebox(15,10)[bl]{C}}
  \put(.3,0){\includegraphics[width=3cm]{cmp}}
  \put(1,1){Z}

  \Put(1,1)[rt]{\textcolor{black}{Z}}
  \Put(.85,.75)[lt]{\strut\framebox(35,20)[tr]{\sp{lt}}}
  \Put(.85,.75)[lc]{\strut\framebox(35,20)[tr]{\sp{lc}}}
  \Put(.85,.75)[lB]{\strut\framebox(35,20)[tr]{\sp{lB}}}
  \Put(.85,.75)[lb]{\strut\framebox(35,20)[tr]{\sp{lb}}}
  \Put(.85,.75)[rt]{\strut\framebox(35,20)[tr]{\sp{rt}}}
  \Put(.85,.75)[cc]{\strut\framebox(35,20)[tr]{\sp{c}}}
  \Put(.85,.75)[c]{\strut\framebox(35,20)[tr]{\sp{c}}}
  \Put(.85,.75){\strut\textcolor{red}{\framebox(35,20)[tr]{\sp{c}}}}
  \put(.85,.75){\textcolor{red}{\circle*{3}}}
}
\end{verbatim}

% --------------------------------------------------------------- Power package
\talkhead{\TeX Power package}
First load preable package:
\begin{verbatim}
  \usepackage[coloremph,colormath,display]{texpower}
\end{verbatim}

\pause
First step\dots\pause \dots and second.\pause

(\verb+\pause First step\dots\pause \dots and second.\pause+)

A more complicated example with
\begin{verbatim}
  \parstepwise{%
    \step{1}
    \step{2}
    \step{3}
  }
\end{verbatim}

\parstepwise{%
 \step{Then you can write some idea and use it.}%

 \step{Then continue with another idea.
   \includegraphics[width=2cm]{cmp}
   \includegraphics[width=2cm]{cmp}}%
 \step{And to finish it. \includegraphics[width=2cm]{cmp}}%
}

%\textcolor{darkred}{Do not use both {\em pause} and {\em absolute
%  placement} on a page!}

\talkhead{Absolute (re)placement with \TeX power}
\begin{verbatim}
\liststepwise[\global\placeat{\Put(.5,.5){0}}]{%
  \step{1\global\placeat{\Put(.5,.5){1}}}
  \step{2\global\placeat{\Put(.5,.5){2}}}
}
\end{verbatim}
\liststepwise[\global\placeat{\Put(.5,.5){0}}]{%
  \step{1\global\placeat{\Put(.5,.5){1}}}
  \step{2\global\placeat{\Put(.5,.5){2}}}
}

\talkhead{Incremental absolute placement with \TeX power}
\begin{verbatim}
\liststepwise[\global\placeat{\Put(.5,.5){0}}]{%
  \step{1\global\placeat{\Put(.5,.5){0}\Put(.5,.5){1}}}
  \step{2\global\placeat{\Put(.5,.5){0}\Put(.5,.5){1}\Put(.5,.5){2}}}
}
\end{verbatim}
\liststepwise[\global\placeat{\Put(.5,.5){0}}]{%
  \step{1\global\placeat{\Put(.5,.5){0}\Put(.5,.5){1}}}
  \step{2\global\placeat{\Put(.5,.5){0}\Put(.5,.5){1}\Put(.5,.5){2}}}
}

% ---------------------------------------------------------------- printCMPtalk
\talkhead{Printing slide handouts}
Instructions:
\begin{enumerate}
  \item If you are using \verb+texpower+ package, add option
    \verb+printout+. It couses that all incremental pages merge
    together. Run \verb+pdflatex+.
  \item Run script \verb+printcmptalk+ with name of your PDF file with
    CMPtalk slides in the directory where the .pdf file is. It creates
    file \verb+\jobname-print.pdf+. If you
    want to send it directly to the default printer
    use switch \verb+-p+ as follows:
    $$\verb+printcmptalk -p myslides.pdf+$$
\end{enumerate}

% ---------------------------------------------------------------- Appendixfoil
\talkhead{Making appendix (pages not visible in page marks)}
\appendixfoil{apx:first}{This is first appendix page.}
Go to \hyperlink{apx:first}{Appendix~1} and Appendix
  \shyperlink{apx:two}{Two}.
\def\appendixname{Secret trump}
\appendixfoil{apx:two}{And this is second appendix page.
  \string\includegraphics[height=1cm]{cmp}

  \string\parbox{5cm}{Next paragraph in parbox}.}

Usage:
\begin{verbatim}
  \appendixfoil{apx:first}{This is first appendix page.}
  Go to \hyperlink{apx:first}{Appendix~1} and Appendix
    \shyperlink{apx:two}{Two}.

  \def\appendixname{Secret trump}
  \appendixfoil{apx:two}{And this is second appendix page.
    \string\includegraphics[height=1cm]{cmp}}
\end{verbatim}
Notice of using \verb+\string+ before \verb+\includegraphics+.

Notice invisible "GoBack" link (of size 1\,em) in the very beginning
of appendix page.

Notice changing of appendix title by redefinition of \verb+\appendixname+.

%---------------------------------------------------------- Loop for more pages
\loop%
  \expandafter\talkhead\expandafter{Page \the\slideno}\hbox{}
\ifnum\slideno<22 \repeat

\end{document}
