<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%% 
%% 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&lt;beamer:1|handout:1&gt;{#1}}{\only&lt;beamer:0|handout:0&gt;{#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}
}</pre></body></html>