-
Notifications
You must be signed in to change notification settings - Fork 0
/
beamerinnerthemeWM.sty
250 lines (224 loc) · 8.29 KB
/
beamerinnerthemeWM.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
\mode<presentation>
%% Pull in package requirements
\usepackage{scalefnt}
\usepackage{calc}
\usepackage{etoolbox}
\usepackage{fontspec} %% To import custom font
%% Pull in the rounded inner theme
%\useinnertheme{rounded}
%% Define default fonts to use (using the "Avenir" alternative "Nunito"
%\usefonttheme{professionalfonts} % using non standard fonts for beamer
%\usefonttheme{serif} % default family is serif
\usepackage{fontspec}
\setmainfont{Nunito-Regular}
%% Define dimensions we'll rely on later
\newlength{\TitlePageTopHeight}
\newlength{\TitlePageBottomHeight}
\newlength{\TitlePageTopTitleHeight}
\newlength{\TitlePageTopGraphicHeight}
\newlength{\TitlePageTopInformationHeight}
\newlength{\FrameBarHeight}
\newlength{\PartPageBannerHeight}
\newlength{\PartPageBannerWidth}
\pgfmathsetlength{\TitlePageTopHeight}{(2/3)*\the\paperheight}
\pgfmathsetlength{\TitlePageBottomHeight}{\the\paperheight-\TitlePageTopHeight}
\pgfmathsetlength{\TitlePageTopTitleHeight}{0.475*\TitlePageTopHeight}
\pgfmathsetlength{\TitlePageTopInformationHeight}{0.475*\TitlePageTopHeight}
\pgfmathsetlength{\TitlePageTopGraphicHeight}{0.05*\TitlePageTopHeight}
\pgfmathsetlength{\PartPageBannerHeight}{0.55*\the\paperheight}
\pgfmathsetlength{\PartPageBannerWidth}{\PartPageBannerHeight*1.54208274}
% Font for the presentation title
\setbeamerfont{title}{size=\fontsize{24.88}{10},series=\bfseries}
% Font of the frame titles
\setbeamerfont{frametitle}{size=\fontsize{20.74}{10},series=\bfseries}
% Font of the part number
\setbeamerfont{part number}{size=\fontsize{15.50}{10},series=\bfseries}
% Font of the acknowledgement
\setbeamerfont{acknowledgement}{size=\fontsize{8.00}{10},series=\itshape}
% Font of the footnotes
\setbeamerfont{footnote}{size=\fontsize{8.00}{10},series=\itshape}
%%
%% Define the frame backgrounds. A toggle determines the
%% type of background that we will draw
%%
\newtoggle{istitlepage}
\newtoggle{ispartpage}
\newtoggle{isbackuppage}
\setbeamertemplate{background}{
\begin{tikzpicture}
%% Bound picture to the entire page
\useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
%% Clear the entire background and paint it to WMWhite
\fill[color=WMWhite,opacity=1] (0,0) rectangle(\the\paperwidth,\the\paperheight);
\iftoggle{istitlepage}{ %% We are in the title page.
\fill[color=WMGreen] (0, \TitlePageBottomHeight) rectangle (\the\paperwidth,\the\paperheight);
\fill[color=WMSilver] (0, \TitlePageBottomHeight+\PageMargin/4.0) rectangle ++(\the\paperwidth, \PageMargin/2.0);
}{ %% We are *not* in the title page
\iftoggle{ispartpage}{ %% We are in the part page
\node[opacity=0.75] at (\the\paperwidth-\PartPageBannerWidth/2.0,\PartPageBannerHeight/2.0+\PageMargin) { \includegraphics[height=\PartPageBannerHeight]{wm_weathervane_silver.png}};
\fill[color=WMGreen] (0, \the\paperheight) rectangle ++(\the\paperwidth, -\PageMargin);
\fill[color=WMGreen] (0, \PageMargin) rectangle (\the\paperwidth, 0);
} { %% We are *not* in the part page
\iftoggle{isbackuppage}{ %% We are in the backup page
\node[opacity=0.75] at (\the\paperwidth/2.0,\PartPageBannerHeight/2.0+\PageMargin) { \includegraphics[height=\PartPageBannerHeight]{wm_crim_dell_silver.png}};
\fill[color=WMGreen] (0, \the\paperheight) rectangle ++(\the\paperwidth, -\PageMargin);
\fill[color=WMGreen] (0, \PageMargin) rectangle (\the\paperwidth, 0);
} { %% We are *not* in the backup page
\fill[color=WMGreen] (0, \the\paperheight) rectangle ++(\the\paperwidth, -\PageMargin);
% \fill[color=WMGreen] (0, \PageFooter) rectangle (\the\paperwidth, 0);
\draw[WMGreen,ultra thick] (0,\PageFooter) -- ++(\the\paperwidth,0.0);
\fill[color=WMGreen] (\the\paperwidth,0) -- ++(0,\PageFooter) -- ++(-1.75*\PageFooter,0) -- ++(-\PageFooter/2.,-\PageFooter/2.0) -- ++(\PageFooter/2.,-\PageFooter/2.0) -- ++(1.75*\PageFooter,0);
}
}
}
%% Before we leave, flip the state. This will be flipped again next time
%% this is called.
\global\togglefalse{istitlepage}
\global\togglefalse{ispartpage}
\global\togglefalse{isbackuppage}
\end{tikzpicture}
}
%%% Define a new beamer type (event)
\def\event{\@dblarg\beamer@event}
\long\def\beamer@event[#1]#2{%
\def\insertevent{#2}%
\def\beamer@shortevent{#1}%
}
\date{\today}
\newcommand\insertshortevent[1][]{%
{%
\let\thanks=\@gobble%
\beamer@setupshort{#1}%
\beamer@insertshort{\beamer@shortevent}%
}}
%%% Define a new beamer type (acknowledgement)
\def\acknowledgement{\@dblarg\beamer@acknowledgement}
\long\def\beamer@acknowledgement[#1]#2{%
\def\insertacknowledgement{#2}%
\def\beamer@shortacknowledgement{#1}%
}
\newcommand\insertshortacknowledgement[1][]{%
{%
\let\thanks=\@gobble%
\beamer@setupshort{#1}%
\beamer@insertshort{\beamer@shortacknowledgement}%
}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Define the title page
\defbeamertemplate*{title page}{WM}[1][]
{
\global\toggletrue{istitlepage}
\begin{minipage}[c][\TitlePageTopTitleHeight][c]{\PageWidthMinusMargins}
\vfill
\vskip0.25em
\pgfmathparse{\textwidth/\widthof{\inserttitle}}
\begin{beamercolorbox}[center]{title page header}
\ifdimgreater{\pgfmathresult pt}{1 pt}{
{\usebeamerfont{title}\inserttitle}%
}{
{\usebeamerfont{title}\scalefont{\pgfmathresult}\inserttitle}
}
\par
\ifx\insertsubtitle\@empty
\else
\vskip0.25em
\ifdimgreater{\pgfmathresult pt}{1 pt}{
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle}
}{
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\scalefont{\pgfmathresult}\insertsubtitle}
}
\fi
\end{beamercolorbox}
\vfill
\vspace{\PageMargin}
\end{minipage}
\begin{minipage}[t][\TitlePageTopGraphicHeight][t]{\PageWidthMinusMargins}
\ \\
\vfill
\ \\
\end{minipage}
\begin{minipage}[t][\TitlePageTopInformationHeight][t]{\PageWidthMinusMargins}
\vfill
\begin{beamercolorbox}[center]{author}
\usebeamerfont{author}\insertauthor
\end{beamercolorbox}
\begin{beamercolorbox}[center]{institute}
\usebeamerfont{institute}\insertinstitute
\end{beamercolorbox}
\vspace{0.75em}
\begin{beamercolorbox}[center]{date}
\usebeamerfont{date}\insertdate
\end{beamercolorbox}
\begin{beamercolorbox}[center]{event}
\usebeamerfont{date}\insertevent
\end{beamercolorbox}
\vfill
\vspace{\PageMargin}
\end{minipage}
\begin{minipage}[t][\TitlePageBottomHeight][t]{\textwidth}
\vspace{0.1\TitlePageBottomHeight}\centering
\includegraphics[height=0.60\TitlePageBottomHeight]{wm_vertical_single_line_full_color}\\
\begin{beamercolorbox}[right]{acknowledgement}
\usebeamerfont{acknowledgement}\insertacknowledgement
\end{beamercolorbox}
\vfill
\vspace{0.05\TitlePageBottomHeight}
\end{minipage}
}
%% End title page
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Define the default part page
\defbeamertemplate*{part page}{WM}[1][]%
{%
\global\toggletrue{ispartpage}%
\vspace{2.5em}%
\begin{beamercolorbox}{part number}%
\usebeamerfont{part number}Part~\insertromanpartnumber%
\end{beamercolorbox}%
\vspace{0.5em}%
\begin{beamercolorbox}{frametitle}%
\usebeamerfont{frametitle}\insertpart%
\end{beamercolorbox}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Define the backups page
\defbeamertemplate*{backups page}{WM}[1][]%
{%
\global\toggletrue{isbackuppage}%
\begin{beamercolorbox}{frametitle}%
\begin{center}%
\usebeamerfont{frametitle}Backup Slides%
\end{center}%
\end{beamercolorbox}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Define the backups page
\defbeamertemplate*{title only page}{WM}[2][]%
{%
\global\toggletrue{isbackuppage}%
\begin{beamercolorbox}{frametitle}%
\begin{center}%
\usebeamerfont{frametitle}THANK YOU!%
\end{center}%
\end{beamercolorbox}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Define the footnote rule
\renewcommand*{\footnoterule}{
\begin{tikzpicture}%
\draw[WMSilver,thick] (0,\PageFooter) -- ++(\the\paperwidth,0.0);%
\end{tikzpicture}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Define the footnote theme
\defbeamertemplate*{footnote}{WM}[1][]%
{
\begin{beamercolorbox}[right]{footnote}%
\usebeamerfont{footnote}
%\parindent 1em\noindent%
%\raggedright
\hbox to 1.8em{\hfil\insertfootnotemark}\insertfootnotetext\par%
\end{beamercolorbox}%
}
\mode
<all>