Debian Codegraph @

texmf-dist/source/latex/beamertheme-trigon/beamerinnerthemetrigon.dtx

raw
1 % \iffalse meta-comment -------------------------------------------------------
2 % Copyright (C) 2021 Thomas Lambert <[email protected]>
3 % Other contributors to this theme are listed here:
4 % https://gitlab.com/thlamb/beamertheme-trigon/-/graphs/master
5 %
6 % The original template was heavily inspired by Metropolis from Matthias
7 % Vogelgesang.
8 %
9 % License CC-BY-SA 4.0
10 % This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
11 % International License (https://creativecommons.org/licenses/by-sa/4.0/)
12 % ------------------------------------------------------------------------- \fi
13 % \iffalse
14 %<*package>
15 \NeedsTeXFormat{LaTeX2e}
16 \ProvidesPackage{beamerinnerthemetrigon}[2023/02/20 v0.7.0 Trigon inner theme]
17 %</package>
18 % \fi
19 % \CheckSum{0}
20 % \StopEventually{}
21 % \iffalse
22 %<*package>
23 % ------------------------------------------------------------------------- \fi
24 %
25 % \subsection{\themename inner theme}
26 %
27 % A |beamer| inner theme dictates the style of the frame elements traditionally
28 % set in the ``body'' of each slide. These include:
29 %
30 % \begin{itemize}
31 % \item title, part, and section pages;
32 % \item main background elements;
33 % \item itemize, enumerate, and description environments;
34 % \item block environments including theorems and proofs;
35 % \item figures and tables; and
36 % \item footnotes and plain text.
37 % \end{itemize}
38 %
39 % \subsubsection{Package dependencies}
40 %
41 % \begin{macrocode}
42 \RequirePackage{pgfopts}
43 \RequirePackage{tikz}
44 \usetikzlibrary{calc,3d}
45 % \end{macrocode}
46 %
47 % \subsubsection{Definitions}
48 %
49 % We define the command |\biglogo| to specify the logo that needs to be
50 % displayed on the title frame. This command is just a replacement for
51 % |\includegraphics|, so it accepts the same options.
52 % \begin{macrocode}
53 \def\logbig{}
54 \newcommand*\biglogo[2][width=0.28\textwidth]{
55 \ifx#2\@empty\else
56 \edef\logbig{\includegraphics[#1]{#2}}
57 \fi
58 }
59 % \end{macrocode}
60 %
61 % \subsubsection{Options}
62 %
63 % \begin{macro}{sectionpage}
64 % Controls whereas a slide with the section title should be inserted at the
65 % beginning of the section or not.
66 % \begin{macrocode}
67 \pgfkeys{
68 /trigon/inner/sectionpage/.cd,
69 .is choice,
70 none/.code=\trigon@disablesectionpage,
71 simple/.code=\trigon@enablesectionpage
72 }
73 % \end{macrocode}
74 % \end{macro}
75 %
76 % \begin{macro}{slidestyle}
77 % Controls the layout that should be used for regular slides.
78 % \begin{macrocode}
79 \def\slidestyle{}
80 \pgfkeys{
81 /trigon/inner/slidestyle/.cd,
82 .is choice,
83 blank/.code=\def\slidestyle{blank}
84 \setbeamertemplate{background}[\slidestyle],
85 style1/.code=\def\slidestyle{smallcornertriangle}
86 \setbeamertemplate{background}[\slidestyle],
87 cyber/.code=\def\slidestyle{cyberbottom}
88 \setbeamertemplate{background}[\slidestyle]
89 }
90 % \end{macrocode}
91 % \end{macro}
92 %
93 % \begin{macro}{titlestyle}
94 % Controls the layout that should be used for the title page.
95 % \begin{macrocode}
96 \def\titlestyle{}
97 \pgfkeys{
98 /trigon/inner/titlestyle/.cd,
99 .is choice,
100 plain/.code=\def\titlestyle{bottomtrianglescolor},
101 style1/.code=\def\titlestyle{titlesmallimage},
102 style2/.code=\def\titlestyle{titlebigimage}
103 }
104 % \end{macrocode}
105 % \end{macro}
106 %
107 % \begin{macro}{sectionstyle}
108 % Controls the layout that should be used for the title page.
109 % \begin{macrocode}
110 \def\sectionstyle{}
111 \pgfkeys{
112 /trigon/inner/sectionstyle/.cd,
113 .is choice,
114 plain/.code=\def\sectionstyle{bottomtrianglescolor},
115 style1/.code=\def\sectionstyle{bigtriangles},
116 style2/.code=\def\sectionstyle{lefttriangles},
117 style3/.code=\def\sectionstyle{bottomtrianglesbw}
118 }
119 % \end{macrocode}
120 % \end{macro}
121 %
122 %
123 % \begin{macro}{\trigon@inner@setdefaults}
124 % Sets default values for the inner theme options.
125 % \begin{macrocode}
126 \newcommand{\trigon@inner@setdefaults}{
127 \pgfkeys{/trigon/inner/.cd,
128 sectionpage=simple,
129 slidestyle=blank,
130 titlestyle=style2,
131 sectionstyle=plain
132 }
133 }
134 % \end{macrocode}
135 % \end{macro}
136 %
137 % \subsubsection{Backgrounds}
138 %
139 % First of all, we define a few commands in order easily create the triangles
140 % used as the main design elements of the theme. All these are defined with
141 % respect to the |\paperwidth| and |\paperheight| of the document, so that it
142 % fits the different aspect ratio possible.
143 %
144 % \begin{macro}{\leftTriangle}
145 % Defines a triangle with the base on the left side (pointing right).
146 % \begin{macrocode}
147 \newcommand{\leftTriangle}[2]{
148 (#1,#2)
149 -- (0,{#2 + tan(30)*#1} )
150 -- (0,{#2 - tan(30)*#1} )
151 -- cycle;
152 }
153 % \end{macrocode}
154 % \end{macro}
155 %
156 % \begin{macro}{\righTriangle}
157 % Defines a triangle with the base on the right side (pointing left).
158 % \begin{macrocode}
159 \newcommand{\rightTriangle}[2]{
160 (#1,#2)
161 -- (\the\paperwidth,{#2 + tan(30)*(\the\paperwidth-#1)} )
162 -- (\the\paperwidth,{#2 - tan(30)*(\the\paperwidth-#1)} )
163 -- cycle;
164 }
165 % \end{macrocode}
166 % \end{macro}
167 %
168 % \begin{macro}{\topTriangle}
169 % Defines a triangle with the base on the bottom side (pointing top).
170 % \begin{macrocode}
171 \newcommand{\topTriangle}[2]{
172 (#1,#2)
173 -- ({#1 - tan(60)*#2},0)
174 -- ({#1 + tan(60)*#2},0)
175 -- cycle;
176 }
177 % \end{macrocode}
178 % \end{macro}
179 %
180 % \begin{macro}{\leftColorTriangle}
181 % Defines a colored triangle with the base on the left side (pointing right).
182 % \begin{macrocode}
183 \newcommand{\leftColorTriangle}[3]{
184 \clip(0,0) rectangle(\the\paperwidth,\the\paperheight);
185 \path[fill=#3]
186 \leftTriangle{#1}{#2}
187 }
188 % \end{macrocode}
189 % \end{macro}
190 %
191 % \begin{macro}{\righColorTriangle}
192 % Defines a colored triangle with the base on the right side (pointing left).
193 % \begin{macrocode}
194 \newcommand{\rightColorTriangle}[3]{
195 \clip(0,0) rectangle(\the\paperwidth,\the\paperheight);
196 \path[fill=#3]
197 \rightTriangle{#1}{#2}
198 }
199 % \end{macrocode}
200 % \end{macro}
201 %
202 % \begin{macro}{\topColorTriangle}
203 % Defines a colored triangle with the base on the bottom side (pointing top).
204 % \begin{macrocode}
205 \newcommand{\topColorTriangle}[3]{
206 \clip(0,0) rectangle(\the\paperwidth,\the\paperheight);
207 \path[fill=#3]
208 \topTriangle{#1}{#2}
209 }
210 % \end{macrocode}
211 % \end{macro}
212 %
213 %
214 % We then define the different backgrounds choices.
215 %
216 % \begin{macro}{blank}
217 % Blank slide background.
218 % \begin{macrocode}
219 \defbeamertemplate{background}{blank}{}
220 % \end{macrocode}
221 % \end{macro}
222 %
223 % \begin{macro}{smallcornertriangle}
224 % Background with a small triangle in bottom left corner (used for normal
225 % frames when the appropriate option is selected).
226 % \begin{macrocode}
227 \defbeamertemplate{background}{smallcornertriangle}{
228 \begin{tikzpicture}[blend group=multiply]
229 \useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
230 \leftColorTriangle{0.62\paperwidth}{0}{tGrey!30!tBg}
231 \end{tikzpicture}
232 }
233 % \end{macrocode}
234 % \end{macro}
235 %
236 % \begin{macro}{cyberbottom}
237 % Background with "mesh" effect on the bottom left corner (used for normal
238 % frames when the appropriate option is selected).
239 % \begin{macrocode}
240 \defbeamertemplate{background}{cyberbottom}{
241 \tikzstyle{cyberVertex}=[scale=1,draw=tGreyBg,circle,fill=tBg]
242 \tikzstyle{cyberVertex2}=[scale=0.5,draw=tGreyBg,circle,fill=tGreyBg]
243 \tikzstyle{cyberEdge} = [draw,color=tGreyBg]
244 \begin{tikzpicture}%[blend group=multiply]
245 \useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
246 \foreach \pos/\name in {
247 {(-0.05\paperwidth,0.75\paperheight)/0},
248 {(0.02\paperwidth,0.53\paperheight)/1},
249 {(-0.04\paperwidth,0.38\paperheight)/2},
250 {(0.08\paperwidth,0.40\paperheight)/3},
251 {(0.052\paperwidth,0.21\paperheight)/5},
252 {(0.24\paperwidth,0.26\paperheight)/6},
253 {(-0.08\paperwidth,-0.06\paperheight)/7},
254 {(0.12\paperwidth,0.07\paperheight)/8},
255 {(0.2\paperwidth,0.-0.08\paperheight)/9},
256 {(0.38\paperwidth,0.06\paperheight)/10},
257 {(0.56\paperwidth,-0.08\paperheight)/11}}
258 \node[cyberVertex] (\name) at \pos {};
259 \foreach \pos/\name in {
260 {(-0.05\paperwidth,0.75\paperheight)/0},
261 {(0.02\paperwidth,0.53\paperheight)/1},
262 {(-0.04\paperwidth,0.38\paperheight)/2},
263 {(0.08\paperwidth,0.40\paperheight)/3},
264 {(0.052\paperwidth,0.21\paperheight)/5},
265 {(0.24\paperwidth,0.26\paperheight)/6},
266 {(-0.08\paperwidth,-0.06\paperheight)/7},
267 {(0.12\paperwidth,0.07\paperheight)/8},
268 {(0.2\paperwidth,0.-0.08\paperheight)/9},
269 {(0.38\paperwidth,0.06\paperheight)/10},
270 {(0.56\paperwidth,-0.08\paperheight)/11}}
271 \node[cyberVertex2] (\name_2) at \pos {};
272 \foreach \source/ \dest in
273 {0/1,1/2,1/3,2/3,2/5,3/5,3/6,5/6,5/7,7/8,5/8,8/6,8/9,6/9,9/10,10/6,10/11}
274 \path[cyberEdge] (\source) -- (\dest);
275 \end{tikzpicture}
276 }
277 % \end{macrocode}
278 % \end{macro}
279 %
280 % \begin{macro}{titlebigimage}
281 % Background for title page with a big image in the top left corener.
282 % \begin{macrocode}
283 \defbeamertemplate{background}{titlebigimage}{
284 \begin{tikzpicture}
285 \useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
286 \begin{scope}[blend group=multiply]
287 \clip(0,0) rectangle(\the\paperwidth,\the\paperheight);
288 \path[fill=tTheme]\leftTriangle{0.5\paperwidth}{0}
289 \topColorTriangle{0.73\paperwidth}{0.70\paperheight}{tGrey!30!tBg}
290 \ifx\inserttitlegraphic\@empty
291 \leftColorTriangle{0.73\paperwidth}{0.70\paperheight}{tTheme}
292 \else
293 \path[clip]\leftTriangle{0.73\paperwidth}{0.70\paperheight}
294 \node[anchor=north west, inner sep=0pt, outer sep=0pt] at (0,\the\paperheight) {\inserttitlegraphic};
295 \fi
296 \end{scope}
297 \clip(0,0) rectangle(\the\paperwidth,\the\paperheight);
298 \path[fill=tBg]\rightTriangle{0.45\paperwidth}{\the\paperheight}
299 \ifx\logbig\@empty \else
300 \node[anchor=north east,inner sep=0mm] at
301 (.96*\the\paperwidth,.96*\the\paperheight) {\logbig};
302 \fi
303 \end{tikzpicture}
304 }
305 % \end{macrocode}
306 % \end{macro}
307 %
308 % \begin{macro}{titlesmallimage}
309 % Background for the titlepage with a small image in the top left corner.
310 % \begin{macrocode}
311 \defbeamertemplate{background}{titlesmallimage}{
312 \begin{tikzpicture}[blend group=multiply]
313 \useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
314 \leftColorTriangle{0.58\paperwidth}{0}{tGrey!30!tBg}
315 \ifx\logbig\@empty \else
316 \node[anchor=north east,inner sep=0mm] at
317 (.94*\the\paperwidth,.94*\the\paperheight) {\logbig};
318 \fi
319 \ifx\inserttitlegraphic\@empty
320 \leftColorTriangle{0.58\paperwidth}{\the\paperheight}{tTheme}
321 \else
322 \path[clip]\leftTriangle{0.58\paperwidth}{\the\paperheight}
323 \node[anchor=north west, inner sep=0pt, outer sep=0pt] at (0,\the\paperheight) {\inserttitlegraphic};
324 \fi
325 \end{tikzpicture}
326 }
327 % \end{macrocode}
328 % \end{macro}
329 %
330 % \begin{macro}{bottomtrianglescolor}
331 % Background for title/section pages with two colored triangles in the bottom.
332 % \begin{macrocode}
333 \defbeamertemplate{background}{bottomtrianglescolor}{
334 \begin{tikzpicture}[blend group=multiply]
335 \useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
336 \leftColorTriangle{0.62\paperwidth}{0}{tTheme}
337 \rightColorTriangle{0.38\paperwidth}{0}{tSec}
338 \end{tikzpicture}
339 }
340 % \end{macrocode}
341 % \end{macro}
342 %
343 % \begin{macro}{bottomtrianglesbw}
344 % Background for title/section pages with two black and white triangles in the
345 % bottom.
346 % \begin{macrocode}
347 \defbeamertemplate{background}{bottomtrianglesbw}{
348 \begin{tikzpicture}[blend group=multiply]
349 \useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
350 \leftColorTriangle{0.62\paperwidth}{0}{tTheme}
351 \rightColorTriangle{0.38\paperwidth}{0}{tGrey!30!tBg}
352 \end{tikzpicture}
353 }
354 % \end{macrocode}
355 % \end{macro}
356 %
357 % \begin{macro}{bigtriangles}
358 % Background for section pages with a big triangle on the left.
359 % \begin{macrocode}
360 \defbeamertemplate{background}{bigtriangles}{
361 \begin{tikzpicture}[blend group=multiply]
362 \useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
363 \leftColorTriangle{0.80\paperwidth}{0.62\paperheight}{tTheme}
364 \rightColorTriangle{0.68\paperwidth}{0.58\paperheight}{tGrey!30!tBg}
365 \end{tikzpicture}
366 }
367 % \end{macrocode}
368 % \end{macro}
369 %
370 % \begin{macro}{lefttriangles}
371 % Background for section pages with small triangles on the left.
372 % \begin{macrocode}
373 \defbeamertemplate{background}{lefttriangles}{
374 \begin{tikzpicture}[blend group=multiply]
375 \useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
376 \leftColorTriangle{0.52\paperwidth}{\the\paperheight}{tTheme}
377 \leftColorTriangle{0.775\paperwidth}{0}{tGrey!30!tBg}
378 \end{tikzpicture}
379 }
380 % \end{macrocode}
381 % \end{macro}
382 %
383 % Before anything, the regular frame background is selected.
384 % \begin{macrocode}
385 \setbeamertemplate{background}[\slidestyle]
386 % \end{macrocode}
387 %
388 % Finally, we need to set the backgrounds properly before creating the different
389 % frames, create the special frames (title, section) and restore the regular
390 % background afterwards.
391 %
392 % \begin{macro}{\titleframe}
393 % Sets the titleframe.
394 % \begin{macrocode}
395 \newcommand{\titleframe}{
396 \setbeamertemplate{title page}[\titlestyle]
397 \setbeamertemplate{background}[\titlestyle]
398 \frame[plain,noframenumbering]{\titlepage}
399 \setbeamertemplate{background}[\slidestyle]
400 }
401 % \end{macrocode}
402 % \end{macro}
403 %
404 % \begin{macro}{\sectionframe}
405 % Sets the titleframe.
406 % \begin{macrocode}
407 \newcommand{\sectionframe}{
408 \setbeamertemplate{section page}[\sectionstyle]
409 \setbeamertemplate{background}[\sectionstyle]
410 \frame[plain,noframenumbering]{\sectionpage}
411 \setbeamertemplate{background}[\slidestyle]
412 }
413 \newcommand{\trigon@disablesectionpage}{
414 \AtBeginSection{
415 % intentionally empty
416 }
417 }
418 \newcommand{\trigon@enablesectionpage}{
419 \AtBeginSection{
420 \sectionframe
421 }
422 }
423 % \end{macrocode}
424 % \end{macro}
425 %
426 %
427 % \subsubsection{Layout}
428 % The following macros define the proper position of the various elements of the
429 % frame, so the fit nicely with the different background selected.
430 %
431 % \begin{macro}{titlebigimage}
432 % Place the text on the title frame with a big image on the top left side.
433 % \begin{macrocode}
434 \defbeamertemplate{title page}{titlebigimage}
435 {
436 \vskip135pt
437 \begin{flushright}
438 \begin{minipage}[t][][c]{0.5\textwidth}%
439 \centering
440 \usebeamerfont{title}\usebeamercolor[fg]{title}
441 \inserttitle\par
442 \end{minipage}
443 \ifx \insertsubtitle\@empty
444 \else
445 \vskip15pt
446 \begin{minipage}[t][][c]{0.5\textwidth}%
447 \centering
448 \usebeamerfont{subtitle}\insertsubtitle\par%
449 \end{minipage}
450 \fi
451 \vskip13pt
452 \begin{minipage}[t][][c]{0.5\textwidth}%
453 \centering
454 \usebeamerfont{author}\insertauthor%
455 \vskip5pt
456 \usebeamerfont{date}\insertdate%
457 \end{minipage}
458 \end{flushright}
459 \vfill
460 }
461 % \end{macrocode}
462 % \end{macro}
463 %
464 % \begin{macro}{titlesmallimage}
465 % Place the text on the title frame with a small image on the top left side.
466 % \begin{macrocode}
467 \defbeamertemplate{title page}{titlesmallimage}
468 {
469 \vskip140pt%
470 \begin{beamercolorbox}[wd=\textwidth,sep=4pt]{title page header}
471 \usebeamerfont{title}\usebeamercolor[fg]{title}\inserttitle\par%
472 \end{beamercolorbox}%
473 \ifx \insertsubtitle\@empty
474 \else
475 \vskip8pt
476 \begin{beamercolorbox}[wd=\textwidth,sep=4pt]{subtitle page header}
477 \usebeamerfont{subtitle}\insertsubtitle\par%
478 \end{beamercolorbox}%
479 \fi
480 \vskip10pt
481 \begin{beamercolorbox}[wd=\textwidth,sep=4pt]{author}
482 \usebeamerfont{author}\insertauthor%
483 \end{beamercolorbox}
484 \vskip2pt%
485 \begin{beamercolorbox}[wd=\textwidth,sep=4pt]{date}
486 \usebeamerfont{date}\insertdate%
487 \end{beamercolorbox}
488 \vfill
489 }
490 % \end{macrocode}
491 % \end{macro}
492 %
493 % \begin{macro}{bottomtrianglescolor}
494 % Place the text on the title frame with two triangles on the bottom.
495 % \begin{macrocode}
496 \defbeamertemplate{title page}{bottomtrianglescolor}
497 {
498 \vskip0pt
499 \begin{center}
500 \begin{minipage}[t][][t]{\textwidth}
501 \centering%
502 \ifx\logbig\@empty \else
503 \logbig
504 \fi
505 \end{minipage}
506 \vskip15pt
507 \begin{minipage}[t][][c]{\textwidth}%
508 \centering
509 \usebeamerfont{title}\usebeamercolor[fg]{title}
510 \inserttitle\par
511 \end{minipage}
512 \ifx \insertsubtitle\@empty
513 \else
514 \vskip15pt
515 \begin{minipage}[t][][c]{\textwidth}%
516 \centering
517 \usebeamerfont{subtitle}\insertsubtitle\par%
518 \end{minipage}
519 \fi
520 \vskip20pt
521 \begin{minipage}[t][][c]{0.5\textwidth}%
522 \centering
523 \usebeamerfont{author}\insertauthor\\[0.3cm]%
524 \usebeamerfont{date}\insertdate
525 \end{minipage}
526 \end{center}
527 \vfill
528 }
529 % \end{macrocode}
530 % \end{macro}
531 %
532 % \begin{macro}{bottomtrianglescolor}
533 % Place the text on the section frame with two colored triangles on the
534 % bottom.
535 % \begin{macrocode}
536 \defbeamertemplate{section page}{bottomtrianglescolor}
537 {
538 \vskip40pt
539 \begin{center}
540 \begin{minipage}[t][][c]{\textwidth}%
541 \centering
542 \usebeamerfont{section title}\usebeamercolor[fg]{title}
543 \insertsectionhead\par
544 \end{minipage}
545 \end{center}
546 \vfill
547 }
548 % \end{macrocode}
549 % \end{macro}
550 %
551 % \begin{macro}{bottomtrianglesbw}
552 % Place the text on the section frame with two black and white triangles on
553 % the bottom.
554 % \begin{macrocode}
555 \defbeamertemplate{section page}{bottomtrianglesbw}
556 {
557 \vskip40pt
558 \begin{center}
559 \begin{minipage}[t][][c]{\textwidth}%
560 \centering
561 \usebeamerfont{section title}\usebeamercolor[fg]{title}
562 \insertsectionhead\par
563 \end{minipage}
564 \end{center}
565 \vfill
566 }
567 % \end{macrocode}
568 % \end{macro}
569 %
570 % \begin{macro}{bigtriangles}
571 % Place the text on the section frame with two big triangles.
572 % \begin{macrocode}
573 \defbeamertemplate{section page}{bigtriangles}
574 {
575 \vskip200pt
576 \begin{flushright}
577 \begin{minipage}[t]{0.62\textwidth}%7
578 \usebeamerfont{section title}\usebeamercolor[fg]{title}
579 \raggedleft
580 \insertsectionhead\par
581 \end{minipage}
582 \end{flushright}
583 \vfill
584 }
585 % \end{macrocode}
586 % \end{macro}
587 %
588 % \begin{macro}{lefttriangles}
589 % Place the text on the section frame with two small left triangles.
590 % \begin{macrocode}
591 \defbeamertemplate{section page}{lefttriangles}
592 {
593 \vskip25pt
594 \begin{beamercolorbox}[wd=\textwidth,leftskip=100pt,sep=4pt]{section page header}
595 \usebeamerfont{section title}\usebeamercolor[fg]{title}
596 \insertsectionhead\par
597 \end{beamercolorbox}%
598 \vfill
599 }
600 % \end{macrocode}
601 % \end{macro}
602 %
603 % \subsubsection{Block environments}
604 %
605 % \begin{macro}{block}
606 % \begin{macro}{block alerted}
607 % \begin{macro}{block example}
608 %
609 % The three different block environments differ only in their colours.
610 % Rather than repeat the essentially the same template three times, we use
611 % the auxiliary macro |\trigon@block| to define all three templates.
612 %
613 % \begin{macrocode}
614 \newlength{\trigon@blocksep}
615 \newlength{\trigon@blockadjust}
616 \setlength{\trigon@blocksep}{0.75ex}
617 \setlength{\trigon@blockadjust}{0.25ex}
618 \providecommand{\trigon@strut}{%
619 \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz()}%
620 }
621 \newcommand{\trigon@block}[1]{
622 \par\vskip\medskipamount%
623 \setlength{\parskip}{0pt}
624 % \end{macrocode}
625 %
626 % If a background color is defined for the block title or body, we need to
627 % add a little bit of padding to the corresponding box. Ideally, this would
628 % be accomplished by setting |colsep=0.75ex|, which is intended to add
629 % ``color separation space'' only when the box has a colored background.
630 % Unfortunately, |colsep| also adds this separation if the background color
631 % is inherited, even if the inherited color is actually empty.
632 % (The technical reason for this boils down to the fact that the |\ifx|
633 % directive does not expand macros.)
634 %
635 % To achieve the correct spacing for |alertblock|s and |exampleblock|s
636 % as well as for normal blocks, we have to begin the |beamercolorbox|
637 % differently based on whether |block title| has an empty background.
638 %
639 % If the |block title| background is empty, or the user has explicitly
640 % removed the background from (e.g.) |block title alerted|, we just need to
641 % set a rightskip for a nice ragged-right block title.
642 %
643 % \begin{macrocode}
644 \ifbeamercolorempty[bg]{block title#1}{%
645 \begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}}{%
646 \ifbeamercolorempty[bg]{block title}{%
647 \begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}%
648 }%
649 % \end{macrocode}
650 %
651 % Otherwise, if the |block title| has a background, we set the padding based
652 % on |\trigon@blockskip|. However, we have to visually compensate for
653 % the |\trigon@strut| added to the block title (see below) by
654 % subtracting |\trigon@blockadjust| from the top and bottom padding.
655 %
656 % \begin{macrocode}
657 {%
658 \begin{beamercolorbox}[
659 sep=\dimexpr\trigon@blocksep-\trigon@blockadjust\relax,
660 leftskip=\trigon@blockadjust,
661 rightskip=\dimexpr\trigon@blockadjust plus 4em\relax
662 ]{block title#1}%
663 }}%
664 % \end{macrocode}
665 %
666 % We can now set the contents of the |block title|. The zero-width but
667 % positive-height box |\trigon@strut| ensures that the block title box
668 % has a consistent height, even if it lacks punctuation, ascenders, or
669 % descenders.
670 %
671 % \begin{macrocode}
672 \usebeamerfont*{block title#1}%
673 \trigon@strut%
674 \insertblocktitle%
675 \trigon@strut%
676 \end{beamercolorbox}%
677 % \end{macrocode}
678 %
679 % Next, we typeset the |block body|. This the code is similar to, but simpler
680 % than, the |block title| code since we don't need to adjust for any struts.
681 %
682 % \begin{macrocode}
683 \nointerlineskip%
684 \ifbeamercolorempty[bg]{block body#1}{%
685 \begin{beamercolorbox}[vmode]{block body#1}}{
686 \ifbeamercolorempty[bg]{block body}{%
687 \begin{beamercolorbox}[vmode]{block body#1}%
688 }{%
689 \begin{beamercolorbox}[sep=\trigon@blocksep, vmode]{block body#1}%
690 \vspace{-\trigon@parskip}
691 }}%
692 \usebeamerfont{block body#1}%
693 \setlength{\parskip}{\trigon@parskip}%
694 }
695 % \end{macrocode}
696 %
697 % This concludes the auxiliary macro |\trigon@block|. Finally,
698 % we define the block beamer templates using this macro.
699 %
700 % \begin{macrocode}
701 \setbeamertemplate{block begin}{\trigon@block{}}
702 \setbeamertemplate{block alerted begin}{\trigon@block{ alerted}}
703 \setbeamertemplate{block example begin}{\trigon@block{ example}}
704 \setbeamertemplate{block end}{\end{beamercolorbox}\vspace*{0.2ex}}
705 \setbeamertemplate{block alerted end}{\end{beamercolorbox}\vspace*{0.2ex}}
706 \setbeamertemplate{block example end}{\end{beamercolorbox}\vspace*{0.2ex}}
707 % \end{macrocode}
708 % \end{macro}
709 % \end{macro}
710 % \end{macro}
711 %
712 % \subsubsection{Lists and floats}
713 %
714 % \begin{macrocode}
715 \setbeamertemplate{caption label separator}{: }
716 \setbeamertemplate{caption}[numbered]
717 % \end{macrocode}
718 %
719 % \subsubsection{Text and spacing settings}
720 %
721 % \begin{macrocode}
722 \newlength{\trigon@parskip}
723 \setlength{\trigon@parskip}{0.5em}
724 \setlength{\parskip}{\trigon@parskip}
725 \linespread{1.15}
726 % \end{macrocode}
727 %
728 % \subsubsection{Margins}
729 %
730 % The margins are defined as
731 % \begin{macrocode}
732 \setbeamersize{text margin left=.05\paperwidth, text margin right=.05\paperwidth}
733 % \end{macrocode}
734 %
735 % \subsubsection{Process package options}
736 %
737 % \begin{macrocode}
738 \trigon@inner@setdefaults
739 \ProcessPgfPackageOptions{/trigon/inner}
740 % \end{macrocode}
741 %
742 % \iffalse
743 %</package>
744 % \fi
745 % \Finale
746 \endinput