summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/guide-latex-fr/Support_oral/beamerouterthemeFeather.sty
blob: b76e6214559e9fabfd20d3e946af377504e8a429 (plain)
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
% This is the outer theme file of the Feather theme.
% Copyright (c) 2014 by Lilyana Vaskova Vankova <lilqna.v@gmail.com>
%
% 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{beamerouterthemeFeather}[2017/08/22 v1.1.0 The Feather Beamer Theme]

%----------------------------------------------------------------------------------------------------------------------------------

% Load required packages

\RequirePackage{tikz}
\RequirePackage{calc}

%% LLT: Added \logofile to make logo configurable
\newcommand{\logofile}{2-logo}
\newcommand{\logoscale}{0.875}

%% LLT: Added unnumberedframe to keep track of
%% Frames to be ignored for progressbar
\newcounter{unnumberedframe}
\define@key{beamerframe}{noframenumbering}[true]{\stepcounter{unnumberedframe}\beamer@noframenumberingtrue}


%----------------------------------------------------------------------------------------------------------------------------------

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Theme options, definitions and templates.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%----------------------------------------------------------------------------------------------------------------------------------

% Options for the progress bar/circle
\def\beamer@progressmovingCircCnt{movingCircCnt} % moving circular counter
\def\beamer@progressfixedCircCnt{fixedCircCnt} % fixed circular counter
\def\beamer@progresscorner{corner} % a counter
\def\beamer@progressstyle{movingCircCnt} % 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}{1.05mm} % As small is the thickness of the border the whole circle goes up
 
%----------------------------------------------------------------------------------------------------------------------------------

% Inner radius of border of the logo frame
\newlength{\beamer@logoinnerradius}
\setlength{\beamer@logoinnerradius}{0.85\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}

%----------------------------------------------------------------------------------------------------------------------------------

% 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]{Feather}{
	\setbeamercolor{Feather}{use = {structure, palette sidebar primary}, fg = palette sidebar primary.fg, bg = structure.fg}
}

%----------------------------------------------------------------------------------------------------------------------------------

 % Headline
\setbeamertemplate{headline}{\featherheaderbackground}

%----------------------------------------------------------------------------------------------------------------------------------

% Footline  
\setbeamertemplate{footline}
	{
	\begin{beamercolorbox}[wd = 1.0\paperwidth, ht = 1.25ex, dp = 1ex, left]{headfoot}
		{\usebeamercolor[fg]{frametitle}\usebeamerfont{section in head/foot}\hspace*{3.5ex}
		\insertshortauthor\ |\ 
		\insertshorttitle
		\insertshortsubtitle
		}
	\end{beamercolorbox}
	}

%----------------------------------------------------------------------------------------------------------------------------------

% Frame title
\setbeamertemplate{frametitle}
	{
	\begin{minipage}[c][0.9\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}
		
	\fi % Saut de ligne obligatoire ici
}

%----------------------------------------------------------------------------------------------------------------------------------

