Debian Codegraph @

texmf-dist/source/latex/beamertheme-trigon/beamerouterthemetrigon.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{beamerouterthemetrigon}[2023/02/20 v0.7.0 Trigon outer theme]
17 %</package>
18 % \fi
19 % \CheckSum{0}
20 % \StopEventually{}
21 % \iffalse
22 %<*package>
23 % ------------------------------------------------------------------------- \fi
24 %
25 % \subsection{\themename outer theme}
26 %
27 % A |beamer| outer theme dictates the style of the frame elements traditionally
28 % set outside the ``body'' of each slide, such as the frame title, the logo, the
29 % footer, etc.
30 %
31 % \subsubsection{Package dependencies}
32 %
33 % \begin{macrocode}
34 \RequirePackage{pgfopts}
35 % \end{macrocode}
36 %
37 % \subsubsection{Definitions}
38 %
39 % We define the command |\smalllogo| to specify the logo that needs to be applied
40 % displayed on all normal frames. This command is just a replacement for
41 % |\includegraphics|, so it accepts the same options.
42 % \begin{macrocode}
43 \def\logsmall{}
44 \newcommand*\smalllogo[2][width=20pt]{
45 \ifx#2\@empty\else
46 \edef\logsmall{\includegraphics[#1]{#2}}
47 \fi
48 }
49 % \end{macrocode}
50 %
51 % \subsubsection{Options}
52 %
53 % \begin{macro}{numbering}
54 % Adds slide number to the bottom of each regular frame
55 % \begin{macrocode}
56 \pgfkeys{
57 /trigon/outer/numbering/.cd,
58 .is choice,
59 none/.code=\setbeamertemplate{frame numbering}[none],
60 counter/.code=\setbeamertemplate{frame numbering}[counter],
61 fraction/.code=\setbeamertemplate{frame numbering}[fraction]
62 }
63 % \end{macrocode}
64 % \end{macro}
65 %
66 % \begin{macro}{\trigon@outer@setdefaults}
67 % Sets default values for the outer theme options.
68 % \begin{macrocode}
69 \newcommand{\trigon@outer@setdefaults}{
70 \pgfkeys{/trigon/outer/.cd,
71 numbering=counter
72 }
73 }
74 % \end{macrocode}
75 % \end{macro}
76 %
77 % \subsubsection{Frame title}
78 %
79 % \begin{macro}{frametitle}
80 % Template for the frame title
81 % \begin{macrocode}
82 \defbeamertemplate*{frametitle}{trigon}
83 {
84 \vspace{-1pt}
85 \begin{beamercolorbox}[wd=\paperwidth,leftskip=0.05\paperwidth]{frametitle}
86 \vskip.4cm
87 \ifx\insertframesubtitle\@empty%
88 {\usebeamerfont{frametitle}\usebeamercolor[fg]{frametitle}\insertframetitle}%
89 \else%
90 {\usebeamerfont{frametitle}\usebeamercolor[fg]{frametitle}\insertframetitle}\\[-.25cm]
91 {\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\insertframesubtitle}%
92 \fi
93 \vskip.3cm
94 \end{beamercolorbox}
95 }
96 % \end{macrocode}
97 % \end{macro}
98 %
99 % \subsubsection{Fame header}
100 %
101 % \begin{macro}{headline}
102 % Templates for the frame header
103 % \begin{macrocode}
104 \defbeamertemplate{headline}{none}{}
105 \defbeamertemplate*{headline}{logo}{
106 \ifx\logsmall\@empty\else
107 \hfill\logsmall\hspace{20pt}\vspace{-40pt}
108 \fi
109 }
110 % \end{macrocode}
111 % \end{macro}
112 %
113 % \subsubsection{Frame footer}
114 %
115 % Define various template for frame footer and manage frame numbering.
116 % \begin{macrocode}
117 \setbeamertemplate{navigation symbols}{}
118
119 \defbeamertemplate{frame footer}{none}{}
120 \defbeamertemplate{frame footer}{custom}[1]{ #1 }
121 \defbeamertemplate{frame numbering}{none}{}
122 \defbeamertemplate{frame numbering}{counter}{\insertframenumber}
123 \defbeamertemplate{frame numbering}{fraction}{
124 \insertframenumber/\inserttotalframenumber
125 }
126
127 \defbeamertemplate{footline}{plain}{%
128 \begin{beamercolorbox}[wd=\textwidth, sep=10pt]{page number in head/foot}%
129 \usebeamerfont{page number in head/foot}%
130 \usebeamercolor[fg]{page number in head/foot}%
131 \usebeamertemplate*{frame footer}
132 \hfill%
133 \usebeamertemplate*{frame numbering}
134 \end{beamercolorbox}%
135 }
136
137 \setbeamertemplate{footline}[plain]
138 % \end{macrocode}
139 %
140 % \begin{macro}{appendix}
141 % Removes page numbering and per-slide progress bars when |\appendix| is
142 % called. This makes it easier to include additional ``backup slides'' at
143 % the end of the presentation, especially in conjunction with the package
144 % |appendixnumberbeamer|.
145 % \begin{macrocode}
146 \AtBeginDocument{%
147 \apptocmd{\appendix}{%
148 \pgfkeys{%
149 /trigon/outer/.cd,
150 numbering=none}
151 }{}{}
152 }
153 % \end{macrocode}
154 % \end{macro}
155 %
156 % \subsubsection{Process package options}
157 %
158 % \begin{macrocode}
159 \trigon@outer@setdefaults
160 \ProcessPgfPackageOptions{/trigon/outer}
161 % \end{macrocode}
162 %
163 % \iffalse
164 %</package>
165 % \fi
166 % \Finale
167 \endinput