From c3af7563cde8b19119e7772c95ef628a50274c7c Mon Sep 17 00:00:00 2001 From: "Achim D. Brucker" Date: Thu, 5 Jan 2017 13:19:05 +0000 Subject: [PATCH] First alpha implementation of classification/licensing functionality. --- .../beamerthemelh-presentation.sty | 207 +++++++++++++++++- lh-presentation/lh-presentation.cls | 35 +-- 2 files changed, 201 insertions(+), 41 deletions(-) diff --git a/lh-presentation/beamerthemelh-presentation.sty b/lh-presentation/beamerthemelh-presentation.sty index ab0f559..a85658c 100644 --- a/lh-presentation/beamerthemelh-presentation.sty +++ b/lh-presentation/beamerthemelh-presentation.sty @@ -12,12 +12,147 @@ \ProvidesPackage{beamerthemelh-presentation} [2016/11/01 v0.0 LaTeX presentation class implementing the cooperate design of LogicalHacking.com] -\ProcessOptionsBeamer -\ProcessOptions +\RequirePackage{ifthen} +\usepackage{xkeyval} +\usepackage{xstring} +\usepackage{etoolbox} + +% +\newcommand{\lh@CCBYNCND}{\href{https://creativecommons.org/licenses/by-nc-nd/4.0/}{CC BY-NC-ND 4.0}} +\newcommand{\lh@CCBYND}{\href{https://creativecommons.org/licenses/by-nd/4.0/}{CC BY-ND 4.0}} +\newcommand{\lh@CCBY}{\href{https://creativecommons.org/licenses/by/4.0/}{CC BY 4.0}} +\newcommand{\lh@CCzero}{\href{https://creativecommons.org/publicdomain/zero/1.0/}{CC0 1.0}} +\newcommand{\lh@GFDL}{\href{https://www.gnu.org/licenses/fdl.html}{GFDL 1.3}} + +\newcommand{\lh@strictlyconfidential}{Strictly Confidential} +\newcommand{\lh@confidential}{Confidential} +\newcommand{\lh@internal}{Internal} +\newcommand{\lh@customer}{Customer} +\newcommand{\lh@public}{Public} + + +\newboolean{lh@slide@strictlyconfidential}\setboolean{lh@slide@strictlyconfidential}{false} +\newboolean{lh@slide@confidential}\setboolean{lh@slide@confidential}{false} +\newboolean{lh@slide@internal}\setboolean{lh@slide@internal}{false} +\newboolean{lh@slide@customer}\setboolean{lh@slide@customer}{false} +\newboolean{lh@slide@public-cc-by-nc-nd}\setboolean{lh@slide@public-cc-by-nc-nd}{false} +\newboolean{lh@slide@public-cc-by-nd}\setboolean{lh@slide@public-cc-by-nd}{false} +\newboolean{lh@slide@public-cc-by}\setboolean{lh@slide@public-cc-by}{false} +\newboolean{lh@slide@public-cc-zero}\setboolean{lh@slide@public-cc-zero}{false} +\newboolean{lh@slide@public-gfdl}\setboolean{lh@slide@public-gfdl}{false} + + + +\newcommand{\classification}{UNDEFINED} +\define@choicekey*{beamerthemelh-presentation.sty}{classification}[\val\nr]% +{strictlyconfidential,confidential,internal,customer,public-cc-by-nc-nd,% + public-cc-by-nd,public-cc-by,public-cc-zero,public-gfdl}% +[strictlyconfidential]% +{% + \let\lh@classification@sel@default\nr +} + +\define@choicekey*{beamerframe}{classification}[\val\nr]% +{strictlyconfidential,confidential,internal,customer,public-cc-by-nc-nd,% + public-cc-by-nd,public-cc-by,public-cc-zero,public-gfdl}% +[strictlyconfidential]% +{% + \let\lh@classification@sel\nr + \ifcase\nr\relax% strictly confidential + \setboolean{lh@slide@strictlyconfidential}{true} + \or% confidential + \setboolean{lh@slide@confidential}{true} + \or% internal + \setboolean{lh@slide@internal}{true} + \or% customer + \setboolean{lh@slide@customer}{true} + \or% public + \setboolean{lh@slide@public-cc-by-nc-nd}{true} + \or + \setboolean{lh@slide@public-cc-by-nd}{true} + \or + \setboolean{lh@slide@public-cc-by}{true} + \or + \setboolean{lh@slide@public-cc-zero}{true} + \or + \setboolean{lh@slide@public-gfdl}{true} + \fi% +} + + + + +\ProcessOptionsX +%\ProcessOptionsBeamer +%\ProcessOptions + +\newcommand{\lh@classification@text}[1]{% + \ifcase\number#1\relax% strictly confidential + \alert{\lh@strictlyconfidential}% + \or% confidential + \alert{\lh@confidential}% + \or% internal + \alert{\lh@internal}% + \or% customer + \lh@customer% + \or% public + \lh@public~(\lh@CCBYNCND)% + \or + \lh@public~(\lh@CCBYND)% + \or + \lh@public~(\lh@CCBY)% + \or + \lh@public~(\lh@CCzero)% + \or + \lh@public~(\lh@GFDL)% + \else + UNDEFINED~CLASSIFICATION:~#1% + \fi% +} +\newcommand{\lh@classification@description}[1]{% + \ifcase\number#1\relax% strictly confidential + STRICTLY CONFIDENTIAL. + \or% confidential + CONFIDENTIAL. + \or% internal + INTERNAL. + \or% customer + CUSTOMER. + \or% public CC BY NC ND + Except where otherwise noted, this presentation is licensed under + a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 + International Public License (\lh@CCBYNCND). + \or% public CC BY ND + Except where otherwise noted, this presentation is licensed under + a Creative Commons Attribution-NoDerivatives 4.0 + International Public License (\lh@CCBYND). + \or% public CC BY + Except where otherwise noted, this presentation is licensed under + a Creative Commons Attribution 4.0 + International Public License (\lh@CCBY). + \or% public CC 0 + Except where otherwise noted, this presentation is licensed under + a \lh@CCzero license: To the extent possible under law, all copyright + and related or neighboring rights to the slides marked \lh@CCBY are + waived. + \or% public GFDL + Except where otherwise noted, this presentation is licensed under + the \lh@GFDL:\\ + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + \fi% +} + +\BeforeBeginEnvironment{frame}{% + \let\lh@classification@sel\lh@classification@sel@default% +} + \mode - - +\let\lh@classification@sel\lh@classification@sel@default% +\renewcommand{\classification}{\lh@classification@text{\lh@classification@sel}} \def\lh@classification{\classification} @@ -45,10 +180,66 @@ } \newcommand{\CopyrightFrame}{% - \bgroup\setbeamertemplate{footline}[default]% - \begin{frame}\vfill\Huge% -\end{frame} -\egroup} + \bgroup%\setbeamertemplate{footline}[default]% + \begin{frame}\vfill% + \frametitle{Document Classification and License Information} + \footnotesize + \begin{itemize} + \item This presentation is classified as \emph{\classification}:\\ + \lh@classification@description{\lh@classification@sel} + \ifthenelse{% + \boolean{lh@slide@strictlyconfidential}\OR% + \boolean{lh@slide@confidential}\OR% + \boolean{lh@slide@internal}\OR% + \boolean{lh@slide@customer}\OR% + \boolean{lh@slide@public-cc-by-nc-nd}\OR% + \boolean{lh@slide@public-cc-by-nd}\OR% + \boolean{lh@slide@public-cc-by}\OR% + \boolean{lh@slide@public-cc-zero}\OR% + \boolean{lh@slide@public-gfdl}}{ + \item Deviating, some slides are classified as: \tiny + \begin{itemize} + \ifthenelse{\boolean{lh@slide@strictlyconfidential}}{ + \item\emph{\lh@classification@text{0}:} + \lh@classification@description{0} + }{} + \ifthenelse{\boolean{lh@slide@confidential}}{ + \item\emph{\lh@classification@text{1}:} + \lh@classification@description{1} + }{} + \ifthenelse{\boolean{lh@slide@internal}}{ + \item\emph{\lh@classification@text{2}:} + \lh@classification@description{2} + }{} + \ifthenelse{\boolean{lh@slide@customer}}{ + \item\emph{\lh@classification@text{3}:} + \lh@classification@description{3} + }{} + \ifthenelse{\boolean{lh@slide@public-cc-by-nc-nd}}{ + \item\emph{\lh@classification@text{4}:} + \lh@classification@description{4} + }{} + \ifthenelse{\boolean{lh@slide@public-cc-by-nd}}{ + \item\emph{\lh@classification@text{5}:} + \lh@classification@description{5} + }{} + \ifthenelse{\boolean{lh@slide@public-cc-by}}{ + \item\emph{\lh@classification@text{6}:} + \lh@classification@description{6} + }{} + \ifthenelse{\boolean{lh@slide@public-cc-zero}}{ + \item\emph{\lh@classification@text{7}:} + \lh@classification@description{7} + }{} + \ifthenelse{\boolean{lh@slide@public-gfdl}}{ + \item\emph{\lh@classification@text{8}:} + \lh@classification@description{8} + }{} + \end{itemize} + }{} + \end{itemize} + \end{frame} + \egroup} \newcommand{\AgendaFrame}[1][]{% \bgroup \setbeamertemplate{footline}[default]% diff --git a/lh-presentation/lh-presentation.cls b/lh-presentation/lh-presentation.cls index 3cca098..65c2919 100644 --- a/lh-presentation/lh-presentation.cls +++ b/lh-presentation/lh-presentation.cls @@ -13,40 +13,9 @@ [2016/12/28 v0.0 LaTeX presenation class implementing the cooperate design of LogicalHacking.com] \LoadClassWithOptions{beamer}[] +\DeclareOptionBeamer{classification}{\PassOptionsToPackage{classification=#1}{beamerthemelh-presentation}} +\ProcessOptionsBeamer\relax -\usepackage{xkeyval} -\newcommand{\classification}{UNDEFINED} -\define@choicekey*{beamerthemelh-presentation.sty}{classification}[\val\nr]% -{strictlyconfidential,confidential,internal,customer,public-cc-by-nc-nd,% - public-cc-by-nd,public-cc-by,public-cc-zero,public-gfdl}% -[strictlyconfidential]% -{% - \ifcase\nr\relax - \renewcommand{\classification}{\alert{Strictly Confidential}}% - \or - \renewcommand{\classification}{\alert{Confidential}}% - \or - \renewcommand{\classification}{\alert{Internal}}% - \or - \renewcommand{\classification}{\alert{Customer}}% - \or - \renewcommand{\classification}{Public (CC-BY-NC-ND)}% - \or - \renewcommand{\classification}{Public (CC-BY-ND)}% - \or - \renewcommand{\classification}{Public (CC-BY)}% - \or - \renewcommand{\classification}{Public (CC0)}% - \or - \renewcommand{\classification}{Public (GFDL)}% - \fi% -} - -\ProcessOptionsX* - - - -\ProcessOptions\relax \usetheme{lh-presentation} \endinput