-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbeamerouterthemeUniNA.sty
156 lines (147 loc) · 7.34 KB
/
beamerouterthemeUniNA.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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerouterthemeUniNA}[2018/11/16 An unofficial beamer theme for the University of Naples "Federico II"]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Load required packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{tikz}
\usetikzlibrary{external}
\RequirePackage{calc}
\RequirePackage{fp}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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}}
\DeclareOptionBeamer{logo}{\def\beamer@logo{#1}}
\ProcessOptionsBeamer
%the height of the header is 1.8 times the lineheight of the frame title
\newlength{\beamer@height}
\usebeamerfont{frametitle} %use the frame title font
\setlength{\beamer@height}{1.8\baselineskip}
%\setlength{\beamer@height}{2\baselineskip}
% reset fonts
\reset@font
% radius of the logo
\newlength{\beamer@logoradius}
\setlength{\beamer@logoradius}{1.2\beamer@height/2}
% width of the border
\newlength{\beamer@borderwidth}
\setlength{\beamer@borderwidth}{1.65mm}
% 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
{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%templates
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %headline
\setbeamertemplate{headline}{%
\begin{beamercolorbox}[wd=1.0\paperwidth,ht=3ex,dp=1.4ex,left]{headfoot}%
\usebeamerfont{section in head/foot}\hspace*{3.5ex}%
\insertshortauthor\ |\ %
\insertshorttitle%
\end{beamercolorbox}%
\aauheaderbackground%
}
%frame title
\setbeamertemplate{frametitle}{%
\vspace{-.8ex}%reduce space before title
\begin{minipage}[t][.75\beamer@height][t]{\textwidth-1.5\beamer@logoouterradius}%
{\usebeamercolor[fg]{frametitle}\usebeamerfont{frametitle}\insertframetitle\par}%
%{\usebeamercolor[fg]{frametitle}\usebeamerfont{frametitle}\insertframetitle\hspace{1em}}% single line
{\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]{%
\tikzexternaldisable
\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,0.5\beamer@height)}] HLR);%coordinate of the logo
%draw the background of the header, the circle and the logo
{\usebeamercolor{UniNA}%
\usebeamercolor{background canvas}%
% draw the blue background rectangle of the header
\draw[draw=none,fill=UniNA.bg] (UL) rectangle (HLR);
% draw the outer circle
\fill[fill=UniNA.fg] (logopos) circle (\beamer@logoouterradius);
% draw the inner circle
\fill[fill=background canvas.bg] (logopos) circle (\beamer@logoinnerradius);
% place the logo
\node at (logopos) {\includegraphics[width=1.9\beamer@logoradius]{\beamer@logo}};
%% 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
\ifx\beamer@rotationcw\undefined% counterclockwise rotation
\FPeval\progress{360*\insertframenumber/\inserttotalframenumber}
\else% clockwise rotation
\FPeval\progress{(-360*\insertframenumber/\inserttotalframenumber)}
\fi
% draw the arc
\draw[color=UniNA.bg,line width=0.5*\beamer@borderwidth] ([xshift=\beamer@counterradius] logopos) arc[radius=\beamer@counterradius, start angle=0, end angle=\progress];
\fill[fill=UniNA.bg] ([shift={(\progress:\beamer@counterradius)}] logopos) circle (0.25\beamer@borderwidth);
% place the current frame number
\node[fill=background canvas.bg,draw=UniNA.fg,thick,circle,minimum width=2*\beamer@borderwidth] (pagenumframe) at ([xshift=\beamer@counterradius]logopos) {};
\node[at=(pagenumframe.center), anchor=center] {{\usebeamercolor[bg]{frametitle}\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
\ifx\beamer@rotationcw\undefined% counterclockwise rotation
\FPeval\progress{360*\insertframenumber/\inserttotalframenumber}
\else% clockwise rotation
\FPeval\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}%
\tikzexternalenable
}
\mode<all>