summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerouterthemetrigon.dtx
blob: 41ab019fc55cabbd82f76337a0d98d936e0f7923 (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
% \iffalse meta-comment -------------------------------------------------------
% Copyright (C) 2021 Thomas Lambert <trigon@thl.ovh>
% Other contributors to this theme are listed here:
%     https://gitlab.com/thlamb/beamertheme-trigon/-/graphs/master
%
% The original template was heavily inspired by Metropolis from Matthias
% Vogelgesang.
%
% License CC-BY-SA 4.0
% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
% International License (https://creativecommons.org/licenses/by-sa/4.0/)
% ------------------------------------------------------------------------- \fi
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerouterthemetrigon}[2021/09/06 v0.6.0 Trigon outer theme]
%</package>
% \fi
% \CheckSum{0}
% \StopEventually{}
% \iffalse
%<*package>
% ------------------------------------------------------------------------- \fi
%
% \subsection{\themename outer theme}
%
% A |beamer| outer theme dictates the style of the frame elements traditionally
% set outside the ``body'' of each slide, such as the frame title, the logo, the
% footer, etc.
%
% \subsubsection{Package dependencies}
%
%    \begin{macrocode}
\RequirePackage{pgfopts}
%    \end{macrocode}
%
% \subsubsection{Definitions}
% We define the command |\logsmall| to specify the logo that needs to be applied
% displayed on all normal frames.
%   \begin{macrocode}
\def\logsmall{}
\newcommand\smalllogo[1]{
  \def\logsmall{#1}
}
%   \end{macrocode}
%
% \subsubsection{Options}
%
% \begin{macro}{numbering}
%   Adds slide number to the bottom of each regular frame
%   \begin{macrocode}
\pgfkeys{
  /trigon/outer/numbering/.cd,
    .is choice,
    none/.code=\setbeamertemplate{frame numbering}[none],
    counter/.code=\setbeamertemplate{frame numbering}[counter],
    fraction/.code=\setbeamertemplate{frame numbering}[fraction]
}
%   \end{macrocode}
% \end{macro}
%
% \begin{macro}{\trigon@outer@setdefaults}
%   Sets default values for the outer theme options.
%   \begin{macrocode}
\newcommand{\trigon@outer@setdefaults}{
  \pgfkeys{/trigon/outer/.cd,
    numbering=counter
  }
}
%   \end{macrocode}
% \end{macro}
%
%
% \subsubsection{Frame title}
% \begin{macro}{frametitle}
% Template for the frame title
%   \begin{macrocode}
\defbeamertemplate*{frametitle}{trigon}
{
  \vspace{-1pt}
  \begin{beamercolorbox}[wd=\paperwidth,leftskip=0.05\paperwidth]{frametitle}
  \vskip.4cm
  \ifx\insertframesubtitle\@empty%
      {\usebeamerfont{frametitle}\usebeamercolor[fg]{frametitle}\insertframetitle}%
  \else%
      {\usebeamerfont{frametitle}\usebeamercolor[fg]{frametitle}\insertframetitle}\\[-.25cm]
      {\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\insertframesubtitle}%
  \fi
  \vskip.3cm
  \end{beamercolorbox}
}
%   \end{macrocode}
% \end{macro}
%
%
% \subsubsection{Fame header}
% \begin{macro}{headline}
% Templates for the frame header
%   \begin{macrocode}
\defbeamertemplate{headline}{none}{}
\defbeamertemplate*{headline}{logo}{
\ifx\logsmall\@empty\else
  \hfill\includegraphics[width=20pt]{\logsmall}\hspace{20pt}\vspace{-40pt}
\fi
}
%   \end{macrocode}
% \end{macro}
%
%
% \subsubsection{Frame footer}
% Define various template for frame footer and manage frame numbering.
% \begin{macrocode}
\setbeamertemplate{navigation symbols}{}

\defbeamertemplate{frame footer}{none}{}
\defbeamertemplate{frame footer}{custom}[1]{ #1 }
\defbeamertemplate{frame numbering}{none}{}
\defbeamertemplate{frame numbering}{counter}{\insertframenumber}
\defbeamertemplate{frame numbering}{fraction}{
  \insertframenumber/\inserttotalframenumber
}

\defbeamertemplate{footline}{plain}{%
  \begin{beamercolorbox}[wd=\textwidth, sep=10pt]{page number in head/foot}%
    \usebeamerfont{page number in head/foot}%
    \usebeamercolor[fg]{page number in head/foot}%
    \usebeamertemplate*{frame footer}
    \hfill%
    \usebeamertemplate*{frame numbering}
  \end{beamercolorbox}%
}

\setbeamertemplate{footline}[plain]
% \end{macrocode}
%
% \begin{macro}{appendix}
%    Removes page numbering and per-slide progress bars when |\appendix| is
%    called. This makes it easier to include additional ``backup slides'' at
%    the end of the presentation, especially in conjunction with the package
%    |appendixnumberbeamer|.
%    \begin{macrocode}
\AtBeginDocument{%
  \apptocmd{\appendix}{%
    \pgfkeys{%
      /trigon/outer/.cd,
      numbering=none}
    }{}{}
}
%   \end{macrocode}
% \end{macro}
%
% \subsubsection{Process package options}
%
%    \begin{macrocode}
\trigon@outer@setdefaults
\ProcessPgfPackageOptions{/trigon/outer}
%    \end{macrocode}
%
% \iffalse
%</package>
% \fi
% \Finale
\endinput