-
Notifications
You must be signed in to change notification settings - Fork 0
/
beamerthemegelos.sty
166 lines (141 loc) · 6.89 KB
/
beamerthemegelos.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
% GELOS Theme
% Based on Lucid (https://github.com/harisont/lucid)
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerthemegelos}[2024/01/17]
\newif\if@doDark
\@doDarkfalse
\DeclareOption{dark}{\@doDarktrue}
\DeclareOption{light}{\@doDarkfalse}
\ProcessOptions
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage[sfdefault]{FiraSans}
\usepackage[T1]{fontenc}
% -------- COLOR SCHEME --------
\if@doDark
\def\@theme{dark}
\definecolor{PrimaryColor}{RGB}{94,114,255} % Primária (#5e72ff)
\definecolor{SecondaryColor}{RGB}{113,175,219} % bulleted lists (#71afdb)
\definecolor{BackgroundColor}{RGB}{34,35,42} % background & titles (#22232a)
\definecolor{TextColor}{RGB}{204,204,204} % text (#ccc)
\definecolor{ProgBarBGColor}{RGB}{52,52,61} % progress bar background (#34343d)
\else
\def\@theme{light}
\definecolor{PrimaryColor}{RGB}{42,33,182} % Primária (#2a21b6)
\definecolor{SecondaryColor}{RGB}{2,143,178} % bulleted lists (#028fb2)
\definecolor{BackgroundColor}{RGB}{239,237,250} % background & titles (#efedfa)
\definecolor{TextColor}{RGB}{17,17,17} % text (#111)
\definecolor{ProgBarBGColor}{RGB}{188,189,207} % progress bar background (#bcbdcf)
\fi
% set colours
\setbeamercolor{normal text}{fg=TextColor}\usebeamercolor*{normal text}
\setbeamercolor{alerted text}{fg=PrimaryColor}
\setbeamercolor{section in toc}{fg=PrimaryColor}
\setbeamercolor{structure}{fg=SecondaryColor}
\hypersetup{colorlinks,linkcolor=,urlcolor=SecondaryColor}
% set fonts
\setbeamerfont{itemize/enumerate body}{size=\large}
\setbeamerfont{itemize/enumerate subbody}{size=\normalsize}
\setbeamerfont{itemize/enumerate subsubbody}{size=\small}
% disable navigation
\setbeamertemplate{navigation symbols}{}
% disable the damn default logo!
\setbeamertemplate{sidebar right}{}
% custom draw the title page above
\setbeamertemplate{title page}{}
% again, manually draw the frame title above
\setbeamertemplate{frametitle}{
\vspace{1cm}
}
% add some space below the footnotes so they don't end up on the progress bar
\setbeamertemplate{footnote}{
\parindent 0em
\noindent
\raggedright
\hbox to 0.8em{\hfil\insertfootnotemark}
\insertfootnotetext
\par
\vspace{2em}
}
% add the same vspace both before and after quotes
\setbeamertemplate{quote begin}{\vspace{0.5em}}
\setbeamertemplate{quote end}{\vspace{0.5em}}
% progress bar counters
\newcounter{showProgressBar}
\setcounter{showProgressBar}{1}
\newcounter{showSlideNumbers}
\setcounter{showSlideNumbers}{1}
\newcounter{showSlideTotal}
\setcounter{showSlideTotal}{1}
\makeatletter
\setbeamertemplate{background}{ % all slides
\begin{tikzpicture}
% set up the entire slide as the canvas
\useasboundingbox (0,0) rectangle(\paperwidth,\paperheight);
% background
\fill[color=BackgroundColor] (0,0) rectangle(\paperwidth,\paperheight);
\ifnum\thepage=1\relax % only title slides
% primary color rectangle
\fill[color=PrimaryColor] (0, 4cm) rectangle(\paperwidth,\paperheight);
% logo
\node[anchor=north] at (0.5\paperwidth,\paperheight-0.5cm){\includegraphics[width=3cm,height=3cm]{gelos-\@theme.png}};
% text (title, subtitle, author, date)
\node[anchor=south,text width=\paperwidth-1cm,inner xsep=0.5cm] at (0.5\paperwidth,4cm) {\color{BackgroundColor}\Huge\textbf{\inserttitle}};
\node[anchor=north east,text width=\paperwidth-1cm,align=right] at (\paperwidth-0.4cm,4cm) {\color{PrimaryColor}\large\textbf{\insertsubtitle}};
\node at (0.5\paperwidth,2cm) {\color{PrimaryColor}\LARGE\insertauthor};
\node at (0.5\paperwidth,1.25cm) {\color{PrimaryColor}\Large\insertinstitute};
\node[anchor=south east] at(\paperwidth,0cm) {\color{PrimaryColor}\footnotesize\insertdate};
\else % other slides
% title bar
\fill[color=PrimaryColor] (0, \paperheight-1.2cm) rectangle(\paperwidth,\paperheight);
% slide title
\node[anchor=north,text width=\paperwidth-2cm,inner xsep=0.5cm,inner ysep=0.25cm] at (0.5\paperwidth,\paperheight-0.1cm) {\color{BackgroundColor}\LARGE\textbf{\insertframetitle}};
% logo
\node[anchor=north east] at (\paperwidth-0.25cm,\paperheight){\includegraphics[width=1cm,height=1cm]{gelos-\@theme.png}};
% show progress bar
\ifnum \value{showProgressBar}>0\relax
% gambiarra: min helps avoid this scalar getting >1 in some edge cases
\pgfmathsetmacro{\progress}{min(1, \insertframenumber/\inserttotalframenumber)}
\fill[color=ProgBarBGColor] (0, 0) rectangle(\paperwidth, 0.1cm);
\fill[color=PrimaryColor] (0, 0) rectangle(\progress * \paperwidth, 0.1cm);
% bottom info
\node[anchor=south west] at(0cm,0.1cm) {\color{PrimaryColor}\footnotesize\vphantom{lp}\insertsection};
% if slide numbers are active
\ifnum \value{showSlideNumbers}>0\relax
% if slide totals are active
\ifnum \value{showSlideTotal}>0\relax
% draw both slide number and slide total
\node[anchor=south east] at(\paperwidth,0.1cm) {\color{PrimaryColor}\footnotesize\insertframenumber/\inserttotalframenumber};
\else
\node[anchor=south east] at(\paperwidth,0.1cm) {\color{PrimaryColor}\footnotesize\insertframenumber};
\fi
\fi
\else
% section title in the bottom left
\node[anchor=south west] at(0cm,0cm) {\color{PrimaryColor}\footnotesize\vphantom{lp}\insertsection};
% if we're showing slide numbers
\ifnum \value{showSlideNumbers}>0\relax
% if slide totals are active
\ifnum \value{showSlideTotal}>0\relax
% slide number and slide total
\node[anchor=south east] at(\paperwidth,0cm) {\color{PrimaryColor}\footnotesize\insertframenumber/\inserttotalframenumber};
\else
\node[anchor=south east] at(\paperwidth,0cm) {\color{PrimaryColor}\footnotesize\insertframenumber};
\fi
\fi
\fi
\fi
\end{tikzpicture}
}
\makeatother
\AtBeginSection{\frame{\sectionpage}} % section pages
\setbeamertemplate{section page}
{
\begin{tikzpicture}
% set up the entire slide as the canvas
\useasboundingbox (0,0) rectangle(\paperwidth,\paperheight);
\fill[color=BackgroundColor] (-1cm, 2cm) rectangle (\paperwidth, \paperheight+0.1cm);
\fill[color=PrimaryColor] (-1cm, 0.5\paperheight-1cm) rectangle(\paperwidth, 0.5\paperheight+1cm);
\node[text width=\paperwidth-1cm,align=center] at (0.4\paperwidth, 0.5\paperheight) {\color{BackgroundColor}\Huge\textbf{\insertsection}};
\end{tikzpicture}
}