📚 The CoCalc Library - books, templates and other resources
cocalc-examples / martinthoma-latex-examples / presentations / software-engineering-basics / beamerouterthemeFeather.sty
132928 viewsLicense: OTHER
% This is the outer theme file of the Feather theme.1% Copyright (c) 2014 by Lilyana Vaskova Vankova <[email protected]>2%3% This program is free software: you can redistribute it and/or modify4% it under the terms of the GNU General Public License as published by5% the Free Software Foundation, either version 3 of the License, or6% (at your option) any later version.7%8% This program is distributed in the hope that it will be useful,9% but WITHOUT ANY WARRANTY; without even the implied warranty of10% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11% GNU General Public License for more details.12%13% You can find the GNU General Public License at <http://www.gnu.org/licenses/>.1415%----------------------------------------------------------------------------------------------------------------------------------1617\NeedsTeXFormat{LaTeX2e}18\ProvidesPackage{beamerouterthemeFeather}[2014/04/08 v1.0.0 The Feather Beamer Theme]1920%----------------------------------------------------------------------------------------------------------------------------------2122% load required packages2324\RequirePackage{tikz}25\RequirePackage{calc}2627%----------------------------------------------------------------------------------------------------------------------------------2829%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%30% Theme options, definitions and templates.31%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%3233%----------------------------------------------------------------------------------------------------------------------------------3435% options for the progress bar/circle3637\def\beamer@progressmovingCircCnt{movingCircCnt} % moving circular counter38\def\beamer@progressfixedCircCnt{fixedCircCnt} % fixed circular counter39\def\beamer@progresscorner{corner} % a counter40\def\beamer@progressstyle{movingCircCnt} % default41\DeclareOptionBeamer{progressstyle}{\def\beamer@progressstyle{#1}}42\DeclareOptionBeamer{rotationcw}{\def\beamer@rotationcw{true}}43\DeclareOptionBeamer{shownavsym}{\def\beamer@shownavsym{true}}44\ProcessOptionsBeamer4546%----------------------------------------------------------------------------------------------------------------------------------4748% the height of the header is 2.5 times the lineheight of the frame title4950\newlength{\beamer@height}51\usebeamerfont{frametitle} %use the frame title font52\setlength{\beamer@height}{2.5\baselineskip}5354%----------------------------------------------------------------------------------------------------------------------------------5556% reset fonts5758\reset@font5960%----------------------------------------------------------------------------------------------------------------------------------6162% radius of the logo6364\newlength{\beamer@logoradius}65\setlength{\beamer@logoradius}{0.95\beamer@height/2}6667%----------------------------------------------------------------------------------------------------------------------------------6869% width of the border7071\newlength{\beamer@borderwidth}72\setlength{\beamer@borderwidth}{1.05mm} % as small is the thickness of the border the whole circle goes up7374%----------------------------------------------------------------------------------------------------------------------------------7576% inner radius of border of the logo frame7778\newlength{\beamer@logoinnerradius}79\setlength{\beamer@logoinnerradius}{0.85\beamer@logoradius}8081%----------------------------------------------------------------------------------------------------------------------------------8283% radius of the outer border of the logo frame8485\newlength{\beamer@logoouterradius}86\setlength{\beamer@logoouterradius}{\beamer@logoinnerradius+\beamer@borderwidth}8788%----------------------------------------------------------------------------------------------------------------------------------8990% radius of the counters9192\newlength{\beamer@counterradius}93\setlength{\beamer@counterradius}{\beamer@logoinnerradius/2+\beamer@logoouterradius/2}9495%----------------------------------------------------------------------------------------------------------------------------------9697% beamer specific options9899\mode<presentation> % refers to the first four modes (beamer,handout,second and trans). That is, to all modes except the article mode100{101\ifbeamercolorempty[fg]{Feather}102{103\setbeamercolor{Feather}{use={structure,palette sidebar primary},fg=palette sidebar primary.fg,bg=structure.fg}104}105106%----------------------------------------------------------------------------------------------------------------------------------107108% headline109110\setbeamertemplate{headline}111{112\featherheaderbackground113}114115%----------------------------------------------------------------------------------------------------------------------------------116117% footline118119\setbeamertemplate{footline}120{121\begin{beamercolorbox}[wd=1.0\paperwidth,ht=1.25ex,dp=1ex,left]{headfoot}122{\usebeamercolor[fg]{frametitle}\usebeamerfont{section in head/foot}\hspace*{3.5ex}123\insertshortauthor\ |\124\insertshorttitle125\insertshortsubtitle126}127\end{beamercolorbox}128}129130%----------------------------------------------------------------------------------------------------------------------------------131132% frame title133134\setbeamertemplate{frametitle}135{136\begin{minipage}[c][0.9\beamer@height][c]{\textwidth}137{\usebeamercolor[fg]{frametitle}\usebeamerfont{frametitle}\insertframetitle\par}138{\usebeamercolor[fg]{framesubtitle}\usebeamerfont{framesubtitle}\insertframesubtitle\par}139\end{minipage}140}141\ifx\beamer@shownavsym\undefined % insert navigation symbols142\setbeamertemplate{navigation symbols}143144\fi145}146147%----------------------------------------------------------------------------------------------------------------------------------148149% macros used in the theme150%% coordinate the fancy header background151152\newcommand{\featherheaderbackground}[0]153{154\begin{tikzpicture}[overlay]155156\coordinate (UL) at (0,0); %upper left corner of the slide157\coordinate (HLR) at (\paperwidth,-0.9\beamer@height); %lower right of the header158159\coordinate (ULL) at (0,-0.95\beamer@height); % upper left corner of the line160\coordinate (LLR) at (\paperwidth,-1\beamer@height); % lower right corner of the line161162\coordinate (ULF) at (0,-5.90\beamer@height); % upper left corner of the footline163\coordinate (LFR) at (\paperwidth,-6.08\beamer@height); % lower right corner of the footline164165\coordinate (logopos) at ([shift={(-\beamer@logoouterradius-2.05\beamer@borderwidth,\beamer@height-\beamer@logoouterradius-5.5\beamer@borderwidth)}] HLR); % coordinate of the logo and the circ position166167%----------------------------------------------------------------------------------------------------------------------------------168169%%draw the background of the header, the circle and the logo170171{172\usebeamercolor{Feather}173174%----------------------------------------------------------------------------------------------------------------------------------175176%% draw the blue background rectangle of the header and the line below it177178\draw[draw=none,fill=Feather.bg] (UL) rectangle (HLR); % background rectabgle179\draw[draw=none,fill=Feather.fg] (ULL) rectangle (LLR); % line below the background rectangle180\draw[draw=none,fill=Feather.bg] (ULF) rectangle (LFR); % footline181182%----------------------------------------------------------------------------------------------------------------------------------183184%% draw the outer circle185186\fill[fill=Feather.fg] (logopos) circle (\beamer@logoouterradius);187188%----------------------------------------------------------------------------------------------------------------------------------189190%% draw the inner circle191192\fill[fill=normal text.bg] (logopos) circle (\beamer@logoinnerradius);193194%----------------------------------------------------------------------------------------------------------------------------------195196%% place the logo in the circle197198\node at (logopos) {\includegraphics[width=1.75\beamer@logoradius]{Feathergraphics/2}};199200%----------------------------------------------------------------------------------------------------------------------------------201202%% draw progress circle/bar203204\ifx\beamer@progressstyle\beamer@progressmovingCircCnt% the circular counter with a moving counter205206%----------------------------------------------------------------------------------------------------------------------------------207208%% calculate end position209210\ifx\beamer@rotationcw\undefined% counterclockwise rotation211\pgfmathsetmacro{\progress}{220*\insertframestartpage/\inserttotalframenumber}; %%% 220 covers the entire circle, while 360 it goes twice212\else% clockwise rotation213\pgfmathsetmacro{\progress}{-220*\insertframestartpage/\inserttotalframenumber};214\fi215216%----------------------------------------------------------------------------------------------------------------------------------217218%% draw the arc219220\draw[color=Feather.bg,line width=0.2*\beamer@borderwidth] ([xshift=\beamer@counterradius] logopos) arc[radius=\beamer@counterradius, start angle=0, end angle=\progress];221\fill[fill=Feather.bg] ([shift={(\progress:\beamer@counterradius)}] logopos) circle (0.25\beamer@borderwidth);222223%----------------------------------------------------------------------------------------------------------------------------------224225%% place the current frame number226227\node[fill=normal text.bg,draw=Feather.fg,thick,circle,minimum width=2*\beamer@borderwidth] at ([xshift=\beamer@counterradius]logopos) {{\usebeamercolor[fg]{normal text}\insertframenumber}};228\fi229\ifx\beamer@progressstyle\beamer@progressfixedCircCnt % the circular counter with a fixed counter230231%----------------------------------------------------------------------------------------------------------------------------------232233%% draw the current frame number234235\ifx\beamer@rotationcw\undefined % counterclockwise rotation236\pgfmathsetmacro{\progress}{360*\insertframestartpage};237else% clockwise rotation238\pgfmathsetmacro{\progress}{-360*\insertframestartpage};239\fi240241%----------------------------------------------------------------------------------------------------------------------------------242243%% draw the arc244245\draw[color=Feather.bg,line width=0.5*\beamer@borderwidth] ([xshift=\beamer@counterradius] logopos) arc (0:\progress:\beamer@counterradius);246247%----------------------------------------------------------------------------------------------------------------------------------248249%% place the current frame number250251\node[fill=normal text.bg,draw=Feather.fg,circle,thick,minimum width=2*\beamer@borderwidth] at ([shift={(\progress:\beamer@counterradius)}] logopos) {{\usebeamercolor[fg]{normal text}\insertframenumber}};252\fi253}254\end{tikzpicture}255}256257%----------------------------------------------------------------------------------------------------------------------------------258259%%setting the blocks260261\setbeamertemplate{blocks}[rounded][shadow=true]262\setbeamercolor{block title}{fg=frametitle.fg, bg=frametitle.bg}263\setbeamercolor{block body}{parent=normal text, use=block title,bg=Feather.fg!30}264265\mode<all>266267