summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tuda-ci/beamerinnerthemeTUDa.sty
blob: 386c71615ce703438597d9bf4c71232b93a009e1 (plain)
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
%% This is file `beamerinnerthemeTUDa.sty' version 2.08 (2020/02/10),
%% it is part of
%% TUDa-CI -- Corporate Design for TU Darmstadt
%% ----------------------------------------------------------------------------
%%
%%  Copyright (C) 2018--2020 by Marei Peischl <marei@peitex.de>
%%
%% ============================================================================
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2008/05/04 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainers of this work are
%%   Marei Peischl <tuda-ci@peitex.de>
%%   Markus Lazanowski <latex@ce.tu-darmstadt.de>
%%
%% The development respository can be found at
%% https://github.com/tudace/tuda_latex_templates
%% Please use the issue tracker for feedback!
%%
%% ============================================================================
%%
\def\fileversion{2.08}
\def\filedate{2020/02/10}
%% This is file `beamerinnerthemeTUDa.sty' version 1.11 (2019/10/15),
%% it is part of
%% TUDa-CI -- Corporate Design for TU Darmstadt
%% ----------------------------------------------------------------------------
%%
%%  Copyright (C) 2018--2019 by Marei Peischl <marei@peitex.de>
%%
%% ============================================================================
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2008/05/04 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainers of this work are
%%   Marei Peischl <tuda-ci@peitex.de>
%%   Markus Lazanowski <latex@ce.tu-darmstadt.de>
%%
%% The development respository can be found at
%% https://github.com/tudace/tuda_latex_templates
%% Please use the issue tracker for feedback!
%%
%% ============================================================================
%%
\def\fileversion{1.11}
\def\filedate{2019/10/15}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerinnerthemeTUDa}
 [\filedate\space\fileversion]

\RequirePackage{l3keys2e}

\mode<presentation>

\RequirePackage{trimclip}


\ExplSyntaxOn
\keys_define:nn {TUDa/beamer/inner} {
	authorontitle .bool_gset:N = \g_TUDa_authorontitle_bool,
	authorontitle .initial:n = false,
	authorontitle .default:n = true
}
\ProcessKeysOptions{TUDa/beamer/inner}

\box_new:N \l_TUDa_titlegraphic_box


