-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tex
More file actions
425 lines (388 loc) · 14.1 KB
/
Copy pathmain.tex
File metadata and controls
425 lines (388 loc) · 14.1 KB
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
%=================================================
%% 2 percentage signs represent comments for code;
% 1 percentage sign represents commented out code
%% Beamer template for presentations
%% Colour palette chosen with colour blindness in
%% mind: https://davidmathlogic.com/colorblind/
%% Paul L. Tran
%% Last updated: 27 Oct, 2025
%=================================================
%=================================================
\documentclass[aspectratio = 1610, english, 11pt, xcolor = dvipsnames]{beamer}
%% Loading packages
\usepackage{lmodern}
\usepackage{newtxmath}
\usepackage{amsthm}
\usepackage{microtype}
\usepackage[T1]{fontenc}
\usepackage{datetime}
\usepackage{booktabs}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{enumerate}
\usepackage{multicol}
\usepackage{makecell}
\usepackage{adjustbox}
\usepackage{varwidth}
\usepackage{tabularx}
\providecommand{\tabularnewline}{\\}
\usepackage{centernot}
\usepackage{tikz}
\usetikzlibrary{shapes, arrows, matrix, chains, positioning, decorations.pathreplacing, decorations.pathmorphing, backgrounds, tikzmark, nef}
\tikzset{input node/.style={circle, draw, fill=gray!20, minimum size=1cm},
hidden node/.style={circle, draw=blue!50, fill=blue!20, minimum size=1cm},
output node/.style={circle, draw=cyan!50, fill=cyan!20, minimum size=1cm},
arrow/.style={->, >=stealth}
}
\usepackage[
sorting = nyt,
citestyle = authoryear,
bibstyle = authoryear-comp,
defernumbers = true,
maxnames = 2,
minnames = 1,
maxbibnames = 99,
giveninits = false,
bibencoding = utf8,
terseinits = true,
uniquename = init,
dashed = false,
doi = true,
isbn = false,
natbib = true,
backend = biber,
date = year
]{biblatex}
%% Setting base theme
\usetheme{Frankfurt}
%% Customising theme and alert colours according to IBM's design palette for colour blindness (https://davidmathlogic.com/colorblind/)
\definecolor{basecolor}{RGB}{100, 143, 255} % HEX #648fff
\colorlet{darkbasecolor}{basecolor!60!black} % Section header slightly darker
\definecolor{alertcolor}{RGB}{181, 53, 116} % HEX #b53574
\setbeamercolor{alerted text}{fg = alertcolor}
%% Assigning colours to the theme
\usecolortheme[named = basecolor]{structure}
\setbeamercolor{section in head/foot}{fg = white, bg = darkbasecolor}
%% Setting title page style
\setbeamertemplate{title page}[default][colsep = -4bp, shadow = false]
%% Setting frame title style
\setbeamertemplate{frametitle}{
\nointerlineskip
\begin{beamercolorbox}[sep = 0.2cm, ht = 1.8em, wd = \paperwidth, shadow = False]{frametitle}
%% Removing \insertframetitle from tikzpicture environment due to the latter causing issues with
%% \hfill in the frame titles
\insertframetitle
% \begin{tikzpicture}[overlay, remember picture]
% \node[anchor = west, align = left] at (-0.2, 0.17){\insertframetitle};
% \end{tikzpicture}
\end{beamercolorbox}
}
%% Creating command to widen slide contents
%% Format: \Wider[measurement]{Slide contents}
\newcommand\Wider[2][3em]{%
\makebox[\linewidth][c]{%
\begin{minipage}{\dimexpr\textwidth+#1\relax}
\raggedright#2
\end{minipage}
}
}
%% Making spacing shortcuts if feeling lazy
\newcommand{\bs}{\bigskip{}}
\newcommand{\ms}{\medskip{}}
%% Setting header style (with sections)
\setbeamertemplate{headline}{
\begin{beamercolorbox}{section in head/foot}
\vskip2pt\insertsectionnavigationhorizontal{\paperwidth}{}{}\vskip2pt
\end{beamercolorbox}
}
%% Setting footer style
% To remove the navigation symbols from the bottom of slides
\setbeamertemplate{navigation symbols}{}
%% Storing original definition of \insertframenumber so that when certain
%% slides have their frame numbers ignored in the count and are hidden, the PDF
%% metadata isn't affected. Specifically, hiding and not counting certain slides uses:
%% \begingroup \def\insertframenumber{\texorpdfstring{\relax}{\sidepanenumber}} \endgroup
\let\sidepanenumber\insertframenumber
%% Customising footer
\setbeamertemplate{footline}{
\hbox{
\setbeamercolor{footercolor}{bg = white, fg = white!50!black}
\begin{beamercolorbox}[wd = 0.333333\paperwidth,ht = 2.25ex, dp = 2ex, left]{footercolor}%
\hspace*{2ex} \insertshortauthor\hspace*{0.5ex} (\insertshortinstitute)
\end{beamercolorbox}%
\begin{beamercolorbox}[wd = 0.333333\paperwidth,ht = 2.25ex, dp = 2ex, center]{footercolor}%
\insertshorttitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd = 0.333333\paperwidth,ht = 2.25ex,dp = 2ex,right]{footercolor}%
\insertframenumber{}
%% Uncomment the line below if you wish to show the total frame number
/ \inserttotalframenumber
\hspace*{4ex}
\end{beamercolorbox}
}
\vskip0pt
}
%% Setting bullet shapes
%% Default bullet shapes are [default, circle, square]
%% Using non-default shape. like a dash, require the format {--}
\setbeamertemplate{enumerate items}[default]
\setbeamertemplate{itemize item}[triangle]
\setbeamertemplate{itemize subitem}[circle]
\setbeamertemplate{itemize subsubitem}{--}
\setbeamertemplate{section in toc}[circle]
%% Setting footnote size
\setbeamerfont{footnote}{size = \tiny}
\renewcommand*{\thefootnote}{\fnsymbol{footnote}}
%% Setting covered items in slides to be transparent
\setbeamercovered{transparent}
%% Enabling numbered captions for tables and figures
\setbeamertemplate{caption}[numbered]
%% Adjusting date format to DD Month, YYYY
\newdateformat{daymonthyeardate}{\THEDAY\ \monthname[\THEMONTH], \THEYEAR}
%=================================================
%=================================================
%% Creating title
\newcommand\makebeamertitle{\frame{\maketitle}}
\title[Short Title]{\textbf{Title}\\Subtitle}
\author[Surname]{Name Surname\thanks{Email: \href{mailto:your@email.address}{your@email.address}. Website: \href{https://google.com/}{https://yourwebsite.com/}.}}
\institute[Institution]{Institution}
\date{
This version: \daymonthyeardate\today\\
\begin{center}
{\small \href{https://github.com/paultran47/beamertemplate}{\alert{[Click here for the latest version]}}}
\end{center}
}
%=================================================
%=================================================
%% Creating references
\addbibresource{mybib.bib}
%% Removing document icons from references
\setbeamertemplate{bibliography item}{}
%% Making URL the same font as text, not courier default
\urlstyle{same}
\newcommand{\doi}[1]{\url{#1}}
%% Changing font of biblatex acronyms into all caps since lmodern doesn't have small caps (e.g., DOI). Default font size is \tiny
\renewcommand*{\mkbibacro}[1]{#1}
\makeatletter
%% Setting up footnote to work in the align environment
\let\original@footnote\footnote
\newcommand{\align@footnote}[1]{
\ifmeasuring@
\chardef\@tempfn = \value{footnote}
\footnotemark
\setcounter{footnote}{\@tempfn}
\else
\iffirstchoice@
\original@footnote{#1}
\fi
\fi
}
\pretocmd{\start@align}{\let\footnote\align@footnote}{}{}
\makeatother
%=================================================
%=================================================
%% Creating slides
\begin{document}
\section{Introduction}
\begin{frame}
\maketitle
\end{frame}
\begin{frame}{Introduction}
\begin{itemize}
\item Item
\vspace{2mm}
\begin{itemize}
\item Subitem
\vspace{2mm}
\begin{itemize}
\item Subsubitem
\end{itemize}
\end{itemize}
\vspace{3mm}
\item \alert{Highlighted item} \hyperlink{app}{\beamerbutton{Appendix}}\label{introduction}
\end{itemize}
\end{frame}
%% Creating ToC
\setbeamertemplate{section in toc}{
\leavevmode\leftskip = 2ex
\llap{
\usebeamerfont*{section number projected}
\usebeamercolor{section number projected}
\begin{pgfpicture}{-1ex}{0ex}{1ex}{2ex} % Section number in circle
\color{bg}
\pgfpathcircle{\pgfpoint{0pt}{.75ex}}{1.2ex}
\pgfusepath{fill}
\pgftext[base]{\color{fg}\inserttocsectionnumber}
\end{pgfpicture}\kern1.25ex
}
\underline{\inserttocsection}\par
}
\AtBeginSection[]{
\begin{frame}[noframenumbering, plain]{Presentation Roadmap}
\tableofcontents[currentsection]
\end{frame}
}
\section{Section A}
\begin{frame}{Slide in Section A}
\begin{itemize}
\onslide<1>{\item Current item in $1^{st}$ slide}
\vspace{2mm}
\begin{itemize}
\uncover<2>{\item Current subitem in $2^{nd}$ slide}
\vspace{2mm}
\begin{itemize}
\uncover<3>{\item Current subsubitem in $3^{rd}$ slide}
\end{itemize}
\end{itemize}
\vspace{3mm}
\item[$\rightarrow$] Custom bullet point with citation: \alert{\citet{mycitation}}
\end{itemize}
\end{frame}
\section{Section B}
\begin{frame}{Slide in Section B}
\begin{itemize}
\item Click for \alert{\hyperlink{tab:1}{Table 1}}:
\end{itemize}
\vspace{1mm}
\begin{table}
\centering
\begin{tabular}{l|c}
& A\\
\hline
B & AB\\
\end{tabular}
\caption{Caption for Table 1}
\label{tab:1}
\end{table}
\end{frame}
\section{Section C}
\begin{frame}{Slide in Section C}
\begin{columns}[T] % The [T] option aligns the columns at the top
\begin{column}{0.5\textwidth}
\begin{itemize}
\item \textbf{Data:} 4 variables $x_{t}^{1}, x_{t}^{2}, x_{t}^{3}, y_{t}$
\vspace{1mm}
\item \textbf{Goal:} Predict $y_{t}$ from $X \equiv x_{t}^{1}, x_{t}^{2}, x_{t}^{3}$
\vspace{1mm}
\item \textbf{Example:} 2 layers, 2 ``hidden'' nodes
\vspace{1mm}
\item From $X_{t}$ to $\hat{y}_{t}$ for observation $t \in T$:
\vspace{1mm}
\begin{itemize}
\item Linearly combine $x_{t}^{1}, x_{t}^{2}, x_{t}^{3} \to a_{t}^{1}, a_{t}^{2}$
\vspace{1mm}
\item $f$ is a non-linear function
\vspace{1mm}
\item $\hat{y}_t$ is predicted output
\end{itemize}
\vspace{1mm}
\item \textbf{Training} prediction error $\to$ update weights $w$
\vspace{1mm}
\item \textbf{Testing} prediction error $\to$ update network structure
\end{itemize}
\end{column}
\begin{column}{0.5\textwidth}
\centering
\textbf{NN Figure}
\begin{tikzpicture}[nef, scale=0.8, every node/.style={scale=0.8}]
% Input Layer
\node[input node] (x1) at (0, 2) {$x_t^1$};
\node[input node] (x2) at (0, 0) {$x_t^2$};
\node[input node] (x3) at (0, -2) {$x_t^3$};
% Hidden Layer
\node[hidden node] (h1) at (3, 1) {$f(a_t^1)$};
\node[hidden node] (h2) at (3, -1) {$f(a_t^2)$};
% Output Layer
\node[output node] (y) at (6, 0) {$\hat{y}_t$};
% Connections
\draw[arrow] (x1) -- node[above, sloped] {$w_{11}^1$} (h1);
\draw[arrow] (x1) -- node[above, sloped] {$w_{12}^1$} (h2);
\draw[arrow] (x2) -- node[above, sloped, pos=0.2] {$w_{21}^1$} (h1);
\draw[arrow] (x2) -- node[above, sloped, pos=0.2] {$w_{22}^1$} (h2);
\draw[arrow] (x3) -- node[above, sloped, pos=0.2] {$w_{31}^1$} (h1);
\draw[arrow] (x3) -- node[below, sloped] {$w_{32}^1$} (h2);
\draw[arrow] (h1) -- node[above, sloped] {$w_1^2$} (y);
\draw[arrow] (h2) -- node[below, sloped] {$w_2^2$} (y);
\end{tikzpicture}\\
\textbf{NN Matrix Algebra}
$
\begin{bmatrix}
x_t^1 & x_t^2 & x_t^3
\end{bmatrix}
\begin{bmatrix}
w_{11}^1 & w_{12}^1 \\
w_{21}^1 & w_{22}^1 \\
w_{31}^1 & w_{32}^1
\end{bmatrix}
=
\begin{bmatrix}
a_t^1 & a_t^2
\end{bmatrix}
$
$
\begin{bmatrix}
f(a_t^{1}) & f(a_{t}^{2})
\end{bmatrix}
\begin{bmatrix}
w_1^2 \\
w_2^2
\end{bmatrix}
= \hat{y}_t
$
\end{column}
\end{columns}
\end{frame}
\section{Conclusion}
\begin{frame}{Conclusion}
\begin{itemize}
\item That's all
\end{itemize}
\end{frame}
%% Redefining footer after conclusion to not have total frame number
\setbeamertemplate{footline}{
\hbox{
\setbeamercolor{footercolor}{bg = white, fg = white!50!black}
\begin{beamercolorbox}[wd = 0.333333\paperwidth,ht = 2.25ex, dp = 2ex, left]{footercolor}%
\hspace*{2ex} \insertshortauthor\hspace*{0.5ex} (\insertshortinstitute)
\end{beamercolorbox}%
\begin{beamercolorbox}[wd = 0.333333\paperwidth,ht = 2.25ex, dp = 2ex, center]{footercolor}%
\insertshorttitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd = 0.333333\paperwidth,ht = 2.25ex,dp = 2ex,right]{footercolor}%
% \insertframenumber{}
%% Uncomment the line below if you wish to show the total frame number
% / \inserttotalframenumber
\hspace*{4ex}
\end{beamercolorbox}
}
\vskip0pt
}
%% The frame number of all slides in the following group are considered as empty in
%%the actual PDF, but has the original definition in the PDF metadata
\begingroup
\def\insertframenumber{\texorpdfstring{\relax}{\sidepanenumber}}
\begin{frame}[noframenumbering]
\begin{center}
\Huge{\textcolor{basecolor}{Thank you!}}\\
\vspace{6mm}
\normalsize{
\href{mailto:your@email.address}{your@email.address}\\
\vspace{3mm}
\href{https://google.com/}{https://yourwebsite.com/}
}
\end{center}
\end{frame}
%% Creating references slides
%% Making references font size to be tiny
\renewcommand*{\bibfont}{\normalfont\tiny}
\begin{frame}[t, noframenumbering, allowframebreaks]{References} % add option allowframebreaks if long reference list
\printbibliography
\end{frame}
%% Additional slides that are linked
%% Declaring empty section to serve as the appendix section without hiding the navigation bar
\section*{}
\begin{frame}[noframenumbering]{Appendix \hfill\hyperlink{introduction}{\beamerbutton{Back to Introduction}}}\label{app}
\end{frame}
\endgroup
\end{document}