-
Notifications
You must be signed in to change notification settings - Fork 2
/
beamerouterthemeAAUsimple.sty
161 lines (150 loc) · 7.45 KB
/
beamerouterthemeAAUsimple.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
% This is the outer theme file of the AAU simple theme.
% Copyright (c) 2014 by Jesper Kjær Nielsen <jkn@es.aau.dk>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You can find the GNU General Public License at <http://www.gnu.org/licenses/>.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerouterthemeAAUsimple}[2014/04/08 v1.2.1 The AAU Simple Beamer Theme]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Load required packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{tikz}
\RequirePackage{calc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Theme options and definitions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%theme options
% options for the progress bar/circle
\def\beamer@progressfixedCircCnt{fixedCircCnt} % fixed circular counter
\def\beamer@progressmovCircCnt{movCircCnt} % moving circular counter
\def\beamer@progresscorner{corner} % a counter in the lower right corner
%\def\beamer@progressmovCnt{movCnt} %
\def\beamer@progressstyle{fixedCircCnt} % default
\DeclareOptionBeamer{progressstyle}{\def\beamer@progressstyle{#1}}
\DeclareOptionBeamer{rotationcw}{\def\beamer@rotationcw{true}}
\DeclareOptionBeamer{shownavsym}{\def\beamer@shownavsym{true}}
\ProcessOptionsBeamer
%the height of the header is 2.5 times the lineheight of the frame title
\newlength{\beamer@height}
\usebeamerfont{frametitle} %use the frame title font
\setlength{\beamer@height}{2.5\baselineskip}
% reset fonts
\reset@font
% radius of the logo
\newlength{\beamer@logoradius}
\setlength{\beamer@logoradius}{0.95\beamer@height/2}
% width of the border
\newlength{\beamer@borderwidth}
\setlength{\beamer@borderwidth}{2mm}
% inner radius of border of the logo frame
\newlength{\beamer@logoinnerradius}
\setlength{\beamer@logoinnerradius}{1.1\beamer@logoradius}
% radius of the outer border of the logo frame
\newlength{\beamer@logoouterradius}
\setlength{\beamer@logoouterradius}{\beamer@logoinnerradius+\beamer@borderwidth}
% radius of the counters
\newlength{\beamer@counterradius}
\setlength{\beamer@counterradius}{\beamer@logoinnerradius/2+\beamer@logoouterradius/2}
% the progress
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%beamer specific options
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\mode<presentation>%refers to the first four modes (beamer,handout,second and trans). That is, to all modes except the article mode
{
\ifbeamercolorempty[fg]{AAUsimple}{%
%define the AAUsimple color if it is not defined (which may be due to that the AAUsimple color theme is not loaded)
\setbeamercolor{AAUsimple}{use={structure,palette sidebar primary},fg=palette sidebar primary.fg,bg=structure.fg}
}{%
%aau header is defined - nothing to do
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%templates
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %headline
\setbeamertemplate{headline}{%
\aauheaderbackground%
}
\setbeamertemplate{footline}{%
\begin{beamercolorbox}[wd=1.0\paperwidth,ht=2.25ex,dp=1ex,left]{headfoot}%
\usebeamerfont{section in head/foot}\hspace*{3.5ex}%
\insertshortauthor\ |\ %
\insertshorttitle%
\end{beamercolorbox}%
}
%frame title
\setbeamertemplate{frametitle}{%
\begin{minipage}[c][\beamer@height][c]{\textwidth}
{\usebeamercolor[fg]{frametitle}\usebeamerfont{frametitle}\insertframetitle\par}%
{\usebeamercolor[fg]{framesubtitle}\usebeamerfont{framesubtitle}\insertframesubtitle\par}%
\end{minipage}
}
\ifx\beamer@shownavsym\undefined% insert navigation symbols
\setbeamertemplate{navigation symbols}{%
%disable navigation symbols
}
\fi
\ifx\beamer@progressstyle\beamer@progresscorner% the progress in the lower right corner
\setbeamertemplate{footline}[frame number]
\fi
}%end of beamer specific options
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Macros used in the theme
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% the fancy header background
\newcommand{\aauheaderbackground}[0]{%
\begin{tikzpicture}[overlay]
\coordinate (UL) at (0,0); %upper left corner of the slide
\coordinate (HLR) at (\paperwidth,-\beamer@height); %lower right of the header
\coordinate (logopos) at ([shift={(-\beamer@logoouterradius-\beamer@borderwidth,\beamer@height-\beamer@logoouterradius-0.5\beamer@borderwidth)}] HLR);%coordinate of the logo
%draw the background of the header, the circle and the logo
{\usebeamercolor{AAUsimple}%
\usebeamercolor{normal text}%
% draw the blue background rectangle of the header
\draw[draw=none,fill=AAUsimple.bg] (UL) rectangle (HLR);
% draw the outer circle
\fill[fill=AAUsimple.fg] (logopos) circle (\beamer@logoouterradius);
% draw the inner circle
\fill[fill=normal text.bg] (logopos) circle (\beamer@logoinnerradius);
% place the logo
\node at (logopos) {\includegraphics[width=1.8\beamer@logoradius]{AAUgraphics/eie2.png}};
%% draw progress circle/bar
\ifx\beamer@progressstyle\beamer@progressfixedCircCnt% the circular counter with a fixed counter
% calculate end position
\ifx\beamer@rotationcw\undefined% counterclockwise rotation
\pgfmathsetmacro{\progress}{360*\insertframenumber/\inserttotalframenumber};
\else% clockwise rotation
\pgfmathsetmacro{\progress}{-360*\insertframenumber/\inserttotalframenumber};
\fi
% draw the arc
\draw[color=AAUsimple.bg,line width=0.5*\beamer@borderwidth] ([xshift=\beamer@counterradius] logopos) arc[radius=\beamer@counterradius, start angle=0, end angle=\progress];
\fill[fill=AAUsimple.bg] ([shift={(\progress:\beamer@counterradius)}] logopos) circle (0.25\beamer@borderwidth);
% place the current frame number
\node[fill=normal text.bg,draw=AAUsimple.fg,thick,circle,minimum width=2*\beamer@borderwidth] at ([xshift=\beamer@counterradius]logopos) {{\usebeamercolor[fg]{normal text}\insertframenumber}};
\fi
\ifx\beamer@progressstyle\beamer@progressmovCircCnt% the circular counter with a moving counter
% draw the current and total frame number
\ifx\beamer@rotationcw\undefined% counterclockwise rotation
\pgfmathsetmacro{\progress}{360*\insertframenumber/\inserttotalframenumber};
\else% clockwise rotation
\pgfmathsetmacro{\progress}{-360*\insertframenumber/\inserttotalframenumber};
\fi
% draw the arc
\draw[color=AAUsimple.bg,line width=0.5*\beamer@borderwidth] ([xshift=\beamer@counterradius] logopos) arc (0:\progress:\beamer@counterradius);
% place the total number of frames
\node[fill=normal text.bg,draw=AAUsimple.fg,circle,thick,minimum width=2*\beamer@borderwidth] at ([xshift=\beamer@counterradius] logopos) {{\usebeamercolor[fg]{normal text}\inserttotalframenumber}};
% place the current frame number
\node[fill=normal text.bg,draw=AAUsimple.fg,circle,thick,minimum width=2*\beamer@borderwidth] at ([shift={(\progress:\beamer@counterradius)}] logopos) {{\usebeamercolor[fg]{normal text}\insertframenumber}};
\fi
}
\end{tikzpicture}%
}
\mode<all>