-
Notifications
You must be signed in to change notification settings - Fork 0
/
slides.sty
422 lines (352 loc) · 14.3 KB
/
slides.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
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Package which include a template for writing a report in latex.
%
% Autor: Andrés Herrera Poyatos (https://github.com/andreshp)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% You can put this package in the directory ~/texmf/tex/latex/ and use it with \usepackage{template}
% whenever you want.
%
% The template does not provide a title environment. You have to use one of the titlex.sty packages
% in order to define a title environment.
% Furthermore, the template requires you to define the following variables:
% Title of the document.
%\newcommand{\doctitle}{This is the title}
% Subtitle.
%\newcommand{\docsubtitle}{A cool subtitle}
% Date.
%\newcommand{\docdate}{March 17th, 2017}
% Subject.
%\newcommand{\subject}{LaTeX}
% Author.
%\newcommand{\docauthor}{Andrés Herrera Poyatos}
%\newcommand{\docaddress}{University of Granada}
%\newcommand{\docemail}{[email protected]}
% Document's abstract. If you leave it empty, then it won't be used.
%\newcommand{\docabstract}{}
\ProvidesPackage{slides}[2018]
%-----------------------------------------------------------------------------------------------------
% COLOURS
%-----------------------------------------------------------------------------------------------------
\definecolor{ChetwodeBlue}{HTML}{6b77ad} % Titles
\definecolor{Jaguar}{HTML}{262731} % Background
\definecolor{TurkishRose}{HTML}{B46275} % Comments
\definecolor{Grandis}{HTML}{F5CF73} % Details
%-----------------------------------------------------------------------------------------------------
% COLOURS
%-----------------------------------------------------------------------------------------------------
\definecolor{DarkBlue}{HTML}{2c386d} % Main Title
\definecolor{ChetwodeBlue}{HTML}{6b77ad} % Titles
\definecolor{Jaguar}{HTML}{262731} % Background
\definecolor{TurkishRose}{HTML}{B46275} % Comments
\definecolor{Grandis}{HTML}{F5CF73} % Details
\definecolor{backg}{HTML}{F2F2F2} % Fondo
%\definecolor{title}{HTML}{bdc3d1} % Títulos
\definecolor{title}{HTML}{dce1ed} % Títulos
\definecolor{comments}{HTML}{BDBDBD} % Comentarios
\definecolor{keywords}{HTML}{08388c} % Palabras clave
\definecolor{strings}{HTML}{FA5858} % Strings
\definecolor{links}{HTML}{2C2C95} % Enlaces
\definecolor{bars}{HTML}{045FB4} % Barras (gráfico)
\usepackage{tcolorbox}
%----------------------------------------------------------------------------------------
% THEME
%----------------------------------------------------------------------------------------
% Theme and colour theme
\usetheme{Dresden}
%\usecolortheme{orchid}
\usecolortheme{dolphin}
%\usecolortheme{seahorse}
\useinnertheme{circles}
\setbeamercovered{transparent}
% Title
\setbeamercolor{title}{fg=DarkBlue}
% Frame title
\setbeamercolor{frametitle}{fg=ChetwodeBlue}
% Structure
\setbeamercolor{structure}{fg=Jaguar}
% Enlaces (tex.stackexchange.com/questions/13423)
\hypersetup{colorlinks,linkcolor=,urlcolor=TurkishRose}
% Remove navigation links (stackoverflow.com/questions/3017030)
\setbeamertemplate{navigation symbols}{}
% Remove footline (stackoverflow.com/questions/1435837)
\setbeamertemplate{footline}{}
% Avoid warning boxes
\hfuzz=20pt
\vfuzz=20pt
%-----------------------------------------------------------------------------------------------------
% FONT SELECTION
%-----------------------------------------------------------------------------------------------------
% Choose one of these fonts
%\usepackage{courier}
%\usepackage[bitstream-charter]{mathdesign}
% Improves the font rendering.
% https://tex.stackexchange.com/questions/82001/microtype-settings-for-dummies
\usepackage[final]{microtype}
% Frame title
\setbeamerfont{frametitle}{series=\bfseries, size=\large}
% Blocks Font size
% https://tex.stackexchange.com/questions/96275/how-to-change-example-block-body-text-size-in-beamer
\setbeamerfont{block body}{size=\normalsize}
\setbeamerfont{block body alerted}{size=\normalsize}
\setbeamerfont{block body exampled}{size=\normalsize}
\setbeamerfont{block title}{size=\normalsize, series=\bfseries}
\setbeamerfont{block title alerted}{size=\large, series=\bfseries}
\setbeamerfont{block title exampled}{size=\large, series=\bfseries}
%----------------------------------------------------------------------------------------
% BLOCKS
%----------------------------------------------------------------------------------------
\usepackage{tcolorbox}
% Blocks colour
\setbeamercolor{block title}{bg=title, fg=ChetwodeBlue}
\setbeamercolor{block body}{bg=ChetwodeBlue!10,fg=black}
\setbeamercolor{block title alerted}{fg=TurkishRose, bg=title!92!red}
\setbeamercolor{block body alerted}{fg=black, bg=ChetwodeBlue!10}
\setbeamercolor{block title example}{fg=green!70!black, bg=title!92!green}
\setbeamercolor{block body example}{fg=ChetwodeBlue!10, bg=backg}
%-----------------------------------------------------------------------------------------------------
% ITEMIZES / ENUMERATES
%-----------------------------------------------------------------------------------------------------
\setbeamertemplate{itemize item}{\color{TurkishRose}$\bullet$}
\setbeamertemplate{itemize subitem}{\color{ChetwodeBlue}$\circ$}
\setbeamercolor{section number projected}{bg=TurkishRose}
% Auxiliar color for itemize
\newcommand*\MyPitem{\item[\color{ChetwodeBlue}{\textbullet}]}
% Color for alerted text in itemize / enumerate
% https://tex.stackexchange.com/questions/96864/changing-the-color-of-alert-command-in-beamer
\setbeamercolor{alerted text}{fg=TurkishRose}
% Avoid warnings in itemize
\renewcommand\textbullet{\ensuremath{\bullet}}
%-----------------------------------------------------------------------------------------------------
% IMAGES
%-----------------------------------------------------------------------------------------------------
% Allows the H placement in images.
\usepackage{float}
%-----------------------------------------------------------------------------------------------------
% HYPERREF SET UP
%-----------------------------------------------------------------------------------------------------
\PassOptionsToPackage{unicode}{hyperref} % Avoid mistakes with non-ASCII characters.
\PassOptionsToPackage{naturalnames}{hyperref} % tex.stackexchange.com/questions/10555
\usepackage{hyperref}
%\hypersetup{
% colorlinks = true, % Quita las cajas y añade un color al texto.
% % Tipos de enlaces cuyo color se puede configurar:
% linkcolor = black, % Por defecto red
% anchorcolor = gray, % Por defecto black
% citecolor = magenta, % Por defecto green
% filecolor = red, % Por defecto cyan
% menucolor = green, % Por defecto red
% runcolor = red, % Por defecto cyan
% urlcolor = magenta, % Por defecto magenta
%}
%-----------------------------------------------------------------------------------------------------
% COMMANDS
%-----------------------------------------------------------------------------------------------------
% New commands
\newcommand{\importsection}[1]{\input{./Sections/#1}} % Include sections from sections directory.
\newcommand{\link}[3]{\href{#1}{\textbf{#2}} - {\small #3}} % Unique style for references
% Background block
\makeatletter
\newbox\@backgroundblock
\newenvironment{backgroundblock}[2]{%
\global\setbox\@backgroundblock=\vbox\bgroup%
\unvbox\@backgroundblock%
\vbox to0pt\bgroup\vskip#2\hbox to0pt\bgroup\hskip#1\relax%
}{\egroup\egroup\egroup}
\addtobeamertemplate{background}{\box\@backgroundblock}{}
% Two part definitions
\newcommand{\twopartdef}[2]
{
\left\{
\begin{array}{ll}
#1 \\
#2
\end{array}
\right.
}
%-----------------------------------------------------------------------------------------------------
% TITLE PAGE
%-----------------------------------------------------------------------------------------------------
\usepackage[framemethod=tikz]{mdframed}
\newmdenv[tikzsetting={draw=Jaguar,fill=white,fill opacity=0.7, line width=2pt}, backgroundcolor=none,leftmargin=40,rightmargin=40,innertopmargin=4pt, roundcorner=15pt] {titleBox}
% Define the title page.
\defbeamertemplate*{title page}{customized}[1][] {
\vspace{0.1\paperheight}
\begin{flushleft}
\begin{titleBox}
\begin{beamercolorbox}[sep=8pt,center]{title}
{\usebeamerfont{title}\textbf{\doctitle}} \\[3mm]
{\color{TurkishRose} \large \textbf{\docsubtitle}}
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center]{author}
\usebeamerfont{author}\large\textbf{\docauthor}
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center]{author}
\textbf{ Tutor: Pedro A. García Sánchez}
\end{beamercolorbox}
\end{titleBox}
\end{flushleft}
}
%-----------------------------------------------------------------------------------------------------
% INFORMATION
%-----------------------------------------------------------------------------------------------------
% Obtain the slides information from \docX command.
\title{\doctitle}
\author{\docauthor}
%----------------------------------------------------------------------------------------
% MATEMÁTICAS
%----------------------------------------------------------------------------------------
% Paquetes para matemáticas:
\usepackage{amsmath, amsthm, amscd} % Teoremas, fuentes y símbolos.
\renewenvironment<>{theorem}[1][\undefined]{
\begin{actionenv}#2
\ifx#1\undefined
\def\insertblocktitle{Teorema}%
\else
\def\insertblocktitle{Teorema ({\em#1})}%
\fi
\par
\mode<presentation>{%
\setbeamercolor{block title}{fg=white,bg=Jaguar!80!ChetwodeBlue}
\setbeamercolor{block body}{fg=black,bg=ChetwodeBlue!10}
}%
\usebeamertemplate{block begin}\em}
{\par\usebeamertemplate{block end}\end{actionenv}}
\renewenvironment<>{lemma}[1][\undefined]{
\begin{actionenv}#2
\ifx#1\undefined
\def\insertblocktitle{Lema}%
\else
\def\insertblocktitle{Lema ({\em#1})}%
\fi
\par
\mode<presentation>{%
\setbeamercolor{block title}{fg=white,bg=Jaguar!80!ChetwodeBlue}
\setbeamercolor{block body}{fg=black,bg=ChetwodeBlue!10}
}%
\usebeamertemplate{block begin}\em}
{\par\usebeamertemplate{block end}\end{actionenv}}
\newenvironment<>{proposition}[1][\undefined]{
\begin{actionenv}#2
\ifx#1\undefined
\def\insertblocktitle{Proposición}%
\else
\def\insertblocktitle{Proposición ({\em#1})}%
\fi
\par
\mode<presentation>{%
\setbeamercolor{block title}{fg=white,bg=Jaguar!80}
\setbeamercolor{block body}{fg=black,bg=ChetwodeBlue!10}
}%
\usebeamertemplate{block begin}\em}
{\par\usebeamertemplate{block end}\end{actionenv}}
\newenvironment<>{corollary}[1][\undefined]{
\begin{actionenv}#2
\ifx#1\undefined
\def\insertblocktitle{Corolario}%
\else
\def\insertblocktitle{Corolario ({\em#1})}%
\fi
\par
\mode<presentation>{%
\setbeamercolor{block title}{fg=white,bg=Jaguar!80}
\setbeamercolor{block body}{fg=black,bg=ChetwodeBlue!10}
}%
\usebeamertemplate{block begin}\em}
{\par\usebeamertemplate{block end}\end{actionenv}}
\newenvironment<>{conjecture}[1][\undefined]{
\begin{actionenv}#2
\ifx#1\undefined
\def\insertblocktitle{Conjetura}%
\else
\def\insertblocktitle{Conjetura ({\em#1})}%
\fi
\par
\mode<presentation>{%
\setbeamercolor{block title}{fg=white,bg=Jaguar!80}
\setbeamercolor{block body}{fg=black,bg=ChetwodeBlue!10}
}%
\usebeamertemplate{block begin}\em}
{\par\usebeamertemplate{block end}\end{actionenv}}
\renewenvironment<>{definition}[1][\undefined]{
\begin{actionenv}#2
\ifx#1\undefined
\def\insertblocktitle{Definición}%
\else
\def\insertblocktitle{Definición ({\em#1})}%
\fi
\par
\mode<presentation>{%
\setbeamercolor{block title}{bg=title, fg=ChetwodeBlue}
\setbeamercolor{block body}{bg=ChetwodeBlue!10,fg=black}
}%
\usebeamertemplate{block begin}\em}
{\par\usebeamertemplate{block end}\end{actionenv}}
\renewenvironment<>{problem}[1][\undefined]{
\begin{actionenv}#2
\ifx#1\undefined
\def\insertblocktitle{Problema}%
\else
\def\insertblocktitle{Problema ({\em#1})}%
\fi
\par
\mode<presentation>{%
\setbeamercolor{block title}{bg=title, fg=ChetwodeBlue}
\setbeamercolor{block body}{bg=ChetwodeBlue!10,fg=black}
}%
\usebeamertemplate{block begin}\em}
{\par\usebeamertemplate{block end}\end{actionenv}}
\renewenvironment<>{example}[1][\undefined]{
\begin{actionenv}#2
\ifx#1\undefined
\def\insertblocktitle{Ejemplo}%
\else
\def\insertblocktitle{Ejemplo ({\em#1})}%
\fi
\par
\mode<presentation>{%
\setbeamercolor{block title}{fg=white,bg=Jaguar!100!green}
\setbeamercolor{block body}{fg=black,bg=green!10}
}%
\usebeamertemplate{block begin}\em}
{\par\usebeamertemplate{block end}\end{actionenv}}
\renewenvironment<>{note}[1][\undefined]{
\begin{actionenv}#2
\ifx#1\undefined
\def\insertblocktitle{Observación}%
\else
\def\insertblocktitle{Observación ({\em#1})}%
\fi
\par
\mode<presentation>{%
\setbeamercolor{block title}{fg=white,bg=Jaguar!80}
\setbeamercolor{block body}{fg=black,bg=ChetwodeBlue!10}
}%
\usebeamertemplate{block begin}\em}
{\par\usebeamertemplate{block end}\end{actionenv}}
\renewenvironment<>{exercise}[1][\undefined]{
\begin{actionenv}#2
\ifx#1\undefined
\def\insertblocktitle{Ejercicio}%
\else
\def\insertblocktitle{Ejercicio ({\em#1})}%
\fi
\par
\mode<presentation>{%
\setbeamercolor{block title}{fg=white,bg=Jaguar!80}
\setbeamercolor{block body}{fg=black,bg=ChetwodeBlue!10}
}%
\usebeamertemplate{block begin}\em}
{\par\usebeamertemplate{block end}\end{actionenv}}
%----------------------------------------------------------------------------------------
% TOC
%----------------------------------------------------------------------------------------
% https://tex.stackexchange.com/questions/105621/beautiful-presentations-done-with-tex-and-related-systems https://nickhigham.wordpress.com/2013/01/18/top-5-beamer-tips/
% https://github.com/markolsonse/sthlmBeamerTheme
%\setcounter{tocdepth}{2}
%\setbeamerfont{myTOC}{series=\bfseries,size=\Large}
%\AtBeginSection[]{\frame{%\frametitle{Outline}
% %\usebeamerfont{myTOC}
% \tableofcontents[current]}}
%\setbeamertemplate{subsection in toc}
% {\leavevmode\leftskip=2em{\color{TurkishRose}$\bullet$}\hskip1em\inserttocsubsection\par}