-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfonts.sty
More file actions
90 lines (79 loc) · 3.71 KB
/
Copy pathfonts.sty
File metadata and controls
90 lines (79 loc) · 3.71 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
\ExplSyntaxOn
% STIX2 is wide and often gets overfull hboxes
\tolerance 2000
\bool_if:nTF
{ \sys_if_engine_luatex_p: }
{
% We avoid using fontsetup directly because it loads unicode-math, while we want to use lua-unicode-math
% \RequirePackage[default, stixtwo]{fontsetup}
\RequirePackage{fontspec}
\RequirePackage{lum-stix2}
\input{fspstixtwoot} % This is the code from fontsetup that loads stix2 text fonts
\babelfont[greek]{rm}{GFS Artemisia} % Some classical Greek letters like "ἴ" are not supported by STIX 2
% We redefine \bot because it misbehaves with lua-unicode-math
% See https://github.com/zauguin/lua-unicode-math/issues/30
% \let\bot\relax
\DeclareRobustCommand \bot {{\symbol{"022A5}}}
% We can similarly load new computer modern with all its features using \input{fspdefault},
% however that turns out to be rather slow (and, furthermore, it relies on unicode-math).
% Luckily, the base fontspec usage is simple enough
\setsansfont
[
ItalicFont=NewCMSans10-BookOblique.otf,
BoldFont=NewCMSans10-Bold.otf,
BoldItalicFont=NewCMSans10-BoldOblique.otf,
SmallCapsFeatures={Numbers=OldStyle},
SlantedFont=NewCMSans10-BookOblique.otf,
BoldSlantedFont=NewCMSans10-BoldOblique.otf,
]
{NewCMSans10-Book.otf}
\setmonofont
[
ItalicFont=NewCMMono10-BookItalic.otf,
BoldFont=NewCMMono10-Bold.otf,
BoldItalicFont=NewCMMono10-BoldOblique.otf,
SlantedFont=NewCMMono10-Book.otf,
SlantedFeatures={FakeSlant=0.25},
BoldSlantedFont=NewCMMono10-Bold.otf,
BoldSlantedFeatures={FakeSlant=0.25},
SmallCapsFeatures={Numbers=OldStyle}
]
{NewCMMono10-Book.otf}
\RequirePackage{microtype}
}
{
\RequirePackage[LGR,TS1,OT2,T2A,T1]{fontenc}
\RequirePackage[not1,notextcomp,lcgreekalpha]{stix2} % Serf and math font families; load after amsmath despite documentation, it breaks otherwise
\RenewDocumentCommand \sfdefault {} {lmss} % Latin modern
\RenewDocumentCommand \ttdefault {} {lmtt} % Latin modern
\RequirePackage{microtype}
\let\square\relax
% We imitate some macros from unicode-math
\tl_map_inline:nn
{
{A} {B} {C} {D} {E} {F} {G} {H} {I} {J} {K} {L} {M} {N} {O} {P} {Q} {R} {S} {T} {U} {V} {W} {X} {Y} {Z}
{a} {b} {c} {d} {e} {f} {g} {h} {i} {j} {k} {l} {m} {n} {o} {p} {q} {r} {s} {t} {u} {v} {w} {x} {y} {z}
}
{
\exp_args:Nc \DeclareMathSymbol {mscr #1} \mathalpha {integrals} {`#1}
\exp_args:Nc \DeclareMathSymbol {mfrak #1} \mathalpha {symbols2} {`#1}
\exp_args:Nc \DeclareMathSymbol {Bbb #1} \mathalpha {symbols3} {`#1}
}
% The `operators` symbol font makes the letters upright
\DeclareMathSymbol \Alpha \mathalpha {operators} {`A}
\DeclareMathSymbol \Beta \mathalpha {operators} {`B}
\DeclareMathSymbol \Epsilon \mathalpha {operators} {`E}
\DeclareMathSymbol \Zeta \mathalpha {operators} {`Z}
\DeclareMathSymbol \Eta \mathalpha {operators} {`H}
\DeclareMathSymbol \Iota \mathalpha {operators} {`I}
\DeclareMathSymbol \Kappa \mathalpha {operators} {`K}
\DeclareMathSymbol \Mu \mathalpha {operators} {`M}
\DeclareMathSymbol \Omicron \mathalpha {operators} {`O}
\DeclareMathSymbol \omicron \mathalpha {operators} {`o}
\DeclareMathSymbol \Rho \mathalpha {operators} {`P}
\DeclareMathSymbol \Tau \mathalpha {operators} {`T}
\DeclareMathSymbol \Chi \mathalpha {operators} {`X}
% We don't define the rest of the Green alphabet because we won't use it (and because it's tedious to do)
\DeclareMathSymbol \muplambda \mathalpha {operators} {"15}
}
\ExplSyntaxOff