-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbeamerfontthemeUCL2026.sty
More file actions
103 lines (84 loc) · 3.04 KB
/
beamerfontthemeUCL2026.sty
File metadata and controls
103 lines (84 loc) · 3.04 KB
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
\mode<presentation>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerfontthemeUCL2026}[2026/02/19 v0.1 UCL2026]
% Loads correct fonts for presentations
% First checks for pdflatex and issues an error
% In order checks and loads the main font: UCL Sans, Aptos
% Checks and loads the math font: Fira Math, issues a warning if not installed
\RequirePackage{iftex}
\ifPDFTeX
\PackageError{beamerfontthemeUCL2026}{%
This theme requires XeLaTeX or LuaLaTeX.%
You are using pdfLaTeX. Please compile with one of these engines}{%
Use: xelatex yourfile.tex or lualatex yourfile.tex}
\fi
\RequirePackage{fontspec}
\RequirePackage{unicode-math}
\ProcessOptionsBeamer
% Set main font
\IfFontExistsTF{UCL Sans}{%
\setsansfont{UCL Sans}[
Scale = 1.0,
UprightFont = * Regular,
BoldFont = * SemiBold,
ItalicFont = * Italic,
BoldItalicFont = * Bold Italic
]
}{
\IfFontExistsTF{Aptos}{%
\setsansfont{Aptos}[
Scale = 1.0,
UprightFont = * Regular,
BoldFont = * SemiBold,
ItalicFont = * Italic,
BoldItalicFont = * Bold Italic
]
}{%
\PackageError{beamerfontthemeUCL2026}{%
This theme requires either UCL Sans or Aptos fonts to be installed
}{Install either UCL Sans or Aptos fonts and recompile the file}
}
}
% Set math font
% TODO: there is no specified paired math font so will need to experiment - using Fira Math for now
\IfFontExistsTF{Fira Math}{%
\setmathfont{Fira Math}[math-style=ISO,
bold-style=ISO,
Scale=MatchLowercase]
}{
% Defaults to the default math font
\PackageWarning{beamerfontthemeUCL2026}{%
Font not found: Fira Math - this is not required but pairs better with the main fonts
}
}
\renewcommand{\normalsize}{\fontsize{24}{26}\selectfont}
\renewcommand{\tiny}{\fontsize{12}{14}\selectfont}
\renewcommand{\small}{\fontsize{18}{20}\selectfont}
\renewcommand{\footnotesize}{\fontsize{16}{19}\selectfont}
\renewcommand{\large}{\fontsize{27}{32}\selectfont}
\renewcommand{\Large}{\fontsize{32}{38}\selectfont}
\renewcommand{\LARGE}{\fontsize{36}{38}\selectfont}
\renewcommand{\huge}{\fontsize{42}{48}\selectfont}
\renewcommand{\Huge}{\fontsize{54}{64}\selectfont}
\normalsize % apply it
% Title page fonts
\setbeamerfont{title}{size=\huge,series=\bfseries}
\setbeamerfont{subtitle}{size=\normalsize,series=\normalfont}
\setbeamerfont{author}{size=\normalsize,series=\normalfont}
\setbeamerfont{institute}{size=\small,series=\normalfont}
\setbeamerfont{date}{size=\small,series=\normalfont}
% Frame title fonts
\setbeamerfont{frametitle}{size=\LARGE, series=\bfseries}
\setbeamerfont{framesubtitle}{size=\large,series=\normalfont}
% Block fonts
\setbeamerfont{block title}{size=\normalsize ,series=\bfseries}
\setbeamerfont{block body}{size=\small,series=\normalfont}
% Item fonts
\setbeamerfont{itemize/enumerate body}{size=\normalsize}
\setbeamerfont{itemize/enumerate subbody}{size=\small}
% Caption fonts
\setbeamerfont{caption}{size=\small,series=\normalfont}
\setbeamerfont{caption name}{series=\bfseries}
% Footnote fonts
\setbeamerfont{footnote}{size=\tiny}
\mode<all>