%% %% This program is provided under the terms of the %% LaTeX Project Public License distributed from CTAN %% archives in directory macros/latex/base/lppl.txt. %% %% Author: Holger Marschall %% holgermarschall@yahoo.de %% \def\fileversion{0.1} \def\filedate{2011/08/02} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{beameraudience}[\filedate\space v\fileversion\space assembling beamer frames according to audience] % check for beamer class % taken from beamersubframe (v 0.1 -- Mike Kaufmann -- THANKS!) \@ifclassloaded{beamer}{}{% \PackageError{beameraudience}{% The package works only with the beamer class,\MessageBreak therefore it is not loaded. }{% The package is not loaded, because it needs the\MessageBreak beamer class. Continuing may lead to additional\MessageBreak errors because of undefined commands. } \endinput } \RequirePackage{kvoptions} \RequirePackage{cprotect} \RequirePackage{ifthen} \DeclareStringOption[all]{audience} \ProcessKeyvalOptions* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% start functional stuff %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % new frame command '\framefor{#1}{#2}' % #1 audience-keyword checked % against the package option % #2 frame content % % and related stuff: '\justfor{#1}{#2}' % '\showcontentfor{#1}{#2}' % \newboolean{includethis} \newcommand{\ifinclude}[1]{\ifthenelse{\boolean{includethis}}{#1}{}} \newcommand{\ifshow}[1]{\ifthenelse{\boolean{includethis}}{\only{#1}}{\only{#1}}} \newcommand{\framefor}[2]% {% \ifthenelse{\equal{#1}{\beameraudience@audience}}{\setboolean{includethis}{true}}{} \ifinclude{% \begin{frame} #2 \end{frame}% } \setboolean{includethis}{false} } \newcommand{\justfor}[2]% {% \ifthenelse{\equal{#1}{\beameraudience@audience}}{\setboolean{includethis}{true}}{} \ifinclude{% #2 } \setboolean{includethis}{false} } \newcommand{\showcontentfor}[2]% {% \ifthenelse{\equal{#1}{\beameraudience@audience}}{\setboolean{includethis}{true}}{} \ifshow{% #2 } \setboolean{includethis}{false} }