-
Notifications
You must be signed in to change notification settings - Fork 0
/
poly.sty
235 lines (200 loc) · 7.02 KB
/
poly.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
\ProvidesPackage{poly}[1/11/2024 Beamer Theme for PolyU (verion 1.1.1) by Rui Song.]
% ================================================================================
% Packages
% ================================================================================
\RequirePackage{tikz}
\RequirePackage{xcolor}
\RequirePackage{textcomp}
\RequirePackage{graphicx}
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{amsfonts}
\RequirePackage{amsthm}
\RequirePackage{verbatim}
\RequirePackage{hyperref}
\RequirePackage{listings}
% ================================================================================
% Color Accents
% ================================================================================
\definecolor{polyured} {HTML}{A02337}
\definecolor{polyured2} {HTML}{A63547}
\definecolor{polyugrey} {HTML}{58595B}
\definecolor{skyblue} {HTML}{6BA4B8}
\setbeamercolor{title} {fg=white}
\setbeamercolor{author} {fg=white}
\setbeamercolor{date} {fg=white}
\setbeamercolor{institute} {fg=white}
\setbeamercolor{head} {bg=polyured2}
\setbeamercolor{alerted text} {fg=polyured}
\setbeamercolor{normal text} {fg=darkgray, bg=white}
\setbeamercolor{structure} {fg=polyured}
\setbeamercolor{jumbo} {bg=polyured}
\setbeamercolor{progress bar} {fg=polyured, bg=polyugrey}
\setbeamercolor{progress bar progress} {use=progress bar, bg=progress bar.fg}
\setbeamercolor{block title} {use=structure, fg=white, bg=polyured2}
\setbeamercolor{block body} {use=structure, fg=darkgray, bg=polyured2!10}
\setbeamercolor{footnote mark} {fg=polyured}
\hypersetup{
colorlinks,
linkcolor=polyured,
anchorcolor=red,
citecolor=blue!80,
urlcolor=skyblue,
}
% ================================================================================
% Fonts
% ================================================================================
\setbeamerfont{title} {series=\bfseries, size=\Large}
\setbeamerfont{subtitle} {series=\mdseries, size=\normalsize}
\setbeamerfont{author} {size=\small}
\setbeamerfont{date} {size=\footnotesize}
\setbeamerfont{institute} {size=\footnotesize}
\setbeamerfont{alerted text} {series=\bfseries}
\setbeamerfont{frametitle} {series=\bfseries}
\setbeamerfont{framesubtitle} {series=\mdseries}
\setbeamerfont{footline} {size=\scriptsize}
\setbeamerfont{block title} {size=\normalsize, series=\bfseries}
\setbeamerfont{block body} {size=\normalsize}
\setbeamerfont{footnote} {size=\scriptsize, series=\mdseries}
\usefonttheme{serif}
% ================================================================================
% Basic Settings
% ================================================================================
% cancel navigation symbols
\setbeamertemplate{navigation symbols}{}
% prettier boxes
\setbeamertemplate{blocks}[rounded]
% bullet points
\setbeamertemplate{itemize item} {\textbullet}
\setbeamertemplate{itemize subitem} {\textopenbullet}
\setbeamertemplate{itemize subsubitem} {\textendash}
% paragraph spacing
\setlength{\parskip} {5pt}
% colored box environment
\newcommand{\coloredbox}[1]{%
\par\smallskip
\fcolorbox{white}{polyured!10}{%
\parbox{.95\linewidth}
{\footnotesize\sffamily\color{polyured} #1}
}
\smallskip\par
}
% code environment
\lstdefinestyle{mystyle}{
commentstyle=\color{skyblue},
keywordstyle=\color{magenta},
numberstyle=\tiny\color{polyugrey},
stringstyle=\color{codepurple},
basicstyle=\ttfamily\scriptsize,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=4,
xleftmargin=10pt,
xrightmargin=10pt,
}
\lstset{style=mystyle}
% ================================================================================
% Slide Templates
% ================================================================================
% headline for all frames
\setbeamertemplate{headline}{
\ifnum\theframenumber=1
% not display the headline for the title page
\else
\begin{beamercolorbox}[wd=\paperwidth,ht=40pt]{head}
\hspace{410pt}\includegraphics[width=40pt]{source/logo-white.pdf}
\end{beamercolorbox}
\fi
}
% frame title and subtitle
\setbeamertemplate{frametitle}{
\begin{picture}(0,0)
\ifx\insertframesubtitle\@empty%
\put(0,27){\usebeamerfont{frametitle}\usebeamercolor[fg]{title}\insertframetitle}%
\else%
\put(0,32){\usebeamerfont{frametitle}\usebeamercolor[fg]{title} \insertframetitle}%
\put(0,20){\usebeamerfont{framesubtitle}\usebeamercolor[fg]{title} \insertframesubtitle }
\fi
\end{picture}
}
% title page
\setbeamertemplate{title page}{
\begin{picture}(0,0)
\put(-20,60){\includegraphics[width=150pt]{source/logo-name}}
\put(0,-90){%
\begin{beamercolorbox}[wd=\paperwidth,ht=140pt]{jumbo}
\end{beamercolorbox}
}
\put(243,-145){\includegraphics[width=250pt]{source/logo-trans}}
\put(-8,10){%
\begin{minipage}{300pt}
\usebeamerfont{title}\usebeamercolor[fg]{title}\inserttitle\par
\vspace{10pt}
\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle
\end{minipage}
}
\put(-8,-55){%
\usebeamerfont{author}\usebeamercolor[fg]{author}\insertauthor
}
\put(-8,-68){%
\usebeamerfont{institute}\usebeamercolor[fg]{institute}\insertinstitute
}
\put(-8,-80){%
\usebeamerfont{date}\usebeamercolor[fg]{date}\insertdate
}
\put(285,-133){\includegraphics[width=140pt]{source/tagline}}
\end{picture}
}
% progress bar at the bottom
\defbeamertemplate{footline}{progress bar}{
\dimen0=\paperwidth
\divide\dimen0 by \inserttotalframenumber
\multiply\dimen0 by \insertframenumber
\edef\progressbarwidth{\the\dimen0}
\leavevmode%
\ifnum\theframenumber=1
\else
\begin{beamercolorbox}[wd=\paperwidth,ht=2pt,dp=1pt]{progress bar}
\begin{beamercolorbox}[wd=\progressbarwidth,ht=2pt,dp=1pt]{progress bar progress}
\end{beamercolorbox}%
\end{beamercolorbox}%
\fi
}
\setbeamertemplate{footline}[progress bar]
% last frame
\newcommand{\backmatter}{
\begingroup
\setbeamertemplate{headline}{}
\setbeamertemplate{footline}{}
\begin{frame}[c]{}
\begin{picture}(0,0)
\put(-29,-45){\includegraphics[width=1\paperwidth]{source/last-frame}}
\end{picture}
\end{frame}
\endgroup
}
% style of sections and subsections in ToCs
\setbeamertemplate{section in toc}{
$\blacktriangleright$~\textbf{\inserttocsection}
}
\setbeamertemplate{subsection in toc}{}
\setbeamertemplate{frametitle continuation}{}
% begin of sections
\AtBeginSection[]
{
\begingroup
\begin{frame}{Contents}{}
\begin{picture}(0,0)
\put(-42,-170){\includegraphics[width=1.1\paperwidth]{source/silhouette}}
\end{picture}
\tableofcontents[currentsection]
\end{frame}
\endgroup
}