-
Notifications
You must be signed in to change notification settings - Fork 48
/
presentation.sty
235 lines (163 loc) · 6.29 KB
/
presentation.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
% ---- Select text fonts -----
% Apply more sophisticated fonts
\usefonttheme{professionalfonts}
% Select text font
\usepackage{sourcesanspro}
% Define semibold font series
\DeclareRobustCommand{\sbseries}{\fontseries{sb}\selectfont}
\DeclareTextFontCommand{\textsb}{\sbseries}
% Select monospaced font
\usepackage{sourcecodepro}
% Select font encoding
\usepackage[T1]{fontenc}
% Select URL font
\usepackage{url}
% ---- Select math fonts -----
% Select symbol font
\usepackage{MnSymbol}
% Select calligraphic and blackboard-bold fonts
\usepackage[cal=euler,bb=fourier]{mathalpha}
% Enable bold math characters
\newcommand{\hmmax}{0} % Avoid "Too many math alphabets" error
\newcommand{\bmmax}{0} % Avoid "Too many math alphabets" error
\usepackage{bm}
% Select font for Roman letters, Greek letters, digits, and punctuation
\usepackage[italic,eulergreek,nolessnomore,noparenthesis,noplusnominus,noequal,nohbar]{mathastext}
% Correct spacing around certain Roman letters
\MTsetmathskips{y}{2mu}{0mu}
\MTsetmathskips{j}{2mu}{0mu}
% ---- Select Beamer theme ----
% Select theme
\usetheme{Boadilla}
% Select color theme
\usecolortheme[]{seagull}
% Make covered elements transparent
\setbeamercovered{transparent}
% Remove navigation symbols
\setbeamertemplate{navigation symbols}{}
% ---- Adjust slide layout ----
% Set layout on title page
\setbeamertemplate{title page}[default][left,leftskip=-8pt]
% Set margins on regular pages
\setbeamersize{text margin left=5mm,text margin right=5mm}
% ---- Adjust spacing ----
% Set spacing between lines
\usepackage[onehalfspacing]{setspace}
% Set spacing on lines
\usepackage{microtype}
% Remove ligatures
\DisableLigatures[f]{encoding = *, family = * }
% ---- Adjust font sizes and shapes ----
% Set title font
\setbeamerfont{title}{size=\huge, series=\scshape}
% Set author font
\setbeamerfont{author}{size=\large}
% Set frame title font
\setbeamerfont{frametitle}{series=\scshape}
% Ensure uniform capitalization of frame title, and lower title
\setbeamertemplate{frametitle}{\vskip3mm\MakeLowercase{\insertframetitle}}
% Format continuation count for multipage slides
\setbeamertemplate{frametitle continuation}{[\insertcontinuationcount]}
% Set list font
\setbeamerfont{itemize/enumerate subbody}{size=\normalsize} % Second level
\setbeamerfont{itemize/enumerate subsubbody}{size=\normalsize} % Third level
% Set theorem fonts
\setbeamerfont{block title}{series=\sbseries,size=\normalsize} % Title
% Set button font
\setbeamerfont{button}{size=\footnotesize}
% ---- Adjust colors ----
% Define colors
\colorlet{BlackGray}{black!85!}
\colorlet{DarkGray}{gray!60!}
\colorlet{LightGray}{gray!30!}
% Set title color
\setbeamercolor{title}{fg=BlackGray}
% Set frame title color
\setbeamercolor{frametitle}{fg=BlackGray}
% Set text color
\setbeamercolor{normal text}{fg=BlackGray}
% Set list items color
\setbeamercolor{itemize item}{fg=DarkGray} % Itemized list, first level
\setbeamercolor{itemize subitem}{fg=DarkGray} % Itemized list, second level
\setbeamercolor{itemize subsubitem}{fg=DarkGray} % Itemized list, third level
\setbeamercolor{enumerate item}{fg=DarkGray} % Numbered list, first level
\setbeamercolor{enumerate subitem}{fg=DarkGray} % Numbered list, second level
\setbeamercolor{enumerate subsubitem}{fg=DarkGray} % Numbered list, third level
% Set theorem colors
\setbeamercolor{block title}{fg=BlackGray,bg=LightGray} % Title
\setbeamercolor{block body}{fg=BlackGray,bg=LightGray} % Body
% Set footer color
\setbeamercolor{footline}{fg=DarkGray}
% Set button colors
\setbeamercolor{button}{fg=DarkGray, bg=white}
% ---- Format title slide ----
% Title capitalization and underline
\let\oldtitle\title
\renewcommand{\title}[1]{\oldtitle[]{\MakeLowercase{#1}\vspace{-5mm}\\\color{BlackGray}{\rule{\textwidth}{2pt}}\vspace{1cm}}}
% Define custom commands with complex argument specifications
\usepackage{xparse}
% Paper information
\NewDocumentCommand{\information}{o g g}{%
\author[]{#2%
\IfValueT{#3}{\vspace{5mm}\\#3}%
\IfValueT{#1}{\vspace{5mm}\\\color{DarkGray}{\footnotesize Available at \url{#1}}}%
}\date[]{}}
% ---- Format lists ----
% Format itemized lists
\setbeamertemplate{itemize item}{\textbullet} % First-level item
\setbeamertemplate{itemize subitem}{\textendash} % Second-level item
\setbeamertemplate{itemize subsubitem}{\textsquare} % Third-level item
% Format numbered lists
\setbeamertemplate{enumerate item}[default] % First-level item
\setbeamertemplate{enumerate subitem}{\alph{enumii}.} % Second-level item
\setbeamertemplate{enumerate subsubitem}{\roman{enumiii}.} % Third-level item
% ---- Create text alerts ----
% Standard alert
\NewDocumentCommand{\al}{o g}{%
\IfNoValueTF{#1}{\textcolor{RubineRed}{#2}}%
{\textcolor<#1>{RubineRed}{#2}}}
% Green, positive alert
\NewDocumentCommand{\alg}{o g}{%
\IfNoValueTF{#1}{\textcolor{Green}{#2}}%
{\textcolor<#1>{Green}{#2}}}
% Red, negative alert
\NewDocumentCommand{\alr}{o g}{%
\IfNoValueTF{#1}{\textcolor{Red}{#2}}%
{\textcolor<#1>{Red}{#2}}}
% Blue, zero alert
\NewDocumentCommand{\alb}{o g}{%
\IfNoValueTF{#1}{\textcolor{NavyBlue}{#2}}%
{\textcolor<#1>{NavyBlue}{#2}}}
% ---- Format figures and tables ----
% Enhance table formatting
\usepackage{booktabs}
% Enable multiple rows in table
\usepackage{multirow}
% Customize captions
\usepackage{caption}
% Format captions
\captionsetup{labelformat=empty,size=normalsize}
% Center figures
\let\oldincludegraphics\includegraphics
\renewcommand{\includegraphics}[2][]{\centering\oldincludegraphics[#1]{#2}}
% ---- Format theorems ----
\setbeamertemplate{blocks}[rounded][shadow=false]
% Define new theorems
\newtheorem{proposition}{Proposition}
\newtheorem{assumption}{Assumption}
\newtheorem{remark}{Remark}
% ---- Create section slide ----
\newcommand{\heading}[1]{\LARGE\scshape\color{BlackGray}\singlespacing\MakeLowercase{#1}}
% ---- Create last slide ----
\newcommand{\lastslide}{{\setbeamercolor{normal text}{bg=LightGray}\begin{frame}\end{frame}}}
% ---- Define shortcuts for pictograms ----
\newcommand{\up}{\textuparrow\,}
\newcommand{\down}{\textdownarrow\,}
\renewcommand{\flat}{\textrightarrow\,}
\newcommand{\then}{$\rightsquigarrow\,$}
\newcommand{\so}{{$\Rightarrow\,$}}
% ---- Remove or insert slide numbers ----
% Remove slide numbers by default
\setbeamertemplate{footline}{}
% Uncomment the line below to insert slide numbers
% \setbeamertemplate{footline}[frame number]