\RenewDocumentCommand{\titlegraphic}{sm}{
	\IfBooleanTF{#1}{
		\def\inserttitlegraphic{
			\hbox_set:Nn \l_TUDa_titlegraphic_box {\raisebox{\depth}{#2}}
			\box_resize_to_wd:Nn \l_TUDa_titlegraphic_box {\width}
			\dim_compare:nTF {\box_ht:N \l_TUDa_titlegraphic_box - \l_TUDa_titlegraphic_ht_dim > \c_zero_dim}
			{
				\dim_set:Nn \l_tmpa_dim {.5\box_ht:N \l_TUDa_titlegraphic_box - .5\l_TUDa_titlegraphic_ht_dim}
				\clipbox{0pt~\dim_eval:n{\l_tmpa_dim}~0pt~\dim_eval:n{\l_tmpa_dim}}{\box_use:N \l_TUDa_titlegraphic_box}
			}{
				\box_resize_to_ht:Nn \l_TUDa_titlegraphic_box {\l_TUDa_titlegraphic_ht_dim}
				\dim_set:Nn \l_tmpa_dim {(\box_wd:N \l_TUDa_titlegraphic_box - \width) / 2}
				\clipbox{\dim_eval:n{\l_tmpa_dim}~0pt~\dim_eval:n{\l_tmpa_dim}~0pt}{\box_use:N \l_TUDa_titlegraphic_box}
			}
		}
	}{
		\def\inserttitlegraphic{#2}
	}
}


\box_new:N \l_TUDa_titlehead_box

\dim_new:N \l_TUDa_titlegraphic_ht_dim
\dim_new:N \l_TUDa_titlegraphic_wd_dim

\defbeamertemplate*{title~ page}{TUDa}[1][]
{
	\nointerlineskip
	\vspace{\dim_eval:n {-\c_TUDa_largerule_dim}}
	\hbox_set:Nn \l_TUDa_titlehead_box {
	\parbox{\dimexpr\TUDa@beamer@linewidth+2\TUDa@beamer@extraindent}{%
	\begin{beamercolorbox}[
		wd=\linewidth,
		sep=\TUDa@beamer@logosep,
	]{title}
	\raggedright
	\usebeamerfont{title}
	\skip_horizontal:n {1ex}
	\strut\parbox[t]{\dimexpr\linewidth- \wd\TUDa@logobox-2ex\relax}{
		\inserttitle
		\par
	}
	\hspace{\fill}\raisebox{\dimexpr-\height+\ht\strutbox\relax}{\usebox\TUDa@logobox}
	\ifx\insertsubtitle\@empty
	\else
	\par\vspace{\c_TUDa_largerule_dim}
	\skip_horizontal:n {1ex}\parbox[t]{\dimexpr\linewidth- \wd\TUDa@logobox-2ex\relax}{
		\usebeamerfont{subtitle}\insertsubtitle
	}
	\fi
	\end{beamercolorbox}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% bool if authorontrile
\bool_if:NT \g_TUDa_authorontitle_bool {
\par\nointerlineskip
\begin{beamercolorbox}[
	wd=\linewidth,ht=\c_TUDa_smallrule_dim,dp=\z@]{smallrule}
\end{beamercolorbox}
\par\nointerlineskip
	\begin{beamercolorbox}[
	wd=\linewidth,
	sep=\c_TUDa_largerule_dim,
	]{title}
	\raggedright
	\skip_horizontal:n {1ex}
	\parbox[t]{\dimexpr\linewidth-2ex\relax}{
		\ifx\insertauthor\@empty
		\else
		\usebeamercolor[fg]{author}\usebeamerfont{author}\insertauthor\par
		\fi
		\ifx\insertauthor\@empty
		\else
		\usebeamercolor[fg]{institute}\usebeamerfont{institute}\insertinstitute
		\fi
	}
\end{beamercolorbox}
}
	}
	}
	\box_use:N \l_TUDa_titlehead_box
\nointerlineskip\begin{beamercolorbox}[
	wd=\dimexpr\TUDa@beamer@linewidth+2\TUDa@beamer@extraindent,ht=\c_TUDa_smallrule_dim,dp=\z@]{smallrule}
	\end{beamercolorbox}
	\dim_set:Nn \l_TUDa_titlegraphic_ht_dim {\textheight-\box_ht:N\l_TUDa_titlehead_box-\box_dp:N \l_TUDa_titlehead_box
	+\c_TUDa_largerule_dim-.5\c_TUDa_rulesep_dim-\c_TUDa_smallrule_dim}
	\let\height\l_TUDa_titlegraphic_ht_dim
	\dim_set:Nn \l_TUDa_titlegraphic_wd_dim{\TUDa@beamer@linewidth+2\TUDa@beamer@extraindent}
	\let\width\l_TUDa_titlegraphic_wd_dim
	\nointerlineskip
	\begin{beamercolorbox}[wd=\width,center]{titlegraphic}
	\raisebox{-\c_TUDa_largerule_dim}[\dim_eval:n {\height-\c_TUDa_largerule_dim}][0pt]{\inserttitlegraphic}
	\end{beamercolorbox}
}


\ExplSyntaxOff
% Blocks


\defbeamertemplate*{block begin}{TUDa}
{
	\par\vskip\medskipamount%
	\begin{beamercolorbox}[ wd=\dimexpr\linewidth+2\TUDa@beamer@extraindent,sep=.5pt,
		leftskip=\dimexpr\ifdim\TUDa@beamer@extraindent>\z@\TUDa@beamer@extraindent-\beamer@colbox@sep\else\z@\fi]{block title}
	\ifx\insertblocktitle\@empty
	\else
	\begin{beamercolorbox}[colsep=.75ex,
		 wd=\dimexpr\linewidth-1pt\relax]{block title}
		\usebeamerfont*{block title}\insertblocktitle%
	\end{beamercolorbox}%
	\ifbeamercolorempty[bg]{block title}
	{}
	{\ifbeamercolorempty[bg]{block body}{}{\par\nointerlineskip\vskip-0.5pt}}%
	\leavevmode
	\fi
	\begin{beamercolorbox}[colsep=.75ex,vmode, wd=\dimexpr\linewidth-1pt\relax]{block body}%
		\usebeamerfont{block body}%
		\ifbeamercolorempty[bg]{block body}{\vskip-.25ex}{\vskip-.75ex}\vbox{}%
	}

\defbeamertemplate*{block end}{TUDa}
	{\end{beamercolorbox}\end{beamercolorbox}\vskip\smallskipamount}

\defbeamertemplate*{block alerted begin}{TUDa}
{
	\par\vskip\medskipamount%
	\begin{beamercolorbox}[
		wd=\dimexpr\linewidth+2\TUDa@beamer@extraindent,
		sep=1.5pt,
		leftskip=\dimexpr\ifdim\TUDa@beamer@extraindent>\z@\TUDa@beamer@extraindent-\beamer@colbox@sep\else\z@\fi,
	]{block frame alerted}
	\ifx\insertblocktitle\@empty
	\else
	\begin{beamercolorbox}[wd={\dimexpr\linewidth-3pt},colsep=.75ex]{block title alerted}
		\usebeamerfont*{block title alerted}\insertblocktitle%
	\end{beamercolorbox}%
	\vskip1.5pt\par\nointerlineskip
	\fi
	\leavevmode
	\usebeamerfont{block body alerted}%
	\begin{beamercolorbox}[wd={\dimexpr\linewidth-3pt},colsep=.75ex]{block body alerted}%
	}

\defbeamertemplate*{block alerted end}{TUDa}
	{\end{beamercolorbox}\end{beamercolorbox}\vskip\smallskipamount}


\defbeamertemplate*{block example begin}{TUDa}
{
	\par\vskip\medskipamount%
	\begin{beamercolorbox}[
		wd=\dimexpr\linewidth+2\TUDa@beamer@extraindent,
		sep=1.5pt,
		leftskip=\dimexpr\ifdim\TUDa@beamer@extraindent>\z@\TUDa@beamer@extraindent-\beamer@colbox@sep\else\z@\fi,
		]{block frame example}
	\ifx\insertblocktitle\@empty
	\else
	\begin{beamercolorbox}[wd={\dimexpr\linewidth-3pt},colsep=.75ex]{block title example}
		\usebeamerfont*{block title example}\insertblocktitle%
	\end{beamercolorbox}%
\vskip1.5pt\par\nointerlineskip
	\fi
	\leavevmode
	\usebeamerfont{block body example}%
	\begin{beamercolorbox}[wd={\dimexpr\linewidth-3pt},colsep=.75ex]{block body example}%
	}
\defbeamertemplate*{block example end}{TUDa}
	{\end{beamercolorbox}\end{beamercolorbox}\vskip\smallskipamount}

%Itemize Items
\defbeamertemplate*{itemize item}{TUDa}{\usebeamerfont*{itemize item}\raise\dimexpr.4\ht\strutbox-.4ex\hbox{\rule{.8ex}{.8ex}}}
\defbeamertemplate*{itemize subitem}{TUDa}{\usebeamerfont*{itemize item}\setlength{\fboxsep}{\z@}\setlength{\fboxrule}{1pt}\raise\dimexpr.4\ht\strutbox-.2ex-\fboxrule\hbox{\fbox{\color{bg}\rule{.4ex}{.4ex}}}}
\defbeamertemplate*{itemize subsubitem}{TUDa}{\usebeamerfont*{itemize subitem}\hbox{--}}

\mode<all>

\endinput