forked from nitrogl/strathbeamer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstrathclyde.sty
523 lines (456 loc) · 15.5 KB
/
strathclyde.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
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
% ----------------------------------------------------------------------
% Date: April 4th, 2016
% Author: Roberto Metere
% Project: Beamer template for Strathclyde University
%
% Copyright (C) 2016 Roberto Metere
% ----------------------------------------------------------------------
%
\mode<presentation>
\usepackage{minibox}
\usepackage{varwidth}
\usepackage{etoolbox}
% \usepackage{scrextend}
% \usepackage{helvet} % Font similar to Arial
\usepackage{tikz}
% \usepackage{fontspec} % Needs xelatex (not pdflatex)
% Official font
% \setmainfont{Arial} % fontspec package
% \renewcommand{\familydefault}{\sfdefault} % use with helvet for Arial-like font
\renewcommand{\rmdefault}{phv} % Arial
\renewcommand{\sfdefault}{phv} % Arial
% Default font size % scrextend
% \changefontsizes{9pt}
% Official colours
\definecolor{strathmain}{HTML}{002B5C}
\definecolor{strathmainlight}{HTML}{33557D}
\definecolor{strathtech}{HTML}{A7A9AC}
\definecolor{strathtechlight}{HTML}{B9BABD}
\definecolor{stratheng}{HTML}{0078AE}
\definecolor{strathenglight}{HTML}{3392BE}
\definecolor{strathhass}{HTML}{F47B20}
\definecolor{strathhasslight}{HTML}{F6954D}
\definecolor{strathsci}{HTML}{5D9732}
\definecolor{strathscilight}{HTML}{7DAC5B}
\definecolor{strathbus}{HTML}{EE3224}
\definecolor{strathbuslight}{HTML}{F15B50}
% Default [main]
\newcommand{\incolour}{}
\newcommand{\tabtype}{main}
\colorlet{strathsubidcolour}{strathtech}
\colorlet{strathidcolour}{strathmain}
\colorlet{strathstrongcolour}{strathmain}
\colorlet{strathlightcolour}{strathmainlight}
\newcommand{\strathsubid}{Professional Services}
\newcommand{\strathid}{Recruitment \& International Office}
\newcommand{\strathidfaculty}{\minibox{The University of Strathclyde:\\ the place of useful learning}}
\newcommand{\strathsetidentity}[2]{
\renewcommand{\strathsubid}{#1}
\renewcommand{\strathid}{#2}
}
\colorlet{slidetitle}{strathmain}
\colorlet{slidetitles}{strathmainlight}
\colorlet{quotesentence}{strathmain}
\definecolor{canvascolor}{rgb}{1.0, 1.0, 1.0}
\colorlet{blockexfg}{white}
\colorlet{blockexbg}{strathscilight}
% Workaround for renewenvironment issues
\long\def\beamer@newenvnoopt#1#2#3#4{%
\expandafter\renewcommand\expandafter<\expandafter>\csname#1\endcsname[#2]{#3}%<- here
\expandafter\long\expandafter\def\csname end#1\endcsname{#4}%
}
\long\def\beamer@newenvopt#1#2[#3]#4#5{%
\expandafter\renewcommand\expandafter<\expandafter>\csname#1\endcsname[#2][#3]{#4}%<- here
\expandafter\long\expandafter\def\csname end#1\endcsname{#5}%
}
% Distance between title and content
\newlength{\frametitlemargin}
\setlength{\frametitlemargin}{0mm}
\newlength{\blockbottommargin}
\setlength{\blockbottommargin}{2mm}
\newlength{\blocktopmargin}
\setlength{\blocktopmargin}{0mm}
\newcommand{\noframetitle}[1][20mm]{\vskip #1}
\newcommand{\framesingletitle}[2][20mm]{{\vskip #1}\noindent{\color{strathstrongcolour} \textbf{\large #2}}{\vskip 2mm}{\vskip \frametitlemargin}}
\newcommand{\emptyframetitle}{\frametitle{\strut}}
\renewenvironment<>{block}[1]{%
\vskip \blocktopmargin%
\begin{minipage}{\textwidth}%
\begin{actionenv}#2%
\def\insertblocktitle{#1}%
\par%
\mode<presentation>{%
\setbeamercolor{local structure}{use=block title,%
fg=block title.bg}}%
\usebeamertemplate{block begin}}
{\par%
\usebeamertemplate{block end}%
\end{actionenv}\vskip \blockbottommargin%
\end{minipage}}
\renewenvironment<>{exampleblock}[1]{%
\vskip \blocktopmargin%
\begin{minipage}{\textwidth}%
\begin{actionenv}#2%
\def\insertblocktitle{#1}%
\par%
\mode<presentation>{%
\setbeamercolor{local structure}{use=block title,%
fg=block title.bg}}%
\usebeamertemplate{block example begin}}
{\par%
\usebeamertemplate{block example end}%
\end{actionenv}\vskip \blockbottommargin%
\end{minipage}}
\renewenvironment<>{alertblock}[1]{%
\vskip \blocktopmargin%
\begin{minipage}{\textwidth}%
\begin{actionenv}#2%
\def\insertblocktitle{#1}%
\par%
\mode<presentation>{%
\setbeamercolor{local structure}{use=block title,%
fg=block title.bg}}%
\usebeamertemplate{block alerted begin}}
{\par%
\usebeamertemplate{block alerted end}%
\end{actionenv}\vskip \blockbottommargin%
\end{minipage}}
% A few enviroments
\newenvironment<>{termblock}[1]{%
\vskip \blocktopmargin%
\begin{minipage}{\textwidth}%
\begin{actionenv}#2%
\def\insertblocktitle{#1}%
\par%
\mode<presentation>{%
\setbeamercolor{block title}{fg=green!80!black,bg=black}
\setbeamercolor{block body}{fg=white,bg=white!20!black}
\setbeamercolor{itemize item}{fg=orange!20!black}
\setbeamertemplate{itemize item}[triangle]
}%
\usebeamertemplate{block begin}}
{\par\usebeamertemplate{block end}\end{actionenv}\vskip \blockbottommargin\end{minipage}}
\newenvironment<>{problock}[1]{%
\vskip \blocktopmargin%
\begin{minipage}{\textwidth}%
\begin{actionenv} #2%
\def\insertblocktitle{#1}%
\par%
\mode<presentation>{%
\setbeamercolor{block title}{fg=green!80!black,bg=green!5!white}
\setbeamercolor{block body}{fg=black,bg=green!1!white}
\setbeamercolor{itemize item}{fg=green!80!black}
\setbeamertemplate{itemize item}[triangle]
}%
\usebeamertemplate{block begin}}
{\par\usebeamertemplate{block end}\end{actionenv}\vskip \blockbottommargin\end{minipage}}
\newenvironment<>{conblock}[1]{%
\vskip \blocktopmargin%
\begin{minipage}{\textwidth}%
\begin{actionenv} #2%
\def\insertblocktitle{#1}%
\par%
\mode<presentation>{%
\setbeamercolor{block title}{fg=red!80!black,bg=red!5!white}
\setbeamercolor{block body}{fg=black,bg=red!1!white}
\setbeamercolor{itemize item}{fg=red!80!black}
\setbeamertemplate{itemize item}[triangle]
}%
\usebeamertemplate{block begin}}
{\par\usebeamertemplate{block end}\end{actionenv}\vskip \blockbottommargin\end{minipage}}
\newenvironment<>{yellowblock}[1]{%
\vskip \blocktopmargin%
\begin{minipage}{\textwidth}%
\begin{actionenv} #2%
\def\insertblocktitle{#1}%
\par%
\mode<presentation>{%
\setbeamercolor{block title}{fg=yellow!20!black,bg=yellow!50!white}
\setbeamercolor{block body}{fg=black,bg=yellow!30!white}
\setbeamercolor{itemize item}{fg=yellow!80!black}
\setbeamertemplate{itemize item}[triangle]
}%
\usebeamertemplate{block begin}}
{\par\usebeamertemplate{block end}\end{actionenv}\vskip \blockbottommargin\end{minipage}}
\newenvironment<>{blueblock}[1]{%
\vskip \blocktopmargin%
\begin{minipage}{\textwidth}%
\begin{actionenv} #2%
\def\insertblocktitle{#1}%
\par%
\mode<presentation>{%
\setbeamercolor{block title}{fg=white,bg=strathenglight}
\setbeamercolor{block body}{fg=black,bg=strathenglight!20!white}
\setbeamercolor{itemize item}{fg=blue!80!black}
\setbeamertemplate{itemize item}[triangle]
}%
\usebeamertemplate{block begin}}
{\par\usebeamertemplate{block end}\end{actionenv}\vskip \blockbottommargin\end{minipage}}
\setbeamertemplate{blocks}[default]
\setbeamerfont{block title}{size=\normalsize\rule{0mm}{\f@size pt}\strut\ifx\insertblocktitle\@empty{\vspace{-2mm}\vspace{-\f@size pt}}\fi}
\setbeamercolor{block title}{fg=white,bg=strathtech}
\setbeamercolor{block body}{fg=black,bg=strathtechlight!20!white}
\setbeamercolor{block title example}{fg=white,bg=strathscilight}
\setbeamercolor{block body example}{fg=black,bg=strathscilight!20!white}
\setbeamercolor{block title alerted}{fg=white,bg=strathbuslight}
\setbeamercolor{block body alerted}{fg=black,bg=strathbuslight!20!white}
% Title-Command
\newcommand{\fcbox}[2]{{\fcolorbox{#1}{#1}{#2}}}
\newcommand{\strathidtitle}[2]{
{
\def\thisblockfontheight{2mm}
\fboxrule=0pt
\fboxsep=0.8mm
\fontsize{\thisblockfontheight}{\thisblockfontheight}
\ifx#1\@empty\else\fcbox{strathsubidcolour}{
\textbf{\rule{0mm}{\thisblockfontheight}\MakeUppercase{#1\ }}
}\fi\fcbox{strathidcolour}{
\textbf{\rule{0mm}{\thisblockfontheight}\MakeUppercase{#2\ }}
}
}
}
\newcommand{\insertstrathtab}{
\begin{tikzpicture}[remember picture, overlay]
\node [anchor=north east, inner sep=0] at ([xshift=-0.056\paperwidth, yshift=0.05mm]current page.north east)
{\pgfuseimage{strath_tab} };
\end{tikzpicture}
}
\newcommand{\insertstrathidentity}{
\begin{tikzpicture}[remember picture, overlay]
\node [anchor=north west, inner sep=0] at ([xshift=0.056\paperwidth, yshift=-16mm]current page.north west)
{\strathidtitle{\strathsubid}{\strathid} };
\end{tikzpicture}
}
\newcommand{\insertstrathidentityfaculty}{
\begin{tikzpicture}[remember picture, overlay]
\node [anchor=south west, inner sep=0] at ([xshift=0.056\paperwidth, yshift=0.05\paperheight]current page.south west)
{
\def\thisblockfontheight{4mm}
\fboxrule=0pt
\fboxsep=1mm
\fontsize{\thisblockfontheight}{\thisblockfontheight}
\fcbox{strathidcolour}{
{\color{white} \textbf{\rule{0mm}{\thisblockfontheight}\strathidfaculty}}
}
};
\end{tikzpicture}
}
% Unknown option
\DeclareOption*{
\PackageWarning{strathclyde}{Unknown option '\CurrentOption'}
}
% Clear canvas
\def\whitebg{1}
\DeclareOption{strathbg}{
\def\whitebg{0}
}
% Coloured logo
\DeclareOption{colour}{
\renewcommand{\incolour}{_colour}
}
\DeclareOption{color}{
\renewcommand{\incolour}{_colour}
}
% MAIN/CORPORATE (default)
\DeclareOption{main}{}
% TECH colours
\DeclareOption{tech}{
\renewcommand{\tabtype}{tech}
\renewcommand{\strathidfaculty}{Technology and Innovation Centre}
\colorlet{strathstrongcolour}{strathtech}
\colorlet{strathlightcolour}{strathtechlight}
\colorlet{strathidcolour}{strathmain}
\colorlet{slidetitle}{strathtech}
\colorlet{slidetitles}{strathtechlight}
}
% SCI colours
\DeclareOption{sci}{
\renewcommand{\tabtype}{sci}
\renewcommand{\strathidfaculty}{Faculty of Science}
\colorlet{strathstrongcolour}{strathsci}
\colorlet{strathlightcolour}{strathscilight}
\colorlet{strathidcolour}{strathsci}
\colorlet{slidetitle}{strathsci}
\colorlet{slidetitles}{strathscilight}
}
% ENG colours
\DeclareOption{eng}{
\renewcommand{\tabtype}{eng}
\renewcommand{\strathidfaculty}{Faculty of Engineering}
\colorlet{strathstrongcolour}{stratheng}
\colorlet{strathlightcolour}{strathenglight}
\colorlet{strathidcolour}{stratheng}
\colorlet{slidetitle}{stratheng}
\colorlet{slidetitles}{strathenglight}
}
% BUS colours
\DeclareOption{bus}{
\renewcommand{\tabtype}{bus}
\renewcommand{\strathidfaculty}{Strathclyde Business School}
\colorlet{strathstrongcolour}{strathbus}
\colorlet{strathlightcolour}{strathbuslight}
\colorlet{strathidcolour}{strathbus}
\colorlet{slidetitle}{strathbus}
\colorlet{slidetitles}{strathbuslight}
}
% HASS colours
\DeclareOption{hass}{
\renewcommand{\tabtype}{hass}
\newcommand{\strathidfaculty}{\minibox{Faculty of Humanities\\ \& Social Sciences}}
\colorlet{strathstrongcolour}{strathhass}
\colorlet{strathlightcolour}{strathhasslight}
\colorlet{strathidcolour}{strathhass}
\colorlet{slidetitle}{strathhass}
\colorlet{slidetitles}{strathhasslight}
}
% -- end of options
\ProcessOptions\relax
% TAB - Synced width and height (Strath title relates to it)
\pgfdeclareimage[interpolate=true,width=0.136\paperwidth, height=20mm]{strath_tab}{strathclyde/strath_tab_\tabtype\incolour.pdf}
% Cover
\pgfdeclareimage[interpolate=true,width=\paperwidth]{bottomtitle}{strathclyde/cover.pdf}
% Removes nav in pages
\usenavigationsymbolstemplate{}
\setbeamercolor{section name}{fg=slidetitle}
\setbeamercolor{section in toc}{fg=slidetitle}
\setbeamercolor{subsection name}{fg=slidetitle}
\setbeamercolor{subsection in toc}{}
% Table of content
\let\oldtoc\tableofcontents
\renewcommand{\tableofcontents}{
\begin{minipage}{\textwidth}
\vskip 20mm
\vskip 2mm
\oldtoc
\end{minipage}
}
\newcommand{\quotesentence}[1]{\vskip 3cm \begin{center} \color{quotesentence} \textbf{\LARGE #1} \end{center}}
\newcommand{\logobg}{
\begin{tikzpicture}[remember picture, overlay]
\node [anchor=south east, inner sep=0pt] at (current page.south east)
{\pgfuseimage{bottomtitle} };
\end{tikzpicture}
}
\setbeamercolor{background canvas}{bg=canvascolor}
\setbeamertemplate{background}{
\ifnumequal{\whitebg}{1}{}{
\ifnumequal{\c@framenumber}{1}{%
% First frame
\logobg
}{%
\ifnumequal{\c@framenumber}{\inserttotalframenumber}{
% Last frame
\logobg
}{%
% Other frames
\logobg
}
}%
}
}
\setbeamertemplate{title page}
{
\insertstrathtab
\insertstrathidentityfaculty
\begin{center}
\vskip 20mm
{
\fboxrule=0pt
\fboxsep=1mm
\fcbox{strathstrongcolour}{
\begin{minipage}[b][\height][b]{\dimexpr\textwidth-2\fboxsep-2\fboxrule\relax}
\vspace{2mm}
\centering
{ \usebeamerfont{title}\LARGE\color{white}\textbf{\inserttitle} }
\ifx\insertsubtitle\@empty
\else
\vskip 2mm
\fcbox{strathlightcolour}{
\begin{minipage}{\dimexpr\textwidth-6\fboxsep-6\fboxrule\relax}
\centering
{ \usebeamerfont{subtitle}\color{white}\rule{0mm}{\f@size pt}\strut\insertsubtitle }
\end{minipage}
} % fcbox
\fi
\vspace{1mm}
\end{minipage}
} % fcbox
}
\vskip 8mm
{
\fboxrule=0pt
\fboxsep=1mm
% \fcbox{strathlightcolour}{
\begin{minipage}[b][\height][b]{\dimexpr\textwidth-2\fboxsep-2\fboxrule\relax}
\vspace{2mm}
\centering
\ifx\insertauthor\@empty
\else
{ \usebeamerfont{author}\large\color{black}{\insertauthor} }
\fi
\ifx\insertinstitute\@empty
\else
\vskip 2mm
% \fcbox{white}{
\begin{minipage}{\dimexpr\textwidth-6\fboxsep-6\fboxrule\relax}
\centering
{ \usebeamerfont{author}\small\color{black}\rule{0mm}{\f@size pt}\insertinstitute }
\end{minipage}
% } % fcbox
\fi
\vspace{1mm}
\end{minipage}
% } % fcbox
}
\ifx\insertdate\@empty
\else
\begin{tikzpicture}[remember picture, overlay]
\node [anchor=south east, inner sep=0pt] at ([yshift=3mm, xshift=-3mm]current page.south east)
{ \small\color{strathtech}\insertdate };
\end{tikzpicture}
\fi
\end{center}
}
\setbeamercolor{headline}{fg=white}
\setbeamertemplate{headline}{
\insertstrathtab
\insertstrathidentity
}
\setbeamercolor{frametitle}{fg=slidetitle}
\setbeamertemplate{frametitle}{
\vskip 20mm
\strut\insertsection
{
\color{slidetitles}
\ifx\insertsubsection\@empty
\else
{\normalsize : \insertsubsection}
\fi
\vskip 0.1cm
\noindent\hrule
\vskip 0.1cm
\noindent\scriptsize \insertsubsubsection \hfill \em \strut\insertframetitle
\vskip -4mm
\vskip \frametitlemargin
}
}
\setbeamercolor{footline}{fg=strathtech}
\setbeamertemplate{footline}{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,left]{}%
\hspace*{2ex} \insertshortauthor
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{}%
\insertshorttitle - \insertshortdate
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{}%
page \insertframenumber{} of \inserttotalframenumber \hspace*{2ex}
\end{beamercolorbox}
}%
\vskip0pt%
}
% Additional stuff
\newcommand{\code}[1]{{\lstset{basicstyle=\large\ttfamily}\lstinline!#1!}}
\mode
<all>