% Macros used in the theme 
%% Coordinate the fancy header background
\newcommand{\featherheaderbackground}[0]{
	\begin{tikzpicture}[overlay]
		\coordinate (UL) at (0,0); % Upper left corner of the slide
		\coordinate (HLR) at (\paperwidth,-0.9\beamer@height); % Lower right of the header
		\coordinate (ULL) at (0,-0.95\beamer@height); % Upper left corner of the line 
		\coordinate (LLR) at (\paperwidth,-1\beamer@height); % Lower right corner of the line 
		\coordinate (ULF) at (0, \dimexpr-\paperheight+1.6em\relax);
		%\coordinate (ULF) at (0,-5.90\beamer@height); % Upper left corner of the footline 
		\coordinate (LFR) at (\paperwidth,-\paperheight);
		%\coordinate (LFR) at (\paperwidth,-6.08\beamer@height); % Lower right corner of the footline 

		\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

%----------------------------------------------------------------------------------------------------------------------------------

%% Draw the background of the header, the circle and the logo
	{
		\usebeamercolor{Feather}

%----------------------------------------------------------------------------------------------------------------------------------

%% Draw the blue background rectangle of the header and the line below it
		\draw[draw = none, fill = Feather.bg] (UL) rectangle (HLR); % Background rectangle
		\draw[draw = none, fill = Feather.fg] (ULL) rectangle (LLR); % Line below the background rectangle
		\draw[draw = none, fill = Feather.bg] (ULF) rectangle (LFR); % Footline 

%----------------------------------------------------------------------------------------------------------------------------------

%% Draw the outer circle
		\fill[fill = Feather.fg] (logopos) circle (\beamer@logoouterradius);

%----------------------------------------------------------------------------------------------------------------------------------

%% Draw the inner circle
		\fill[fill = normal text.bg] (logopos) circle (\beamer@logoinnerradius);

%----------------------------------------------------------------------------------------------------------------------------------

%% Place the logo in the circle
%% LLT: use customisable \logofile
		\node at (logopos) {\includegraphics[width = \dimexpr \logoscale \beamer@logoradius * 2\relax]{\logofile}};

%----------------------------------------------------------------------------------------------------------------------------------

%% Draw progress circle/bar
		\ifx\beamer@progressstyle\beamer@progressmovingCircCnt % The circular counter with a moving counter

%----------------------------------------------------------------------------------------------------------------------------------

%% Calculate end position
%%% LLT: modified to discount unnumbered frames, and
%%% Make the arc go a complete circle at end of
%%% Presentation
		\ifx\beamer@rotationcw\undefined % Counterclockwise rotation
			\pgfmathsetmacro{\effectivetotalframe}{max(\inserttotalframenumber-\theunnumberedframe,1)}
			\pgfmathsetmacro{\progress}{(\insertframenumber-\theunnumberedframe)/\effectivetotalframe*360};
		\else % Clockwise rotation
			\pgfmathsetmacro{\progress}{(\insertframenumber-\theunnumberedframe)/\effectivetotalframe*(-360)}; 
		\fi

%----------------------------------------------------------------------------------------------------------------------------------

%% Draw the arc
		\draw[color = Feather.bg, line width = 0.2*\beamer@borderwidth] ([xshift = \beamer@counterradius] logopos) arc[radius = \beamer@counterradius, start angle = 0, end angle = \progress];
		\fill[fill = Feather.bg] ([shift = {(\progress:\beamer@counterradius)}] logopos) circle (0.25\beamer@borderwidth);

%----------------------------------------------------------------------------------------------------------------------------------

%% Place the current frame number
		\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}};
		\fi      
		\ifx\beamer@progressstyle\beamer@progressfixedCircCnt % The circular counter with a fixed counter

%----------------------------------------------------------------------------------------------------------------------------------

%% Draw the current frame number
		\ifx\beamer@rotationcw\undefined % Counterclockwise rotation
			\pgfmathsetmacro{\progress}{360*\insertframestartpage};
		\else % Clockwise rotation
			\pgfmathsetmacro{\progress}{-360*\insertframestartpage};
		\fi

%----------------------------------------------------------------------------------------------------------------------------------

%% Draw the arc
		\draw[color = Feather.bg, line width = 0.5*\beamer@borderwidth] ([xshift = \beamer@counterradius] logopos) arc (0:\progress:\beamer@counterradius);

%----------------------------------------------------------------------------------------------------------------------------------

%% Place the current frame number
		\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}};
		\fi
	}
	\end{tikzpicture}
}

%----------------------------------------------------------------------------------------------------------------------------------

%% Setting the blocks
\setbeamertemplate{blocks}[rounded][shadow = true]
\setbeamercolor{block title}{fg = frametitle.fg, bg = frametitle.bg} 
\setbeamercolor{block body}{parent = normal text, use = block title, bg = Feather.fg!30}

\mode<all>