summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerthemetrigon.dtx
blob: b12e1dc7e8b1c2725fd8bbfdd79c5b0b657d6594 (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
% \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{beamerthemetrigon}[2021/09/06 v0.6.0 Trigon Beamer theme]
%</package>
% \fi
% \CheckSum{0}
% \StopEventually{}
% \iffalse
%<*package>
% ------------------------------------------------------------------------- \fi
%
%
% \subsection{\themename parent theme}
%
% The primary job of this package is to load the component sub-packages of the
% \themename theme and route the theme options accordingly. It also
% provides some custom commands and environments for the user.
%
%
% \subsubsection{Package dependencies}
%
%   \begin{macrocode}
\RequirePackage{pgfopts}
\RequirePackage{tikz}
%    \end{macrocode}
%
%
%\subsubsection{Options}
%
% Most options are passed off to the component sub-packages.
%
%   \begin{macrocode}
\pgfkeys{/trigon/.cd,
  .search also={
    /trigon/inner,
    /trigon/outer,
    /trigon/color,
    /trigon/font
  }
}
%    \end{macrocode}
%
% \begin{macro}{titleformat plain}
%    Controls the formatting of the text on standout ``plain'' frames.
%   \begin{macrocode}
\pgfkeys{
  /trigon/titleformat plain/.cd,
    .is choice,
    regular/.code={%
      \let\trigon@plaintitleformat\@empty%
      \setbeamerfont{standout}{shape=\normalfont}%
    },
    smallcaps/.code={%
      \let\trigon@plaintitleformat\@empty%
      \setbeamerfont{standout}{shape=\scshape}%
    },
    allsmallcaps/.code={%
      \let\trigon@plaintitleformat\MakeLowercase%
      \setbeamerfont{standout}{shape=\scshape}%
      \PackageWarning{beamerthemetrigon}{%
        Be aware that titleformat plain=allsmallcaps can lead to problems%
      }
    },
    allcaps/.code={%
      \let\trigon@plaintitleformat\MakeUppercase%
      \setbeamerfont{standout}{shape=\normalfont}%
      \PackageWarning{beamerthemetrigon}{%
        Be aware that titleformat plain=allcaps can lead to problems%
      }
    },
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{titleformat}
%    Sets a standard format for titles, subtitles, section titles, frame
%    titles, and the text on standout ``plain'' frames.
%   \begin{macrocode}
\pgfkeys{
  /trigon/titleformat/.code=\pgfkeysalso{
      font/titleformat title=#1,
      font/titleformat subtitle=#1,
      font/titleformat section=#1,
      font/titleformat frame=#1,
      titleformat plain=#1,
    }
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{usesourcefonts}
%     Select whereas the Source Sans Pro font is being loaded automatically or
%     not.
%   \begin{macrocode}
\newif\if@trigon@usesourcefonts
\pgfkeys{/trigon/.cd,
  usesourcefonts/.is if=@trigon@usesourcefonts,
  usesourcefonts=true,
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Component sub-packages}
%
% Having processed the options, we can now load the component sub-packages of
% the theme.
%
%   \begin{macrocode}
\useinnertheme{trigon}
\useoutertheme{trigon}
\usecolortheme{trigon}
\usefonttheme{trigon}
%    \end{macrocode}
%
%
% \subsubsection{Custom commands}
%
% The parent theme defines custom commands as their proper usage may depend
% on multiple sub-packages.
%
% \begin{macro}{\metroset}
%    Allows the user to change options midway through a presentation.
%    \begin{macrocode}
\newcommand{\trigonset}[1]{\pgfkeys{/trigon/.cd,#1}}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Process package options}
%
%   \begin{macrocode}
\ProcessOptionsBeamer
\ProcessPgfOptions{/trigon}
\if@trigon@usesourcefonts%
  \RequirePackage[default,t1,semibold]{sourcesanspro}
\fi
%    \end{macrocode}
%
% \iffalse
%</package>
% \fi
% \Finale
\endinput