forked from hamaluik/Beamer-Theme-Execushares
-
Notifications
You must be signed in to change notification settings - Fork 3
/
beamerthemelucid.sty
187 lines (161 loc) · 6.98 KB
/
beamerthemelucid.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
\usepackage{tikz}
\usetikzlibrary{calc}
% -------- COLOR SCHEME --------
\definecolor{PrimaryColor}{RGB}{7,79,140} % primary color (blue)
\definecolor{SecondaryColor}{RGB}{242,88,26} % bulleted lists
\definecolor{BackgroundColor}{RGB}{255,255,255} % background & titles (white)
\definecolor{TextColor}{RGB}{0,0,0} % text (black)
\definecolor{ProgBarBGColor}{RGB}{175,175,175} % progress bar background (grey)
% 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}
% make pixelated bullets
\setbeamertemplate{itemize item}{
\tikz{
\draw[fill=SecondaryColor,draw=none] (0, 0) rectangle(0.1, 0.1);
\draw[fill=SecondaryColor,draw=none] (0.1, 0.1) rectangle(0.2, 0.2);
\draw[fill=SecondaryColor,draw=none] (0, 0.2) rectangle(0.1, 0.3);
}
}
\setbeamertemplate{itemize subitem}{
\tikz{
\draw[fill=SecondaryColor,draw=none] (0, 0) rectangle(0.075, 0.075);
\draw[fill=SecondaryColor,draw=none] (0.075, 0.075) rectangle(0.15, 0.15);
\draw[fill=SecondaryColor,draw=none] (0, 0.15) rectangle(0.075, 0.225);
}
}
\setbeamertemplate{itemize subsubitem}{
\tikz{
\draw[fill=SecondaryColor,draw=none] (0.050, 0.050) rectangle(0.15, 0.15);
}
}
% 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}{}
% disable "Figure:" in the captions
% TODO: somehow this doesn't work for md-generated slides
%\setbeamertemplate{caption}{\tiny\insertcaption}
%\setbeamertemplate{caption label separator}{}
% 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}
% 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=\the\paperwidth
\slidewidth=\the\paperwidth
\slideheight=\the\paperheight
% draw everything with tikz
\setbeamertemplate{background}{ % all slides
% progress bar stuff
\progressbar@tmpcounta=\insertframenumber
\progressbar@tmpcountb=\inserttotalframenumber
\progressbar@tmpdim=\progressbar@pbwidth
\divide\progressbar@tmpdim by 100
\multiply\progressbar@tmpdim by \progressbar@tmpcounta
\divide\progressbar@tmpdim by \progressbar@tmpcountb
\multiply\progressbar@tmpdim by 100
\begin{tikzpicture}
% set up the entire slide as the canvas
\useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
% background
\fill[color=BackgroundColor] (0,0) rectangle(\the\paperwidth,\the\paperheight);
\ifnum\thepage=1\relax % only title slides
% primary color rectangle
\fill[color=PrimaryColor] (0, 4cm) rectangle(\slidewidth,\slideheight);
% text (title, subtitle, author, date)
\node[anchor=south,text width=\slidewidth-1cm,inner xsep=0.5cm] at (0.5\slidewidth,4cm) {\color{BackgroundColor}\Huge\textbf{\inserttitle}};
\node[anchor=north east,text width=\slidewidth-1cm,align=right] at (\slidewidth-0.4cm,4cm) {\color{PrimaryColor}\large\textbf{\insertsubtitle}};
\node at (0.5\slidewidth,2cm) {\color{PrimaryColor}\LARGE\insertauthor};
\node at (0.5\slidewidth,1.25cm) {\color{PrimaryColor}\Large\insertinstitute};
\node[anchor=south east] at(\slidewidth,0cm) {\color{PrimaryColor}\tiny\insertdate};
\else % other slides
% title bar
\fill[color=PrimaryColor] (0, \slideheight-1cm) rectangle(\slidewidth,\slideheight);
% slide title
\node[anchor=north,text width=\slidewidth-0.75cm,inner xsep=0.5cm,inner ysep=0.25cm] at (0.5\slidewidth,\slideheight) {\color{BackgroundColor}\huge\textbf{\insertframetitle}};
% logo (TODO: autoscale; now it expects 350x350
\node[anchor=north east] at (\slidewidth-0.25cm,\slideheight+0.06cm){\insertlogo};
% show progress bar
\ifnum \value{showProgressBar}>0\relax%
% progress bar icon in the middle of the screen
\draw[fill=ProgBarBGColor,draw=none] (0cm,0cm) rectangle(\slidewidth,0.25cm);
\draw[fill=PrimaryColor,draw=none] (0cm,0cm) rectangle(\progressbar@tmpdim,0.25cm);
% bottom info
\node[anchor=south west] at(0cm,0.25cm) {\color{PrimaryColor}\tiny\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(\slidewidth,0.25cm) {\color{PrimaryColor}\tiny\insertframenumber/\inserttotalframenumber};
\else
\node[anchor=south east] at(\slidewidth,0.25cm) {\color{PrimaryColor}\tiny\insertframenumber};
\fi
\fi
\else
% section title in the bottom left
\node[anchor=south west] at(0cm,0cm) {\color{PrimaryColor}\tiny\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(\slidewidth,0cm) {\color{PrimaryColor}\tiny\insertframenumber/\inserttotalframenumber};
\else
\node[anchor=south east] at(\slidewidth,0cm) {\color{PrimaryColor}\tiny\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(\slidewidth,\slideheight);
\fill[color=BackgroundColor] (-1cm, 2cm) rectangle (\slidewidth, \slideheight+0.1cm);
\fill[color=PrimaryColor] (-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{BackgroundColor}\Huge\textbf{\insertsection}};
\end{tikzpicture}
}