Debian Codegraph @

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

raw
1 %% ---------------------------------------------------------------------------
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 %% ---------------------------------------------------------------------------
13
14 \documentclass{ltxdoc}
15 %\OnlyDescription
16
17 \usepackage{xcolor}
18 \definecolor{tPrim}{HTML}{00707F} % Green-Blue
19 \definecolor{tSec}{HTML}{5FA4B0} % Green-Blue light
20 \definecolor{tAccent}{HTML}{F07F3C} % Orange
21 \definecolor{tGrey}{HTML}{E6E6E1} % Grey-Beige
22
23 \usepackage[default,t1,semibold]{sourcesanspro}
24
25 \usepackage{parskip}
26 \usepackage{setspace}
27 \usepackage{xspace}
28 \onehalfspacing
29
30 %\usepackage{enumitem}
31 %\setlist[itemize]{noitemsep}
32 %\setlist[enumerate]{noitemsep}
33
34 \usepackage{listings}
35 \lstset{%
36 language=[LaTeX]{TeX},
37 basicstyle=\ttfamily,
38 keywordstyle=\color{tPrim}\bfseries,
39 commentstyle=\color{tSec},
40 stringstyle=\color{tSec},
41 backgroundcolor=\color{white},
42 numbers=none,
43 numberstyle=\tiny\ttfamily,
44 stepnumber=2,
45 showspaces=false,
46 showstringspaces=false,
47 showtabs=false,
48 frame=none,
49 framerule=1pt,
50 tabsize=2,
51 rulesep=5em,
52 captionpos=b,
53 breaklines=true,
54 breakatwhitespace=false,
55 framexleftmargin=0em,
56 framexrightmargin=0em,
57 xleftmargin=0em,
58 xrightmargin=0em,
59 aboveskip=1em,
60 belowskip=1em,
61 morekeywords={usetheme,institute,maketitle,@trigon@titleformat,%
62 plain,trigonset,setbeamercolor},
63 }
64 \lstMakeShortInline|
65 \usepackage{metalogo}
66
67 \setcounter{tocdepth}{2}
68
69 \usepackage[colorlinks=true,
70 linkcolor=tPrim,
71 menucolor=tPrim,
72 urlcolor=tPrim]{hyperref}
73
74 \setlength{\fboxsep}{0pt}%
75 \usepackage{caption} % For subfigures
76 \usepackage{subcaption} % For subfigures
77
78 \newcommand{\DescribeOption}[4]{
79 \DescribeMacro{#1}
80 \begin{minipage}[t]{\textwidth}
81 \textit{\textbf{\textcolor{tSec}{#2}}}\dotfill\,#3\par
82 \begingroup
83 \vspace{0.5em}#4\par
84 \endgroup
85 \end{minipage}
86 }
87
88
89 %% ------------------------------------------------------------------------------
90 \newcommand{\themename}{\textbf{\textsc{Trigon}}\xspace}
91 \usepackage{readprov}
92 \ReadPackageInfos{beamerthemetrigon}
93
94
95 %% =============================================================================
96
97 \title{\textsc{Trigon}\\ A Modern, elegant and versatile theme for Beamer}
98 \author{Thomas Lambert \\ \url{[email protected]}}
99 \date{\fileversion~---~\filedate}
100
101 %% =============================================================================
102
103 \begin{document}
104
105 \maketitle
106 \tableofcontents
107
108
109 %% ------------------------------------
110 \section{Introduction}
111
112 \themename found its origin and inspiration in the graphical guidelines
113 resulting from the visual identity overhaul of the
114 \href{https://www.uliege.be}{University of Liège} (Belgium).\\
115 Although directly inspired from these guidelines, \themename was stripped out of
116 any mention or specificities related the University and its faculties. This
117 makes the \themename theme perfectly suitable for many different contexts.
118
119 The final product provides a modern, elegant and versatile theme with a
120 high degree of customization.
121
122 \themename's codebase lives on
123 \href{https://gitlab.com/thlamb/beamertheme-trigon} {Gitlab}. The implementation
124 of this theme is strongly inspired from the excellent
125 \href{https://github.com/matze/mtheme}{\textsc{Metropolis}} theme by Matthias
126 Vogelgesang, from which it borrows numerous options.\newline
127 Any feature request, issue report or merge requests are welcome.
128
129
130 %% ------------------------------------
131 \section{Getting Started}
132
133 \subsection{Installing from CTAN}
134 The latest stable version of \themename is available on
135 \href{https://ctan.org/pkg/beamertheme-trigon}{CTAN} and should now be part of
136 the usual \TeX\ distibutions (\TeX\ Live, Mac\TeX\ , Mik\TeX\ ), under the name
137 \textit{beamertheme-trigon}. It means that if your distribution is kept
138 up-to-date, the package should normally be already installed on your system. If
139 this is not the case, consider updating the packages of your Tex distribution.
140
141 For \TeX\ Live and Mac\TeX\ users, this usually means running
142 \begin{lstlisting}
143 tlmgr update --all
144 \end{lstlisting}
145 , or if administrative privileges are required
146 \begin{lstlisting}
147 sudo tlmgr update --all
148 \end{lstlisting}
149
150 For Mik\TeX\ users, please refer to \href{https://miktex.org/howto/update-miktex}{the official Mik\TeX\ documentation}.
151
152
153 \subsection{Installing from Gitlab}
154
155 If you want to use the cutting-edge development version of \themename, you can
156 install it manually by following these steps:
157 \begin{description}
158 \item[Download the source] from
159 \href{https://gitlab.com/thlamb/beamertheme-trigon}{\themename repository}
160 using |git clone| or as a \href{https://gitlab.com/thlamb/beamertheme-trigon/-/archive/master/beamertheme-trigon-master.zip}{zip archive} of the latest development version.
161 \item[Compile the style files] by running |make sty| inside the downloaded
162 directory. (Or run \LaTeX{} directly on |source/trigontheme.ins|.)
163 \item[Move the resulting |*.sty| files] to the folder containing your
164 presentation. To use \themename with many presentations, run
165 |make install| or move the |*.sty| files to a folder in your \TeX{} path
166 instead.
167 \item[Use the theme] by declaring |\usetheme{trigon}| in the preamble of your
168 document.
169 \end{description}
170
171 \themename uses the Make build system to offer the following installation
172 options for advanced users:
173
174 \begin{description}
175 \item[|make sty|] builds the theme style files.
176 \item[|make doc|] builds this documentation manual.
177 \item[|make demo|] builds a demo presentation to test the features of
178 \themename.
179 \item[|make all|] builds the theme and manual.
180 \item[|make clean|] removes the files generated by |make all|.
181 \item[|make install|] installs the theme into your local texmf folder.
182 \item[|make uninstall|] removes the theme from your local texmf folder.
183 \end{description}
184
185
186 \subsection{Overleaf}
187 Since October 2021,
188 \href{https://www.overleaf.com/blog/tex-live-2021-now-available}{TexLive 2011 is
189 availabe on Overleaf}. \themename is therefore automatically supported for new
190 documents. If you want to switch older documents to use the \themename theme,
191 you need to
192 \href{https://www.overleaf.com/blog/new-feature-select-your-tex-live-compiler-version}{select
193 TexLive 2021 or higher as your TeX Live version} (this may cause issues with
194 other packages used in your presentation).
195
196 In addition to that, a template project was created and is publicly availabe in
197 the
198 \href{https://www.overleaf.com/latex/templates/trigon-beamer-theme/wjyyzvdzqkgf}{Overleaf
199 Gallery} to bootstrap your presentation.
200
201
202 \subsection{A Minimal Example}
203
204 The following code shows a minimal example of a Beamer presentation using
205 \themename.
206
207 \begin{lstlisting}
208 \documentclass{beamer}
209 \usetheme{trigon} % Use trigon theme
210 \title{A minimal example}
211 \subtitle{A subtitle example}
212 \date{\today}
213 \author{Thomas Lambert}
214 \institute{Your university or company}
215 \begin{document}
216 \maketitle
217 \section{First Section}
218 \begin{frame}{First Frame}
219 Hello, world!
220 \end{frame}
221 \end{document}
222 \end{lstlisting}
223
224
225 \subsection{Dependencies}
226
227 \themename depends on the |beamer| class and the following standard packages:
228 \begin{itemize}
229 \item |tikz|
230 \item |pgfopts|
231 \end{itemize}
232
233 The theme works best with the open source
234 \href{https://fonts.adobe.com/fonts/source-sans}{Source Sans Pro} font from
235 Adobe.\newline
236 Therefore, the package |sourcesanspro| is loaded by default with the theme.
237 However, if the user prefers to select an other font, the theme option
238 |nosourcefonts| can be used to prevent the font package from being loaded.
239
240
241 %% ------------------------------------
242 \section{Customization}
243
244 \subsection{Package options}
245
246 \themename provides a number of options, which can be set using a key=value
247 interface. The primary way to set options is to provide a comma-separated list
248 of option-value pairs when loading \themename in the preamble:
249 \begin{lstlisting}
250 \usetheme[option1=value1, option2=value2, ...]{trigon}
251 \end{lstlisting}
252
253
254 Options can be changed at any time --- even mid-presentation! --- with the
255 |\trigonset| macro.
256 \begin{lstlisting}
257 \trigonset{option1=newvalue1, option2=newvalue2, ...}
258 \end{lstlisting}
259
260 The list of options is structured as shown in the following example.
261
262 \DescribeOption{option key}{list of possible values}{default}{
263 A short description of the option.
264 }
265
266 As \themename implementation is heavily inspired from the excellent
267 \href{https://github.com/matze/mtheme}{\textsc{Metropolis}} theme by Matthias
268 Vogelgesang, many of \textsc{Metropolis} options are also available in
269 \themename.
270
271 \subsubsection{Main theme}
272
273 \DescribeOption{background}{light,dark}{light}{%
274 Provides the option to have a dark background and light foreground instead of
275 the reverse.
276 }
277
278 \DescribeOption{titleformat}%
279 {regular, smallcaps, allsmallcaps, allcaps}
280 {regular}{
281 Changes the format of titles, subtitles, section titles, frame titles, and
282 the text on ``standout'' frames. The available options produce
283 Regular, \textsc{SmallCaps}, \textsc{\MakeLowercase{AllSmallCaps}}, or
284 \MakeUppercase{AllCaps} titles. Please refer to
285 Section~\ref{sec:titleformats} for known issues with these options.
286 }
287
288 \DescribeOption{usesourcefonts}{true,false}{true}{%
289 Chooses if the |sourcesanspro| font package should be loaded |true| or not
290 |false|.
291 }
292
293
294 \subsubsection{Inner theme}
295
296 \DescribeOption{sectionpage}{none, simple}{simple}{
297 Adds a slide at the start of each section (|simple|). The |none| option
298 disables the section page.
299 }
300
301 \DescribeOption{titlestyle}{plain, style1, style2}{style2}{
302 Changes the layout of the title page.
303 }
304 \begin{figure}[h!]
305 \begin{subfigure}[b]{0.3\textwidth}
306 \fbox{\includegraphics[width=\textwidth]{screenshots/layout_example-02.jpg}}
307 \caption*{plain}
308 \end{subfigure}
309 \hspace{\fill}
310 \begin{subfigure}[b]{0.3\textwidth}
311 \fbox{\includegraphics[width=\textwidth]{screenshots/layout_example-03.jpg}}
312 \caption*{style1}
313 \end{subfigure}
314 \hspace{\fill}
315 \begin{subfigure}[b]{0.3\textwidth}
316 \fbox{\includegraphics[width=\textwidth]{screenshots/layout_example-01.jpg}}
317 \caption*{style2 (default)}
318 \end{subfigure}
319 \end{figure}
320
321 \DescribeOption{sectionstyle}{plain, style1, style2, style3}{plain}{
322 Changes the layout of the section page. |style3| is similar to |plain| but
323 with the right triangle in grey instead of theme color.
324 }
325 \begin{figure}[h!]
326 \begin{subfigure}[b]{0.3\textwidth}
327 \fbox{\includegraphics[width=\textwidth]{screenshots/layout_example-04.jpg}}
328 \caption*{plain (default)}
329 \end{subfigure}
330 \hspace{\fill}
331 \begin{subfigure}[b]{0.3\textwidth}
332 \fbox{\includegraphics[width=\textwidth]{screenshots/layout_example-05.jpg}}
333 \caption*{style1}
334 \end{subfigure}
335 \hspace{\fill}
336 \begin{subfigure}[b]{0.3\textwidth}
337 \fbox{\includegraphics[width=\textwidth]{screenshots/layout_example-06.jpg}}
338 \caption*{style2}
339 \end{subfigure}
340 \end{figure}
341
342 \DescribeOption{slidestyle}{blank, style1, cyber}{blank}{
343 Changes the background of the regular frames.
344 }
345 \begin{figure}[h!]
346 \hspace{\fill}
347 \begin{subfigure}[b]{0.3\textwidth}
348 \fbox{\includegraphics[width=\textwidth]{screenshots/layout_example-08.jpg}}
349 \caption*{blank (default)}
350 \end{subfigure}
351 \hspace{\fill}
352 \begin{subfigure}[b]{0.3\textwidth}
353 \fbox{\includegraphics[width=\textwidth]{screenshots/layout_example-09.jpg}}
354 \caption*{style1}
355 \end{subfigure}
356 \hspace{\fill}
357 \begin{subfigure}[b]{0.3\textwidth}
358 \fbox{\includegraphics[width=\textwidth]{screenshots/layout_example-10.jpg}}
359 \caption*{cyber}
360 \end{subfigure}
361 \end{figure}
362
363 \subsubsection{Outer theme}
364
365 \DescribeOption{numbering}{none, counter, fraction}{counter}{
366 Controls whether the frame number at the bottom right of each slide is
367 omitted (|none|), shown (|counter|) or displayed as a fraction of the total
368 number of frames (|fraction|).
369 }
370
371 \subsubsection{Color theme}
372 \DescribeOption{block}{transparent, fill}{fill}{
373 Optionally adds a light grey background to block environments like |theorem|
374 and |example|.
375 }
376
377 \DescribeOption{headingcolor}{default, theme}{default}{
378 Controls weather the color of all headings (title page, frame title, etc.)
379 should be in black (|default|) or in a slightly darker shade of the theme
380 color |theme|.
381 }
382
383 \DescribeOption{textgcolor}{default, theme}{default}{
384 Controls weather the color of the regular text elements should be in black
385 (|default|) or in a slightly darker shade of the theme color |theme|.
386 }
387
388 \subsubsection{Font theme}
389
390 \DescribeMacro{titleformat title}
391 \DescribeMacro{titleformat subtitle}
392 \DescribeMacro{titleformat section}
393 \DescribeOption{titleformat frame}%
394 {regular, smallcaps, allsmallcaps, allcaps}%
395 {regular}{
396 Individually controls the format of titles, subtitles, section titles, and
397 frame titles (see |titleformat|, above).
398 }
399
400
401 \subsection{Color Customization}
402
403 The included \themename color theme is used by default, but its colors can be
404 easily changed to suit your tastes. All of the theme's styles are defined in
405 terms of a few main colors:
406 \begin{itemize}
407 \item |tPrim| The primary theme color, used for main triangle elements, and
408 for headings and text if the appropriate options are selected.
409 \item |tSec| The secondary theme color (lighter shade of the primary color),
410 used for some triangle elements and example text.
411 \item |tAccent| The accent color, used mostly for alerted text.
412 \item |tGrey| A grey color, used for background elements (triangles, blocks,
413 etc.).
414 \item |tTxt| The default text color.
415 \item |tBg| The default background color.
416 \item |tGreyBg| A tint of grey to use for the triangle elements.
417 \item |tTheme| A tint of the |tPrim| color to use for some triangle elements.
418 \end{itemize}
419
420 An easy way to customize the theme is to redefine these colors using
421
422 \begin{lstlisting}
423 \colorlet{tPrim}{ ... }
424 \colorlet{tSec}{ ... }
425 ...
426 \end{lstlisting}
427 in your preamble.
428
429 \subsection{Logos}
430
431 The package allows the inclusion of logos on the title page and on the content
432 slides. For that, the following commands are defined:
433 \begin{lstlisting}
434 \biglogo[<options>]{path/to/your/titlepage_logo}
435 \smalllogo[<options>]{path/to/your/titlepage_logo}
436 \end{lstlisting}
437 These two commands are just replacements for |\includegraphics| and they will
438 pass the options as-is so you can perfectly size and position the images.
439
440
441
442 \section{Tips \& Tricks}
443
444 \subsection{Backup Slides}
445
446 Speakers will often include extra slides at the end of their presentation to
447 refer to during audience questions. One easy way to do this is to include the
448 \verb|appendixnumberbeamer| package in your preamble and call \verb|\appendix|
449 before your backup slides.
450
451 \themename will automatically turn off slide numbering for slides in the
452 appendix.
453
454
455 \section{Known Issues}
456
457 \subsection{Title formats}
458 \label{sec:titleformats}
459
460 Be aware that not every font supports small caps, so the |smallcaps| or
461 |allsmallcaps| options may not work if you use a font other than
462 |sourcesanspro|.
463
464 The title format options |allsmallcaps| and |allcaps| are quite nice from an
465 aesthetic point of view, but their use of |\MakeLowercase| and
466 |\MakeUppercase| can cause unexpected problems. For example:
467
468 \begin{itemize}
469 \item Some commands, like |\\|, do not work inside |\MakeLowercase| and
470 |\MakeUppercase|. (See \textsc{Metropolis}
471 \href{https://github.com/matze/mtheme/issues/125} {\#125})
472 \item Only alphabetic characters are affected by |\MakeLowercase|, so
473 numerals and punctuation remain at full height. This can spoil some of the
474 aesthetic benefits of |allsmallcaps|. (See \textsc{Metropolis}
475 \href{https://github.com/matze/mtheme/issues/33}{\#33})
476 \item |\MakeLowercase| and |\MakeUppercase| apply to math mode and
477 |\scshape| does not. This can easily introduce mathematical errors that
478 are hard to catch.
479 \item It is impossible to typeset symbols which are encoded as uppercase
480 letters in a different font. In particular, |\mathbb| and |\mathcal|
481 letters will be replaced by other math glyphs. (See \textsc{Metropolis}
482 \href{https://github.com/matze/mtheme/issues/153}{\#153})
483 \end{itemize}
484
485 The |allsmallcaps| and |allcaps| options are safe to use if your titles contain
486 only alphabetic characters and do not require the expansion of any macros.
487
488
489 \section{License}
490 \themename is licensed under the terms of the
491 \href{https://creativecommons.org/licenses/by-sa/4.0/}{Creative Commons
492 Attribution-ShareAlike 4.0} license.
493
494
495 \section{Implementation}
496 \DocInput{beamerthemetrigon.dtx}
497 \DocInput{beamerinnerthemetrigon.dtx}
498 \DocInput{beamerouterthemetrigon.dtx}
499 \DocInput{beamerfontthemetrigon.dtx}
500 \DocInput{beamercolorthemetrigon.dtx}
501
502 \end{document}
503