A Beamer theme for cryptoparty presentations.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

299 lines
8.0 KiB

% \iffalse
%
% Copyright (C) 2020 Damien Goutte-Gattat
%
% This work may be distributed and/or modified under the conditions of the
% LaTeX Project Public License, either version 1.3 of the license or (at
% your option) any later version. The latest version if this license is in:
%
% http://www.latex-project.org/lppl.txt
%
% and version 1.3 or later is part of all distributions of LaTeX version
% 2003/12/01 or later.
%
% This work has the LPPL maintenance status "maintained".
%
% The Current Maintainer of this work is Damien Goutte-Gattat
% <dgouttegattat@incenp.org>.
%
% This work consists of the file beamer-cpldn.dtx, and all files generated
% from it.
%
%<*batchfile>
\begingroup
\input docstrip
\keepsilent
\askforoverwritefalse
\preamble
Copyright (C) 2020 Damien Goutte-Gattat
This file is part of a work distributed under the conditins of the
LaTeX Project Public License. See the source file from which this file
has been generated for details.
\endpreamble
\generate{
\file{beamerthemecpldn.sty}{\from{beamer-cpldn.dtx}{theme}}
\file{beamerouterthemecpldn.sty}{\from{beamer-cpldn.dtx}{outertheme}}
\file{beamerinnerthemecpldn.sty}{\from{beamer-cpldn.dtx}{innertheme}}
\file{beamercolorthemecpldn.sty}{\from{beamer-cpldn.dtx}{colortheme}}
}
\endgroup
%</batchfile>
%
%<*driver>
\ProvidesFile{beamer-cpldn.dtx}[2020/03/09 v0.1 Beamer theme for CryptoParty London]
\documentclass[a4paper]{ltxdoc}
\usepackage{hyperref}
\RecordChanges
\begin{document}
\DocInput{beamer-cpldn.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{0}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
% Digits \0\1\2\3\4\5\6\7\8\9
% Exclamation \! Double quote \" Hash (number) \#
% Dollar \$ Percent \% Ampersand \&
% Acute accent \' Left paren \( Right paren \)
% Asterisk \* Plus \+ Comma \,
% Minus \- Point \. Solidus \/
% Colon \: Semicolon \; Less than \<
% Equals \= Greater than \> Question mark \?
% Commercial at \@ Left bracket \[ Backslash \\
% Right bracket \] Circumflex \^ Underscore \_
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
% \changes{0.1}{2020/03/16}{Initial version.}
%
% \GetFileInfo{beamer-cpldn.dtx}
%
% \title{^^A
% The \textsf{beamer-cpldn} class\thanks{^^A
% This file has version number \fileversion, last revised \filedate.}}
% \author{^^A
% Damien Goutte-Gattat\\
% \texttt{dgouttegattat@incenp.org}}
% \date{\filedate}
%
% \maketitle
%
% \abstract{A Beamer theme to typeset presentations for cryptoparties.}
%
% \tableofcontents
%
% \section{Introduction}
% This is a Beamer theme for
% \url{https://www.cryptoparty.in}{cryptoparties}. It is aimed at
% creating workshop presentations that share a consistent visual
% appearance.
%
% The name \emph{cpldn} stands for \emph{CryptoParty London}, where I
% regularly animate crypto-related workshops.
%
% The theme reuses the color chart from the cryptoparty.in website. It
% also comes with a vectorized version of the cryptoparty logo. The
% original logo was also found on the cryptoparty.in website, where it
% is presumably available under a CC0 license.
%
%
% \section{Usage}
%
% Create a Beamer presentation as usual, and include the following line
% somewhere in the preamble:
%
% \begin{verbatim}
% \usetheme{cpldn}
% \end{verbatim}
%
%
% \StopEventually{\PrintChanges}
%
%
% \section{The code}
%
% \subsection{The main theme}
% \iffalse
%<*theme>
% \fi
%
% \begin{macrocode}
\mode<presentation>
% \end{macrocode}
%
% We specify the different themes to use. We use our own outer, inner,
% and color themes.
% \begin{macrocode}
\useoutertheme{cpldn}
\useinnertheme{cpldn}
\usecolortheme{cpldn}
\setbeamercovered{transparent}
\setbeamertemplate{navigation symbols}{}
\mode<all>
% \end{macrocode}
%
% \iffalse
%</theme>
% \fi
%
%
% \subsection{The outer theme}
% \iffalse
%<*outertheme>
% \fi
%
% \begin{macrocode}
\mode<presentation>
% \end{macrocode}
%
% Our outer theme is based on the standard |infolines| theme from the
% Beamer distribution.
% \begin{macrocode}
\useoutertheme{infolines}
% \end{macrocode}
%
% We don't wont a headline on top of the frame title, so we set the
% |headline| template to nothing.
% \begin{macrocode}
\setbeamertemplate{headline}{}
% \end{macrocode}
%
% We redefine the |frametitle| template to insert the cryptoparty logo
% on the top right corner of each frame.
% \begin{macrocode}
\defbeamertemplate*{frametitle}{cpldn}[1][left]
{%
\ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}%
\@tempdima=\textwidth%
\advance\@tempdima by\beamer@leftmargin%
\advance\@tempdima by\beamer@rightmargin%
\begin{beamercolorbox}[sep=.3cm,#1,wd=\the\@tempdima]{frametitle}
\usebeamerfont{frametitle}%
\vbox{}\vskip-1ex%
\if@tempswa\else\csname beamer@fte#1\endcsname\fi%
\strut\insertframetitle%
\hskip 0pt plus 1filll%
\includegraphics[height=1.5ex]{cpldn-logo}\par%
{%
\ifx\insertframesubtitle\@empty%
\else%
{\usebeamerfont{framesubtitle}%
\usebeamercolor[fg]{framesubtitle}%
\strut\insertframesubtitle\par%
}%
\fi
}%
\vskip-1ex%
\if@tempswa\else\vskip-.3cm\fi%
\end{beamercolorbox}%
}
\mode<all>
% \end{macrocode}
%
% \iffalse
%</outertheme>
% \fi
%
%
% \subsection{The inner theme}
% \iffalse
%<*innertheme>
% \fi
%
% \begin{macrocode}
\mode<presentation>
% \end{macrocode}
%
% Our inner theme is based on the standard |rectangles| theme from the
% Beamer distribution.
% \begin{macrocode}
\useinnertheme{rectangles}
% \end{macrocode}
%
% We redefine the |begin block| template to draw a border on the top of
% the block.
% \begin{macrocode}
\defbeamertemplate*{block begin}{cpldn}
{
\par\vskip-1.4ex%
\begin{beamercolorbox}[colsep*=.75ex,ht=.2ex]{block top border}\end{beamercolorbox}
\ifx\insertblocktitle\@empty\else%
\nointerlineskip%
\begin{beamercolorbox}[colsep*=.75ex]{block title}
\usebeamerfont*{block title}\insertblocktitle%
\end{beamercolorbox}%
\fi%
{\parskip0pt\par}%
\nointerlineskip%
\usebeamerfont{block body}%
\begin{beamercolorbox}[colsep*=.75ex,vmode]{block body}%
\ifbeamercolorempty[bg]{block body}{\vskip-.25ex}{\vskip-.75ex}\vbox{}%
}
\defbeamertemplate*{block end}{cpldn}
{\end{beamercolorbox}\vskip\smallskipamount}
\mode<all>
% \end{macrocode}
%
% \iffalse
%</innertheme>
% \fi
%
%
% \subsection{The color theme}
% \iffalse
%<*colortheme>
% \fi
%
% \begin{macrocode}
\mode<presentation>
% \end{macrocode}
%
% We define the colors we will use throughout the theme. Those colors
% have been picked up from the cryptoparty.in website.
%
% \begin{macrocode}
\definecolor{cpldnpalepink}{rgb}{1,.94,.97}
\definecolor{cpldnpink}{rgb}{1,.89,.95}
\definecolor{cpldnmagenta}{rgb}{1,.11,.64}
\definecolor{cpldnviolet}{rgb}{.86,0,1}
\definecolor{cpldndarkblue}{rgb}{.4,.26,.95}
% \end{macrocode}
%
% Then we set some standard Beamer colors to the newly defined colors.
%
% \begin{macrocode}
\setbeamercolor{alerted text}{fg=cpldnmagenta}
\setbeamercolor{sample text}{fg=cpldnviolet}
\setbeamercolor{structure}{fg=cpldndarkblue}
\setbeamercolor*{author in head/foot}{fg=cpldndarkblue,bg=cpldnpalepink}
\setbeamercolor*{title in head/foot}{fg=cpldndarkblue,bg=cpldnpalepink}
\setbeamercolor*{date in head/foot}{fg=cpldndarkblue,bg=cpldnpalepink}
\setbeamercolor*{frametitle}{fg=cpldndarkblue,bg=cpldnpink}
\setbeamercolor*{block title}{fg=cpldndarkblue,bg=cpldnpink}
\setbeamercolor*{block body}{fg=black,bg=cpldnpalepink}
\setbeamercolor*{block top border}{bg=cpldnmagenta}
\mode<all>
% \end{macrocode}
%
% \iffalse
%</colortheme>
% \fi
%
%
% ^^A Inserts the LPPL text.
% \providecommand{\LPPLsection}{\section}
% \providecommand{\LPPLsubsection}{\subsection}
% \MakePercentComment\input{lppl-1-3c}\MakePercentIgnore
%
% \Finale
\endinput