-
Notifications
You must be signed in to change notification settings - Fork 0
/
beamerthemegemini.sty
226 lines (198 loc) · 5.79 KB
/
beamerthemegemini.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
% Gemini theme
% https://github.com/anishathalye/gemini
% ====================
% Dependencies
% ====================
\RequirePackage{exscale}
\RequirePackage{ragged2e}
\RequirePackage{changepage}
\RequirePackage{fontspec}
\RequirePackage{calc}
% ====================
% Fonts
% ====================
\newfontfamily\Raleway[Ligatures=TeX]{Raleway}
\newfontfamily\Lato[Ligatures=TeX]{Lato}
\usefonttheme{professionalfonts}
\setsansfont{Lato}[
UprightFont=*-Light,
ItalicFont=*-LightItalic,
BoldFont=*-Regular,
BoldItalicFont=*-Italic
]
\setbeamerfont{headline}{family=\Raleway}
\setbeamerfont{headline title}{size=\Huge,series=\bfseries}
\setbeamerfont{headline author}{size=\Large}
\setbeamerfont{headline institute}{size=\normalsize}
\setbeamerfont{block title}{family=\Raleway,size=\large,series=\bfseries}
\setbeamerfont{heading}{family=\Lato,series=\bfseries}
\setbeamerfont{caption}{size=\small}
\setbeamerfont{footline}{family=\Raleway,size=\normalsize}
% ====================
% Macros
% ====================
\newcommand{\samelineand}{\qquad}
% ====================
% Elements
% ====================
% List
\makeatletter
\def\@listi{\leftmargin\leftmarginii
\topsep 1ex % spacing before
\parsep 0\p@ \@plus\p@
\itemsep 0.5ex} % spacing between
\makeatother
% Itemize
\setbeamertemplate{itemize item}{\raise0.5ex \hbox{\vrule width 0.5ex height 0.5ex}}
\setbeamertemplate{itemize subitem}{\raise0.3ex \hbox{\vrule width 0.5ex height 0.5ex}}
\setbeamertemplate{itemize subsubitem}{\raise0.2ex \hbox{\vrule width 0.5ex height 0.5ex}}
% Enumerate
\setbeamertemplate{enumerate item}{\insertenumlabel.}
\setbeamertemplate{enumerate subitem}{\insertsubenumlabel.}
\setbeamertemplate{enumerate subsubitem}{\insertsubsubenumlabel.}
% Equation
\setlength\belowdisplayshortskip{2ex}
% Caption
\setbeamertemplate{caption}[numbered]
\setbeamertemplate{caption label separator}[period]
\setlength{\abovecaptionskip}{2ex}
\setlength{\belowcaptionskip}{1ex}
% Bibliography
\setbeamertemplate{bibliography item}[text]
% Navigation
\beamertemplatenavigationsymbolsempty
% ====================
% Components
% ====================
% Heading
\newcommand\heading[1]
{%
\par\bigskip
{\usebeamerfont{heading}\usebeamercolor[fg]{heading}#1}\par\smallskip
}
% logo
\newlength{\logoleftwidth}
\setlength{\logoleftwidth}{0cm}
\newlength{\logorightwidth}
\setlength{\logorightwidth}{0cm}
\newlength{\maxlogowidth} % space on both sides set to maxlogowidth to keep title centered
\setlength{\maxlogowidth}{0cm}
\newcommand{\logoright}[1]{
\newcommand{\insertlogoright}{#1}
\settowidth{\logorightwidth}{\insertlogoright}
\addtolength{\logorightwidth}{10ex}
\setlength{\maxlogowidth}{\maxof{\logoleftwidth}{\logorightwidth}}
}
\newcommand{\logoleft}[1]{
\newcommand{\insertlogoleft}{#1}
\settowidth{\logoleftwidth}{\insertlogoleft}
\addtolength{\logoleftwidth}{10ex}
\setlength{\maxlogowidth}{\maxof{\logoleftwidth}{\logorightwidth}}
}
% Headline
\setbeamertemplate{headline}
{
\begin{beamercolorbox}{headline}
\begin{columns}
\begin{column}{\maxlogowidth}
\vskip5ex
\ifdefined\insertlogoleft
\vspace*{\fill}
\hspace{10ex}
\raggedright
\insertlogoleft
\vspace*{\fill}
\else\fi
\end{column}
\begin{column}{\dimexpr\paperwidth-\maxlogowidth-\maxlogowidth}
\usebeamerfont{headline}
\vskip3ex
\centering
{\usebeamerfont{headline title}\usebeamercolor[fg]{headline title}\inserttitle\\[0.5ex]}
{\usebeamerfont{headline author}\usebeamercolor[fg]{headline author}\insertauthor\\[1ex]}
{\usebeamerfont{headline institute}\usebeamercolor[fg]{headline institute}\insertinstitute\\[1ex]}
\end{column}
\begin{column}{\maxlogowidth}
\vskip5ex
\ifdefined\insertlogoright
\vspace*{\fill}
\raggedleft
\insertlogoright
\hspace{10ex}
\vspace*{\fill}
\else\fi
\end{column}
\end{columns}
\vspace{5ex}
\ifbeamercolorempty[bg]{headline rule}{}{
\begin{beamercolorbox}[wd=\paperwidth,colsep=0.5ex]{headline rule}\end{beamercolorbox}
}
\end{beamercolorbox}
}
% Block
\setbeamertemplate{block begin}
{
\begin{beamercolorbox}[colsep*=0ex,dp=2ex,center]{block title}
\vskip0pt
\usebeamerfont{block title}\insertblocktitle
\vskip-1.25ex
\begin{beamercolorbox}[colsep=0.025ex]{block separator}\end{beamercolorbox}
\end{beamercolorbox}
{\parskip0pt\par}
\usebeamerfont{block body}
\vskip-0.5ex
\begin{beamercolorbox}[colsep*=0ex]{block body}
\justifying
\setlength{\parskip}{1ex}
\vskip-2ex
}
\setbeamertemplate{block end}
{
\end{beamercolorbox}
\vskip0pt
\vspace*{2ex}
}
% Alert Block
\setbeamertemplate{block alerted begin}
{
\begin{beamercolorbox}[colsep*=0ex,dp=2ex,center]{block alerted title}
\vskip0pt
\usebeamerfont{block title}\insertblocktitle
\vskip-1.25ex
\begin{beamercolorbox}[colsep=0.025ex]{block alerted separator}\end{beamercolorbox}
\end{beamercolorbox}
{\parskip0pt\par}
\usebeamerfont{block body}
\vskip-0.5ex
\begin{beamercolorbox}[colsep*=0ex]{block alerted body}
\justifying
\begin{adjustwidth}{1ex}{1ex}
\setlength{\parskip}{1ex}
\vskip-2ex
}
\setbeamertemplate{block alerted end}
{
\end{adjustwidth}
\vskip1ex
\end{beamercolorbox}
\vskip0pt
\vspace*{2ex}
}
% Footer
\newcommand{\footercontent}[1]{\newcommand{\insertfootercontent}{#1}}
\setbeamertemplate{footline}{
\ifdefined\insertfootercontent
\begin{beamercolorbox}[vmode]{headline}
\ifbeamercolorempty[bg]{headline rule}{}{
\begin{beamercolorbox}[wd=\paperwidth,colsep=0.25ex]{headline rule}\end{beamercolorbox}
}
\vspace{1.5ex}
\hspace{\sepwidth}
\usebeamerfont{footline}
\centering
\insertfootercontent
\hspace{\sepwidth}
\vspace{1.5ex}
\end{beamercolorbox}
\else\fi
}