-
Notifications
You must be signed in to change notification settings - Fork 0
/
beamerouterthemeSURFsara.sty
179 lines (158 loc) · 6.28 KB
/
beamerouterthemeSURFsara.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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerouterthemeSURFsara}[2018/06/07 SURFsara beamer inner theme]
\RequirePackage{calc}
\RequirePackage[absolute,overlay]{textpos}
\RequirePackage{tikz}
\mode
<presentation>
\setbeamertemplate{background canvas}
{
\begin{tikzpicture}
\fill[white!93!black, opacity=1] (0, 0) rectangle(\the\paperwidth, \the\paperheight);
\ifx\surf@frontcover\undefined
\PackageWarning{BeamerSURFsara}
{Background of front cover has not been set yet. Please rerun}
{Background of front cover has not been set yet. Please rerun}
\else
\ifnum\thepage=\surf@frontcover\relax%
\fill[PrimaryColor, opacity=1] (0, 0) rectangle(\the\paperwidth, \the\paperheight);
\fi
\fi
\end{tikzpicture}
}
\setbeamertemplate{background}
{
\begin{tikzpicture}
% Don't stray outside the paper dimensions.
\useasboundingbox (0, 0) rectangle(\the\paperwidth, \the\paperheight);
\ifx\surf@titlepagepage\undefined
\PackageWarning{BeamerSURFsara}
{title page page number undetermined yet. Please rerun}
{You need to rerun in order to get the title page number right}
\else
\ifnum\thepage=\surf@titlepagepage\relax%
% Set a solid bar at the left side of the page
\fill[color=PrimaryColor] (0, 0) rectangle(.175\paperwidth, \the\paperheight);
\fi
\fi
\end{tikzpicture}
}
\IfStrEqCase{\surf@variant}%
{%
{surfsara}{\def\surf@logo{SURFsara_logo}}%
{surf}{\def\surf@logo{SURF_logo}}%
}
\titlegraphic{\includegraphics[height=4ex]{\surf@logo}}
% Define where the element of the title page are placed
\setbeamertemplate{title page}
{
\write\@auxout{\gdef\noexpand\surf@titlepagepage{\thepage}}
\begin{textblock*}{.675\pagewidth}(.25\pagewidth, .275\pageheight)
\begin{beamercolorbox}{title page header}
\usebeamerfont{title}\usebeamercolor{title}\color{fg}\inserttitle
\end{beamercolorbox}%
\vskip1ex%
\begin{beamercolorbox}[wd=.65\paperwidth]{subtitle page header}
\usebeamerfont{subtitle}\usebeamercolor{subtitle}\color{fg}\insertsubtitle
\end{beamercolorbox}%
\vskip4ex%
\begin{beamercolorbox}[wd=.65\paperwidth, left]{author}
\usebeamerfont{author}\usebeamercolor{author}\color{fg}\insertauthor
\end{beamercolorbox}%
\end{textblock*}
\begin{textblock*}{.675\pagewidth}(.25\pagewidth, .72\pageheight)
\begin{beamercolorbox}[center]{date}
\usebeamerfont{date}\usebeamercolor{date}\color{fg}\insertdate
\end{beamercolorbox}%
\begin{beamercolorbox}[center]{location}
\usebeamerfont{location}\usebeamercolor{location}\color{fg}\insertlocation
\end{beamercolorbox}%
\vskip2.5ex%
\begin{beamercolorbox}[center]{logo}
\inserttitlegraphic
\end{beamercolorbox}%
\end{textblock*}
}
\setbeamercolor{bottomstopbar}{fg=black,bg=PrimaryColor}
\setbeamertemplate{footline}
{
\hbox{%
\begin{beamercolorbox}[wd=.05\paperwidth, ht=2.25ex, dp=1ex, center]{author in head/foot}%
\includegraphics[height=2.25ex]{\surf@logo}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.283333\paperwidth, ht=2.25ex, dp=1ex, center]{author in head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor\expandafter\beamer@ifempty\expandafter{\beamer@shortinstitute}{}{~~(\insertshortinstitute)}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth, ht=2.25ex, dp=1ex, center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth, ht=2.25ex, dp=1ex, right]{date in head/foot}%
\usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
\usebeamerfont{page number in head/foot}\usebeamercolor[fg]{page number in head/foot}\insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}%
}%
\vskip0pt%
\begin{beamercolorbox}[ht=1mm, wd=\pagewidth]{bottomstopbar}
\end{beamercolorbox}%
}
\addtobeamertemplate{frametitle}{}{\vspace*{1.5ex}}
\defbeamertemplate*{frontcover}{surfsara}{
\write\@auxout{\gdef\noexpand\surf@frontcover{\thepage}}
\begin{center}
\includegraphics[scale=1.5]{\surf@logo}
\end{center}
}
\def\frontcover{\usebeamertemplate*{frontcover}}
\setbeamercolor*{colorbox}{use=structure, fg=white, bg=PrimaryColor}
\defbeamertemplate*{backcover}{surfsara}{
\vspace{1.2cm}
\begin{center}
\includegraphics[scale=2]{SURF_logo}
\end{center}
\vspace{.6cm}
\begin{center}
\href{https://surf.nl}{\small\faLink\hspace{.5em}\textsb{surf.nl}}
\end{center}
\vspace{.1cm}
\begin{center}
\includegraphics[scale=.25]{cc-by}\\[-2mm]
\href{https://creativecommons.org/licenses/by/4.0/legalcode}{
\scriptsize\texttt{Attribution 4.0 International (CC-BY-4.0)}
}\\
\tiny\textlt{\itshape Creative Commons}
\end{center}
}
\def\backcover{\usebeamertemplate*{backcover}}
\defbeamertemplate{balloon}{surfsara}[4]
{
\begin{textblock*}{\pagewidth}(0pt, 0pt)
\includegraphics[width=\pagewidth]{#1}
\end{textblock*}
\begin{textblock*}{\pagewidth}(0pt, 0pt)
\begin{tikzpicture}
\fill[fill=white, opacity=1]
% Clockwise rectangle
(0, 0)-- (0,\pageheight)-- (\pagewidth, \pageheight)-- (\pagewidth, 0)--cycle
% Counter-clockwise rectangle
(3mm, 3mm)[rounded corners=4mm]-- (\pagewidth-3mm, 3mm)--
(\pagewidth-3mm, \pageheight-3mm)-- (3mm, \pageheight-3mm)--cycle;
\end{tikzpicture}
\end{textblock*}
\begin{textblock*}{\pagewidth}(8mm, 8mm)
\begin{tikzpicture}
\filldraw[fill=white, opacity=.75, draw=white!20!black, line width=.1mm]
(0, 0)[rounded corners=2mm]-- (8mm, 0)-- (8mm, -6mm)--
(10mm+#2, -6mm)-- (10mm+#2, -10mm-#3)-- (8mm, -10mm-#3)-- (8mm, -6mm)--
(0, -6mm)-- cycle;
\end{tikzpicture}
\end{textblock*}
\begin{textblock*}{\pagewidth}(20mm, 17mm)
\begin{minipage}{#2-10mm}
\raggedright\Large\textbf{\hyphenchar\font=-1#4}
\end{minipage}
\end{textblock*}
}
\def\balloon#1#2#3#4{\setbeamertemplate{balloon}[surfsara]{#1}{#2}{#3}{#4}\usebeamertemplate{balloon}}
\setbeamertemplate{navigation symbols}{}
\mode
<all>