tUse hyperlinks for external animations, improve code style - scibeamer - quickly create scientific presentations using LateX and Beamer
 (HTM) git clone git://src.adamsgaard.dk/scibeamer
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 3b6f3b57e44edfe31389e23d7e1dbdadbaf053aa
 (DIR) parent f6501aaea57e75760fbf82f6c62df081e33bcbb5
 (HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
       Date:   Thu, 19 Sep 2019 11:43:51 +0200
       
       Use hyperlinks for external animations, improve code style
       
       Diffstat:
         M scibeamer.sty                       |     178 +++++++++++++++++++++++--------
       
       1 file changed, 134 insertions(+), 44 deletions(-)
       ---
 (DIR) diff --git a/scibeamer.sty b/scibeamer.sty
       t@@ -3,9 +3,8 @@
        
        %\RequirePackage{lmodern}
        
       -% for \movie command
       -\RequirePackage{multimedia}
       -
       +% for \movie* commands
       +\RequirePackage{hyperref}
        
        % Do not show horizontal line above footnotes
        \renewcommand\footnoterule{}
       t@@ -16,101 +15,192 @@
        % \fcite{arg1}{arg2}
        % Add a citation as a small footnote in the current slide. `arg1` will be 
        % stylized as regular text, followed by `arg2` in emphasized style.
       -% Example: \fcite{Author year}{Journal}
       -\newcommand{\fcite}[2]{\let\thefootnote\relax\footnotetext{\footnotesize{#1 \emph{#2}}}}
       +% Example: \fcite{Author et al.\ 1999}{Journal}
       +\newcommand{\fcite}[2]{%
       +\let\thefootnote\relax\footnotetext{\footnotesize{#1 \emph{#2}}}%
       +}
        
        
        %% Frame templates
        
        % \titleframe{arg1}
       -% Add a plain frame with large centered text.
       +% Add a frame with large centered text.
        % Example: \titleframe{Conclusions}
       -\newcommand{\titleframe}[1]{\begin{frame}\begin{center}\huge{#1}\end{center}\end{frame}}
       +\newcommand{\titleframe}[1]{%
       +\begin{frame}
       +        \begin{center}
       +                \huge{#1}
       +        \end{center}
       +\end{frame}
       +}
        
        % \plainimageframe{arg1}{arg2}
        % Add a plain frame with a single full-frame image `arg1`, scaled relative to 
        % frame width multiplied by `arg2`.
        % Example: \plainimageframe{image.png}{1.0}
       -\newcommand{\plainimageframe}[2]{\begin{frame}\begin{center}\centering\includegraphics[width=#2\textwidth]{#1}\end{center}\end{frame}}
       +\newcommand{\plainimageframe}[2]{%
       +\begin{frame}[plain]
       +        \begin{center}
       +                \centering
       +                \includegraphics[width=#2\textwidth]{#1}
       +        \end{center}
       +\end{frame}
       +}
        
        % \plainimageframeheight{arg1}{arg2}
        % Add a plain frame with a single full-frame image `arg1`, scaled relative to 
        % frame height multiplied by `arg2`.
        % Example: \plainimageframeheight{image.png}{1.0}
       -\newcommand{\plainimageframeheight}[2]{\begin{frame}\begin{center}\centering\includegraphics[height=#2\textheight]{#1}\end{center}\end{frame}}
       +\newcommand{\plainimageframeheight}[2]{%
       +\begin{frame}[plain]
       +        \begin{center}
       +                \centering
       +                \includegraphics[height=#2\textheight]{#1}
       +        \end{center}
       +\end{frame}
       +}
        
        % \imageframe{arg1}{arg2}{arg3}
        % Add a frame with title `arg1`, containing a single full-frame image `arg2`, 
        % scaled relative to frame width multiplied by `arg3`.
        % Example: \imageframe{An example frame}{image.png}{1.0}
       -\newcommand{\imageframe}[3]{\begin{frame}{#1}\begin{center}\centering\includegraphics[width=#3\textwidth]{#2}\end{center}\end{frame}}
       -
       -% \plainimageframeheight{arg1}{arg2}{arg3}
       +\newcommand{\imageframe}[3]{%
       +\begin{frame}{#1}
       +        \begin{center}
       +                \centering
       +                \includegraphics[width=#3\textwidth]{#2}
       +        \end{center}
       +\end{frame}
       +}
       +
       +% \imageframeheight{arg1}{arg2}{arg3}
        % Add a frame with title `arg1`, containing a single full-frame image `arg2`, 
        % scaled relative to frame height multiplied by `arg3`.
       -% Example: \plainimageframeheight{An example frame}{image.png}{1.0}
       -\newcommand{\imageframeheight}[3]{\begin{frame}{#1}\begin{center}\centering\includegraphics[height=#3\textheight]{#2}\end{center}\end{frame}}
       +% Example: \imageframeheight{An example frame}{image.png}{1.0}
       +\newcommand{\imageframeheight}[3]{%
       +\begin{frame}{#1}
       +        \begin{center}
       +                \centering
       +                \includegraphics[height=#3\textheight]{#2}
       +        \end{center}
       +\end{frame}
       +}
        
        % \plainimageframe{arg1}{arg2}
        % Add a frame with title `arg1`, containing a single full-frame image `arg2` 
        % that is not scaled relative to the frame size.
        % Example: \plainimageframe{An example frame}{image.png}
       -\newcommand{\imageframenoscale}[2]{\begin{frame}{#1}\begin{center}\centering\includegraphics{#2}\end{center}\end{frame}}
       +\newcommand{\imageframenoscale}[2]{%
       +\begin{frame}{#1}
       +        \begin{center}
       +                \centering
       +                \includegraphics{#2}
       +        \end{center}
       +\end{frame}
       +}
        
        % \imageframecite{arg1}{arg2}{arg3}{arg4}{arg5}
        % Add a frame with title `arg1`, containing a single image `arg2`, scaled 
        % relative to frame width multiplied by `arg3`, including a citation to 
        % publication authored by `arg4`, published in `arg5`.
        % Example: \imageframecite{An example title}{image.pdf}{1.0}{Author year}{Journal}
       -\newcommand{\imageframecite}[5]{\begin{frame}{#1}\begin{center}\centering\includegraphics[width=#3\textwidth]{#2}\end{center}\fcite{#4}{#5}\end{frame}}
       +\newcommand{\imageframecite}[5]{%
       +\begin{frame}{#1}
       +        \begin{center}
       +                \centering
       +                \includegraphics[width=#3\textwidth]{#2}
       +        \end{center}
       +        \fcite{#4}{#5}
       +\end{frame}
       +}
        
        % \imageframeciteheight{arg1}{arg2}{arg3}{arg4}{arg5}
        % Add a frame with title `arg1`, containing a single image `arg2`, scaled 
        % relative to frame height multiplied by `arg3`, including a citation to 
        % publication authored by `arg4`, published in `arg5`.
        % Example: \imageframecite{An example title}{image.pdf}{1.0}{Author year}{Journal}
       -\newcommand{\imageframeciteheight}[5]{\begin{frame}{#1}\begin{center}\centering\includegraphics[height=#3\textheight]{#2}\end{center}\fcite{#4}{#5}\end{frame}}
       -
       -
       -% \plainmovieframe{arg1}{arg2}{arg3}
       +\newcommand{\imageframeciteheight}[5]{%
       +\begin{frame}{#1}
       +        \begin{center}
       +                \centering
       +                \includegraphics[height=#3\textheight]{#2}
       +        \end{center}
       +        \fcite{#4}{#5}
       +\end{frame}
       +}
       +
       +% \plainmovieframe{arg1}{arg2}
        % Add a plain frame with a single full-frame movie `arg1`, with a placeholder 
       -% text `arg2`, with multimedia options `arg3` (externalviewer always set)
       -% NOTE: The movie file *must* reside in the same folder as the PDF, and file 
       -% names with underscore characters cannot be used.
       -% Example: \plainmovieframe{movie.mp4}{Example movie clip}{}
       -\newcommand{\plainmovieframe}[3]{\begin{frame}\begin{center}\centering\movie[externalviewer,#3]{#2}{#1}\\\footnotesize{\texttt{#1}}\end{center}\end{frame}}
       -
       -% \movieframe{arg1}{arg2}{arg3}{arg4}
       +% text `arg2`.
       +% Example: \plainmovieframe{movie.mp4}{Example movie clip}
       +\newcommand{\plainmovieframe}[3]{%
       +\begin{frame}[plain]
       +        \begin{center}
       +                \centering
       +                \href{#1}{#2}\\
       +                \footnotesize{\texttt{#1}}
       +        \end{center}
       +\end{frame}
       +}
       +
       +% \movieframe{arg1}{arg2}{arg3}
        % Add a frame titled `arg1`, a single full-frame movie `arg2`, with a 
       -% placeholder text `arg3`, with multimedia options `arg4` (externalviewer 
       -% always set)
       +% placeholder text `arg3`
        % NOTE: The movie file *must* reside in the same folder as the PDF, and file 
        % names with underscore characters cannot be used.
       -% Example: \movieframe{Example movie}{movie.mp4}{Example movie clip}{}
       -\newcommand{\movieframe}[4]{\begin{frame}{#1}\begin{center}\centering\movie[externalviewer,#4]{#3}{#2}\\\footnotesize{\texttt{#2}}\end{center}\end{frame}}
       +% Example: \movieframe{Example movie}{movie.mp4}{movie.png}
       +\newcommand{\movieframe}[3]{%
       +\begin{frame}{#1}
       +        \begin{center}
       +                \centering
       +                \href{#2}{#3}
       +        \end{center}
       +\end{frame}
       +}
        
        % \plainmovieframepreview{arg1}{arg2}{arg3}
        % Add a plain frame with a single full-frame movie `arg1`, with a preview image 
       +\newcommand{\movieframepreview}[3]{%
       +\begin{frame}{#1}[plain]
       +        \begin{center}
       +                \centering
       +                \href{#2}{%
       +                        \includegraphics[width=0.8\textwidth]{#3}\\
       +                        \footnotesize{\texttt{#2}}%
       +                }
       +        \end{center}
       +\end{frame}
       +}
       +
        % `arg2`, with multimedia options `arg3` (externalviewer always set)
        % NOTE: The movie file *must* reside in the same folder as the PDF, and file 
        % names with underscore characters cannot be used.
        % Example: \plainmovieframepreview{movie.mp4}{movie.png}{}
       -\newcommand{\plainmovieframepreview}[3]{\begin{frame}\begin{center}\centering\movie[externalviewer,#3]{\includegraphics[height=0.75\textheight]{#2}}{#1}\\\footnotesize{\texttt{#1}}\end{center}\end{frame}}
       +\newcommand{\plainmovieframepreview}[3]{%
       +\begin{frame}[plain]
       +        \begin{center}
       +                \centering
       +                \movie[externalviewer,#3]{\includegraphics[height=0.75\textheight]{#2}}{#1}\\
       +                \footnotesize{\texttt{#1}}
       +        \end{center}
       +\end{frame}
       +}
        
        % \movieframepreview{arg1}{arg2}{arg3}{arg4}
        % Add a frame titled `arg1` with a single full-frame movie `arg2`, a preview 
       -% image `arg2`, and with multimedia options `arg3` (externalviewer always set)
       -% NOTE: The movie file *must* reside in the same folder as the PDF, and file 
       -% names with underscore characters cannot be used.
       -% Example: \movieframepreview{An example movie}{movie.mp4}{movie.png}{}
       -\newcommand{\movieframepreview}[4]{\begin{frame}{#1}\begin{center}\centering\movie[externalviewer,#4]{\includegraphics[height=0.75\textheight]{#3}}{#2}\\\footnotesize{\texttt{#2}}\end{center}\end{frame}}
       -
       -% \movieframepreviewnotitle{arg1}{arg2}{arg3}{arg4}
       -% Add a frame titled `arg1` with a single full-frame movie `arg2`, a preview 
       -% image `arg2`, and with multimedia options `arg3` (externalviewer always set)
       -% NOTE: The movie file *must* reside in the same folder as the PDF, and file 
       -% names with underscore characters cannot be used.
       +% image `arg3`
       +% NOTE: The movie file *must* reside in the same folder as the PDF.
        % Example: \movieframepreview{An example movie}{movie.mp4}{movie.png}{}
       -\newcommand{\movieframepreviewnotitle}[4]{\begin{frame}{#1}\begin{center}\centering\movie[externalviewer,#4]{\includegraphics[height=0.75\textheight]{#3}}{#2}\\\end{center}\end{frame}}
       +\newcommand{\movieframepreview}[3]{%
       +\begin{frame}{#1}
       +        \begin{center}
       +                \centering
       +                \href{#2}{%
       +                        \includegraphics[width=0.8\textwidth]{#3}\\
       +                        \footnotesize{\texttt{#2}}%
       +                }
       +        \end{center}
       +\end{frame}
       +}
        
        \endinput