forked from hamaluik/Beamer-Theme-Execushares
/
beamerthemeITMOUniversity.sty
200 lines (171 loc) · 7.89 KB
/
beamerthemeITMOUniversity.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
% the various libraries we will be using
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage[none]{hyphenat}
\usepackage{fontspec}
\usepackage{epstopdf}
\defaultfontfeatures{Ligatures=TeX}
% define colours
\definecolor{StyleBlack}{RGB}{43,40,40}
\definecolor{StyleBlue}{RGB}{48,75,166}
\definecolor{StyleWhite}{RGB}{255,255,243}
\definecolor{StyleGrey}{RGB}{107,110,108}
% use Fontin Fonts:
\setmainfont{Fontin}
\setsansfont{Fontin Sans}
\setmonofont{Droid Sans Mono}
% To use with pdflatex,
% comment the fontspec package at the top
% set colours
\setbeamercolor{itemize item}{fg=StyleBlue}
\setbeamercolor{enumerate item}{fg=StyleBlue}
\setbeamercolor{alerted text}{fg=StyleBlue}
\setbeamercolor{section in toc}{fg=StyleBlack}
% set fonts
\setbeamerfont{itemize/enumerate body}{size=\large}
\setbeamerfont{itemize/enumerate subbody}{size=\normalsize}
\setbeamerfont{itemize/enumerate subsubbody}{size=\small}
% make the itemize bullets pixelated >
\setbeamertemplate{itemize item}{
\tikz{
\draw[fill=StyleBlue,draw=none] (0, 0) rectangle(0.1, 0.1);
\draw[fill=StyleBlue,draw=none] (0.1, 0.1) rectangle(0.2, 0.2);
\draw[fill=StyleBlue,draw=none] (0, 0.2) rectangle(0.1, 0.3);
}
}
% make the subitems also pixelated >, but a little smaller and red
\setbeamertemplate{itemize subitem}{
\tikz{
\draw[fill=StyleBlue,draw=none] (0, 0) rectangle(0.075, 0.075);
\draw[fill=StyleBlue,draw=none] (0.075, 0.075) rectangle(0.15, 0.15);
\draw[fill=StyleBlue,draw=none] (0, 0.15) rectangle(0.075, 0.225);
}
}
% disable navigation
\setbeamertemplate{navigation symbols}{}
% custom draw the title page above
\setbeamertemplate{title page}{}
% again, manually draw the frame title above
\setbeamertemplate{frametitle}{}
% disable "Figure:" in the captions
\setbeamertemplate{caption}{\tiny\insertcaption}
\setbeamertemplate{caption label separator}{}
% since I don't know a better way to do this, these are all switches
% doing `\setcounter{showProgressBar}{0}` will turn the progress bar off (I turn it off for Appendix slides)
% etc
\newcounter{showProgressBar}
\setcounter{showProgressBar}{1}
\newcounter{showSlideNumbers}
\setcounter{showSlideNumbers}{1}
\newcounter{showSlideTotal}
\setcounter{showSlideTotal}{1}
% use \makeatletter for our progress bar definitions
% progress bar idea from http://tex.stackexchange.com/a/59749/44221
% slightly adapted for visual purposes here
\makeatletter
\newcount\progressbar@tmpcounta% auxiliary counter
\newcount\progressbar@tmpcountb% auxiliary counter
\newdimen\progressbar@pbwidth %progressbar width
\newdimen\progressbar@tmpdim % auxiliary dimension
\newdimen\slidewidth % auxiliary dimension
\newdimen\slideheight % auxiliary dimension
% make the progress bar go across the screen
%\progressbar@pbwidth=12.8cm
\progressbar@pbwidth=\the\paperwidth
\slidewidth=\the\paperwidth
\slideheight=\the\paperheight
% use tikz to draw everything
% it may not be the best, but it's easy to work with
% and looks good
% TODO: base title slide and contents slide on something other than slide numbers :/
\setbeamertemplate{background}{
% deal with progress bar stuff
% (calculate where it should go)
\progressbar@tmpcounta=\insertframenumber
\progressbar@tmpcountb=\inserttotalframenumber
\progressbar@tmpdim=\progressbar@pbwidth
\multiply\progressbar@tmpdim by \progressbar@tmpcounta
\divide\progressbar@tmpdim by \progressbar@tmpcountb
\begin{tikzpicture}[nodes = {align=left}]
% set up the entire slide as the canvas
\useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
% the background
\fill[color=StyleWhite] (0,0) rectangle(\the\paperwidth,\the\paperheight);
% separate the drawing based on if we're the first (title) slide or not
\ifnum\thepage=1\relax
% the title page
% draw the fills
% don't like the fill
%\fill[color=StyleBlue] (0, 4cm) rectangle(\slidewidth,\slideheight);
%ITMO logo
\node[anchor=north west,text width=\slidewidth-1cm,inner xsep=0.5cm] at (0,\paperheight-0.25cm) {\includegraphics[width=0.3\paperwidth]{logo/itmo_white.eps}};
%\node[anchor=north west,text width=\slidewidth-1cm,inner xsep=1pt] (itmo-logo) at (-0.4cm,\paperheight) {\includegraphics[width=3.8cm]{logo/itmo_white.eps}};
% draw the actual text
\node[anchor=south west,text width=\slidewidth-1cm,align=left] at (0.05\slidewidth,4cm) {\color{StyleBlue}\Huge\textbf{\inserttitle}};
%\node[anchor=north west,text width=\slidewidth-1cm,align=left] at (0.05\slidewidth,4cm) {\color{StyleBlack}\small\insertsubtitle};
%\node[above] at (0.5\slidewidth,3cm) {\color{StyleBlack}\tiny by};
\node[anchor=north west,text width=\slidewidth-1cm,align=left] at (0.05\slidewidth,4cm) {\color{StyleBlack}\Large\insertauthor};
\node[below, anchor=north west,text width=\slidewidth-1cm,align=left] at (0.05\slidewidth,2.2cm) {\tiny\insertinstitute};
% add the date in the corner
\node[anchor=south east] at(\slidewidth,0cm) {\color{StyleGrey}\tiny\insertdate};
\else
% NOT the title page
% title bar
\fill[color=StyleBlue] (0, \slideheight-1cm) rectangle(\slidewidth,\slideheight);
%ITMO logo
\node[anchor=north west,text width=\slidewidth-1cm,inner xsep=1pt] (itmo-logo) at (-0.4cm,\paperheight) {\includegraphics[width=3.8cm]{logo/itmo_blue.eps}};
% swap the comment on these to add section titles to slide titles
%\node[anchor=north,text width=11.8cm,inner xsep=0.5cm,inner ysep=0.25cm] at (6.4cm,9.6cm) {\color{StyleWhite}\Large\textbf{\insertsectionhead: \insertframetitle}};
\node[anchor=north,text width=\slidewidth-1cm,inner xsep=0.5cm,inner ysep=0.25cm,,align=right] at (0.5\slidewidth,\slideheight) {\color{StyleWhite}\huge\textbf{\insertframetitle}};
% if we're showing a progress bar, show it
% (I disable the progress bar and slide numbers for the "Appendix" slides)
\ifnum \value{showProgressBar}>0\relax%
% the the progress bar icon in the middle of the screen
\draw[fill=StyleGrey,draw=none] (0cm,0cm) rectangle(\slidewidth,0.25cm);
\draw[fill=StyleBlue,draw=none] (0cm,0cm) rectangle(\progressbar@tmpdim,0.25cm);
% bottom information
\node[anchor=south west] at(0cm,0.25cm) {\color{StyleGrey}\tiny\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(\slidewidth,0.25cm) {\color{StyleGrey}\tiny\insertframenumber/\inserttotalframenumber};
\else
% slide totals aren't active, don't draw them
\node[anchor=south east] at(\slidewidth,0.25cm) {\color{StyleGrey}\tiny\insertframenumber};
\fi
\fi
% don't show the progress bar?
\else
% section title in the bottom left
\node[anchor=south west] at(0cm,0cm) {\color{StyleGrey}\tiny\insertsection};
% if we're showing slide numbers
\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(\slidewidth,0cm) {\color{StyleGrey}\tiny\insertframenumber/\inserttotalframenumber};
\else
% slide totals aren't active, don't draw them
\node[anchor=south east] at(\slidewidth,0cm) {\color{StyleGrey}\tiny\insertframenumber};
\fi
\fi
\fi
\fi
\end{tikzpicture}
}
\makeatother
% add section titles
\AtBeginSection{\frame{\sectionpage}}
\setbeamertemplate{section page}
{
\begin{tikzpicture}
% set up the entire slide as the canvas
\useasboundingbox (0,0) rectangle(\slidewidth,\slideheight);
%\fill[color=StyleWhite] (0,0) rectangle(\the\paperwidth,\the\paperheight);
\fill[color=StyleWhite] (-1cm, 2cm) rectangle (\slidewidth, \slideheight+0.1cm);
\fill[color=StyleBlue] (-1cm, 0.5\slideheight-1cm) rectangle(\slidewidth, 0.5\slideheight+1cm);
\node[text width=\the\paperwidth-1cm,align=center] at (0.4\slidewidth, 0.5\slideheight) {\color{StyleWhite}\Huge\textbf{\insertsection}};
\end{tikzpicture}
}