-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbeamerthemesintef.sty
313 lines (273 loc) · 9.32 KB
/
beamerthemesintef.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
% Template for Sapienza presentations with LaTeX beamer.
%
% Adapted by Andrea Gasparini, [email protected] for
% Sapienza presentations.
%
% Original template by Federico Zenith, [email protected].
% Derived (through several iterations) from Håvard Berland's
% beamerthementnu class.
%
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
% TODO: remove top-right logo from title page
\ProvidesPackage{beamerthemesintef}[2021/11/02]
\RequirePackage{etoolbox}
\RequirePackage{tikz}
% Force 16:9 aspect ratio
\RequirePackage{geometry}
\geometry{paperwidth=16cm,paperheight=9cm}
% Caladea is a Cambria clone, Carlito a Calibri clone
\RequirePackage{caladea,carlito}
\renewcommand{\familydefault}{\sfdefault}
\RequirePackage{graphicx,sintefcolor}
% No navigation symbols
\setbeamertemplate{navigation symbols}{}
\newcommand{\@footlineauthor}{\insertauthor \enspace$\vert$\enspace}
\newcommand{\@footlinepayoff}{\@footlineauthor\inserttitle}
\newcommand{\footlinepayoff}[1]{\renewcommand{\@footlinepayoff}{#1}}
% Define footline content
\setbeamertemplate{footline}{%
\begin{beamercolorbox}[wd=\textwidth,ht=5mm,dp=3mm,rightskip=1cm,leftskip=1cm]{footline}
\insertframenumber/\inserttotalframenumber
\ifstrempty{\@footlinepayoff}{}{%
\usebeamerfont{footline}\hfill\@footlinepayoff
}
\end{beamercolorbox}
}
% Set footline AND coordinate blocks with it
\newcommand{\footlinecolor}[1]{% if #1 is empty, makes footline transparent
\ifstrempty{#1}{%
\footlinepayoff{}
\setbeamercolor{footline}{fg=darkgray, bg=}
\setbeamercolor{block title}{fg=white,bg=maincolor}
\setbeamercolor{block body}{fg=white,bg=maincolor}
}{
\footlinepayoff{\@footlineauthor\inserttitle}
\setbeamercolor{footline}{fg=white,bg=#1}
\setbeamercolor{block title}{fg=white,bg=#1}
\setbeamercolor{block body}{fg=white,bg=#1}
}%
}
\footlinecolor{} % Default: no footline
\pgfdeclareimage[width=0.09\paperwidth]{logo}{assets/logo_RGB}
\pgfdeclareimage[width=0.09\paperwidth]{whitelogo}{assets/logo_RGB_negative}
\newcommand{\@logo}{logo}
% Set colours
% NOTE! Beamer colors should be set in the preamble. It often works fine in the
% document itself, but NOT for normal text foreground.
% \themecolor should only be called from the preamble.
\newcommand{\themecolor}[1]{
\ifstrequal{#1}{main}{%
\setbeamercolor{footline}{fg=white}
\setbeamercolor{normal text}{fg=white,bg=maincolor}
\setbeamercolor{structure}{fg=white}
\renewcommand{\@logo}{whitelogo}
\setbeamercolor{block title}{fg=maincolor,bg=sintefgrey}
\setbeamercolor{block body}{fg=darkgray,bg=sintefgrey}
}{%
\setbeamercolor{footline}{fg=darkgray}
\setbeamercolor{normal text}{fg=darkgray,bg=white}
\setbeamercolor{structure}{fg=maincolor}
\renewcommand{\@logo}{logo}
\setbeamercolor{block title}{fg=white,bg=maincolor}
\setbeamercolor{block body}{fg=darkgray,bg=sintefgrey}
}
}
\themecolor{white} % Default: white theme
\setbeamercolor{title}{fg=maincolor,bg=white}
\setbeamercolor{alerted text}{fg=maincolor}
\setbeamercolor{author}{fg=black}
\setbeamercolor{date}{fg=black}
\setbeamerfont{author}{size=\small}
\setbeamerfont{date}{size=\small}
\setbeamerfont{title}{series=\bfseries}
\setbeamerfont{subtitle}{series=\mdseries,size=\small}
\setbeamerfont{frametitle}{series=\bfseries}
\setbeamerfont{framesubtitle}{series=\mdseries}
\setbeamerfont{footline}{size=\scriptsize}
\setbeamerfont{block title}{series=\centering\bfseries}
% Code to get prettier boxes
\setbeamertemplate{blocks}[rounded]
% Bullets in several levels
\setbeamertemplate{itemize item}{\textbullet}
\setbeamertemplate{itemize subitem}{\textemdash}
\setbeamertemplate{itemize subsubitem}{\ensuremath{\circ}}
\newenvironment{colorblock}[3][white]{%
\begingroup
\setbeamercolor{block title}{fg=#1,bg=#2}
\setbeamercolor{block body} {fg=#1,bg=#2}
\begin{block}{#3}
}{%
\end{block}
\endgroup
}
% Put the logo in each slide's top left area
\setbeamertemplate{headline}{\hspace{0.06\textwidth}\pgfuseimage{\@logo}}
% Define frame title and subtitle layout
\setbeamertemplate{frametitle}{%
\vspace*{-3.5ex}
\begin{beamercolorbox}[leftskip=2cm]{frametitle}%
\usebeamerfont{frametitle}\insertframetitle\\
\usebeamerfont{framesubtitle}\insertframesubtitle
\end{beamercolorbox}
}
\def\@courseLabel{}
\def\@IDnumber{}
\newcommand{\course}[1]{\def\@courseLabel{#1}}
\newcommand{\IDnumber}[1]{\def\@IDnumber{#1}}
% Define the title page
\setbeamertemplate{title page}{%
\vskip0pt plus 1filll%
% Reposition the box in an inelegant way - but it works!
\hspace{-12mm}
\vspace{20mm}
\begin{beamercolorbox}[wd=0.72\textwidth,sep=10pt,leftskip=8mm]{title}%
{\usebeamerfont{title}\inserttitle}
{\usebeamerfont{subtitle}\insertsubtitle}
{\usebeamerfont{subtitle}\@courseLabel}
{\usebeamerfont{author}\usebeamercolor[fg]{author}\textbf{\insertauthor} \ifdefempty{\@IDnumber}{}{(\@IDnumber)}}
{\usebeamerfont{date}\usebeamercolor[fg]{date}\insertdate}
\end{beamercolorbox}
}
% Define slide splitting dimensions (e.g. title and chapter slides)
\newcommand{\TikzSplitSlide}[1]{%
\rule{0.56\paperwidth}{0pt}%
\begin{tikzpicture}
\clip (-0.1\paperwidth,-0.5\paperheight) --
( 0.5\paperwidth,-0.5\paperheight) --
( 0.5\paperwidth, 0.5\paperheight) --
( 0.1\paperwidth, 0.5\paperheight) -- cycle;
\node at (0.2\paperwidth,0) {%
\includegraphics[height=\paperheight]{#1}%
};
\end{tikzpicture}
}
\newbool{splittitle}
\newcommand{\@TitleBackground}{}
\newcommand{\titlebackground}{\@ifstar{\SplitBackground}{\FullBackground}}
\newcommand{\FullBackground}[1]{\renewcommand{\@TitleBackground}{#1}}
\newcommand{\SplitBackground}[1]{%
\booltrue{splittitle}%
\renewcommand{\@TitleBackground}{#1}%
}
% Overwrite the maketitle command for the title page
\renewcommand{\maketitle}{
\begingroup
\ifdefempty{\@TitleBackground}{}{% Skip if \@TitleBackground is empty
\setbeamertemplate{background}{%
\ifbool{splittitle}{%
\TikzSplitSlide{\@TitleBackground}
}{% Normal, full-screen background
\includegraphics[height=\paperheight]{\@TitleBackground}
}
}
}
\begin{frame}%
\titlepage%
\end{frame}%
\endgroup
}
\makeatletter
\newenvironment{withoutheadline}{
\setbeamertemplate{headline}[default]
\def\beamer@entrycode{\vspace*{-\headheight}}
}{}
\makeatother
% Define chapter environment
\newenvironment{chapter}[3][]{% Args: image (optional), color, frame title
\begingroup
\themecolor{main}
\setbeamertemplate{footline}{}
\ifstrempty{#2}{
\setbeamercolor{frametitle}{fg=white}
\setbeamercolor{normal text}{fg=white,bg=maincolor}
}{
\setbeamercolor{frametitle}{fg=white}
\setbeamercolor{normal text}{fg=white,bg=#2}
}
\ifstrempty{#1}{}{\setbeamertemplate{background}{\TikzSplitSlide{#1}}}
\setbeamertemplate{frametitle}{%
\vspace*{8ex}
\begin{beamercolorbox}[wd=0.45\textwidth]{frametitle}
\usebeamerfont{frametitle}\insertframetitle\\
\usebeamerfont{framesubtitle}\insertframesubtitle
\end{beamercolorbox}
}
\begin{frame}{#3}
\hspace*{0.05\textwidth}%
\minipage{0.35\textwidth}%
\usebeamercolor[fg]{normal text}%
}{%
\endminipage
\end{frame}
\endgroup
}
% Define sidepic environment
\newenvironment{sidepic}[2]{% Args: image, frame title
\begingroup
\setbeamertemplate{background}{%
\hspace*{0.6\paperwidth}%
\includegraphics[height=\paperheight]{#1}%
}
\setbeamertemplate{frametitle}{% Same as normal, but with right skip
\vspace*{-3.5ex}
\begin{beamercolorbox}[leftskip=2cm,rightskip=0.4\textwidth]{frametitle}%
\usebeamerfont{frametitle}\insertframetitle\\
\usebeamerfont{framesubtitle}\insertframesubtitle
\end{beamercolorbox}
}
\begin{frame}{#2}
\minipage{0.6\textwidth}%
}{%
\endminipage
\end{frame}
\endgroup
}
% Define backmatter
\newcommand{\backmatter}[1][]{
\begingroup
\themecolor{main}
\begin{frame}[c]
\centering
\begin{minipage}{\textwidth}
\usebeamercolor[fg]{normal text}
\centering
\ifstrequal{#1}{notitle}{}{
\Huge \inserttitle
\vspace{5mm}
}
\Large \textsl{\\Thank you for listening! \\ Any questions?}
\end{minipage}
\end{frame}
\endgroup
}
% Define sectioning and table of contents
\AtBeginSection[]
{
\begingroup
\themecolor{main}
\begin{frame}{Table of Contents}
\tableofcontents[currentsection]
\end{frame}
\endgroup
}
% style of section presented in the table of contents
\setbeamertemplate{section in toc}{$\blacktriangleright$~\inserttocsection}
% automate subtitle of each frame
\makeatletter
\pretocmd\beamer@checkframetitle{\framesubtitle{\thesection \, \secname}}
\makeatother
% avoid numbering of frames that are breaked into multiply slides
\setbeamertemplate{frametitle continuation}{}
%参考文献设置