-
Notifications
You must be signed in to change notification settings - Fork 3
/
ITMOtemplate.sty
371 lines (339 loc) · 11.4 KB
/
ITMOtemplate.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
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
\mode<presentation>
%%%%% Fourier math
\usepackage[T1]{fontenc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[raster,most]{tcolorbox}
\usepackage{adjustbox}
\usepackage{ifxetex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Define the colors of the corporate style.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\definecolor{ITMOblue}{RGB}{25,70,186}
\definecolor{ITMOred}{RGB}{236,11,67}
\definecolor{ITMOwhite}{RGB}{255,255,255}
\definecolor{ITMOPeach}{RGB}{255,132,0}
\definecolor{ITMOSkyBlue}{RGB}{61,181,230}
\definecolor{ITMOMint}{RGB}{0,174,157}
\definecolor{ITMOSeaWave}{RGB}{94, 192, 213}
\definecolor{ITMOMango}{RGB}{255,230,13}
\definecolor{ITMOLemon}{RGB}{235,231,14}
\definecolor{ITMOCoral}{RGB}{234,65,38}
\definecolor{ITMOEmerald}{RGB}{0,148,77}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Fonts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifxetex
\usepackage{fontspec}
\setsansfont[
% Path = {fonts/}
Path = fonts/,
BoldFont = helveticaneue-medium.ttf,
ItalicFont = helveticaneue-thin.ttf,
BoldItalicFont = helveticaneue-light.ttf
]{helveticaneue.ttf}
\else
\usepackage[scaled]{helvet}
\renewcommand\familydefault{\sfdefault}
\usepackage[letterspace=50]{microtype}
\fi
\usefonttheme[onlymath]{serif}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Headline
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \setbeamertemplate{headline}{\vskip-.1px}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Footline
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{footline}{
\begin{beamercolorbox}[ht=3ex,dp=2ex,leftskip=1.4cm,rightskip=.3cm]{section in head/foot}
\insertsectionnavigationhorizontal{.8\textwidth}{}{}
\hfill
\insertframenumber~/ \inserttotalframenumber
\hspace{2pt}
\end{beamercolorbox}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Title page
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamercolor{title}{fg=ITMOwhite}
% Changing foot/head lines for titlepage
\makeatletter
\def\ps@lines@titlepage{%
%%%% FOOTLINE
\setbeamertemplate{footline}{
\setlength\lineskip{3pt}
{
\fontsize{4pt}{6pt}\selectfont\centering\usebeamercolor[fg]{title}
\textbf{\textit{\insertdate}}
\par
}
\vspace{.5cm}
}
%%%% HEADLINE
\setbeamertemplate{headline}{
\vspace{.5cm}
{\centering\includegraphics[height = 1.5cm]{figs/itmo_logo_blue_en.eps}\par}
}
%%%% BACKGROUND
\setbeamertemplate{background}{
\includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{figs/itmo_polygons.pdf}
}
}
\makeatother
\setbeamertemplate{title page}
{
\thispagestyle{lines@titlepage}
\usebeamercolor[fg]{title}
\vfill
\centering{
\begin{varwidth}{0.9\textwidth}
\bf\Large\inserttitle
\end{varwidth}
}
\bigskip
\centering{\footnotesize\insertauthor}
\bigskip
{
\fontsize{5pt}{6pt}\selectfont
{\textit{\insertinstitute}}
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Frame
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{sidebar right}{}
\setbeamertemplate{navigation symbols}{}
\setbeamercolor{section in head/foot}{bg=ITMOblue, fg=ITMOwhite}
\setbeamerfont{frametitle}{series=\bfseries}
\setbeamerfont{frame}{size=\footnotesize}
%%% See the beamercolorbox documentation in http://tug.ctan.org/macros/latex/contrib/beamer/doc/beameruserguide.pdf
%%% The page 126
\setbeamertemplate{frametitle}{
\nointerlineskip
\begin{beamercolorbox}[wd=\paperwidth,dp=7pt,ht=18pt,leftskip=10pt,rightskip=10pt]{section in head/foot}
\insertframetitle
\hfill
\raisebox{-1pt}{\includegraphics[height=12pt]{figs/itmo_logo_horiz_blue_en.eps}}
\end{beamercolorbox}
}
\logo{\includegraphics[height=1.5cm]{figs/itmo_logo_blue_en.eps}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Beamer Features
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Overlays
\setbeamercovered{transparent}
%%%%% Alert
\setbeamercolor{alerted text}{fg=ITMOred,bg=white}
\newcommand{\boxalert}[1]{{%
\colorbox{ITMOred}{\color{white}{#1}}%
}}
\usestructuretemplate{\color{ITMOblue}}{}
%%%%% Table of Contents
\setbeamertemplate{section in toc}[sections numbered]
\setbeamertemplate{subsection in toc}[subsections numbered]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Fancylist environment
%%%%% https://tex.stackexchange.com/questions/385663/custom-enumerate-list-align-enumerate-label-at-the-center-of-text
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcounter{fancycount}
% lets define some options using pgfkeys
% https://tex.stackexchange.com/questions/34312/how-to-create-a-command-with-key-values
\pgfkeys{
/fancylist/.is family,
/fancylist,
default/.style = {shape = circle, color = ITMOblue},
shape/.estore in = \myshape,
color/.estore in = \mycolor,
}
\newenvironment{fancylist}[1][color=ITMOPeach, shape=circle] {%
\pgfkeys{/fancylist, default, #1}%
% lets decide label shape based on option
\def\mysquare{square}
\def\myring{ring}
\def\myhollowsquare{hollowsquare}
\ifx\myshape\mysquare
\def\mydraw{
\node[
draw = \mycolor, rectangle, minimum width = 7.0mm,
minimum height=7.0mm, inner sep = 0pt, fill = \mycolor
] at (X) { \color{white}\refstepcounter{fancycount}\Large\arabic{fancycount} }
}
\else
\ifx\myshape\myhollowsquare
\def\mydraw{
\node[
draw = \mycolor, rectangle, minimum width = 7.0mm, minimum height = 7.0mm, inner sep = 0pt
] at (X) { \color{white}\refstepcounter{fancycount}\Large\arabic{fancycount} }
}
\else
\ifx\myshape\myring
\def\mydraw{
\node[
draw = \mycolor, circle, minimum width = 7.0mm, inner sep = 0pt
] at (X) {\color{white}\refstepcounter{fancycount}\Large\arabic{fancycount}}
}
\else
\def\mydraw{
\node[
draw = \mycolor, circle, minimum width = 7.0mm, inner sep = 0pt, fill=\mycolor
] at (X) {\color{white}\refstepcounter{fancycount}\Large\arabic{fancycount}}
}
\fi
\fi
\fi
\setcounter{fancycount}{0}
% lets keep it simple and ask users to use \item
\def\item{\tcbitem}
\begin{tcbitemize} [
raster columns=1,
nofloat,
enhanced,
raster left skip=10.0mm,
sharp corners=all,
opacityfill=0,
valign=center,
coltext=black,
overlay={
\coordinate (X) at ([xshift=-7.50mm]frame.west); \mydraw;
\draw[very thick, color=\mycolor] (frame.north west) -- (frame.south west);
}
]
} {\end{tcbitemize}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Fancybox
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newsavebox\mybox
\providecommand\fancybox[3][ITMOblue] {%
\tcbset{
mybox/.style={
enhanced,
grow to left by=-2.5cm,
boxsep=0mm,
sharp corners=all,
opacityfill=0,
coltext=black,
overlay={
\coordinate (X) at ([xshift=-1mm, yshift=-1.5mm]frame.north west);
\node[align=right, text=#1, text width=2.5cm, anchor=north east] at (X) {#2};
\draw[line width=0.5mm, color=#1] (frame.north west) -- (frame.south west);
}
}
}
\begin{tcolorbox}[mybox]
efdf: #3
\end{tcolorbox}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Theorem
\newcounter{theo} \setcounter{theo}{0}
\renewcommand{\thetheo}{\arabic{theo}}
\resetcounteronoverlays{theo}
\renewenvironment<>{theorem}[1][]{%
\refstepcounter{theo}
\tcbset{
mybox/.style={
enhanced,
grow to left by=-2cm,
boxsep=0mm,
sharp corners=all,
opacityfill=0,
coltext=black,
overlay={
\coordinate (X) at ([xshift=-1mm, yshift=-1.5mm]frame.north west);
\node[align=right, text=ITMOblue, text width=2.5cm, anchor=north east] at (X) {Theorem~\thetheo};
\draw[line width=0.5mm, color=ITMOblue] (frame.north west) -- (frame.south west);
}
}
}
\def\tmp{#1}%
\ifx\tmp\@nnil
\begin{actionenv}#2\begin{tcolorbox}[mybox]
\textit{#1}\par
\else
\begin{actionenv}#2\begin{tcolorbox}[mybox]
}{
\end{tcolorbox}\end{actionenv}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Proof
\renewenvironment<>{proof}{%
\tcbset{
mybox/.style={
enhanced,
grow to left by=-2cm,
boxsep=0mm,
sharp corners=all,
opacityfill=0,
coltext=black,
overlay={
\coordinate (X) at ([xshift=-1mm, yshift=-1.5mm]frame.north west);
\node[align=right, text=ITMOEmerald, text width=2.5cm, anchor=north east] at (X) {Proof.};
\draw[line width=0.5mm, color=ITMOEmerald] (frame.north west) -- (frame.south west);
}
}
}
\begin{actionenv}#1
\begin{tcolorbox}[mybox]
}{
\hfill\qedsymbol
\end{tcolorbox}
\end{actionenv}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Example
\newcounter{exmpl} \setcounter{exmpl}{0}
\renewcommand{\theexmpl}{\arabic{exmpl}}
\resetcounteronoverlays{exmpl}
\renewenvironment<>{example}[1][]{%
\refstepcounter{exmpl}
\tcbset{
mybox/.style={
enhanced,
grow to left by=-2cm,
boxsep=0mm,
sharp corners=all,
opacityfill=0,
coltext=black,
overlay={
\coordinate (X) at ([xshift=-1mm, yshift=-1.5mm]frame.north west);
\node[align=right, text=ITMOPeach, text width=2.5cm, anchor=north east] at (X) {Example~\theexmpl};
\draw[line width=0.5mm, color=ITMOPeach] (frame.north west) -- (frame.south west);
}
}
}
\def\tmp{#1}%
\ifx\tmp\@nnil
\begin{actionenv}#2\begin{tcolorbox}[mybox]
\textit{#1}\par
\else
\begin{actionenv}#2\begin{tcolorbox}[mybox]
}{
\end{tcolorbox}
\end{actionenv}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Alertblock
\renewenvironment<>{alertblock}[1]{%
\tcbset{
mybox/.style={
enhanced,
grow to left by=-2cm,
boxsep=0mm,
sharp corners=all,
opacityfill=0,
coltext=black,
overlay={
\coordinate (X) at ([xshift=-1mm, yshift=-1.5mm]frame.north west);
\node[align=right, text=ITMOred, text width=2.5cm, anchor=north east] at (X) {#1};
\draw[line width=0.5mm, color=ITMOred] (frame.north west) -- (frame.south west);
}
}
}
\begin{actionenv}#2
\begin{tcolorbox}[mybox]
}{
\end{tcolorbox}
\end{actionenv}
}