-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbeamerfontthemefira.sty
120 lines (111 loc) · 4.23 KB
/
beamerfontthemefira.sty
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
%------------------------------------------------------------
% Fira Sans Beamer font theme file `beamerfontthemefira.sty'
% SLIGHTLY edited by Xu, Minjie (Jeff)
% and TEMPLATE FROM Metropolis font theme by Matthias Vogelgesang
%------------------------------------------------------------
% ORIGINAL source file was
% beamerfontthememetropolis.dtx (with option `package')
%------------------------------------------------------------
% Copyright 2015 Matthias Vogelgesang and the LaTeX community
% A full list of contributors can be found at
% https://github.com/matze/mtheme/graphs/contributors
% and original template based on HSRM theme by Benjamin Weiss
%------------------------------------------------------------
% This Fira Sans Beamer font theme is licensed under:
% LaTeX Project Public License (version 1.3 or later),
% GNU General Public License (version 3.0 or later),
% Creative Commons Attribution-ShareAlike 4.0 International License
% https://creativecommons.org/licenses/by-sa/4.0/.
%------------------------------------------------------------
%------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerfontthemefira}[2016/03/21 Fira Sans Beamer Font Theme]
%------------------------------------------------------------
\RequirePackage{etoolbox, ifxetex, ifluatex}
\ifboolexpr{bool {xetex} or bool {luatex}}{%
\RequirePackage[no-math]{fontspec}
\newcounter{fontsnotfound}
\newcommand{\checkfont}[1]{%
\suppressfontnotfounderror=1%
\font\x = "#1" at 10pt
\selectfont
\ifx\x\nullfont%
\stepcounter{fontsnotfound}%
\fi%
\suppressfontnotfounderror=0%
}%
\newcommand{\iffontsexist}[3]{%
\setcounter{fontsnotfound}{0}%
\expandafter\forcsvlist\expandafter%
\checkfont\expandafter{#1}%
\ifnum\value{fontsnotfound}=0%
#2%
\else%
#3%
\fi%
}
\iffontsexist{%
Fira Sans Light,%
Fira Sans Light Italic,%
Fira Sans,%
Fira Sans Italic%
}{%
\setsansfont[BoldFont={Fira Sans}]{Fira Sans Light}%
}{%
\iffontsexist{%
Fira Sans Light OT,%
Fira Sans Light Italic OT,%
Fira Sans OT,%
Fira Sans Italic OT%
}{%
\setsansfont[BoldFont={Fira Sans OT}]{Fira Sans Light OT}%
}{%
\PackageWarning{beamerfontthemefira}{%
Could not find Fira Sans fonts%
}%
}%
}%
\iffontsexist{Fira Mono, Fira Mono Bold}{%
\setmonofont{Fira Mono}%
}{%
\iffontsexist{Fira Mono OT, Fira Mono Bold OT}{%
\setmonofont{Fira Mono OT}%
}{%
\PackageWarning{beamerfontthemefira}{%
Could not find Fira Mono fonts%
}%
}%
}%
\AtBeginEnvironment{tabular}{%
\addfontfeature{Numbers={Monospaced}}%
}%
}{%
\renewcommand{\familydefault}{\sfdefault}%
\RequirePackage{FiraSans, FiraMono, newtxsf}%
}%
%------------------------------------------------------------
%------------------------------------------------------------
\setbeamerfont{title}{size=\Large, series=\bfseries}
\setbeamerfont*{subtitle}{size=\large}
\setbeamerfont{author}{size=\small}
\setbeamerfont{date}{size=\scriptsize}
%------------------------------------------------------------
%\setbeamerfont{section title}{size=\Large, series=\bfseries}
%\setbeamerfont{plain title}{size=\Large, series=\bfseries}
%\setbeamerfont{block title}{size=\normalsize, series=\bfseries}
%\setbeamerfont{block title alerted}{size=\normalsize, series=\bfseries}
%\setbeamerfont{frametitle}{size=\large, series=\bfseries}
%------------------------------------------------------------
\setbeamerfont{caption}{size=\scriptsize}
\setbeamerfont{caption name}{series=\bfseries}
%\setbeamerfont{description item}{series=\bfseries}
%\setbeamerfont{page number in head/foot}{size=\scriptsize}
%\setbeamerfont{bibliography entry author}{size=\normalsize, series=\normalfont}
%\setbeamerfont{bibliography entry title}{size=\normalsize, series=\bfseries}
%\setbeamerfont{bibliography entry location}{size=\normalsize, series=\normalfont}
%\setbeamerfont{bibliography entry note}{size=\small, series=\normalfont}
%------------------------------------------------------------
%------------------------------------------------------------
\endinput
% End of file `beamerfontthemefira.sty'.
%------------------------------------------------------------