-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpytooling.sty
More file actions
215 lines (201 loc) · 11 KB
/
Copy pathpytooling.sty
File metadata and controls
215 lines (201 loc) · 11 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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{pytooling}[2000/00/00 pyTooling Unicode Definitions]
% ============================================================
% Engine guard
% ============================================================
\ifdefined\directlua\else
\PackageError{pytooling}{LuaLaTeX is required for this package}{%
This package uses unicode definitions and features specifically
designed for the LuaTeX engine. Please switch your compiler.}
\fi
% ============================================================
% Package options (key-value via kvoptions)
% ============================================================
\RequirePackage{kvoptions}
\SetupKeyvalOptions{family=pytooling, prefix=pytooling@}
% Required:
% \DeclareStringOption{fontfamily} % dejavu, latinmodern, libertinus, noto
% Optional: emoji configuration with defaults
\DeclareStringOption[latinmodern]{fontfamily} % dejavu, latinmodern, libertinus, noto
\DeclareStringOption[NotoColorEmoji.ttf]{emojifont}
\DeclareStringOption[0.6]{emojiscale}
\DeclareStringOption[0.1em]{emojiraise}
\ProcessKeyvalOptions{pytooling}
% ============================================================
% Validate required option
% ============================================================
%\ifx\pytooling@fontfamily\@empty
% \PackageError{pytooling}{Option 'fontfamily' is required}{%
% Specify the font family to use, e.g.\MessageBreak
% \string\usepackage[fontfamily=libertinus]{pytooling}.\MessageBreak
% Valid values: libertinus, latinmodern, noto.}
%\fi
% ============================================================
% Font family setup
% ============================================================
\RequirePackage{amsmath,amstext}
\RequirePackage{unicode-math}
\def\pytooling@ff@libertinus{libertinus}
\def\pytooling@ff@latinmodern{latinmodern}
\def\pytooling@ff@noto{noto}
\def\pytooling@ff@dejavu{dejavu}
\ifx\pytooling@fontfamily\pytooling@ff@libertinus
\setmainfont{Libertinus Serif}
\setsansfont{Libertinus Sans}
\setmonofont{Libertinus Mono}
\setmathfont{Libertinus Math}
\else\ifx\pytooling@fontfamily\pytooling@ff@latinmodern
\setmainfont{Latin Modern Roman}[
SizeFeatures={
{Size={-6}, Font=LMRoman5-Regular},
{Size={6-7}, Font=LMRoman6-Regular},
{Size={7-8}, Font=LMRoman7-Regular},
{Size={8-9}, Font=LMRoman8-Regular},
{Size={9-10}, Font=LMRoman9-Regular},
{Size={10-12}, Font=LMRoman10-Regular},
{Size={12-17}, Font=LMRoman12-Regular},
{Size={17-}, Font=LMRoman17-Regular},
},
SmallCapsFont={Latin Modern Roman Caps},
SlantedFont={Latin Modern Roman Slanted},
SlantedFeatures={SmallCapsFont={LMRomanCaps10-Oblique}},
ItalicFont={LMRoman10-Italic},
BoldFont={LMRoman10-Bold},
BoldItalicFont={LMRoman10-BoldItalic},
]
\setsansfont{Latin Modern Sans}[
SizeFeatures={
{Size={-9}, Font=LMSans8-Regular},
{Size={9-10}, Font=LMSans9-Regular},
{Size={10-12}, Font=LMSans10-Regular},
{Size={12-17}, Font=LMSans12-Regular},
{Size={17-}, Font=LMSans17-Regular},
},
ItalicFont={LMSans10-Oblique},
BoldFont={LMSans10-Bold},
BoldItalicFont={LMSans10-BoldOblique},
]
\setmonofont{Latin Modern Mono}[
SmallCapsFont={Latin Modern Mono Caps},
SlantedFont={Latin Modern Mono Slanted},
]
\setmathfont{Latin Modern Math}
\else\ifx\pytooling@fontfamily\pytooling@ff@noto
\setmainfont{Noto Serif}
\setsansfont{Noto Sans}
\setmonofont{Noto Sans Mono}
\setmathfont{Noto Sans Math}
\else\ifx\pytooling@fontfamily\pytooling@ff@dejavu
\setmainfont{DejaVu Serif}
\setsansfont{DejaVu Sans}
\setmonofont{DejaVu Sans Mono}
\setmathfont{DejaVu Math TeX Gyre}
\else
\PackageError{pytooling}{Unknown fontfamily '\pytooling@fontfamily'}{%
Valid values: libertinus, latinmodern, noto, dejavu.}
\fi\fi\fi\fi
% ============================================================
% Emoji font setup
% ============================================================
\RequirePackage{newunicodechar}
\newfontfamily{\emojifont}[Renderer=OpenType, Scale=\pytooling@emojiscale]{\pytooling@emojifont}
\newcommand{\emoji}[1]{{\raisebox{\pytooling@emojiraise}{\emojifont{#1}\;}}}
% ============================================================
% Unicode character/symbol definitions
% ============================================================
\newunicodechar{≤}{\ensuremath{≤}} % \le
\newunicodechar{≥}{\ensuremath{≥}} % \ge
\newunicodechar{±}{\ensuremath{\pm}}
\newunicodechar{—}{---}
\newunicodechar{…}{\dots}
%\newunicodechar{␣}{ } % open box = visible space U+2423
\newunicodechar{⟲}{\ensuremath{\acwopencirclearrow}} % circular arrow counterclockwise U+27F2
\newunicodechar{←}{\ensuremath{\leftarrow}} % Leftwards Arrow U+2190
\newunicodechar{↑}{\ensuremath{\uparrow}} % Upwards Arrow U+2191
\newunicodechar{→}{\ensuremath{\rightarrow}} % Rightwards Arrow U+2192
\newunicodechar{↓}{\ensuremath{\downarrow}} % Downwards Arrow U+2193
\newunicodechar{↔}{\ensuremath{\leftrightarrow}} % U+2194
\newunicodechar{↕}{\ensuremath{\updowntarrow}} % U+2195
\newunicodechar{↖}{\ensuremath{\nwarrow}} % U+2196
\newunicodechar{↗}{\ensuremath{\nearrow}} % U+2197
\newunicodechar{↘}{\ensuremath{\searrow}} % U+2198
\newunicodechar{↙}{\ensuremath{\swarrow}} % U+2199
\newunicodechar{➚}{\ensuremath{\nearrow}} % WORKAROUND FOR Heavy North East Arrow U+279A
%\newunicodechar{⭠}{\ensuremath{⭠}} % Leftwards Triangle-Headed Arrow U+2B60
%\newunicodechar{⭡}{\ensuremath{⭡}} % Upwards Triangle-Headed Arrow U+2B61
%\newunicodechar{⭢}{\ensuremath{⭢}} % Rightwards Triangle-Headed Arrow U+2B62
%\newunicodechar{⭣}{\ensuremath{⭣}} % Downwards Triangle-Headed Arrow U+2B63
% ============================================================
% Unicode icon definitions
% ============================================================
\newunicodechar{🍎}{\emoji{🍎}} % red apple U+1F34E
\newunicodechar{🍏}{\emoji{🍏}} % green apple U+1F34F
\newunicodechar{🐧}{\emoji{🐧}} % penguin U+1F427
\newunicodechar{⛄}{\emoji{⛄}} % snowman U+26C4
\newunicodechar{🪟}{\emoji{🪟}} % window U+1FA9F
\newunicodechar{🏢}{\emoji{🏢}} % glas building U+1F3E2
\newunicodechar{🐍}{\emoji{🐍}} % green snake U+1F40D
\newunicodechar{🐛}{\emoji{🐛}} % Bug U+1F41B
\newunicodechar{🪳}{\emoji{🪳}} % Cockroach U+1FAB3
\newunicodechar{🔴}{\emoji{🔴}} % large red circle U+1F534
\newunicodechar{🔵}{\emoji{🔵}} % large blue circle U+1F535
\newunicodechar{🟠}{\emoji{🟠}} % large orange circle U+1F7E0
\newunicodechar{🟡}{\emoji{🟡}} % large yellow circle U+1F7E1
\newunicodechar{🟢}{\emoji{🟢}} % large green circle U+1F7E2
\newunicodechar{🟣}{\emoji{🟣}} % large purple circle U+1F7E3
\newunicodechar{🟤}{\emoji{🟤}} % large yellow circle U+1F7E4
\newunicodechar{⚫}{\emoji{⚫}} % medium black circle U+26AB
\newunicodechar{⬤}{\emoji{⬤}} % black large circle U+2B24
\newunicodechar{🟥}{\emoji{🟥}} % large red square U+1F7E5
\newunicodechar{🟦}{\emoji{🟦}} % large blue square U+1F7E6
\newunicodechar{🟧}{\emoji{🟧}} % large red square U+1F7E7
\newunicodechar{🟨}{\emoji{🟨}} % large yellow square U+1F7E8
\newunicodechar{🟩}{\emoji{🟩}} % large yellow square U+1F7E9
\newunicodechar{🟪}{\emoji{🟪}} % large purple square U+1F7EA
\newunicodechar{🟫}{\emoji{🟫}} % large braun square U+1F7EB
\newunicodechar{⬛}{\emoji{⬛}} % black large square U+2B1B
\newunicodechar{📦}{\emoji{📦}} % Package U+1F4E6
\newunicodechar{📁}{\emoji{📁}} % File Folder U+1F4C1
\newunicodechar{📂}{\emoji{📂}} % Open File Folder U+1F4C2
\newunicodechar{🪣}{\emoji{🪣}} % Bucket ️ U+1FAA3
\newunicodechar{🗑}{\emoji{🗑}} % Wastebasket 🗑️ U+1F5D1
\newunicodechar{⚙}{\emoji{⚙}} % Gear ⚙️ U+2699
\newunicodechar{⛔}{\emoji{⛔}} % No entry U+26D4
\newunicodechar{❌}{\emoji{❌}} % Cross Mark U+274C
\newunicodechar{❓}{\emoji{❓}} % Black Question Mark Ornament U+2753
\newunicodechar{❗}{\emoji{❗}} % Heavy Exclamation Mark Symbol U+2757
\newunicodechar{➖}{\emoji{➖}} % Heavy Minus Sign U+2796
\newunicodechar{🚫}{\emoji{🚫}} % No entry sign U+1F6AB
\newunicodechar{🛇}{\emoji{🛇}} % Prohibited U+1F6C7
\newunicodechar{⚠}{\emoji{⚠}} % Warning U+26A0
\newunicodechar{🚧}{\emoji{🚧}} % Construction sign U+1F6A7
\newunicodechar{✅}{\emoji{✅}} % White heavy check mark U+2705
\newunicodechar{🔥}{\emoji{🔥}} % Fire U+1F525
\newunicodechar{🐋}{\emoji{🐋}} % Whale U+1F40B
\newunicodechar{🐳}{\emoji{🐳}} % Spouting Whale U+1F433
\newunicodechar{⚓}{\emoji{⚓}} % Anchor U+2693
\newunicodechar{📤}{\emoji{📤}} % Outbox Tray U+1F4E4
\newunicodechar{📥}{\emoji{📥}} % Inbox Tray U+1F4E5
\newunicodechar{👀}{\emoji{👀}} % Eyes U+1F440
\newunicodechar{👆}{\emoji{👆}} % White Up Pointing Backhand Index U+1F446
\newunicodechar{👇}{\emoji{👇}} % White Down Pointing Backhand Index U+1F447
\newunicodechar{📈}{\emoji{📈}} % Chart with Upwards Trend U+1F4C8
\newunicodechar{📉}{\emoji{📉}} % Chart with Downwards Trend U+1F4C9
\newunicodechar{📊}{\emoji{📊}} % Bar Chart U+1F4CA
\newunicodechar{📓}{\emoji{📓}} % Notebook U+1F4D3
\newunicodechar{📝}{\emoji{📝}} % Memo U+1F4DD
\newunicodechar{🔍}{\emoji{🔍}} % Left-Pointing Magnifying Glass U+1F50D
\newunicodechar{🔒}{\emoji{🔒}} % Lock U+1F512
\newunicodechar{🔓}{\emoji{🔓}} % Open Lock U+1F513
\newunicodechar{🔑}{\emoji{🔑}} % Key U+1F511
\newunicodechar{🔔}{\emoji{🔔}} % Bell U+1F514
\newunicodechar{🔗}{\emoji{🔗}} % Link Symbol U+1F517
\newunicodechar{🔧}{\emoji{🔧}} % Wrench U+1F527
\newunicodechar{🔨}{\emoji{🔨}} % Hammer U+1F528
\newunicodechar{🗎}{\emoji{🗎}} % Document U+1F5CE
\newunicodechar{⭐}{\emoji{⭐}} % White medium star U+2B50
\newunicodechar{⌛}{\emoji{⌛}} % Hourglass U+231B
% ============================================================
% End of LaTeX package
% ============================================================
\endinput