Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132930 views
License: OTHER
1
% This is the outer theme file of the Feather theme.
2
% Copyright (c) 2014 by Lilyana Vaskova Vankova <[email protected]>
3
%
4
% This program is free software: you can redistribute it and/or modify
5
% it under the terms of the GNU General Public License as published by
6
% the Free Software Foundation, either version 3 of the License, or
7
% (at your option) any later version.
8
%
9
% This program is distributed in the hope that it will be useful,
10
% but WITHOUT ANY WARRANTY; without even the implied warranty of
11
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
% GNU General Public License for more details.
13
%
14
% You can find the GNU General Public License at <http://www.gnu.org/licenses/>.
15
16
%----------------------------------------------------------------------------------------------------------------------------------
17
18
\NeedsTeXFormat{LaTeX2e}
19
\ProvidesPackage{beamerouterthemeFeather}[2014/04/08 v1.0.0 The Feather Beamer Theme]
20
21
%----------------------------------------------------------------------------------------------------------------------------------
22
23
% load required packages
24
25
\RequirePackage{tikz}
26
\RequirePackage{calc}
27
28
%----------------------------------------------------------------------------------------------------------------------------------
29
30
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31
% Theme options, definitions and templates.
32
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
33
34
%----------------------------------------------------------------------------------------------------------------------------------
35
36
% options for the progress bar/circle
37
38
\def\beamer@progressmovingCircCnt{movingCircCnt} % moving circular counter
39
\def\beamer@progressfixedCircCnt{fixedCircCnt} % fixed circular counter
40
\def\beamer@progresscorner{corner} % a counter
41
\def\beamer@progressstyle{movingCircCnt} % default
42
\DeclareOptionBeamer{progressstyle}{\def\beamer@progressstyle{#1}}
43
\DeclareOptionBeamer{rotationcw}{\def\beamer@rotationcw{true}}
44
\DeclareOptionBeamer{shownavsym}{\def\beamer@shownavsym{true}}
45
\ProcessOptionsBeamer
46
47
%----------------------------------------------------------------------------------------------------------------------------------
48
49
% the height of the header is 2.5 times the lineheight of the frame title
50
51
\newlength{\beamer@height}
52
\usebeamerfont{frametitle} %use the frame title font
53
\setlength{\beamer@height}{2.5\baselineskip}
54
55
%----------------------------------------------------------------------------------------------------------------------------------
56
57
% reset fonts
58
59
\reset@font
60
61
%----------------------------------------------------------------------------------------------------------------------------------
62
63
% radius of the logo
64
65
\newlength{\beamer@logoradius}
66
\setlength{\beamer@logoradius}{0.95\beamer@height/2}
67
68
%----------------------------------------------------------------------------------------------------------------------------------
69
70
% width of the border
71
72
\newlength{\beamer@borderwidth}
73
\setlength{\beamer@borderwidth}{1.05mm} % as small is the thickness of the border the whole circle goes up
74
75
%----------------------------------------------------------------------------------------------------------------------------------
76
77
% inner radius of border of the logo frame
78
79
\newlength{\beamer@logoinnerradius}
80
\setlength{\beamer@logoinnerradius}{0.85\beamer@logoradius}
81
82
%----------------------------------------------------------------------------------------------------------------------------------
83
84
% radius of the outer border of the logo frame
85
86
\newlength{\beamer@logoouterradius}
87
\setlength{\beamer@logoouterradius}{\beamer@logoinnerradius+\beamer@borderwidth}
88
89
%----------------------------------------------------------------------------------------------------------------------------------
90
91
% radius of the counters
92
93
\newlength{\beamer@counterradius}
94
\setlength{\beamer@counterradius}{\beamer@logoinnerradius/2+\beamer@logoouterradius/2}
95
96
%----------------------------------------------------------------------------------------------------------------------------------
97
98
% beamer specific options
99
100
\mode<presentation> % refers to the first four modes (beamer,handout,second and trans). That is, to all modes except the article mode
101
{
102
\ifbeamercolorempty[fg]{Feather}
103
{
104
\setbeamercolor{Feather}{use={structure,palette sidebar primary},fg=palette sidebar primary.fg,bg=structure.fg}
105
}
106
107
%----------------------------------------------------------------------------------------------------------------------------------
108
109
% headline
110
111
\setbeamertemplate{headline}
112
{
113
\featherheaderbackground
114
}
115
116
%----------------------------------------------------------------------------------------------------------------------------------
117
118
% footline
119
120
\setbeamertemplate{footline}
121
{
122
\begin{beamercolorbox}[wd=1.0\paperwidth,ht=1.25ex,dp=1ex,left]{headfoot}
123
{\usebeamercolor[fg]{frametitle}\usebeamerfont{section in head/foot}\hspace*{3.5ex}
124
\insertshortauthor\ |\
125
\insertshorttitle
126
\insertshortsubtitle
127
}
128
\end{beamercolorbox}
129
}
130
131
%----------------------------------------------------------------------------------------------------------------------------------
132
133
% frame title
134
135
\setbeamertemplate{frametitle}
136
{
137
\begin{minipage}[c][0.9\beamer@height][c]{\textwidth}
138
{\usebeamercolor[fg]{frametitle}\usebeamerfont{frametitle}\insertframetitle\par}
139
{\usebeamercolor[fg]{framesubtitle}\usebeamerfont{framesubtitle}\insertframesubtitle\par}
140
\end{minipage}
141
}
142
\ifx\beamer@shownavsym\undefined % insert navigation symbols
143
\setbeamertemplate{navigation symbols}
144
145
\fi
146
}
147
148
%----------------------------------------------------------------------------------------------------------------------------------
149
150
% macros used in the theme
151
%% coordinate the fancy header background
152
153
\newcommand{\featherheaderbackground}[0]
154
{
155
\begin{tikzpicture}[overlay]
156
157
\coordinate (UL) at (0,0); %upper left corner of the slide
158
\coordinate (HLR) at (\paperwidth,-0.9\beamer@height); %lower right of the header
159
160
\coordinate (ULL) at (0,-0.95\beamer@height); % upper left corner of the line
161
\coordinate (LLR) at (\paperwidth,-1\beamer@height); % lower right corner of the line
162
163
\coordinate (ULF) at (0,-5.90\beamer@height); % upper left corner of the footline
164
\coordinate (LFR) at (\paperwidth,-6.08\beamer@height); % lower right corner of the footline
165
166
\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 position
167
168
%----------------------------------------------------------------------------------------------------------------------------------
169
170
%%draw the background of the header, the circle and the logo
171
172
{
173
\usebeamercolor{Feather}
174
175
%----------------------------------------------------------------------------------------------------------------------------------
176
177
%% draw the blue background rectangle of the header and the line below it
178
179
\draw[draw=none,fill=Feather.bg] (UL) rectangle (HLR); % background rectabgle
180
\draw[draw=none,fill=Feather.fg] (ULL) rectangle (LLR); % line below the background rectangle
181
\draw[draw=none,fill=Feather.bg] (ULF) rectangle (LFR); % footline
182
183
%----------------------------------------------------------------------------------------------------------------------------------
184
185
%% draw the outer circle
186
187
\fill[fill=Feather.fg] (logopos) circle (\beamer@logoouterradius);
188
189
%----------------------------------------------------------------------------------------------------------------------------------
190
191
%% draw the inner circle
192
193
\fill[fill=normal text.bg] (logopos) circle (\beamer@logoinnerradius);
194
195
%----------------------------------------------------------------------------------------------------------------------------------
196
197
%% place the logo in the circle
198
199
\node at (logopos) {\includegraphics[width=1.75\beamer@logoradius]{Feathergraphics/2}};
200
201
%----------------------------------------------------------------------------------------------------------------------------------
202
203
%% draw progress circle/bar
204
205
\ifx\beamer@progressstyle\beamer@progressmovingCircCnt% the circular counter with a moving counter
206
207
%----------------------------------------------------------------------------------------------------------------------------------
208
209
%% calculate end position
210
211
\ifx\beamer@rotationcw\undefined% counterclockwise rotation
212
\pgfmathsetmacro{\progress}{220*\insertframestartpage/\inserttotalframenumber}; %%% 220 covers the entire circle, while 360 it goes twice
213
\else% clockwise rotation
214
\pgfmathsetmacro{\progress}{-220*\insertframestartpage/\inserttotalframenumber};
215
\fi
216
217
%----------------------------------------------------------------------------------------------------------------------------------
218
219
%% draw the arc
220
221
\draw[color=Feather.bg,line width=0.2*\beamer@borderwidth] ([xshift=\beamer@counterradius] logopos) arc[radius=\beamer@counterradius, start angle=0, end angle=\progress];
222
\fill[fill=Feather.bg] ([shift={(\progress:\beamer@counterradius)}] logopos) circle (0.25\beamer@borderwidth);
223
224
%----------------------------------------------------------------------------------------------------------------------------------
225
226
%% place the current frame number
227
228
\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}};
229
\fi
230
\ifx\beamer@progressstyle\beamer@progressfixedCircCnt % the circular counter with a fixed counter
231
232
%----------------------------------------------------------------------------------------------------------------------------------
233
234
%% draw the current frame number
235
236
\ifx\beamer@rotationcw\undefined % counterclockwise rotation
237
\pgfmathsetmacro{\progress}{360*\insertframestartpage};
238
else% clockwise rotation
239
\pgfmathsetmacro{\progress}{-360*\insertframestartpage};
240
\fi
241
242
%----------------------------------------------------------------------------------------------------------------------------------
243
244
%% draw the arc
245
246
\draw[color=Feather.bg,line width=0.5*\beamer@borderwidth] ([xshift=\beamer@counterradius] logopos) arc (0:\progress:\beamer@counterradius);
247
248
%----------------------------------------------------------------------------------------------------------------------------------
249
250
%% place the current frame number
251
252
\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}};
253
\fi
254
}
255
\end{tikzpicture}
256
}
257
258
%----------------------------------------------------------------------------------------------------------------------------------
259
260
%%setting the blocks
261
262
\setbeamertemplate{blocks}[rounded][shadow=true]
263
\setbeamercolor{block title}{fg=frametitle.fg, bg=frametitle.bg}
264
\setbeamercolor{block body}{parent=normal text, use=block title,bg=Feather.fg!30}
265
266
\mode<all>
267