Debian Codegraph @

texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty

raw
1 %%
2 %% This is file `unicode-math-xetex.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% unicode-math.dtx (with options: `package,XE')
8 %% um-code-opening.dtx (with options: `package,XE')
9 %% um-code-variables.dtx (with options: `package,XE')
10 %% um-code-api.dtx (with options: `package,XE')
11 %% um-code-ui.dtx (with options: `package,XE')
12 %% um-code-pkgopt.dtx (with options: `package,XE')
13 %% um-code-msg.dtx (with options: `package,XE')
14 %% um-code-usv.dtx (with options: `package,XE')
15 %% um-code-setchar.dtx (with options: `package,XE')
16 %% um-code-mathtext.dtx (with options: `package,XE')
17 %% um-code-main.dtx (with options: `package,XE')
18 %% um-code-fontopt.dtx (with options: `package,XE')
19 %% um-code-fontparam.dtx (with options: `package,XE')
20 %% um-code-mathmap.dtx (with options: `package,XE')
21 %% um-code-sym-commands.dtx (with options: `package,XE')
22 %% um-code-alphabets.dtx (with options: `package,XE')
23 %% um-code-primes.dtx (with options: `package,XE')
24 %% um-code-sscript.dtx (with options: `package,XE')
25 %% um-code-compat.dtx (with options: `package,XE')
26 %% um-code-amsmath.dtx (with options: `package,XE')
27 %% um-code-epilogue.dtx (with options: `package,XE')
28 %%
29 %% ------------------------------------------------
30 %% The UNICODE-MATH package <wspr.io/unicode-math>
31 %% ------------------------------------------------
32 %% This package is free software and may be redistributed and/or modified under
33 %% the conditions of the LaTeX Project Public License, version 1.3c or higher
34 %% (your choice): <http://www.latex-project.org/lppl/>.
35 %% ------------------------------------------------
36 %% Copyright 2006-2018 Will Robertson, LPPL "maintainer"
37 %% Copyright 2010-2017 Philipp Stephani
38 %% Copyright 2011-2017 Joseph Wright
39 %% Copyright 2012-2015 Khaled Hosny
40 %% ------------------------------------------------
41 %%
42 %%^^A%% unicode-math.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
43 %%^^A%% Metadata for the package code, including files and versioning
44
45 \ProvidesExplPackage{unicode-math-xetex}
46 {2023/08/13} {0.8r} {Unicode maths in XeLaTeX and LuaLaTeX}
47
48 %%^^A%% um-code-opening.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
49 %%^^A%% Assorted initialisation tasks, including some low-level function definitions.
50
51 \RequirePackage{xparse,l3keys2e}
52 \RequirePackage{fontspec}
53 \RequirePackage{fix-cm}
54 \RequirePackage{amsmath}
55 \cs_set_protected:Npn \__um_after_package:nNn #1 #2 #3
56 {
57 \AtBeginDocument
58 {
59 \cs_new_protected:Npn #2 {#3}
60 \@ifpackageloaded {#1} {#2} {}
61 }
62 }
63 \cs_set_protected_nopar:Npn \exp_last_unbraced:NNx { \::N \::x_unbraced \::: }
64 \cs_generate_variant:Nn \fontspec_set_family:Nnn {Nx,Nxx}
65 \cs_generate_variant:Nn \prop_get:NnNTF {cx}
66 \cs_generate_variant:Nn \tl_if_eq:nnF {o}
67 \cs_set_eq:NN \__um_group_begin: \group_begin:
68 \cs_set_protected:Npn \__um_group_end:n #1 { #1 \group_end: }
69 \cs_set_eq:NN \__um_group_begin_frozen: \__um_group_begin:
70 \cs_set_eq:NN \__um_group_end_frozen:n \__um_group_end:n
71 \prg_new_conditional:Nnn \__um_glyph_if_exist:Nn {p,TF,T,F}
72 {
73 \tex_iffontchar:D #1 #2 \scan_stop:
74 \prg_return_true:
75 \else:
76 \prg_return_false:
77 \fi:
78 }
79 \cs_set_protected:Nn \__um_fontface_gset_eq:NN
80 {
81 \tex_global:D \tex_let:D #1 #2
82 }
83 \cs_generate_variant:Nn \__um_fontface_gset_eq:NN {cN}
84 \cs_set:Npn \__um_set_mathcode:nnnn #1#2#3#4
85 {
86 \Umathcode \int_eval:n {#1} =
87 \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#4} \scan_stop:
88 }
89 \cs_set:Npn \__um_set_mathcode:nnn #1#2#3
90 {
91 \Umathcode \int_eval:n {#1} =
92 \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#1} \scan_stop:
93 }
94 \cs_set:Npn \__um_set_mathchar:NNnn #1#2#3#4
95 {
96 \Umathchardef #1 =
97 \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#4} \scan_stop:
98 }
99 \cs_generate_variant:Nn \__um_set_mathchar:NNnn {c}
100 \cs_new:Nn \__um_set_delcode:nnn
101 {
102 \Udelcode#2 = \csname sym#1\endcsname #3 \scan_stop:
103 }
104 \cs_new:Nn \__um_radical:nn
105 {
106 \Uradical \csname sym#1\endcsname #2 \scan_stop:
107 }
108 \cs_new:Nn \__um_delimiter:Nnn
109 {
110 \Udelimiter \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop:
111 }
112 \cs_new:Nn \__um_accent:nnn
113 {
114 \Umathaccent #1~ \mathchar@type\mathaccent \use:c { sym #2 } #3 \scan_stop:
115 }
116 \cs_new:Nn \__um_char_gmake_mathactive:N
117 {
118 \tex_global:D \tex_mathcode:D `#1 = "8000 \scan_stop:
119 }
120 \cs_new:Nn \__um_char_gmake_mathactive:n
121 {
122 \tex_global:D \tex_mathcode:D \int_eval:n {#1} = "8000 \scan_stop:
123 }
124 \cs_new:Nn \__um_mathactive_remap:nn
125 {
126 \group_begin:
127 \cs_set_protected:Npn \__um_tmp: {#2}
128 \__um_char_gmake_mathactive:n {#1}
129 \char_gset_active_eq:nN {#1} \__um_tmp:
130 \group_end:
131 }
132 \cs_new_protected:Nn \__um_mathgroup_set:n
133 {
134 \tex_fam:D #1 \scan_stop:
135 }
136 \cs_new:Nn \__um_copy_fontdimen:nnN
137 {
138 \fontdimen #1 \font = \the \fontdimen #2 #3 \relax
139 }
140 \cs_new:Nn \__um_zero_fontdimen:n
141 {
142 \fontdimen #1 \font = 0pt\relax
143 }
144 \prg_new_conditional:Nnn \__um_int_if_zero:n {p,TF,T,F}
145 {
146 \int_compare:nNnTF {#1} = 0 {\prg_return_true:} {\prg_return_false:}
147 }
148 \cs_new:Nn \usv_set:nnn { \tl_const:cn { c__um_#1_#2_usv } {#3} }
149 \cs_new:Nn \__um_to_usv:nn { \use:c { c__um_#1_#2_usv } }
150 \prg_new_conditional:Nnn \__um_usv_if_exist:nn {T,F,TF}
151 {
152 \cs_if_exist:cTF { c__um_#1_#2_usv }
153 \prg_return_true: \prg_return_false:
154 }
155 \tl_map_inline:nn
156 {
157 \new@mathgroup\cdp@list\cdp@elt\DeclareMathSizes
158 \@DeclareMathSizes\newmathalphabet\newmathalphabet__um\newmathalphabet__um@
159 \DeclareMathVersion\define@mathalphabet\define@mathgroup\addtoversion
160 \version@list\version@elt\alpha@list\alpha@elt
161 \restore@mathversion\init@restore@version\dorestore@version\process@table
162 \new@mathversion\DeclareSymbolFont\group@list\group@elt
163 \new@symbolfont\SetSymbolFont\SetSymbolFont@\get@cdp
164 \DeclareMathAlphabet\new@mathalphabet\SetMathAlphabet\SetMathAlphabet@
165 \DeclareMathAccent\set@mathaccent\DeclareMathSymbol\set@mathchar
166 \set@mathsymbol\DeclareMathDelimiter\@xxDeclareMathDelimiter
167 \@DeclareMathDelimiter\@xDeclareMathDelimiter\set@mathdelimiter
168 \set__ummathdelimiter\DeclareMathRadical\mathchar@type
169 \DeclareSymbolFontAlphabet\DeclareSymbolFontAlphabet@
170 }
171 {
172 \tl_remove_once:Nn \@preamblecmds {\do#1}
173 }
174 \cs_new:Npn \__um_error:n { \msg_error:nn {unicode-math} }
175 \cs_new:Npn \__um_error:nx { \msg_error:nnx {unicode-math} }
176 \cs_new:Npn \__um_warning:n { \msg_warning:nn {unicode-math} }
177 \cs_new:Npn \__um_warning:nnn { \msg_warning:nnxx {unicode-math} }
178 \cs_new:Npn \__um_log:n { \msg_log:nn {unicode-math} }
179 \cs_new:Npn \__um_log:nx { \msg_log:nnx {unicode-math} }
180 \cs_generate_variant:Nn \msg_new:nnn {nnx}
181 \cs_generate_variant:Nn \msg_new:nnnn {nnxx}
182 \cs_new:Nn \__um_msg_new:nn { \msg_new:nnx {unicode-math} {#1} { \tl_trim_spaces:n {#2} } }
183 \cs_new:Npn \__um_cs_set:Nn #1 #2
184 {
185 \cs_if_exist:NF #1 { \ERROR{CS~ DOES~ NOT~ EXIST,~ USE~ "NEW"} }
186 \cs_set_protected:Nn #1
187 {
188 #2
189 }
190 }
191 \cs_new:Npn \__um_cs_new:Nn #1 #2
192 {
193 \cs_new_protected:Nn #1
194 {
195 #2
196 }
197 }
198
199 %%^^A%% um-code-variables.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
200 %%^^A%% Declaration of all code-level variables used in the package.
201
202 \bool_new:N \g__um_ot_math_bool
203 \bool_new:N \g__um_main_font_defined_bool
204 \bool_new:N \g__um_init_bool
205 \bool_new:N \l__um_implicit_alph_bool
206 \bool_new:N \g__um_literal_bool
207 \bool_new:N \g__um_upLatin_bool
208 \bool_new:N \g__um_uplatin_bool
209 \bool_new:N \g__um_upGreek_bool
210 \bool_new:N \g__um_upgreek_bool
211 \bool_new:N \g__um_bfliteral_bool
212 \bool_new:N \g__um_bfupLatin_bool
213 \bool_new:N \g__um_bfuplatin_bool
214 \bool_new:N \g__um_bfupGreek_bool
215 \bool_new:N \g__um_bfupgreek_bool
216 \bool_new:N \g__um_upsans_bool
217 \bool_new:N \g__um_sfliteral_bool
218 \bool_new:N \g__um_upNabla_bool
219 \bool_new:N \g__um_uppartial_bool
220 \bool_new:N \g__um_literal_Nabla_bool
221 \bool_new:N \g__um_literal_partial_bool
222 \bool_new:N \l__um_smallfrac_bool
223 \bool_new:N \g__um_literal_colon_bool
224 \bool_new:N \g__um_mathrm_text_bool
225 \bool_new:N \g__um_mathit_text_bool
226 \bool_new:N \g__um_mathbf_text_bool
227 \bool_new:N \g__um_mathsf_text_bool
228 \bool_new:N \g__um_mathtt_text_bool
229 \int_new:N \g__um_fam_int
230 \int_new:N \g__um_fonts_used_int
231 \int_new:N \l__um_primecount_int
232 \tl_const:Nn \c__um_math_alphabet_name_latin_tl {Latin,~lowercase}
233 \tl_const:Nn \c__um_math_alphabet_name_Latin_tl {Latin,~uppercase}
234 \tl_const:Nn \c__um_math_alphabet_name_greek_tl {Greek,~lowercase}
235 \tl_const:Nn \c__um_math_alphabet_name_Greek_tl {Greek,~uppercase}
236 \tl_const:Nn \c__um_math_alphabet_name_num_tl {Numerals}
237 \tl_const:Nn \c__um_math_alphabet_name_misc_tl {Misc.}
238 \tl_new:N \l__um_style_tl
239 \tl_new:N \l__um_family_tl
240 \tl_new:N \l__um_alphabet_tl
241 \tl_new:N \l__um_fontname_tl
242 \tl_new:N \l__um_symfont_label_tl
243 \tl_new:N \l__um_remap_style_tl
244 \tl_new:N \l__um_fam_two_tl
245 \tl_new:N \l__um_fam_three_tl
246 \tl_new:N \l__um_curr_named_slot
247 \tl_new:N \l__um_tmpa_tl
248 \tl_new:N \l__um_tmpb_tl
249 \tl_new:N \l__um_tmpc_tl
250 \tl_new:N \l__um_mathstyle_tl
251 \tl_new:N \l__um_radicals_tl
252 \tl_new:N \l__um_nolimits_tl
253 \tl_new:N \l__um_trial_family_tl
254 \tl_new:N \l__um_ss_chain_tl
255 \tl_new:N \l__um_tmpa_key_tl
256 \tl_new:N \g__um_operator_mathfont_tl
257 \tl_new:N \g__um_slash_delimiter_usv
258 \tl_new:N \g__um_mathparam_settings_tl
259 \tl_new:N \l__um_mathtable_tl
260 \tl_new:N \g__um_mathtable_tl
261 \tl_new:N \g__um_fontname_tl
262 \tl_new:N \g__um_mversion_tl
263 \tl_new:N \g__um_symfont_tl
264 \tl_new:N \l__um_font_keyval_tl
265 \tl_new:N \g__um_family_tl
266 \tl_new:N \g__um_style_tl
267 \tl_new:N \g__um_remap_style_tl
268 \tl_new:N \l__um_not_token_name_tl
269 \tl_new:N \g__um_curr_font_cmd_tl
270 \tl_new:N \g__um_sqrt_font_cmd_tl
271 \tl_new:N \g__um_prime_font_cmd_tl
272 \clist_new:N \g__um_char_nrange_clist
273 \clist_new:N \g__um_unknown_keys_clist
274 \clist_new:N \g__um_alphabet_clist
275 \clist_new:N \l__um_mathmap_charints_clist
276 \clist_new:N \l__um_unknown_keys_clist
277 \clist_new:N \l__um_keyval_clist
278 \clist_new:N \l__um_alphabet_clist
279 \clist_new:N \g__um_bad_alpha_clist
280 \clist_gput_right:Nx \g__um_bad_alpha_clist { \tl_to_str:n {bf} }
281 \clist_gput_right:Nx \g__um_bad_alpha_clist { \tl_to_str:n {sf} }
282 \clist_gput_right:Nx \g__um_bad_alpha_clist { \tl_to_str:n {bfsf} }
283 \seq_new:N \l__um_missing_alph_seq
284 \seq_new:N \g__um_mathalph_seq
285 \seq_new:N \g__um_char_range_seq
286 \seq_new:N \g__um_mclass_range_seq
287 \seq_new:N \g__um_mathclasses_seq
288 \seq_gset_from_clist:Nn \g__um_mathclasses_seq
289 {
290 \mathord,\mathalpha,\mathbin,\mathrel,\mathpunct,
291 \mathop,
292 \mathopen,\mathclose,
293 \mathfence,\mathover,\mathunder,
294 \mathaccent,\mathaccentoverlay,\mathbotaccent,\mathaccentwide,\mathbotaccentwide
295 }
296 \seq_new:N \g__um_default_mathalph_seq
297 \seq_new:N \g__um_mathstyles_seq
298 \prop_new:N \g__um_supers_prop
299 \prop_new:N \g__um_subs_prop
300 \muskip_new:N \g__um_primekern_muskip
301 \muskip_gset:Nn \g__um_primekern_muskip { -\thinmuskip/2 }% arbitrary
302 \fp_new:N \g__um_size_tfsf_fp
303 \fp_new:N \g__um_size_sfssf_fp
304 \quark_new:N \q_unicode_math
305
306 %%^^A%% um-code-api.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
307 %%^^A%% The (underdeveloped) API to interface with the package internals.
308
309 \cs_new:Nn \unimath_get_mathstyle:
310 {
311 \tl_use:N \l__um_mathstyle_tl
312 }
313
314 %%^^A%% um-code-ui.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
315 %%^^A%% The xparse user interface top-level definitions.
316
317 \NewDocumentCommand \unimathsetup {m} { \keys_set:nn {unicode-math} {#1} }
318 \NewDocumentCommand \setmathfont { O{} m O{} }
319 {
320 \__um_setmathfont:nn {#1,#3} {#2}
321 }
322 \NewDocumentCommand \setmathfontface { m O{} m O{} }
323 {
324 \__um_setmathfontface:Nnn #1 {#2,#4} {#3}
325 }
326 \@onlypreamble \setmathfontface
327 \NewDocumentCommand \setoperatorfont {m}
328 {
329 \tl_gset:Nn \g__um_operator_mathfont_tl {#1}
330 }
331 \setoperatorfont{\mathrm}
332 \NewDocumentCommand \addnolimits {m}
333 {
334 \tl_put_right:Nn \l__um_nolimits_tl {#1}
335 }
336 \NewDocumentCommand \removenolimits {m}
337 {
338 \tl_remove_all:Nn \l__um_nolimits_tl {#1}
339 }
340
341 %%^^A%% um-code-pkgopt.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
342 %%^^A%% Package options.
343
344 \cs_new:Nn \__um_keys_choices:nn
345 {
346 \cs_set:Npn \__um_keys_choices_fn:nn { \__um_keys_choices_aux:nnn {#1} }
347 \use:x
348 {
349 \exp_not:N \keys_define:nn {unicode-math}
350 {
351 #1 .choice: ,
352 \__um_tl_map_dbl:nN {#2} \__um_keys_choices_fn:nn
353 }
354 }
355 }
356 \cs_new:Nn \__um_keys_choices_aux:nnn { #1 / #2 .code:n = { \exp_not:n {#3} } , }
357 \cs_new:Nn \__um_tl_map_dbl:nN
358 {
359 \__um_tl_map_dbl:Nnn #2 #1 \q_recursion_tail {}{} \q_recursion_stop
360 }
361 \cs_new:Nn \__um_tl_map_dbl:Nnn
362 {
363 \quark_if_recursion_tail_stop:n {#2}
364 \quark_if_recursion_tail_stop:n {#3}
365 #1 {#2} {#3}
366 \__um_tl_map_dbl:Nnn #1
367 }
368 \__um_keys_choices:nn {mathup}
369 {
370 {sym} { \bool_gset_false:N \g__um_mathrm_text_bool }
371 {text} { \bool_gset_true:N \g__um_mathrm_text_bool }
372 }
373 \__um_keys_choices:nn {mathrm}
374 {
375 {sym} { \bool_gset_false:N \g__um_mathrm_text_bool }
376 {text} { \bool_gset_true:N \g__um_mathrm_text_bool }
377 }
378 \__um_keys_choices:nn {mathit}
379 {
380 {sym} { \bool_gset_false:N \g__um_mathit_text_bool }
381 {text} { \bool_gset_true:N \g__um_mathit_text_bool }
382 }
383 \__um_keys_choices:nn {mathbf}
384 {
385 {sym} { \bool_gset_false:N \g__um_mathbf_text_bool }
386 {text} { \bool_gset_true:N \g__um_mathbf_text_bool }
387 }
388 \__um_keys_choices:nn {mathsf}
389 {
390 {sym} { \bool_gset_false:N \g__um_mathsf_text_bool }
391 {text} { \bool_gset_true:N \g__um_mathsf_text_bool }
392 }
393 \__um_keys_choices:nn {mathtt}
394 {
395 {sym} { \bool_gset_false:N \g__um_mathtt_text_bool }
396 {text} { \bool_gset_true:N \g__um_mathtt_text_bool }
397 }
398 \__um_keys_choices:nn {normal-style}
399 {
400 {ISO} {
401 \bool_gset_false:N \g__um_literal_bool
402 \bool_gset_false:N \g__um_upGreek_bool
403 \bool_gset_false:N \g__um_upgreek_bool
404 \bool_gset_false:N \g__um_upLatin_bool
405 \bool_gset_false:N \g__um_uplatin_bool
406 }
407 {TeX} {
408 \bool_gset_false:N \g__um_literal_bool
409 \bool_gset_true:N \g__um_upGreek_bool
410 \bool_gset_false:N \g__um_upgreek_bool
411 \bool_gset_false:N \g__um_upLatin_bool
412 \bool_gset_false:N \g__um_uplatin_bool
413 }
414 {french} {
415 \bool_gset_false:N \g__um_literal_bool
416 \bool_gset_true:N \g__um_upGreek_bool
417 \bool_gset_true:N \g__um_upgreek_bool
418 \bool_gset_true:N \g__um_upLatin_bool
419 \bool_gset_false:N \g__um_uplatin_bool
420 }
421 {upright} {
422 \bool_gset_false:N \g__um_literal_bool
423 \bool_gset_true:N \g__um_upGreek_bool
424 \bool_gset_true:N \g__um_upgreek_bool
425 \bool_gset_true:N \g__um_upLatin_bool
426 \bool_gset_true:N \g__um_uplatin_bool
427 }
428 {literal} {
429 \bool_gset_true:N \g__um_literal_bool
430 }
431 }
432 \__um_keys_choices:nn {math-style}
433 {
434 {ISO} {
435 \unimathsetup { nabla=upright, partial=italic,
436 normal-style=ISO, bold-style=ISO, sans-style=italic }
437 }
438 {TeX} {
439 \unimathsetup { nabla=upright, partial=italic,
440 normal-style=TeX, bold-style=TeX, sans-style=upright }
441 }
442 {french} {
443 \unimathsetup { nabla=upright, partial=upright,
444 normal-style=french, bold-style=upright, sans-style=upright }
445 }
446 {upright} {
447 \unimathsetup { nabla=upright, partial=upright,
448 normal-style=upright, bold-style=upright, sans-style=upright }
449 }
450 {literal} {
451 \unimathsetup { colon=literal, nabla=literal, partial=literal,
452 normal-style=literal, bold-style=literal, sans-style=literal }
453 }
454 }
455 \__um_keys_choices:nn {bold-style}
456 {
457 {ISO} {
458 \bool_gset_false:N \g__um_bfliteral_bool
459 \bool_gset_false:N \g__um_bfupGreek_bool
460 \bool_gset_false:N \g__um_bfupgreek_bool
461 \bool_gset_false:N \g__um_bfupLatin_bool
462 \bool_gset_false:N \g__um_bfuplatin_bool
463 }
464 {TeX} {
465 \bool_gset_false:N \g__um_bfliteral_bool
466 \bool_gset_true:N \g__um_bfupGreek_bool
467 \bool_gset_false:N \g__um_bfupgreek_bool
468 \bool_gset_true:N \g__um_bfupLatin_bool
469 \bool_gset_true:N \g__um_bfuplatin_bool
470 }
471 {upright} {
472 \bool_gset_false:N \g__um_bfliteral_bool
473 \bool_gset_true:N \g__um_bfupGreek_bool
474 \bool_gset_true:N \g__um_bfupgreek_bool
475 \bool_gset_true:N \g__um_bfupLatin_bool
476 \bool_gset_true:N \g__um_bfuplatin_bool
477 }
478 {literal} {
479 \bool_gset_true:N \g__um_bfliteral_bool
480 }
481 }
482 \__um_keys_choices:nn {sans-style}
483 {
484 {italic} { \bool_gset_false:N \g__um_upsans_bool }
485 {upright} { \bool_gset_true:N \g__um_upsans_bool }
486 {literal} { \bool_gset_true:N \g__um_sfliteral_bool }
487 }
488 \__um_keys_choices:nn {nabla}
489 {
490 {upright} {
491 \bool_gset_false:N \g__um_literal_Nabla_bool
492 \bool_gset_true:N \g__um_upNabla_bool
493 }
494 {italic} {
495 \bool_gset_false:N \g__um_literal_Nabla_bool
496 \bool_gset_false:N \g__um_upNabla_bool
497 }
498 {literal} {
499 \bool_gset_true:N \g__um_literal_Nabla_bool
500 }
501 }
502 \__um_keys_choices:nn {partial}
503 {
504 {upright} {
505 \bool_gset_false:N \g__um_literal_partial_bool
506 \bool_gset_true:N \g__um_uppartial_bool
507 }
508 {italic} {
509 \bool_gset_false:N \g__um_literal_partial_bool
510 \bool_gset_false:N \g__um_uppartial_bool
511 }
512 {literal} {
513 \bool_gset_true:N \g__um_literal_partial_bool
514 }
515 }
516 \__um_keys_choices:nn {colon}
517 {
518 {literal} { \bool_gset_true:N \g__um_literal_colon_bool }
519 {TeX} { \bool_gset_false:N \g__um_literal_colon_bool }
520 }
521 \__um_keys_choices:nn {slash-delimiter}
522 {
523 {ascii} { \tl_gset:Nn \g__um_slash_delimiter_usv {"002F} }
524 {frac} { \tl_gset:Nn \g__um_slash_delimiter_usv {"2044} }
525 {div} { \tl_gset:Nn \g__um_slash_delimiter_usv {"2215} }
526 }
527 \__um_keys_choices:nn {active-frac}
528 {
529 {small}
530 {
531 \bool_set_true:N \l__um_smallfrac_bool
532 \use:c {__um_setup_active_frac:}
533 }
534
535 {normalsize}
536 {
537 \bool_set_false:N \l__um_smallfrac_bool
538 \use:c {__um_setup_active_frac:}
539 }
540 }
541 \keys_define:nn {unicode-math}
542 {
543 warnings-off .code:n =
544 {
545 \clist_map_inline:nn {#1}
546 { \msg_redirect_name:nnn { unicode-math } { ##1 } { none } }
547 }
548 }
549 \__um_keys_choices:nn {trace}
550 {
551 {on} {} % default
552 {debug} { \msg_redirect_module:nnn { unicode-math } { log } { warning } }
553 {off} { \msg_redirect_module:nnn { unicode-math } { log } { none } }
554 }
555 \unimathsetup {math-style=TeX}
556 \unimathsetup {slash-delimiter=ascii}
557 \unimathsetup {trace=off}
558 \unimathsetup {mathrm=text,mathit=text,mathbf=text,mathsf=text,mathtt=text}
559 \cs_if_exist:NT \tfrac { \unimathsetup {active-frac=small} }
560 \ProcessKeysOptions {unicode-math}
561
562 %%^^A%% um-code-msg.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
563 %%^^A%% Definitions of error, warning, and log messages.
564
565 \char_set_catcode_space:n {32}
566 \__um_msg_new:nn {default-math-font}
567 {
568 Defining the default maths font as '\l__um_fontname_tl'.
569 }
570 \__um_msg_new:nn {setup-implicit}
571 {
572 Setup alphabets: implicit mode.
573 }
574 \__um_msg_new:nn {setup-explicit}
575 {
576 Setup alphabets: explicit mode.
577 }
578 \__um_msg_new:nn {alph-initialise}
579 {
580 Initialising \@backslashchar math#1.
581 }
582 \__um_msg_new:nn {setup-alph}
583 {
584 Setup alphabet: #1.
585 }
586 \__um_msg_new:nn {no-alphabet}
587 {
588 I am trying to set up alphabet"#1" but there are no configuration settings for it.
589 (See source file "unicode-math-alphabets.dtx" to debug.)
590 }
591 \__um_msg_new:nn {no-named-range}
592 {
593 I am trying to define new alphabet "#2" in range "#1", but range "#1" hasn't been defined yet.
594 }
595 \__um_msg_new:nn {missing-alphabets}
596 {
597 Missing math alphabets in font "\fontname\g__um_curr_font_cmd_tl" \\ \\
598 \seq_map_function:NN \l__um_missing_alph_seq \__um_print_indent:n
599 }
600 \cs_new:Nn \__um_print_indent:n { \space\space\space\space #1 \\ }
601 \__um_msg_new:nn {macro-expected}
602 {
603 I've expected that #1 is a macro, but it isn't.
604 }
605 \__um_msg_new:nn {wrong-meaning}
606 {
607 I've expected #1 to have the meaning #3, but it has the meaning #2.
608 }
609 \__um_msg_new:nn {patch-macro}
610 {
611 I'm going to patch macro #1.
612 }
613 \__um_msg_new:nn {mathtools-overbracket} {
614 Using \token_to_str:N \overbracket\ and
615 \token_to_str:N \underbracket\ from
616 `mathtools' package.\\
617 \\
618 Use \token_to_str:N \Uoverbracket\ and
619 \token_to_str:N \Uunderbracket\ for
620 original `unicode-math' definition.
621 }
622 \__um_msg_new:nn {mathtools-colon} {
623 I'm going to overwrite the following commands from
624 the `mathtools' package: \\ \\
625 \ \ \ \ \token_to_str:N \dblcolon,
626 \token_to_str:N \coloneqq,
627 \token_to_str:N \Coloneqq,
628 \token_to_str:N \eqqcolon. \\ \\
629 Note that since I won't overwrite the other colon-like
630 commands, using them will lead to inconsistencies.
631 }
632 \__um_msg_new:nn {colonequals} {
633 I'm going to overwrite the following commands from
634 the `colonequals' package: \\ \\
635 \ \ \ \ \token_to_str:N \ratio,
636 \token_to_str:N \coloncolon,
637 \token_to_str:N \minuscolon, \\
638 \ \ \ \ \token_to_str:N \colonequals,
639 \token_to_str:N \equalscolon,
640 \token_to_str:N \coloncolonequals. \\ \\
641 Note that since I won't overwrite the other colon-like
642 commands, using them will lead to inconsistencies.
643 Furthermore, changing \token_to_str:N \colonsep \c_space_tl
644 or \token_to_str:N \doublecolonsep \c_space_tl won't have
645 any effect on the re-defined commands.
646 }
647 \__um_msg_new:nn {bad-cs-in-range}
648 {
649 Command `#1` in math range is not recognised as a maths symbol.
650 Check file "unicode-math-table.tex" for allowable commands.
651 }
652 \__um_msg_new:nn {legacy-char-not-supported}
653 {
654 Command `#1` is a legacy maths symbol that is not supported by unicode-math.
655 }
656 \__um_msg_new:nn {range-not-bf-sf}
657 {
658 Range alphabets cannot include alphabets referring to `bf`, `sf`, or `bfsf`
659 since they relate to input commands not output glyphs.
660 Use `bfit` or `bfup` (etc.) to specify which.
661 }
662 \__um_msg_new:nn {no-main-font}
663 {
664 No main maths font has been set up yet.\\If you simply want ‘the default’, use: \\
665 \iow_indent:n {\token_to_str:N\setmathfont{latinmodern-math.otf}}
666 }
667 \__um_msg_new:nn {not-ot-math}
668 {
669 The first font loaded by unicode-math must be an OpenType Math font (with script=math).
670 If you simply want ‘the default’ before loading supplementary fonts over the top for certain
671 ranges, use: \\
672 \iow_indent:n {\token_to_str:N\setmathfont{latinmodern-math.otf}}
673 }
674 \char_set_catcode_ignore:n {32}
675
676 %%^^A%% um-code-usv.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
677 %%^^A%% Mapping of mathematical unicode slots for alphabets.
678
679 \usv_set:nnn {normal} {num} {48}
680 \usv_set:nnn {normal} {Latin} {"1D434}
681 \usv_set:nnn {normal} {latin} {"1D44E}
682 \usv_set:nnn {normal} {Greek} {"1D6E2}
683 \usv_set:nnn {normal} {greek} {"1D6FC}
684 \usv_set:nnn {normal} {varTheta} {"1D6F3}
685 \usv_set:nnn {normal} {epsilon} {"1D716}
686 \usv_set:nnn {normal} {vartheta} {"1D717}
687 \usv_set:nnn {normal} {varkappa} {"1D718}
688 \usv_set:nnn {normal} {phi} {"1D719}
689 \usv_set:nnn {normal} {varrho} {"1D71A}
690 \usv_set:nnn {normal} {varpi} {"1D71B}
691 \usv_set:nnn {normal} {Nabla} {"1D6FB}
692 \usv_set:nnn {normal} {partial} {"1D715}
693 \usv_set:nnn {up} {num} {48}
694 \usv_set:nnn {up} {Latin} {65}
695 \usv_set:nnn {up} {latin} {97}
696 \usv_set:nnn {up} {Greek} {"391}
697 \usv_set:nnn {up} {greek} {"3B1}
698 \usv_set:nnn {it} {Latin} {"1D434}
699 \usv_set:nnn {it} {latin} {"1D44E}
700 \usv_set:nnn {it} {Greek} {"1D6E2}
701 \usv_set:nnn {it} {greek} {"1D6FC}
702 \usv_set:nnn {bb} {num} {"1D7D8}
703 \usv_set:nnn {bb} {Latin} {"1D538}
704 \usv_set:nnn {bb} {latin} {"1D552}
705 \usv_set:nnn {scr} {Latin} {"1D49C}
706 \usv_set:nnn {cal} {Latin} {"1D49C}
707 \usv_set:nnn {scr} {latin} {"1D4B6}
708 \usv_set:nnn {cal} {latin} {"1D4B6}
709 \usv_set:nnn {frak} {Latin} {"1D504}
710 \usv_set:nnn {frak} {latin} {"1D51E}
711 \usv_set:nnn {sf} {num} {"1D7E2}
712 \usv_set:nnn {sfup} {num} {"1D7E2}
713 \usv_set:nnn {sfit} {num} {"1D7E2}
714 \usv_set:nnn {sfup} {Latin} {"1D5A0}
715 \usv_set:nnn {sf} {Latin} {"1D5A0}
716 \usv_set:nnn {sfup} {latin} {"1D5BA}
717 \usv_set:nnn {sf} {latin} {"1D5BA}
718 \usv_set:nnn {sfit} {Latin} {"1D608}
719 \usv_set:nnn {sfit} {latin} {"1D622}
720 \usv_set:nnn {tt} {num} {"1D7F6}
721 \usv_set:nnn {tt} {Latin} {"1D670}
722 \usv_set:nnn {tt} {latin} {"1D68A}
723 \usv_set:nnn {bf} {num} {"1D7CE}
724 \usv_set:nnn {bfup} {num} {"1D7CE}
725 \usv_set:nnn {bfit} {num} {"1D7CE}
726 \usv_set:nnn {bfup} {Latin} {"1D400}
727 \usv_set:nnn {bfup} {latin} {"1D41A}
728 \usv_set:nnn {bfup} {Greek} {"1D6A8}
729 \usv_set:nnn {bfup} {greek} {"1D6C2}
730 \usv_set:nnn {bfit} {Latin} {"1D468}
731 \usv_set:nnn {bfit} {latin} {"1D482}
732 \usv_set:nnn {bfit} {Greek} {"1D71C}
733 \usv_set:nnn {bfit} {greek} {"1D736}
734 \usv_set:nnn {bffrak} {Latin} {"1D56C}
735 \usv_set:nnn {bffrak} {latin} {"1D586}
736 \usv_set:nnn {bfscr} {Latin} {"1D4D0}
737 \usv_set:nnn {bfcal} {Latin} {"1D4D0}
738 \usv_set:nnn {bfscr} {latin} {"1D4EA}
739 \usv_set:nnn {bfcal} {latin} {"1D4EA}
740 \usv_set:nnn {bfsf} {num} {"1D7EC}
741 \usv_set:nnn {bfsfup} {num} {"1D7EC}
742 \usv_set:nnn {bfsfit} {num} {"1D7EC}
743 \usv_set:nnn {bfsfup} {Latin} {"1D5D4}
744 \usv_set:nnn {bfsfup} {latin} {"1D5EE}
745 \usv_set:nnn {bfsfup} {Greek} {"1D756}
746 \usv_set:nnn {bfsfup} {greek} {"1D770}
747 \usv_set:nnn {bfsfit} {Latin} {"1D63C}
748 \usv_set:nnn {bfsfit} {latin} {"1D656}
749 \usv_set:nnn {bfsfit} {Greek} {"1D790}
750 \usv_set:nnn {bfsfit} {greek} {"1D7AA}
751 \usv_set:nnn {bfsf} {Latin} { \bool_if:NTF \g__um_upLatin_bool \g__um_bfsfup_Latin_usv \g__um_bfsfit_Latin_usv }
752 \usv_set:nnn {bfsf} {latin} { \bool_if:NTF \g__um_uplatin_bool \g__um_bfsfup_latin_usv \g__um_bfsfit_latin_usv }
753 \usv_set:nnn {bfsf} {Greek} { \bool_if:NTF \g__um_upGreek_bool \g__um_bfsfup_Greek_usv \g__um_bfsfit_Greek_usv }
754 \usv_set:nnn {bfsf} {greek} { \bool_if:NTF \g__um_upgreek_bool \g__um_bfsfup_greek_usv \g__um_bfsfit_greek_usv }
755 \usv_set:nnn {bf} {Latin} { \bool_if:NTF \g__um_bfupLatin_bool \g__um_bfup_Latin_usv \g__um_bfit_Latin_usv }
756 \usv_set:nnn {bf} {latin} { \bool_if:NTF \g__um_bfuplatin_bool \g__um_bfup_latin_usv \g__um_bfit_latin_usv }
757 \usv_set:nnn {bf} {Greek} { \bool_if:NTF \g__um_bfupGreek_bool \g__um_bfup_Greek_usv \g__um_bfit_Greek_usv }
758 \usv_set:nnn {bf} {greek} { \bool_if:NTF \g__um_bfupgreek_bool \g__um_bfup_greek_usv \g__um_bfit_greek_usv }
759 \usv_set:nnn {up} {varTheta} {"3F4}
760 \usv_set:nnn {up} {Digamma} {"3DC}
761 \usv_set:nnn {up} {epsilon} {"3F5}
762 \usv_set:nnn {up} {vartheta} {"3D1}
763 \usv_set:nnn {up} {varkappa} {"3F0}
764 \usv_set:nnn {up} {phi} {"3D5}
765 \usv_set:nnn {up} {varrho} {"3F1}
766 \usv_set:nnn {up} {varpi} {"3D6}
767 \usv_set:nnn {up} {digamma} {"3DD}
768 \usv_set:nnn {bfup} {varTheta} {"1D6B9}
769 \usv_set:nnn {bfup} {Digamma} {"1D7CA}
770 \usv_set:nnn {bfup} {epsilon} {"1D6DC}
771 \usv_set:nnn {bfup} {vartheta} {"1D6DD}
772 \usv_set:nnn {bfup} {varkappa} {"1D6DE}
773 \usv_set:nnn {bfup} {phi} {"1D6DF}
774 \usv_set:nnn {bfup} {varrho} {"1D6E0}
775 \usv_set:nnn {bfup} {varpi} {"1D6E1}
776 \usv_set:nnn {bfup} {digamma} {"1D7CB}
777 \usv_set:nnn {it} {varTheta} {"1D6F3}
778 \usv_set:nnn {it} {epsilon} {"1D716}
779 \usv_set:nnn {it} {vartheta} {"1D717}
780 \usv_set:nnn {it} {varkappa} {"1D718}
781 \usv_set:nnn {it} {phi} {"1D719}
782 \usv_set:nnn {it} {varrho} {"1D71A}
783 \usv_set:nnn {it} {varpi} {"1D71B}
784 \usv_set:nnn {bfit} {varTheta} {"1D72D}
785 \usv_set:nnn {bfit} {epsilon} {"1D750}
786 \usv_set:nnn {bfit} {vartheta} {"1D751}
787 \usv_set:nnn {bfit} {varkappa} {"1D752}
788 \usv_set:nnn {bfit} {phi} {"1D753}
789 \usv_set:nnn {bfit} {varrho} {"1D754}
790 \usv_set:nnn {bfit} {varpi} {"1D755}
791 \usv_set:nnn {bfsfup} {varTheta} {"1D767}
792 \usv_set:nnn {bfsfup} {epsilon} {"1D78A}
793 \usv_set:nnn {bfsfup} {vartheta} {"1D78B}
794 \usv_set:nnn {bfsfup} {varkappa} {"1D78C}
795 \usv_set:nnn {bfsfup} {phi} {"1D78D}
796 \usv_set:nnn {bfsfup} {varrho} {"1D78E}
797 \usv_set:nnn {bfsfup} {varpi} {"1D78F}
798 \usv_set:nnn {bfsfit} {varTheta} {"1D7A1}
799 \usv_set:nnn {bfsfit} {epsilon} {"1D7C4}
800 \usv_set:nnn {bfsfit} {vartheta} {"1D7C5}
801 \usv_set:nnn {bfsfit} {varkappa} {"1D7C6}
802 \usv_set:nnn {bfsfit} {phi} {"1D7C7}
803 \usv_set:nnn {bfsfit} {varrho} {"1D7C8}
804 \usv_set:nnn {bfsfit} {varpi} {"1D7C9}
805 \usv_set:nnn {up} {Nabla} {"02207}
806 \usv_set:nnn {it} {Nabla} {"1D6FB}
807 \usv_set:nnn {bfup} {Nabla} {"1D6C1}
808 \usv_set:nnn {bfit} {Nabla} {"1D735}
809 \usv_set:nnn {bfsfup} {Nabla} {"1D76F}
810 \usv_set:nnn {bfsfit} {Nabla} {"1D7A9}
811 \usv_set:nnn {up} {partial} {"02202}
812 \usv_set:nnn {it} {partial} {"1D715}
813 \usv_set:nnn {bfup} {partial} {"1D6DB}
814 \usv_set:nnn {bfit} {partial} {"1D74F}
815 \usv_set:nnn {bfsfup} {partial} {"1D789}
816 \usv_set:nnn {bfsfit} {partial} {"1D7C3}
817 \usv_set:nnn {up} {B} {`\B}
818 \usv_set:nnn {up} {C} {`\C}
819 \usv_set:nnn {up} {D} {`\D}
820 \usv_set:nnn {up} {E} {`\E}
821 \usv_set:nnn {up} {F} {`\F}
822 \usv_set:nnn {up} {H} {`\H}
823 \usv_set:nnn {up} {I} {`\I}
824 \usv_set:nnn {up} {L} {`\L}
825 \usv_set:nnn {up} {M} {`\M}
826 \usv_set:nnn {up} {N} {`\N}
827 \usv_set:nnn {up} {P} {`\P}
828 \usv_set:nnn {up} {Q} {`\Q}
829 \usv_set:nnn {up} {R} {`\R}
830 \usv_set:nnn {up} {Z} {`\Z}
831 \usv_set:nnn {it} {B} {"1D435}
832 \usv_set:nnn {it} {C} {"1D436}
833 \usv_set:nnn {it} {D} {"1D437}
834 \usv_set:nnn {it} {E} {"1D438}
835 \usv_set:nnn {it} {F} {"1D439}
836 \usv_set:nnn {it} {H} {"1D43B}
837 \usv_set:nnn {it} {I} {"1D43C}
838 \usv_set:nnn {it} {L} {"1D43F}
839 \usv_set:nnn {it} {M} {"1D440}
840 \usv_set:nnn {it} {N} {"1D441}
841 \usv_set:nnn {it} {P} {"1D443}
842 \usv_set:nnn {it} {Q} {"1D444}
843 \usv_set:nnn {it} {R} {"1D445}
844 \usv_set:nnn {it} {Z} {"1D44D}
845 \usv_set:nnn {up} {d} {`\d}
846 \usv_set:nnn {up} {e} {`\e}
847 \usv_set:nnn {up} {g} {`\g}
848 \usv_set:nnn {up} {h} {`\h}
849 \usv_set:nnn {up} {i} {`\i}
850 \usv_set:nnn {up} {j} {`\j}
851 \usv_set:nnn {up} {o} {`\o}
852 \usv_set:nnn {it} {d} {"1D451}
853 \usv_set:nnn {it} {e} {"1D452}
854 \usv_set:nnn {it} {g} {"1D454}
855 \usv_set:nnn {it} {h} {"0210E}
856 \usv_set:nnn {it} {i} {"1D456}
857 \usv_set:nnn {it} {j} {"1D457}
858 \usv_set:nnn {it} {o} {"1D45C}
859 \usv_set:nnn {bb} {h} {"1D559}
860 \usv_set:nnn {tt} {h} {"1D691}
861 \usv_set:nnn {scr} {h} {"1D4BD}
862 \usv_set:nnn {cal} {h} {"1D4BD}
863 \usv_set:nnn {frak} {h} {"1D525}
864 \usv_set:nnn {bfup} {h} {"1D421}
865 \usv_set:nnn {bfit} {h} {"1D489}
866 \usv_set:nnn {sfup} {h} {"1D5C1}
867 \usv_set:nnn {sfit} {h} {"1D629}
868 \usv_set:nnn {bffrak} {h} {"1D58D}
869 \usv_set:nnn {bfscr} {h} {"1D4F1}
870 \usv_set:nnn {bfcal} {h} {"1D4F1}
871 \usv_set:nnn {bfsfup} {h} {"1D5F5}
872 \usv_set:nnn {bfsfit} {h} {"1D65D}
873 \usv_set:nnn {up} {dotlessi} {"00131}
874 \usv_set:nnn {up} {dotlessj} {"00237}
875 \usv_set:nnn {it} {dotlessi} {"1D6A4}
876 \usv_set:nnn {it} {dotlessj} {"1D6A5}
877 \usv_set:nnn {bb} {C} {"2102}
878 \usv_set:nnn {bb} {H} {"210D}
879 \usv_set:nnn {bb} {N} {"2115}
880 \usv_set:nnn {bb} {P} {"2119}
881 \usv_set:nnn {bb} {Q} {"211A}
882 \usv_set:nnn {bb} {R} {"211D}
883 \usv_set:nnn {bb} {Z} {"2124}
884 \usv_set:nnn {up} {Pi} {"003A0}
885 \usv_set:nnn {up} {pi} {"003C0}
886 \usv_set:nnn {up} {Gamma} {"00393}
887 \usv_set:nnn {up} {gamma} {"003B3}
888 \usv_set:nnn {up} {summation} {"02211}
889 \usv_set:nnn {it} {Pi} {"1D6F1}
890 \usv_set:nnn {it} {pi} {"1D70B}
891 \usv_set:nnn {it} {Gamma} {"1D6E4}
892 \usv_set:nnn {it} {gamma} {"1D6FE}
893 \usv_set:nnn {bb} {Pi} {"0213F}
894 \usv_set:nnn {bb} {pi} {"0213C}
895 \usv_set:nnn {bb} {Gamma} {"0213E}
896 \usv_set:nnn {bb} {gamma} {"0213D}
897 \usv_set:nnn {bb} {summation} {"02140}
898 \usv_set:nnn {bbit} {D} {"2145}
899 \usv_set:nnn {bbit} {d} {"2146}
900 \usv_set:nnn {bbit} {e} {"2147}
901 \usv_set:nnn {bbit} {i} {"2148}
902 \usv_set:nnn {bbit} {j} {"2149}
903 \usv_set:nnn {scr} {B} {"212C}
904 \usv_set:nnn {scr} {E} {"2130}
905 \usv_set:nnn {scr} {F} {"2131}
906 \usv_set:nnn {scr} {H} {"210B}
907 \usv_set:nnn {scr} {I} {"2110}
908 \usv_set:nnn {scr} {L} {"2112}
909 \usv_set:nnn {scr} {M} {"2133}
910 \usv_set:nnn {scr} {R} {"211B}
911 \usv_set:nnn {scr} {e} {"212F}
912 \usv_set:nnn {scr} {g} {"210A}
913 \usv_set:nnn {scr} {o} {"2134}
914 \usv_set:nnn {cal} {B} {"212C}
915 \usv_set:nnn {cal} {E} {"2130}
916 \usv_set:nnn {cal} {F} {"2131}
917 \usv_set:nnn {cal} {H} {"210B}
918 \usv_set:nnn {cal} {I} {"2110}
919 \usv_set:nnn {cal} {L} {"2112}
920 \usv_set:nnn {cal} {M} {"2133}
921 \usv_set:nnn {cal} {R} {"211B}
922 \usv_set:nnn {cal} {e} {"212F}
923 \usv_set:nnn {cal} {g} {"210A}
924 \usv_set:nnn {cal} {o} {"2134}
925 \usv_set:nnn {frak} {C} {"212D}
926 \usv_set:nnn {frak} {H} {"210C}
927 \usv_set:nnn {frak} {I} {"2111}
928 \usv_set:nnn {frak} {R} {"211C}
929 \usv_set:nnn {frak} {Z} {"2128}
930
931 %%^^A%% um-code-setchar.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
932 %%^^A%% General assignment of maths symbols.
933
934 \group_begin:
935 \file_get:nnN {unicode-math-table.tex} {} \l__um_mathtable_tl
936 \cs_set:Npn \UnicodeMathSymbol #1#2#3#4
937 {
938 \exp_not:n { \__um_sym:nnn {#1} {#2} {#3} }
939 }
940 \tl_gset:Nx \g__um_mathtable_tl {\l__um_mathtable_tl}
941 \group_end:
942 \__um_cs_new:Nn \__um_input_math_symbol_table: {\g__um_mathtable_tl}
943 \AtBeginDocument{\__um_define_math_chars:}
944 \__um_cs_new:Nn \__um_define_math_chars:
945 {
946 \group_begin:
947 \cs_set:Npn \__um_sym:nnn ##1##2##3
948 {
949 \tl_if_in:nnT
950 { \mathord \mathalpha \mathbin \mathrel \mathpunct \mathop \mathfence }
951 {##3}
952 {
953 \exp_last_unbraced:NNx \cs_gset_eq:NN ##2 { \char_generate:nn {##1} {12} }
954 }
955 }
956 \__um_input_math_symbol_table:
957 \group_end:
958 }
959 \cs_set:Nn \__um_set_mathsymbol:nNNn
960 {
961 \bool_lazy_and:nnT
962 {
963 \int_compare_p:nNn {#4} > {127}
964 }
965 {
966 \int_compare_p:nNn { \char_value_catcode:n {#4} } = {11}
967 }
968 { \char_set_catcode_other:n {#4} }
969
970 \token_case_meaning:Nn #3
971 {
972 \mathord { \__um_set_mathcode:nnn {#4} {#3} {#1} }
973 \mathalpha { \__um_set_mathcode:nnn {#4} {#3} {#1} }
974 \mathbin { \__um_set_mathcode:nnn {#4} {#3} {#1} }
975 \mathrel { \__um_set_mathcode:nnn {#4} {#3} {#1} }
976 \mathpunct { \__um_set_mathcode:nnn {#4} {#3} {#1} }
977 \mathop { \__um_set_big_operator:nnn {#1} {#2} {#4} }
978 \mathopen { \__um_set_math_open:nnn {#1} {#2} {#4} }
979 \mathclose { \__um_set_math_close:nnn {#1} {#2} {#4} }
980 \mathfence { \__um_set_math_fence:nnnn {#1} {#2} {#3} {#4} }
981 \mathaccent
982 { \__um_set_math_accent:Nnnn #2 {fixed} {#1} {#4} }
983 \mathbotaccent
984 { \__um_set_math_accent:Nnnn #2 {bottom~ fixed} {#1} {#4} }
985 \mathaccentwide
986 { \__um_set_math_accent:Nnnn #2 {} {#1} {#4} }
987 \mathbotaccentwide
988 { \__um_set_math_accent:Nnnn #2 {bottom} {#1} {#4} }
989 \mathover
990 { \__um_set_math_overunder:Nnnn #2 {} {#1} {#4} }
991 \mathunder
992 { \__um_set_math_overunder:Nnnn #2 {bottom} {#1} {#4} }
993 \mathaccentoverlay
994 { \__um_set_math_accent:Nnnn #2 {} {#1} {#4} }
995 }
996 }
997 \edef\mathfence{\string\mathfence}
998 \edef\mathover{\string\mathover}
999 \edef\mathunder{\string\mathunder}
1000 \edef\mathbotaccent{\string\mathbotaccent}
1001 \edef\mathaccentwide{\string\mathaccentwide}
1002 \edef\mathaccentoverlay{\string\mathaccentoverlay}
1003 \edef\mathbotaccentwide{\string\mathbotaccentwide}
1004 \cs_new:Nn \__um_set_big_operator:nnn
1005 {
1006 \__um_char_gmake_mathactive:n {#3}
1007 \cs_set_protected_nopar:Npx \__um_tmpa: { \exp_not:c { \cs_to_str:N #2 _sym } }
1008 \char_gset_active_eq:nN {#3} \__um_tmpa:
1009
1010 \__um_set_mathchar:cNnn {\cs_to_str:N #2 op} \mathop {#1} {#3}
1011
1012 \cs_gset:cpx { \cs_to_str:N #2 _sym }
1013 {
1014 \exp_not:c { \cs_to_str:N #2 op }
1015 \exp_not:n { \tl_if_in:NnT \l__um_nolimits_tl {#2} \nolimits }
1016 }
1017 }
1018 \cs_new:Nn \__um_set_math_open:nnn
1019 {
1020 \tl_if_in:NnTF \l__um_radicals_tl {#2}
1021 {
1022 \cs_if_exist:NF #2
1023 {
1024 %% todo: check if the check is necessary
1025 \cs_gset_protected_nopar:Npx #2 { \exp_not:c { \cs_to_str:N #2 sign } }
1026 }
1027 \cs_gset_protected_nopar:cpx { \cs_to_str:N #2 sign }
1028 {
1029 \__um_radical:nn {#1} {#3}
1030 }
1031 \tl_if_exist:cF {c__um_radical_\cs_to_str:N #2_tl}
1032 {
1033 \tl_const:cn {c__um_radical_\cs_to_str:N #2_tl} {\use:c{sym #1}~ #3}
1034 }
1035 }
1036 {
1037 \__um_set_delcode:nnn {#1} {#3} {#3}
1038 \__um_set_mathcode:nnn {#3} \mathopen {#1}
1039 \cs_gset_protected_nopar:Npx #2
1040 { \__um_delimiter:Nnn \mathopen {#1} {#3} }
1041 }
1042 }
1043 \cs_new:Nn \__um_set_math_close:nnn
1044 {
1045 \__um_set_delcode:nnn {#1} {#3} {#3}
1046 \__um_set_mathcode:nnn {#3} \mathclose {#1}
1047 \cs_gset_protected_nopar:Npx #2
1048 { \__um_delimiter:Nnn \mathclose {#1} {#3} }
1049 }
1050 \cs_new:Nn \__um_set_math_fence:nnnn
1051 {
1052 \__um_set_mathcode:nnn {#4} {#3} {#1}
1053 \__um_set_delcode:nnn {#1} {#4} {#4}
1054 \cs_gset_protected_nopar:cpx {l \cs_to_str:N #2}
1055 { \__um_delimiter:Nnn \mathopen {#1} {#4} }
1056 \cs_gset_protected_nopar:cpx {r \cs_to_str:N #2}
1057 { \__um_delimiter:Nnn \mathclose {#1} {#4} }
1058 }
1059 \cs_new:Nn \__um_set_math_accent:Nnnn
1060 {
1061 \cs_gset_protected_nopar:Npx #1
1062 { \__um_accent:nnn {#2} {#3} {#4} }
1063 }
1064 \cs_new:Nn \__um_set_math_overunder:Nnnn
1065 {
1066 \cs_gset_protected_nopar:Npx #1 ##1
1067 {
1068 \mathop
1069 { \__um_accent:nnn {#2} {#3} {#4} {{}##1} }
1070 % TODO: remove braces above ^^ which work around a LuaTeX bug
1071 \limits
1072 }
1073 }
1074
1075 %%^^A%% um-code-mathtext.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
1076 %%^^A%% The "math text" commands such as `\mathbf` and co.
1077
1078 \keys_define:nn {__um_mathface}
1079 {
1080 version .tl_set:N = \l__um_mversion_tl
1081 }
1082 \__um_cs_new:Nn \__um_setmathfontface:Nnn
1083 {
1084 \tl_clear:N \l__um_mversion_tl
1085
1086 \keys_set_known:nnN {__um_mathface} {#2} \l__um_keyval_clist
1087
1088 \fontspec_set_family:Nxx \l__um_tmpa_tl
1089 { ItalicFont={}, BoldFont={}, SmallCapsFont={}, \exp_not:V \l__um_keyval_clist }
1090 { #3 }
1091
1092 \tl_if_empty:NT \l__um_mversion_tl
1093 {
1094 \tl_set:Nn \l__um_mversion_tl {normal}
1095 \DeclareMathAlphabet #1 {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\shapedefault}
1096 }
1097
1098 \SetMathAlphabet #1 {\l__um_mversion_tl} {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\shapedefault}
1099
1100 % integrate with fontspec's \setmathrm etc:
1101 \token_case_meaning:Nn #1
1102 {
1103 \mathrm { \cs_gset_eq:NN \g__fontspec_mathrm_tl \l__um_tmpa_tl }
1104 \mathsf { \cs_gset_eq:NN \g__fontspec_mathsf_tl \l__um_tmpa_tl }
1105 \mathtt { \cs_gset_eq:NN \g__fontspec_mathtt_tl \l__um_tmpa_tl }
1106 }
1107 }
1108 \cs_set:Npn \use@mathgroup #1 #2
1109 {
1110 \math@bgroup
1111 \cs_if_eq:cNF {M@\f@encoding} #1 {#1}
1112 \__um_switch_to:n {literal}
1113 \__um_mathgroup_set:n {#2}
1114 \math@egroup
1115 }
1116 \cs_set_protected:Npn \operator@font
1117 {
1118 \__um_switch_to:n {literal}
1119 \__um_fontswitch:n { \g__um_operator_mathfont_tl }
1120 }
1121 \cs_set:Nn \__um_fontswitch:n
1122 {
1123 \cs_set_eq:NN \math@bgroup \scan_stop:
1124 \cs_set_eq:NN \__um_group_begin: \scan_stop:
1125 \cs_set:Npn \__um_group_end:n % takes no argument in this case
1126 {
1127 \cs_set_eq:NN \__um_group_begin: \__um_group_begin_frozen:
1128 \cs_set_eq:NN \__um_group_end:n \__um_group_end_frozen:n
1129 \cs_set_eq:NN \math@bgroup \@@math@bgroup
1130 \cs_set_eq:NN \math@egroup \@@math@egroup
1131 }
1132 \cs_set_eq:NN \math@egroup \__um_group_end:n
1133 #1 \scan_stop:
1134 }
1135 \cs_generate_variant:Nn \tl_if_eq:nnT {o}
1136 \__um_cs_set:Nn \__fontspec_setmainfont_hook:nn
1137 {
1138 \tl_if_eq:onT {\g__fontspec_mathrm_tl} {\rmdefault}
1139 {
1140 \fontspec_gset_family:Nnn \g__fontspec_mathrm_tl {#1} {#2}
1141 \__fontspec_setmathrm_hook:nn {#1} {#2}
1142 }
1143 }
1144 \__um_cs_set:Nn \__fontspec_setsansfont_hook:nn
1145 {
1146 \tl_if_eq:onT {\g__fontspec_mathsf_tl} {\sfdefault}
1147 {
1148 \fontspec_gset_family:Nnn \g__fontspec_mathsf_tl {#1} {#2}
1149 \__fontspec_setmathsf_hook:nn {#1} {#2}
1150 }
1151 }
1152 \__um_cs_set:Nn \__fontspec_setmonofont_hook:nn
1153 {
1154 \tl_if_eq:onT {\g__fontspec_mathtt_tl} {\ttdefault}
1155 {
1156 \fontspec_gset_family:Nnn \g__fontspec_mathtt_tl {#1} {#2}
1157 \__fontspec_setmathtt_hook:nn {#1} {#2}
1158 }
1159 }
1160 \cs_new:Nn \__um_rm_series_default:n
1161 {
1162 \ifcsname #1series@rm\endcsname
1163 \csname #1series@rm\endcsname
1164 \else
1165 \csname #1default\endcsname
1166 \fi
1167 }
1168 \__um_cs_set:Nn \__fontspec_setmathrm_hook:nn
1169 {
1170 \SetMathAlphabet\mathrm{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl{\__um_rm_series_default:n {md}}\shapedefault
1171 \SetMathAlphabet\mathit{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl{\__um_rm_series_default:n {md}}\itdefault
1172 \SetMathAlphabet\mathbf{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl{\__um_rm_series_default:n {bf}}\shapedefault
1173 }
1174 \__um_cs_set:Nn \__fontspec_setboldmathrm_hook:nn
1175 {
1176 \SetMathAlphabet\mathrm{bold}\g_fontspec_encoding_tl\g__fontspec_bfmathrm_tl{\__um_rm_series_default:n {md}}\shapedefault
1177 \SetMathAlphabet\mathbf{bold}\g_fontspec_encoding_tl\g__fontspec_bfmathrm_tl{\__um_rm_series_default:n {bf}}\shapedefault
1178 \SetMathAlphabet\mathit{bold}\g_fontspec_encoding_tl\g__fontspec_bfmathrm_tl\mddefault\itdefault
1179 }
1180 \__um_cs_set:Nn \__fontspec_setmathsf_hook:nn
1181 {
1182 \SetMathAlphabet\mathsf{normal}\g_fontspec_encoding_tl\g__fontspec_mathsf_tl{\__um_rm_series_default:n {md}}\shapedefault
1183 \SetMathAlphabet\mathsf{bold} \g_fontspec_encoding_tl\g__fontspec_mathsf_tl{\__um_rm_series_default:n {bf}}\shapedefault
1184 }
1185 \__um_cs_set:Nn \__fontspec_setmathtt_hook:nn
1186 {
1187 \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g__fontspec_mathtt_tl{\__um_rm_series_default:n {md}}\shapedefault
1188 \SetMathAlphabet\mathtt{bold} \g_fontspec_encoding_tl\g__fontspec_mathtt_tl{\__um_rm_series_default:n {bf}}\shapedefault
1189 }
1190 \tl_if_eq:onF {\g__fontspec_mathrm_tl} {\rmdefault} { \__fontspec_setmathrm_hook:nn {} {} }
1191 \tl_if_eq:onF {\g__fontspec_mathsf_tl} {\sfdefault} { \__fontspec_setmathsf_hook:nn {} {} }
1192 \tl_if_eq:onF {\g__fontspec_mathtt_tl} {\ttdefault} { \__fontspec_setmathtt_hook:nn {} {} }
1193 \AtBeginDocument
1194 {
1195 \tl_if_eq:onT {\g__fontspec_mathrm_tl} {\rmdefault} { \__fontspec_setmathrm_hook:nn {} {} }
1196 \tl_if_eq:onT {\g__fontspec_mathsf_tl} {\sfdefault} { \__fontspec_setmathsf_hook:nn {} {} }
1197 \tl_if_eq:onT {\g__fontspec_mathtt_tl} {\ttdefault} { \__fontspec_setmathtt_hook:nn {} {} }
1198 }
1199
1200 %%^^A%% um-code-main.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
1201 %%^^A%% Definition of `\setmainfont`.
1202
1203 \__um_cs_new:Nn \__um_setmathfont:nn
1204 {
1205
1206 \__um_init:n {#2}
1207 \cs_set_eq:NN \glb@currsize \scan_stop:
1208 \cs_if_exist:cF { S@ \f@size } { \calculate@math@sizes }
1209 \use:c { S@ \f@size }
1210
1211 \keys_set_known:nnN {unicode-math} {#1} \l__um_unknown_keys_clist
1212
1213 \bool_if:NT \g__um_init_bool \__um_fontspec_trial_font:
1214 \bool_if:NT \g__um_init_bool \__um_declare_math_sizes:
1215
1216 \__um_fontspec_select_font:
1217 \__um_setup_math_fam:
1218 \bool_if:NT \g__um_init_bool
1219 {
1220 \__um_setup_legacy_fam_two:
1221 \__um_setup_legacy_fam_three:
1222 }
1223
1224 \__um_input_math_symbol_table:
1225
1226 \bool_if:NT \g__um_init_bool \__um_onceoff_setup:
1227 \__um_remap_symbols:
1228 \__um_setup_mathactives:
1229 \__um_setup_delcodes:
1230 \__um_setup_alphabets:
1231
1232 %% TODO: what of the above should only be run for the "default"/"main" font?
1233
1234 \bool_if:NTF \g__um_init_bool
1235 {
1236 \bool_gset_true:N \g__um_main_font_defined_bool
1237 \__um_log:n {default-math-font}
1238 }
1239 {
1240 }
1241 }
1242 \AtBeginDocument { \bool_if:NF \g__um_main_font_defined_bool \__um_load_lm: }
1243 \__um_cs_new:Nn \__um_load_lm:
1244 {
1245 \setmathfont{latinmodern-math.otf}[BoldFont={latinmodern-math.otf}]
1246 }
1247 \__um_cs_new:Nn \__um_init:n
1248 {
1249 \tl_set:Nn \l__um_fontname_tl {#1}
1250 \bool_gset_true:N \g__um_ot_math_bool
1251 \tl_set:Nn \l__um_mversion_tl {normal}
1252 \tl_set:Nn \l__um_symfont_label_tl {operators}
1253
1254 \tl_set:Nn \l__um_script_features_tl {Style=MathScript}
1255 \tl_set:Nn \l__um_sscript_features_tl {Style=MathScriptScript}
1256 \tl_set_eq:NN \l__um_script_font_tl \l__um_fontname_tl
1257 \tl_set_eq:NN \l__um_sscript_font_tl \l__um_fontname_tl
1258
1259 \bool_gset_true:N \g__um_init_bool
1260 \seq_gclear:N \g__um_char_range_seq
1261 \clist_clear:N \l__um_mathmap_charints_clist
1262 \seq_gclear:N \g__um_mathalph_seq
1263 \seq_clear:N \l__um_missing_alph_seq
1264
1265 \cs_set_eq:NN \__um_sym:nnn \__um_process_symbol_noparse:nnn
1266 \cs_set_eq:NN \__um_remap_symbol:nnn \__um_remap_symbol_noparse:nnn
1267 \cs_set_eq:NN \__um_maybe_init_alphabet:n \__um_init_alphabet:n
1268 \cs_set_eq:NN \__um_assign_delcode:nn \__um_assign_delcode_noparse:nn
1269 \cs_set_eq:NN \__um_make_mathactive:nNN \__um_make_mathactive_noparse:nNN
1270 }
1271 \tl_new:N \g__um_main_font_cmd_tl
1272 \cs_new:Nn \__um_sf_size: { \__um_fontdimen_pc_to_pt:nN {10} \g__um_trial_font }
1273 \cs_new:Nn \__um_ssf_size: { \__um_fontdimen_pc_to_pt:nN {11} \g__um_trial_font }
1274 \__um_cs_new:Nn \__um_declare_math_sizes:
1275 {
1276 \fp_gset:Nn \g__um_size_tfsf_fp { (\f@size + \__um_sf_size: )/2 }
1277 \fp_gset:Nn \g__um_size_sfssf_fp { (\__um_sf_size: + \__um_ssf_size:)/2 }
1278
1279 \dim_compare:nF { \fontdimen 10 \g__um_trial_font == 0pt }
1280 {
1281 \DeclareMathSizes { \f@size } { \f@size } { \__um_sf_size: } { \__um_ssf_size: }
1282 }
1283 }
1284 \__um_cs_new:Nn \__um_fontspec_trial_font:
1285 {
1286 \tl_set:Nx \l__um_font_keyval_tl
1287 {
1288 BoldItalicFont = {}, ItalicFont = {}, SmallCapsFont = {},
1289 Script = Math,
1290 \l__um_unknown_keys_clist
1291 }
1292
1293 \fontspec_set_family:Nxn \l__um_trial_family_tl {\l__um_font_keyval_tl} {\l__um_fontname_tl}
1294
1295 \group_begin:
1296 \fontfamily { \l__um_trial_family_tl } \selectfont
1297 \exp_last_unbraced:NNo \__um_fontface_gset_eq:NN \g__um_trial_font \font@name
1298 \fontspec_if_script:nF {math}
1299 {
1300 \__um_warning:n {not-ot-math}
1301 \bool_gset_false:N \g__um_ot_math_bool
1302 \bool_gset_false:N \g__um_init_bool
1303 }
1304 \group_end:
1305
1306 }
1307 \__um_cs_new:Nn \__um_fontspec_select_font:
1308 {
1309 \tl_set:Nx \l__um_font_keyval_tl
1310 {
1311 BoldItalicFont = {}, ItalicFont = {}, SmallCapsFont = {},
1312 Script = Math,
1313 SizeFeatures =
1314 {
1315 {
1316 Size = \fp_use:N \g__um_size_tfsf_fp -
1317 } ,
1318 {
1319 Size = \fp_use:N \g__um_size_sfssf_fp - \fp_use:N \g__um_size_tfsf_fp ,
1320 Font = \l__um_script_font_tl ,
1321 \l__um_script_features_tl
1322 } ,
1323 {
1324 Size = - \fp_use:N \g__um_size_sfssf_fp ,
1325 Font = \l__um_sscript_font_tl ,
1326 \l__um_sscript_features_tl
1327 }
1328 } ,
1329 \l__um_unknown_keys_clist
1330 }
1331
1332 \fontspec_set_family:Nxn \l__um_family_tl {\l__um_font_keyval_tl} {\l__um_fontname_tl}
1333
1334 \int_gincr:N \g__um_fonts_used_int
1335 \group_begin:
1336 \fontfamily { \l__um_family_tl } \selectfont
1337 \exp_last_unbraced:Nno \__um_fontface_gset_eq:cN {g__um_mathfont_ \int_use:N \g__um_fonts_used_int _font} \font@name
1338 \tl_gset:Nx \g__um_curr_font_cmd_tl { \exp_not:c {g__um_mathfont_ \int_use:N \g__um_fonts_used_int _font} }
1339 \bool_if:NT \g__um_init_bool
1340 {
1341 \exp_last_unbraced:NNo \__um_fontface_gset_eq:NN \l__um_font \font@name
1342 }
1343 \group_end:
1344 }
1345 \tl_gset:Nn \g__um_main_font_cmd_tl { \l__um_font }
1346 \tl_gset:Nn \g__um_sqrt_font_cmd_tl { \l__um_font }
1347 \tl_gset:Nn \g__um_prime_font_cmd_tl { \l__um_font }
1348 \__um_cs_new:Nn \__um_setup_math_fam:
1349 {
1350 \cs_if_exist:cF { sym \l__um_symfont_label_tl }
1351 {
1352 \DeclareSymbolFont{\l__um_symfont_label_tl}
1353 {\encodingdefault}{\l__um_family_tl}{\mddefault}{\shapedefault}
1354 }
1355 \SetSymbolFont{\l__um_symfont_label_tl}{\l__um_mversion_tl}
1356 {\encodingdefault}{\l__um_family_tl}{\mddefault}{\shapedefault}
1357 \str_if_eq:eeT {\l__um_mversion_tl} {normal}
1358 {
1359 \SetSymbolFont{\l__um_symfont_label_tl}{bold}
1360 {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\shapedefault}
1361 }
1362 }
1363 \__um_cs_new:Nn \__um_setup_legacy_fam_two:
1364 {
1365 \fontspec_set_family:Nxn \l__um_fam_two_tl
1366 {
1367 \l__um_font_keyval_tl,
1368 ScaleAgain = 1.0001,
1369 FontAdjustment =
1370 {
1371 \__um_copy_fontdimen:nnN { 8} {43} \g__um_main_font_cmd_tl
1372 \__um_copy_fontdimen:nnN { 9} {42} \g__um_main_font_cmd_tl
1373 \__um_copy_fontdimen:nnN {10} {32} \g__um_main_font_cmd_tl
1374 \__um_copy_fontdimen:nnN {11} {45} \g__um_main_font_cmd_tl
1375 \__um_copy_fontdimen:nnN {12} {44} \g__um_main_font_cmd_tl
1376 \__um_copy_fontdimen:nnN {13} {21} \g__um_main_font_cmd_tl
1377 \__um_copy_fontdimen:nnN {14} {21} \g__um_main_font_cmd_tl
1378 \__um_copy_fontdimen:nnN {15} {22} \g__um_main_font_cmd_tl
1379 \__um_copy_fontdimen:nnN {16} {18} \g__um_main_font_cmd_tl
1380 \__um_copy_fontdimen:nnN {17} {18} \g__um_main_font_cmd_tl
1381 \__um_copy_fontdimen:nnN {18} {24} \g__um_main_font_cmd_tl
1382 \__um_copy_fontdimen:nnN {19} {20} \g__um_main_font_cmd_tl
1383 \__um_copy_fontdimen:nnN {22} {15} \g__um_main_font_cmd_tl
1384 \__um_zero_fontdimen:n {20} % delim1 = FractionDelimiterDisplaySize
1385 \__um_zero_fontdimen:n {21} % delim2 = FractionDelimiterSize
1386 }
1387 } {\l__um_fontname_tl}
1388
1389 \SetSymbolFont{symbols}{\l__um_mversion_tl}
1390 {\encodingdefault}{\l__um_fam_two_tl}{\mddefault}{\shapedefault}
1391
1392 \str_if_eq:eeT {\l__um_mversion_tl} {normal}
1393 {
1394 \SetSymbolFont{symbols}{bold}
1395 {\encodingdefault}{\l__um_fam_two_tl}{\bfdefault}{\shapedefault}
1396 }
1397 }
1398 \__um_cs_new:Nn \__um_setup_legacy_fam_three:
1399 {
1400 \fontspec_set_family:Nxn \l__um_fam_three_tl
1401 {
1402 \l__um_font_keyval_tl,
1403 ScaleAgain = 0.9999,
1404 FontAdjustment = {
1405 \__um_copy_fontdimen:nnN { 8} {48} \g__um_main_font_cmd_tl
1406 \__um_copy_fontdimen:nnN { 9} {28} \g__um_main_font_cmd_tl
1407 \__um_copy_fontdimen:nnN {10} {30} \g__um_main_font_cmd_tl
1408 \__um_copy_fontdimen:nnN {11} {29} \g__um_main_font_cmd_tl
1409 \__um_copy_fontdimen:nnN {12} {31} \g__um_main_font_cmd_tl
1410 \__um_zero_fontdimen:n {13}
1411 }
1412 } {\l__um_fontname_tl}
1413
1414 \SetSymbolFont{largesymbols}{\l__um_mversion_tl}
1415 {\encodingdefault}{\l__um_fam_three_tl}{\mddefault}{\shapedefault}
1416
1417 \str_if_eq:eeT {\l__um_mversion_tl} {normal}
1418 {
1419 \SetSymbolFont{largesymbols}{bold}
1420 {\encodingdefault}{\l__um_fam_three_tl}{\bfdefault}{\shapedefault}
1421 }
1422 }
1423 \__um_cs_new:Nn \__um_onceoff_setup:
1424 {
1425 \__um_set_delcode:nnn {operators} {`\.} {0}
1426 }
1427 \cs_set:Nn \__um_process_symbol_noparse:nnn
1428 {
1429 \__um_set_mathsymbol:nNNn {\l__um_symfont_label_tl} #2 #3 {#1}
1430 }
1431 \cs_set:Nn \__um_process_symbol_parse:nnn
1432 {
1433 \__um_if_char_spec:nNT {#1} {#3}
1434 {
1435 \__um_process_symbol_noparse:nnn {#1} {#2} {#3}
1436 }
1437 }
1438 \__um_cs_new:Nn \__um_remap_symbols:
1439 {
1440 \__um_remap_symbol:nnn {`\-} {\mathbin} {"2212}
1441 \__um_remap_symbol:nnn {`\*} {\mathbin} {"02217}% text asterisk to "centred asterisk"
1442 \bool_if:NF \g__um_literal_colon_bool
1443 {
1444 \__um_remap_symbol:nnn {`\:} {\mathrel} {"02236}% colon to ratio (i.e., punct to rel)
1445 }
1446 }
1447 \cs_new:Nn \__um_remap_symbol_parse:nnn
1448 {
1449 \__um_if_char_spec:nNT {#3} {#2}
1450 { \__um_remap_symbol_noparse:nnn {#1} {#2} {#3} }
1451 }
1452 \cs_new:Nn \__um_remap_symbol_noparse:nnn
1453 {
1454 \clist_map_inline:nn {#1}
1455 { \__um_set_mathcode:nnnn {##1} {#2} {\l__um_symfont_label_tl} {#3} }
1456 }
1457 \__um_cs_new:Nn \__um_setup_mathactives:
1458 {
1459 \__um_make_mathactive:nNN {"2032} \__um_prime_single_mchar \mathord
1460 \__um_make_mathactive:nNN {"2033} \__um_prime_double_mchar \mathord
1461 \__um_make_mathactive:nNN {"2034} \__um_prime_triple_mchar \mathord
1462 \__um_make_mathactive:nNN {"2057} \__um_prime_quad_mchar \mathord
1463 \__um_make_mathactive:nNN {"2035} \__um_backprime_single_mchar \mathord
1464 \__um_make_mathactive:nNN {"2036} \__um_backprime_double_mchar \mathord
1465 \__um_make_mathactive:nNN {"2037} \__um_backprime_triple_mchar \mathord
1466 \__um_make_mathactive:nNN {`\'} \mathstraightquote \mathord
1467 \__um_make_mathactive:nNN {`\`} \mathbacktick \mathord
1468 }
1469 \cs_new:Nn \__um_make_mathactive_parse:nNN
1470 {
1471 \__um_if_char_spec:nNT {#1} #3
1472 { \__um_make_mathactive_noparse:nNN {#1} #2 #3 }
1473 }
1474 \cs_new:Nn \__um_make_mathactive_noparse:nNN
1475 {
1476 \__um_set_mathchar:NNnn #2 #3 {\l__um_symfont_label_tl} {#1}
1477 \__um_char_gmake_mathactive:n {#1}
1478 }
1479 \cs_new:Nn \__um_assign_delcode_noparse:nn
1480 {
1481 \__um_set_delcode:nnn \l__um_symfont_label_tl {#1} {#2}
1482 }
1483 \cs_new:Nn \__um_assign_delcode_parse:nn
1484 {
1485 \__um_if_char_spec:nNT {#2} \@nil
1486 {
1487 \__um_assign_delcode_noparse:nn {#1} {#2}
1488 }
1489 }
1490 \cs_new:Nn \__um_assign_delcode:n { \__um_assign_delcode:nn {#1} {#1} }
1491 \__um_cs_new:Nn \__um_setup_delcodes:
1492 {
1493 \__um_assign_delcode:nn {`\/} {\g__um_slash_delimiter_usv}
1494 \__um_assign_delcode:nn {"2044} {\g__um_slash_delimiter_usv} % fracslash
1495 \__um_assign_delcode:nn {"2215} {\g__um_slash_delimiter_usv} % divslash
1496 \__um_assign_delcode:n {"005C} % backslash
1497 \__um_assign_delcode:nn {`\<} {"27E8} % angle brackets with ascii notation
1498 \__um_assign_delcode:nn {`\>} {"27E9} % angle brackets with ascii notation
1499 \__um_assign_delcode:n {"2191} % up arrow
1500 \__um_assign_delcode:n {"2193} % down arrow
1501 \__um_assign_delcode:n {"2195} % updown arrow
1502 \__um_assign_delcode:n {"219F} % up arrow twohead
1503 \__um_assign_delcode:n {"21A1} % down arrow twohead
1504 \__um_assign_delcode:n {"21A5} % up arrow from bar
1505 \__um_assign_delcode:n {"21A7} % down arrow from bar
1506 \__um_assign_delcode:n {"21A8} % updown arrow from bar
1507 \__um_assign_delcode:n {"21BE} % up harpoon right
1508 \__um_assign_delcode:n {"21BF} % up harpoon left
1509 \__um_assign_delcode:n {"21C2} % down harpoon right
1510 \__um_assign_delcode:n {"21C3} % down harpoon left
1511 \__um_assign_delcode:n {"21C5} % arrows up down
1512 \__um_assign_delcode:n {"21F5} % arrows down up
1513 \__um_assign_delcode:n {"21C8} % arrows up up
1514 \__um_assign_delcode:n {"21CA} % arrows down down
1515 \__um_assign_delcode:n {"21D1} % double up arrow
1516 \__um_assign_delcode:n {"21D3} % double down arrow
1517 \__um_assign_delcode:n {"21D5} % double updown arrow
1518 \__um_assign_delcode:n {"21DE} % up arrow double stroke
1519 \__um_assign_delcode:n {"21DF} % down arrow double stroke
1520 \__um_assign_delcode:n {"21E1} % up arrow dashed
1521 \__um_assign_delcode:n {"21E3} % down arrow dashed
1522 \__um_assign_delcode:n {"21E7} % up white arrow
1523 \__um_assign_delcode:n {"21E9} % down white arrow
1524 \__um_assign_delcode:n {"21EA} % up white arrow from bar
1525 \__um_assign_delcode:n {"21F3} % updown white arrow
1526 }
1527 \tl_set:Nn \l__um_nolimits_tl
1528 {
1529 \int\iint\iiint\iiiint\oint\oiint\oiiint
1530 \intclockwise\varointclockwise\ointctrclockwise\sumint
1531 \intbar\intBar\fint\cirfnint\awint\rppolint
1532 \scpolint\npolint\pointint\sqint\intlarhk\intx
1533 \intcap\intcup\upint\lowint
1534 }
1535 \tl_set:Nn \l__um_radicals_tl {\sqrt \longdivision \cuberoot \fourthroot}
1536
1537 %%^^A%% um-code-fontopt.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
1538 %%^^A%% Keyval for `\setmathfont`
1539
1540 \keys_define:nn {unicode-math}
1541 {
1542 version .code:n =
1543 {
1544 \tl_set:Nn \l__um_mversion_tl {#1}
1545 \DeclareMathVersion {\l__um_mversion_tl}
1546 }
1547 }
1548 \keys_define:nn {unicode-math}
1549 {
1550 script-features .tl_set:N = \l__um_script_features_tl ,
1551 sscript-features .tl_set:N = \l__um_sscript_features_tl ,
1552 script-font .tl_set:N = \l__um_script_font_tl ,
1553 sscript-font .tl_set:N = \l__um_sscript_font_tl ,
1554 }
1555 \keys_define:nn {unicode-math}
1556 {
1557 range .code:n =
1558 {
1559 \bool_if:NF \g__um_main_font_defined_bool { \__um_error:n {no-main-font} }
1560 \bool_gset_false:N \g__um_init_bool
1561 \__um_range_init:
1562 \group_begin:
1563 \seq_map_inline:Nn \g__um_mathclasses_seq
1564 {
1565 \cs_set:Npn ##1 { \use_none:n \q_unicode_math \exp_not:N ##1 }
1566 }
1567 \cs_set:Npn \__um_sym:nnn ##1 ##2 ##3
1568 {
1569 \cs_set:Npn ##2 { \use_none:n \q_unicode_math ##1 }
1570 }
1571 \__um_input_math_symbol_table:
1572 \__um_range_process:n {#1}
1573 \group_end:
1574 }
1575 }
1576 \__um_cs_new:Nn \__um_range_init:
1577 {
1578 \int_gincr:N \g__um_fam_int
1579 \tl_set:Nx \l__um_symfont_label_tl {__um_fam\int_use:N\g__um_fam_int}
1580 \cs_set_eq:NN \__um_sym:nnn \__um_process_symbol_parse:nnn
1581 \cs_set_eq:NN \__um_remap_symbol:nnn \__um_remap_symbol_parse:nnn
1582 \cs_set_eq:NN \__um_maybe_init_alphabet:n \use_none:n
1583 \cs_set_eq:NN \__um_assign_delcode:nn \__um_assign_delcode_parse:nn
1584 \cs_set_eq:NN \__um_make_mathactive:nNN \__um_make_mathactive_parse:nNN
1585 \seq_gclear:N \g__um_char_range_seq
1586 \seq_gclear:N \g__um_mclass_range_seq
1587 \seq_gclear:N \g__um_mathalph_seq
1588 }
1589 \cs_new:Nn \__um_range_process:n
1590 {
1591 \clist_map_inline:nn {#1}
1592 {
1593 \__um_mathalph_decl:nF {##1} { \__um_range_decl:n {##1} }
1594 }
1595 }
1596 \cs_new:Nn \__um_mathalph_decl:nF
1597 {
1598 \tl_set:Nn \l__um_tmpa_tl {#1}
1599 \tl_clear:N \l__um_tmpb_tl
1600 \tl_clear:N \l__um_tmpc_tl
1601
1602 \tl_if_in:NnT \l__um_tmpa_tl {->}
1603 { \exp_after:wN \__um_split_arrow:w \l__um_tmpa_tl \q_nil }
1604
1605 \tl_if_in:NnT \l__um_tmpa_tl {/}
1606 { \exp_after:wN \__um_split_slash:w \l__um_tmpa_tl \q_nil }
1607
1608 \tl_set:Nx \l__um_tmpa_tl { \tl_to_str:N \l__um_tmpa_tl }
1609 \exp_args:NNx \tl_remove_all:Nn \l__um_tmpa_tl { \token_to_str:N \math }
1610 \exp_args:NNx \tl_remove_all:Nn \l__um_tmpa_tl { \token_to_str:N \sym }
1611 \tl_trim_spaces:N \l__um_tmpa_tl
1612
1613 \tl_if_empty:NT \l__um_tmpc_tl
1614 { \tl_set_eq:NN \l__um_tmpc_tl \l__um_tmpa_tl }
1615
1616 \clist_if_in:NVT \g__um_bad_alpha_clist \l__um_tmpa_tl { \__um_error:n {range-not-bf-sf} }
1617
1618 \prop_if_exist:cTF {g__um_named_range_ \l__um_tmpa_tl _prop}
1619 {
1620 \seq_gput_right:Nx \g__um_mathalph_seq
1621 {
1622 { \exp_not:V \l__um_tmpa_tl }
1623 { \exp_not:V \l__um_tmpb_tl }
1624 { \exp_not:V \l__um_tmpc_tl }
1625 }
1626 }
1627 {#2}
1628 }
1629 \cs_set:Npn \__um_split_arrow:w #1->#2 \q_nil
1630 {
1631 \tl_set:Nx \l__um_tmpa_tl { \tl_trim_spaces:n {#1} }
1632 \tl_set:Nx \l__um_tmpc_tl { \tl_trim_spaces:n {#2} }
1633 }
1634 \cs_set:Npn \__um_split_slash:w #1/#2 \q_nil
1635 {
1636 \tl_set:Nx \l__um_tmpa_tl { \tl_trim_spaces:n {#1} }
1637 \tl_set:Nx \l__um_tmpb_tl { \tl_trim_spaces:n {#2} }
1638 }
1639 \cs_new_protected:Nn \__um_range_decl:n
1640 {
1641 \bool_lazy_and:nnTF { \tl_if_single_p:n {#1} } { \token_if_cs_p:N #1 }
1642 % IF A CSNAME:
1643 {
1644 \tl_if_in:VnTF #1 { \q_unicode_math }
1645 {
1646 \seq_if_in:NnTF \g__um_mathclasses_seq {#1}
1647 { \seq_gput_right:Nn \g__um_mclass_range_seq {#1} }
1648 { \seq_gput_right:Nx \g__um_char_range_seq { #1 } }
1649 }
1650 { \__um_error:nx {bad-cs-in-range} { \tl_to_str:n {#1} } }
1651 }
1652 % ELSE ASSUME NUMERIC INPUT:
1653 {
1654 \seq_gput_right:Nx \g__um_char_range_seq { #1 }
1655 }
1656 }
1657 \cs_new:Nn \__um_if_char_spec:nNT
1658 {
1659 % math class:
1660 \seq_if_in:NnT \g__um_mclass_range_seq {#2}
1661 { \use_none_delimit_by_q_nil:w }
1662
1663 % character slot:
1664 \seq_map_inline:Nn \g__um_char_range_seq
1665 {
1666 \__um_int_if_slot_is_last_in_range:nnT {#1} {##1}
1667 { \seq_gremove_all:Nn \g__um_char_range_seq {##1} }
1668
1669 \__um_int_if_slot_in_range:nnT {#1} {##1}
1670 { \seq_map_break:n { \use_none_delimit_by_q_nil:w } }
1671 }
1672
1673 % the following expands to nil if no match was found:
1674 \use_none:nnn
1675 \q_nil
1676 \use:n
1677 {
1678 \cs_if_eq:NNT #2 \mathalpha
1679 {
1680 \clist_put_right:Nx \l__um_mathmap_charints_clist { \int_eval:n {#1} }
1681 }
1682 #3
1683 }
1684 }
1685 \cs_new:Nn \__um_int_if_slot_in_range:nnT
1686 {
1687 \__um_numrange_parse:nwT {#1} #2 - \q_nil - \q_stop {#3}
1688 }
1689 \cs_set:Npn \__um_numrange_parse:nwT #1 #2 - #3 - #4 \q_stop #5
1690 {
1691 \tl_if_empty:nTF {#4} { \int_compare:nT {#1=#2} {#5} }
1692 {
1693 \tl_if_empty:nTF {#3} { \int_compare:nT {#1>=#2} {#5} }
1694 {
1695 \tl_if_empty:nTF {#2} { \int_compare:nT {#1<=#3} {#5} }
1696 {
1697 \int_compare:nT {#1>=#2} { \int_compare:nT {#1<=#3} {#5} }
1698 } } }
1699 }
1700 \cs_new:Nn \__um_int_if_slot_is_last_in_range:nnT
1701 {
1702 \__um_numrange_last_parse:nwT {#1} #2 - \q_nil - \q_stop {#3}
1703 }
1704 \cs_set:Npn \__um_numrange_last_parse:nwT #1 #2 - #3 - #4 \q_stop #5
1705 {
1706 \tl_if_empty:nTF {#4} { \int_compare:nT {#1==#2} {#5} }
1707 {
1708 \tl_if_empty:nTF {#2} { \int_compare:nT {#1==#3} {#5} }
1709 {
1710 \int_compare:nT {#1==#3} {#5}
1711 } }
1712 }
1713
1714 %%^^A%% um-code-fontparam.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
1715 %%^^A%% Cross-platform interface for font parameters
1716
1717 \cs_new_protected_nopar:Nn \__um_new_cramped_style:N
1718 { \tl_const:Nn #1 { \use_none:n #1 } }
1719 \__um_new_cramped_style:N \crampeddisplaystyle
1720 \__um_new_cramped_style:N \crampedtextstyle
1721 \__um_new_cramped_style:N \crampedscriptstyle
1722 \__um_new_cramped_style:N \crampedscriptscriptstyle
1723 \cs_new_nopar:Npn \__um_font_dimen:Nnnnn #1 #2 #3 #4 #5 {
1724 \fontdimen
1725 \cs_if_eq:NNTF #1 \displaystyle {
1726 #2 \textfont
1727 } {
1728 \cs_if_eq:NNTF #1 \crampeddisplaystyle {
1729 #3 \textfont
1730 } {
1731 \cs_if_eq:NNTF #1 \textstyle {
1732 #4 \textfont
1733 } {
1734 \cs_if_eq:NNTF #1 \crampedtextstyle {
1735 #5 \textfont
1736 } {
1737 \cs_if_eq:NNTF #1 \scriptstyle {
1738 #4 \scriptfont
1739 } {
1740 \cs_if_eq:NNTF #1 \crampedscriptstyle {
1741 #5 \scriptfont
1742 } {
1743 \cs_if_eq:NNTF #1 \scriptscriptstyle {
1744 #4 \scriptscriptfont
1745 } {
1746 #5 \scriptscriptfont
1747 }
1748 }
1749 }
1750 }
1751 }
1752 }
1753 }
1754 2~
1755 }
1756 \cs_new_protected_nopar:Nn \__um_font_param:nnnnn
1757 {
1758 \__um_font_param_aux:ccnnnn { __um_ #1 :N } { __um_set_ #1 :Nn }
1759 { #2 } { #3 } { #4 } { #5 }
1760 }
1761 \cs_new_protected_nopar:Nn \__um_font_param:nnn
1762 {
1763 \__um_font_param:nnnnn { #1 } { #2 } { #2 } { #3 } { #3 }
1764 }
1765 \cs_new_protected_nopar:Nn \__um_font_param:nn
1766 {
1767 \__um_font_param:nnnnn { #1 } { #2 } { #2 } { #2 } { #2 }
1768 }
1769 \cs_new_protected_nopar:Nn \__um_font_param:n
1770 { }
1771 \cs_new_protected_nopar:Nn \__um_font_param_aux:NNnnnn
1772 {
1773 \cs_new_nopar:Npn #1 ##1
1774 {
1775 \__um_font_dimen:Nnnnn ##1 { #3 } { #4 } { #5 } { #6 }
1776 }
1777 \cs_new_protected_nopar:Npn #2 ##1 ##2
1778 {
1779 #1 ##1 \dim_eval:n { ##2 }
1780 }
1781 }
1782 \cs_generate_variant:Nn \__um_font_param_aux:NNnnnn { cc }
1783 \__um_font_param:nn { axis } { 15 }
1784 \__um_font_param:nn { operator_size } { 13 }
1785 \__um_font_param:n { fraction_del_size }
1786 \__um_font_param:nnn { fraction_denom_down } { 45 } { 44 }
1787 \__um_font_param:nnn { fraction_denom_vgap } { 50 } { 49 }
1788 \__um_font_param:nnn { fraction_num_up } { 43 } { 42 }
1789 \__um_font_param:nnn { fraction_num_vgap } { 47 } { 46 }
1790 \__um_font_param:nn { fraction_rule } { 48 }
1791 \__um_font_param:nn { limit_above_bgap } { 29 }
1792 \__um_font_param:n { limit_above_kern }
1793 \__um_font_param:nn { limit_above_vgap } { 28 }
1794 \__um_font_param:nn { limit_below_bgap } { 31 }
1795 \__um_font_param:n { limit_below_kern }
1796 \__um_font_param:nn { limit_below_vgap } { 30 }
1797 \__um_font_param:nn { over_delimiter_vgap } { 41 }
1798 \__um_font_param:nn { over_delimiter_bgap } { 38 }
1799 \__um_font_param:nn { under_delimiter_vgap } { 40 }
1800 \__um_font_param:nn { under_delimiter_bgap } { 39 }
1801 \__um_font_param:nn { overbar_kern } { 55 }
1802 \__um_font_param:nn { overbar_rule } { 54 }
1803 \__um_font_param:nn { overbar_vgap } { 53 }
1804 \__um_font_param:n { quad }
1805 \__um_font_param:nn { radical_kern } { 62 }
1806 \__um_font_param:nn { radical_rule } { 61 }
1807 \__um_font_param:nnn { radical_vgap } { 60 } { 59 }
1808 \__um_font_param:nn { radical_degree_before } { 63 }
1809 \__um_font_param:nn { radical_degree_after } { 64 }
1810 \__um_font_param:nn { radical_degree_raise } { 65 }
1811 \__um_font_param:nn { space_after_script } { 27 }
1812 \__um_font_param:nnn { stack_denom_down } { 35 } { 34 }
1813 \__um_font_param:nnn { stack_num_up } { 33 } { 32 }
1814 \__um_font_param:nnn { stack_vgap } { 37 } { 36 }
1815 \__um_font_param:nn { sub_shift_down } { 18 }
1816 \__um_font_param:nn { sub_shift_drop } { 20 }
1817 \__um_font_param:n { subsup_shift_down }
1818 \__um_font_param:nn { sub_top_max } { 19 }
1819 \__um_font_param:nn { subsup_vgap } { 25 }
1820 \__um_font_param:nn { sup_bottom_min } { 23 }
1821 \__um_font_param:nn { sup_shift_drop } { 24 }
1822 \__um_font_param:nnnnn { sup_shift_up } { 21 } { 22 } { 21 } { 22 }
1823 \__um_font_param:nn { supsub_bottom_max } { 26 }
1824 \__um_font_param:nn { underbar_kern } { 58 }
1825 \__um_font_param:nn { underbar_rule } { 57 }
1826 \__um_font_param:nn { underbar_vgap } { 56 }
1827 \__um_font_param:n { connector_overlap_min }
1828 \cs_set:Nn \__um_fontdimen_to_percent:nN
1829 {
1830 \fp_eval:n { \dim_to_decimal_in_sp:n { \fontdimen #1 #2 } / 100 }
1831 }
1832 \cs_new:Nn \__um_fontdimen_pc_to_pt:nN
1833 {
1834 \fp_eval:n { \dim_to_decimal_in_sp:n { \fontdimen #1 #2 } / 100 * \f@size }
1835 }
1836 \cs_new:Nn \__um_mathstyle_scale:NnnN
1837 {
1838 \ifx#1\scriptstyle
1839 #2 \__um_fontdimen_to_percent:nN {10} #4 #3
1840 \else
1841 \ifx#1\scriptscriptstyle
1842 #2 \__um_fontdimen_to_percent:nN {11} #4 #3
1843 \else
1844 #2 #3
1845 \fi
1846 \fi
1847 }
1848
1849 %%^^A%% um-code-mathmap.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
1850 %%^^A%% Setup of symbol alphabets.
1851
1852 \__um_cs_new:Nn \__um_setup_alphabets:
1853 {
1854 \bool_if:NTF \g__um_init_bool { \__um_setup_alphabets_implicit: }
1855 {
1856 \seq_if_empty:NF \g__um_mathalph_seq { \__um_setup_alphabets_explicit: }
1857 \clist_if_empty:NF \l__um_mathmap_charints_clist { \__um_setup_alphabets_inherit: }
1858 }
1859 }
1860 \__um_cs_new:Nn \__um_setup_alphabets_implicit:
1861 {
1862 \__um_log:n {setup-implicit}
1863 \seq_gset_eq:NN \g__um_mathalph_seq \g__um_default_mathalph_seq
1864 \bool_set_true:N \l__um_implicit_alph_bool
1865 \__um_maybe_init_alphabet:n {sf}
1866 \__um_maybe_init_alphabet:n {bf}
1867 \__um_maybe_init_alphabet:n {bfsf}
1868 \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_noparse:nnn
1869 \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_noparse:nn
1870 \__um_mathalph_map:
1871 \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } }
1872 }
1873 \__um_cs_new:Nn \__um_setup_alphabets_explicit:
1874 {
1875 \__um_log:n {setup-explicit}
1876 \bool_set_false:N \l__um_implicit_alph_bool
1877 \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_noparse:nnn
1878 \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_noparse:nn
1879 \__um_mathalph_map:
1880 \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } }
1881 }
1882 \__um_cs_new:Nn \__um_setup_alphabets_inherit:
1883 {
1884 \seq_gclear:N \g__um_mathalph_seq
1885 \seq_map_inline:Nn \g__um_default_mathalph_seq
1886 {
1887 \tl_set:No \l__um_style_tl { \use_i:nnn ##1 }
1888 \clist_set:No \l__um_alphabet_clist { \use_ii:nnn ##1 }
1889
1890 \clist_map_inline:Nn \l__um_alphabet_clist
1891 {
1892 \clist_if_exist:cT {g__um_named_slots_ \l__um_style_tl _ ####1 _clist}
1893 {
1894 \clist_map_inline:cn {g__um_named_slots_ \l__um_style_tl _ ####1 _clist}
1895 {
1896 \clist_map_inline:Nn \l__um_mathmap_charints_clist
1897 {
1898 \__um_int_if_slot_in_range:nnT {################1} {########1}
1899 {
1900 \seq_gput_right:Nn \g__um_mathalph_seq {##1}
1901 \clist_map_break:n { \clist_map_break:n { \clist_map_break: } }
1902 }
1903 }
1904 }
1905 }
1906 }
1907 }
1908
1909 \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_parse:nnn
1910 \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_parse:nn
1911 \__um_mathalph_map:
1912 }
1913 \cs_set:Nn \__um_mathalph_map:
1914 {
1915 \seq_map_inline:Nn \g__um_mathalph_seq
1916 {
1917 \tl_set:No \l__um_style_tl { \use_i:nnn ##1 }
1918 \clist_set:No \l__um_alphabet_clist { \use_ii:nnn ##1 }
1919 \tl_set:No \l__um_remap_style_tl { \use_iii:nnn ##1 }
1920
1921 % If no set of alphabets is defined:
1922 \clist_if_empty:NT \l__um_alphabet_clist
1923 {
1924 \cs_set_eq:NN \__um_maybe_init_alphabet:n \__um_init_alphabet:n
1925 \prop_get:cnN { g__um_named_range_ \l__um_style_tl _prop }
1926 { default-alpha } \l__um_alphabet_clist
1927 }
1928
1929 \__um_check_math_alphabet:
1930 \__um_setup_math_alphabet:
1931 }
1932 }
1933 \cs_new:Nn \__um_check_math_alphabet:
1934 {
1935 \clist_map_inline:Nn \l__um_alphabet_clist
1936 {
1937 \tl_set:Nn \l__um_alphabet_tl {##1}
1938 \__um_if_alphabet_exists:nnTF \l__um_style_tl \l__um_alphabet_tl
1939 {
1940 \str_if_eq:eeTF {\l__um_alphabet_tl} {misc}
1941 {
1942 \__um_maybe_init_alphabet:n \l__um_style_tl
1943 \clist_map_break:
1944 }
1945 {
1946 \__um_glyph_if_exist:NnT \g__um_curr_font_cmd_tl
1947 { \__um_to_usv:nn {\l__um_style_tl} {\l__um_alphabet_tl} }
1948 {
1949 \__um_maybe_init_alphabet:n \l__um_style_tl
1950 \clist_map_break:
1951 }
1952 }
1953 }
1954 {
1955 \msg_warning:nnx {unicode-math} {no-alphabet}
1956 { \l__um_style_tl / \l__um_alphabet_tl }
1957 }
1958 }
1959 }
1960 \__um_cs_new:Nn \__um_setup_math_alphabet:
1961 {
1962 \clist_map_inline:Nn \l__um_alphabet_clist
1963 {
1964 \tl_set:Nx \l__um_alphabet_tl { \tl_trim_spaces:n {##1} }
1965
1966
1967 \__um_if_alphabet_exists:nnT {\l__um_style_tl} {\l__um_alphabet_tl}
1968 {
1969 \exp_args:No \tl_if_eq:nnTF \l__um_alphabet_tl {misc}
1970 {
1971 \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)}
1972 \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl}
1973 }
1974 {
1975 \__um_glyph_if_exist:NnTF \g__um_curr_font_cmd_tl { \__um_to_usv:nn {\l__um_remap_style_tl} {\l__um_alphabet_tl} }
1976 {
1977 \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)}
1978 \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl}
1979 }
1980 {
1981 \bool_if:NTF \l__um_implicit_alph_bool
1982 {
1983 \seq_put_right:Nx \l__um_missing_alph_seq
1984 {
1985 \@backslashchar sym \l__um_style_tl \space
1986 (\tl_use:c{c__um_math_alphabet_name_ \l__um_alphabet_tl _tl})
1987 }
1988 }
1989 {
1990 \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {up}
1991 }
1992 }
1993 }
1994 }
1995 }
1996 }
1997 \cs_new:Nn \__um_new_alphabet_config:nnn
1998 {
1999 \prop_if_exist:cF {g__um_named_range_#1_prop}
2000 { \__um_warning:nnn {no-named-range} {#1} {#2} }
2001
2002 \prop_gput:cnn {g__um_named_range_#1_prop} { alpha_tl }
2003 {
2004 \prop_item:cn {g__um_named_range_#1_prop} { alpha_tl } {#2}
2005 }
2006 % Q: do I need to bother removing duplicates?
2007
2008 \cs_new:cn { __um_config_#1_#2:n }
2009 {
2010 \clist_gclear_new:c {g__um_named_slots_#1_#2_clist}
2011 \tl_set:Nn \l__um_curr_named_slot { g__um_named_slots_#1_#2_clist }
2012 #3
2013 \clist_gremove_duplicates:c {g__um_named_slots_#1_#2_clist}
2014 }
2015
2016 }
2017 \cs_new:Nn \__um_alphabet_config:nnn
2018 {
2019 \use:c {__um_config_#1_#2:n} {#3}
2020 }
2021 \prg_new_conditional:Nnn \__um_if_alphabet_exists:nn {T,TF}
2022 {
2023 \cs_if_exist:cTF {__um_config_#1_#2:n}
2024 \prg_return_true: \prg_return_false:
2025 }
2026 \cs_new:Nn \__um_map_char_noparse:nn
2027 {
2028 \__um_set_mathcode:nnnn {#1} {\mathalpha} {\l__um_symfont_label_tl} {#2}
2029 }
2030 \cs_new:Nn \__um_map_char_parse:nn
2031 {
2032 \__um_if_char_spec:nNT {#1} {\mathalpha}
2033 { \__um_map_char_noparse:nn {#1}{#2} }
2034 }
2035 \cs_new:Nn \__um_map_char_single:nnn
2036 {
2037 \__um_map_char_single:nn { \__um_to_usv:nn {#1} {#3} }
2038 { \__um_to_usv:nn {#2} {#3} }
2039 }
2040 \cs_set:Nn \__um_map_chars_range:nnn
2041 {
2042 \int_step_inline:nnnn {0} {1} {#1-1}
2043 { \__um_map_char_single:nn {#2+##1} {#3+##1} }
2044
2045 \clist_gput_right:cx { \l__um_curr_named_slot }
2046 { \int_eval:n { #3 } - \int_eval:n { #3 + #1-1 } }
2047 }
2048 \cs_new:Nn \__um_map_chars_range:nnnn
2049 {
2050 \__um_map_chars_range:nnn {#1} { \__um_to_usv:nn {#2} {#4} }
2051 { \__um_to_usv:nn {#3} {#4} }
2052 }
2053 \cs_set:Nn \__um_set_normal_char:nnn
2054 {
2055 \__um_usv_if_exist:nnT {#3} {#1}
2056 {
2057 \clist_map_inline:nn {#2}
2058 {
2059 \__um_set_mathalphabet_pos:nnnn {normal} {#1} {##1} {#3}
2060 \__um_map_char_single:nnn {##1} {#3} {#1}
2061
2062 \clist_gput_right:cx {\l__um_curr_named_slot}
2063 { \int_eval:n { \__um_to_usv:nn {#3} {#1} } }
2064 }
2065 }
2066 }
2067 \cs_new:Nn \__um_set_normal_Latin:nn
2068 {
2069 \clist_map_inline:nn {#1}
2070 {
2071 \__um_set_mathalphabet_Latin:nnn {normal} {##1} {#2}
2072 \__um_map_chars_range:nnnn {26} {##1} {#2} {Latin}
2073 }
2074 }
2075 \cs_new:Nn \__um_set_normal_latin:nn
2076 {
2077 \clist_map_inline:nn {#1}
2078 {
2079 \__um_set_mathalphabet_latin:nnn {normal} {##1} {#2}
2080 \__um_map_chars_range:nnnn {26} {##1} {#2} {latin}
2081 }
2082 }
2083 \cs_new:Nn \__um_set_normal_greek:nn
2084 {
2085 \clist_map_inline:nn {#1}
2086 {
2087 \__um_set_mathalphabet_greek:nnn {normal} {##1} {#2}
2088 \__um_map_chars_range:nnnn {25} {##1} {#2} {greek}
2089 \__um_map_char_single:nnn {##1} {#2} {epsilon}
2090 \__um_map_char_single:nnn {##1} {#2} {vartheta}
2091 \__um_map_char_single:nnn {##1} {#2} {varkappa}
2092 \__um_map_char_single:nnn {##1} {#2} {phi}
2093 \__um_map_char_single:nnn {##1} {#2} {varrho}
2094 \__um_map_char_single:nnn {##1} {#2} {varpi}
2095 \__um_set_mathalphabet_pos:nnnn {normal} {epsilon} {##1} {#2}
2096 \__um_set_mathalphabet_pos:nnnn {normal} {vartheta} {##1} {#2}
2097 \__um_set_mathalphabet_pos:nnnn {normal} {varkappa} {##1} {#2}
2098 \__um_set_mathalphabet_pos:nnnn {normal} {phi} {##1} {#2}
2099 \__um_set_mathalphabet_pos:nnnn {normal} {varrho} {##1} {#2}
2100 \__um_set_mathalphabet_pos:nnnn {normal} {varpi} {##1} {#2}
2101 }
2102 }
2103 \cs_new:Nn \__um_set_normal_Greek:nn
2104 {
2105 \clist_map_inline:nn {#1}
2106 {
2107 \__um_set_mathalphabet_Greek:nnn {normal} {##1} {#2}
2108 \__um_map_chars_range:nnnn {25} {##1} {#2} {Greek}
2109 \__um_map_char_single:nnn {##1} {#2} {varTheta}
2110 \__um_set_mathalphabet_pos:nnnn {normal} {varTheta} {##1} {#2}
2111 }
2112 }
2113 \cs_new:Nn \__um_set_normal_numbers:nn
2114 {
2115 \__um_set_mathalphabet_numbers:nnn {normal} {#1} {#2}
2116 \__um_map_chars_range:nnnn {10} {#1} {#2} {num}
2117 }
2118 \cs_new:Nn \__um_mathmap_noparse:nnn
2119 {
2120 \tl_gput_right:cx { g__um_switchto_#1_tl }
2121 {
2122 \__um_set_mathcode:nnnn {#2} {\mathalpha} {\l__um_symfont_label_tl} {#3}
2123 }
2124 }
2125 \cs_new:Nn \__um_mathmap_parse:nnn
2126 {
2127 \exp_args:NNx \clist_if_in:NnT \l__um_mathmap_charints_clist { \int_eval:n {#3} }
2128 {
2129 \__um_mathmap_noparse:nnn {#1} {#2} {#3}
2130 }
2131 }
2132 \cs_new:Nn \__um_set_mathalphabet_char:nnnn
2133 {
2134 \__um_set_mathalphabet_char:nnn {#1} { \__um_to_usv:nn {#2} {#4} }
2135 { \__um_to_usv:nn {#3} {#4} }
2136 }
2137 \cs_new:Nn \__um_set_mathalph_range:nnnn
2138 {
2139 \int_step_inline:nnnn {0} {1} {#1-1}
2140 { \__um_set_mathalphabet_char:nnn {#2} { ##1 + #3 } { ##1 + #4 } }
2141 }
2142 \cs_new:Nn \__um_set_mathalph_range:nnnnn
2143 {
2144 \clist_gput_right:cx { \l__um_curr_named_slot }
2145 { \int_eval:n { \__um_to_usv:nn {#4} {#5} } - \int_eval:n { (#1-1)+\__um_to_usv:nn {#4} {#5} } }
2146
2147 \__um_set_mathalph_range:nnnn {#1} {#2} { \__um_to_usv:nn {#3} {#5} }
2148 { \__um_to_usv:nn {#4} {#5} }
2149 }
2150 \cs_new:Nn \__um_set_mathalphabet_pos:nnnn
2151 {
2152 \__um_usv_if_exist:nnT {#4} {#2}
2153 {
2154 \clist_map_inline:nn {#3}
2155 { \__um_set_mathalphabet_char:nnnn {#1} {##1} {#4} {#2} }
2156
2157 \clist_gput_right:cx {\l__um_curr_named_slot}
2158 { \int_eval:n { \__um_to_usv:nn {#4} {#2} } }
2159 }
2160 }
2161 \cs_new:Nn \__um_set_mathalphabet_numbers:nnn
2162 {
2163 \clist_map_inline:nn {#2}
2164 { \__um_set_mathalph_range:nnnnn {10} {#1} {##1} {#3} {num} }
2165 }
2166 \cs_new:Nn \__um_set_mathalphabet_Latin:nnn
2167 {
2168 \clist_map_inline:nn {#2}
2169 { \__um_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {Latin} }
2170 }
2171 \cs_new:Nn \__um_set_mathalphabet_latin:nnn
2172 {
2173 \clist_map_inline:nn {#2}
2174 {
2175 \__um_set_mathalph_range:nnnnn {26} {#1} {##1} {#3} {latin}
2176 \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {h}
2177 }
2178 }
2179 \cs_new:Nn \__um_set_mathalphabet_Greek:nnn
2180 {
2181 \clist_map_inline:nn {#2}
2182 {
2183 \__um_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {Greek}
2184 \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varTheta}
2185 }
2186 }
2187 \cs_new:Nn \__um_set_mathalphabet_greek:nnn
2188 {
2189 \clist_map_inline:nn {#2}
2190 {
2191 \__um_set_mathalph_range:nnnnn {25} {#1} {##1} {#3} {greek}
2192 \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {epsilon}
2193 \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {vartheta}
2194 \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varkappa}
2195 \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {phi}
2196 \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varrho}
2197 \__um_set_mathalphabet_char:nnnn {#1} {##1} {#3} {varpi}
2198 }
2199 }
2200
2201 %%^^A%% um-code-sym-commands.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
2202 %%^^A%% Definition of "math symbol alphabet" commands such as `\symbf` and co.
2203
2204 \__um_cs_new:Nn \__um_prepare_mathstyle:n
2205 {
2206 \seq_gput_right:Nn \g__um_mathstyles_seq {#1}
2207 \__um_init_alphabet:n {#1}
2208 \cs_set_protected:cpx {sym#1}
2209 {
2210 \__um_group_begin:
2211 \exp_not:n
2212 {
2213 \mode_if_math:F { \exp_args:Nc \non@alpherr {sym#1} }
2214 \tl_set:Nn \l__um_mathstyle_tl {#1}
2215 }
2216 \__um_switch_to:n {#1}
2217 \__um_mathgroup_set:n {-1}
2218 \__um_group_end:n
2219 }
2220 }
2221 \__um_cs_new:Nn \__um_init_alphabet:n
2222 {
2223 \__um_log:nx {alph-initialise} {#1}
2224 \tl_gclear_new:c {g__um_switchto_#1_tl}
2225 \cs_set_protected:cpn {__um_switchto_#1:} { \tl_use:c {g__um_switchto_#1_tl} }
2226 }
2227 \cs_new_protected:Nn \__um_switch_to:n
2228 {
2229 \tl_use:c {g__um_switchto_#1_tl}
2230 }
2231 \__um_cs_new:Nn \__um_default_mathalph:nnn
2232 {
2233 \prop_new:c {g__um_named_range_#1_prop}
2234 \seq_gput_right:Nn \g__um_default_mathalph_seq {{#1}{#2}{#3}}
2235 \prop_gput:cnn { g__um_named_range_#1_prop } { default-alpha } {#2}
2236 }
2237 \__um_default_mathalph:nnn {up } {latin,Latin,greek,Greek,num,misc} {up }
2238 \__um_default_mathalph:nnn {it } {latin,Latin,greek,Greek,misc} {it }
2239 \__um_default_mathalph:nnn {bb } {latin,Latin,num,misc} {bb }
2240 \__um_default_mathalph:nnn {bbit } {misc} {bbit }
2241 \__um_default_mathalph:nnn {scr } {latin,Latin} {scr }
2242 \__um_default_mathalph:nnn {cal } {latin,Latin} {scr }
2243 \__um_default_mathalph:nnn {bfcal } {latin,Latin} {bfscr }
2244 \__um_default_mathalph:nnn {frak } {latin,Latin} {frak }
2245 \__um_default_mathalph:nnn {tt } {latin,Latin,num} {tt }
2246 \__um_default_mathalph:nnn {sfup } {latin,Latin,num} {sfup }
2247 \__um_default_mathalph:nnn {sfit } {latin,Latin} {sfit }
2248 \__um_default_mathalph:nnn {bfup } {latin,Latin,greek,Greek,num,misc} {bfup }
2249 \__um_default_mathalph:nnn {bfit } {latin,Latin,greek,Greek,misc} {bfit }
2250 \__um_default_mathalph:nnn {bfscr } {latin,Latin} {bfscr }
2251 \__um_default_mathalph:nnn {bffrak} {latin,Latin} {bffrak}
2252 \__um_default_mathalph:nnn {bfsfup} {latin,Latin,greek,Greek,num,misc} {bfsfup}
2253 \__um_default_mathalph:nnn {bfsfit} {latin,Latin,greek,Greek,misc} {bfsfit}
2254 \clist_map_inline:nn
2255 {
2256 up, it, bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf,
2257 tt, bb, bbit, scr, bfscr, cal, bfcal, frak, bffrak,
2258 normal, literal, sf, bf,
2259 }
2260 {
2261 \__um_prepare_mathstyle:n {#1}
2262 }
2263 \clist_map_inline:nn
2264 { rm, it, bf, sf, tt }
2265 { \cs_set_eq:cc { mathtext #1 } { math #1 } }
2266 \clist_map_inline:nn
2267 {
2268 normal, bb , bbit, scr, bfscr, cal, bfcal, frak, bffrak, tt,
2269 bfup, bfit, sfup, sfit, bfsfup, bfsfit, bfsf
2270 }
2271 {
2272 \cs_set:cpx { math #1 } { \exp_not:c { sym #1 } }
2273 }
2274 \AtBeginDocument { \__um_setup_mathtext: }
2275 \__um_cs_new:Nn \__um_setup_mathtext:
2276 {
2277 \clist_map_inline:nn
2278 { rm, it, bf, sf, tt }
2279 {
2280 \cs_set_protected:cpx { math ##1 }
2281 {
2282 \exp_not:n { \bool_if:NTF } \exp_not:c { g__um_ math ##1 _text_bool}
2283 { \exp_not:c { mathtext ##1 } }
2284 { \exp_not:c { sym ##1 } }
2285 }
2286 }
2287 }
2288 \cs_set_protected:Npn \mathup { \mathrm }
2289 \cs_set_protected:Npn \symrm { \symup }
2290
2291 %%^^A%% um-code-alphabets.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
2292 %%^^A%% Definitions for setting up the "math symbol alphabets".
2293
2294 \__um_new_alphabet_config:nnn {up} {num}
2295 {
2296 \__um_set_normal_numbers:nn {up} {#1}
2297 \__um_set_mathalphabet_numbers:nnn {up} {up} {#1}
2298 }
2299
2300 \__um_new_alphabet_config:nnn {up} {Latin}
2301 {
2302 \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Latin:nn {up} {#1} }
2303 {
2304 \bool_if:NT \g__um_upLatin_bool { \__um_set_normal_Latin:nn {up,it} {#1} }
2305 }
2306 \__um_set_mathalphabet_Latin:nnn {up} {up,it} {#1}
2307 \__um_set_mathalphabet_Latin:nnn {literal} {up} {up}
2308 \__um_set_mathalphabet_Latin:nnn {literal} {it} {it}
2309 }
2310
2311 \__um_new_alphabet_config:nnn {up} {latin}
2312 {
2313 \bool_if:NTF \g__um_literal_bool { \__um_set_normal_latin:nn {up} {#1} }
2314 {
2315 \bool_if:NT \g__um_uplatin_bool
2316 {
2317 \__um_set_normal_latin:nn {up,it} {#1}
2318 \__um_set_normal_char:nnn {h} {up,it} {#1}
2319 \__um_set_normal_char:nnn {dotlessi} {up,it} {#1}
2320 \__um_set_normal_char:nnn {dotlessj} {up,it} {#1}
2321 }
2322 }
2323 \__um_set_mathalphabet_latin:nnn {up} {up,it}{#1}
2324 \__um_set_mathalphabet_latin:nnn {literal} {up} {up}
2325 \__um_set_mathalphabet_latin:nnn {literal} {it} {it}
2326 }
2327
2328 \__um_new_alphabet_config:nnn {up} {Greek}
2329 {
2330 \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Greek:nn {up}{#1} }
2331 {
2332 \bool_if:NT \g__um_upGreek_bool { \__um_set_normal_Greek:nn {up,it}{#1} }
2333 }
2334 \__um_set_mathalphabet_Greek:nnn {up} {up,it}{#1}
2335 \__um_set_mathalphabet_Greek:nnn {literal} {up} {up}
2336 \__um_set_mathalphabet_Greek:nnn {literal} {it} {it}
2337 }
2338
2339 \__um_new_alphabet_config:nnn {up} {greek}
2340 {
2341 \bool_if:NTF \g__um_literal_bool { \__um_set_normal_greek:nn {up} {#1} }
2342 {
2343 \bool_if:NT \g__um_upgreek_bool
2344 {
2345 \__um_set_normal_greek:nn {up,it} {#1}
2346 }
2347 }
2348 \__um_set_mathalphabet_greek:nnn {up} {up,it} {#1}
2349 \__um_set_mathalphabet_greek:nnn {literal} {up} {up}
2350 \__um_set_mathalphabet_greek:nnn {literal} {it} {it}
2351 }
2352
2353 \__um_new_alphabet_config:nnn {up} {misc}
2354 {
2355 \bool_if:NTF \g__um_literal_Nabla_bool
2356 {
2357 \__um_set_normal_char:nnn {Nabla}{up}{up}
2358 }
2359 {
2360 \bool_if:NT \g__um_upNabla_bool
2361 {
2362 \__um_set_normal_char:nnn {Nabla}{up,it}{up}
2363 }
2364 }
2365 \bool_if:NTF \g__um_literal_partial_bool
2366 {
2367 \__um_set_normal_char:nnn {partial}{up}{up}
2368 }
2369 {
2370 \bool_if:NT \g__um_uppartial_bool
2371 {
2372 \__um_set_normal_char:nnn {partial}{up,it}{up}
2373 }
2374 }
2375 \__um_set_mathalphabet_pos:nnnn {up} {partial} {up,it} {#1}
2376 \__um_set_mathalphabet_pos:nnnn {up} {Nabla} {up,it} {#1}
2377 \__um_set_mathalphabet_pos:nnnn {up} {dotlessi} {up,it} {#1}
2378 \__um_set_mathalphabet_pos:nnnn {up} {dotlessj} {up,it} {#1}
2379 }
2380 \__um_new_alphabet_config:nnn {it} {Latin}
2381 {
2382 \bool_if:NTF \g__um_literal_bool { \__um_set_normal_Latin:nn {it} {#1} }
2383 {
2384 \bool_if:NF \g__um_upLatin_bool { \__um_set_normal_Latin:nn {up,it} {#1} }
2385 }
2386 \__um_set_mathalphabet_Latin:nnn {it} {up,it} {#1}
2387 }
2388
2389 \__um_new_alphabet_config:nnn {it} {latin}
2390 {
2391 \bool_if:NTF \g__um_literal_bool
2392 {
2393 \__um_set_normal_latin:nn {it}{#1}
2394 \__um_set_normal_char:nnn {h}{it}{#1}
2395 }
2396 {
2397 \bool_if:NF \g__um_uplatin_bool
2398 {
2399 \__um_set_normal_latin:nn {up,it} {#1}
2400 \__um_set_normal_char:nnn {h} {up,it} {#1}
2401 \__um_set_normal_char:nnn {dotlessi} {up,it} {#1}
2402 \__um_set_normal_char:nnn {dotlessj} {up,it} {#1}
2403 }
2404 }
2405 \__um_set_mathalphabet_latin:nnn {it} {up,it} {#1}
2406 \__um_set_mathalphabet_pos:nnnn {it} {dotlessi} {up,it} {#1}
2407 \__um_set_mathalphabet_pos:nnnn {it} {dotlessj} {up,it} {#1}
2408 }
2409
2410 \__um_new_alphabet_config:nnn {it} {Greek}
2411 {
2412 \bool_if:NTF \g__um_literal_bool
2413 {
2414 \__um_set_normal_Greek:nn {it} {#1}
2415 }
2416 {
2417 \bool_if:NF \g__um_upGreek_bool { \__um_set_normal_Greek:nn {up,it} {#1} }
2418 }
2419 \__um_set_mathalphabet_Greek:nnn {it} {up,it} {#1}
2420 }
2421
2422 \__um_new_alphabet_config:nnn {it} {greek}
2423 {
2424 \bool_if:NTF \g__um_literal_bool
2425 {
2426 \__um_set_normal_greek:nn {it} {#1}
2427 }
2428 {
2429 \bool_if:NF \g__um_upgreek_bool { \__um_set_normal_greek:nn {it,up} {#1} }
2430 }
2431 \__um_set_mathalphabet_greek:nnn {it} {up,it} {#1}
2432 }
2433
2434 \__um_new_alphabet_config:nnn {it} {misc}
2435 {
2436 \bool_if:NTF \g__um_literal_Nabla_bool
2437 {
2438 \__um_set_normal_char:nnn {Nabla} {it} {it}
2439 }
2440 {
2441 \bool_if:NF \g__um_upNabla_bool
2442 {
2443 \__um_set_normal_char:nnn {Nabla} {up,it} {it}
2444 }
2445 }
2446 \bool_if:NTF \g__um_literal_partial_bool
2447 {
2448 \__um_set_normal_char:nnn {partial} {it} {it}
2449 }
2450 {
2451 \bool_if:NF \g__um_uppartial_bool
2452 {
2453 \__um_set_normal_char:nnn {partial} {up,it} {it}
2454 }
2455 }
2456 \__um_set_mathalphabet_pos:nnnn {it} {partial} {up,it}{#1}
2457 \__um_set_mathalphabet_pos:nnnn {it} {Nabla} {up,it}{#1}
2458 }
2459 \__um_new_alphabet_config:nnn {bb} {latin}
2460 {
2461 \__um_set_mathalphabet_latin:nnn {bb} {up,it} {#1}
2462 }
2463
2464 \__um_new_alphabet_config:nnn {bb} {Latin}
2465 {
2466 \__um_set_mathalphabet_Latin:nnn {bb} {up,it} {#1}
2467 \__um_set_mathalphabet_pos:nnnn {bb} {C} {up,it} {#1}
2468 \__um_set_mathalphabet_pos:nnnn {bb} {H} {up,it} {#1}
2469 \__um_set_mathalphabet_pos:nnnn {bb} {N} {up,it} {#1}
2470 \__um_set_mathalphabet_pos:nnnn {bb} {P} {up,it} {#1}
2471 \__um_set_mathalphabet_pos:nnnn {bb} {Q} {up,it} {#1}
2472 \__um_set_mathalphabet_pos:nnnn {bb} {R} {up,it} {#1}
2473 \__um_set_mathalphabet_pos:nnnn {bb} {Z} {up,it} {#1}
2474 }
2475
2476 \__um_new_alphabet_config:nnn {bb} {num}
2477 {
2478 \__um_set_mathalphabet_numbers:nnn {bb} {up} {#1}
2479 }
2480
2481 \__um_new_alphabet_config:nnn {bb} {misc}
2482 {
2483 \__um_set_mathalphabet_pos:nnnn {bb} {Pi} {up,it} {#1}
2484 \__um_set_mathalphabet_pos:nnnn {bb} {pi} {up,it} {#1}
2485 \__um_set_mathalphabet_pos:nnnn {bb} {Gamma} {up,it} {#1}
2486 \__um_set_mathalphabet_pos:nnnn {bb} {gamma} {up,it} {#1}
2487 \__um_set_mathalphabet_pos:nnnn {bb} {summation} {up} {#1}
2488 }
2489
2490 \__um_new_alphabet_config:nnn {bbit} {misc}
2491 {
2492 \__um_set_mathalphabet_pos:nnnn {bbit} {D} {up,it} {#1}
2493 \__um_set_mathalphabet_pos:nnnn {bbit} {d} {up,it} {#1}
2494 \__um_set_mathalphabet_pos:nnnn {bbit} {e} {up,it} {#1}
2495 \__um_set_mathalphabet_pos:nnnn {bbit} {i} {up,it} {#1}
2496 \__um_set_mathalphabet_pos:nnnn {bbit} {j} {up,it} {#1}
2497 }
2498 \__um_new_alphabet_config:nnn {scr} {Latin}
2499 {
2500 \__um_set_mathalphabet_Latin:nnn {scr} {up,it} {#1}
2501 \__um_set_mathalphabet_pos:nnnn {scr} {B} {up,it} {#1}
2502 \__um_set_mathalphabet_pos:nnnn {scr} {E} {up,it} {#1}
2503 \__um_set_mathalphabet_pos:nnnn {scr} {F} {up,it} {#1}
2504 \__um_set_mathalphabet_pos:nnnn {scr} {H} {up,it} {#1}
2505 \__um_set_mathalphabet_pos:nnnn {scr} {I} {up,it} {#1}
2506 \__um_set_mathalphabet_pos:nnnn {scr} {L} {up,it} {#1}
2507 \__um_set_mathalphabet_pos:nnnn {scr} {M} {up,it} {#1}
2508 \__um_set_mathalphabet_pos:nnnn {scr} {R} {up,it} {#1}
2509 }
2510
2511 \__um_new_alphabet_config:nnn {scr} {latin}
2512 {
2513 \__um_set_mathalphabet_latin:nnn {scr} {up,it} {#1}
2514 \__um_set_mathalphabet_pos:nnnn {scr} {e} {up,it} {#1}
2515 \__um_set_mathalphabet_pos:nnnn {scr} {g} {up,it} {#1}
2516 \__um_set_mathalphabet_pos:nnnn {scr} {o} {up,it} {#1}
2517 }
2518 \__um_new_alphabet_config:nnn {cal} {Latin}
2519 {
2520 \__um_set_mathalphabet_Latin:nnn {cal} {up,it} {#1}
2521 \__um_set_mathalphabet_pos:nnnn {cal} {B} {up,it} {#1}
2522 \__um_set_mathalphabet_pos:nnnn {cal} {E} {up,it} {#1}
2523 \__um_set_mathalphabet_pos:nnnn {cal} {F} {up,it} {#1}
2524 \__um_set_mathalphabet_pos:nnnn {cal} {H} {up,it} {#1}
2525 \__um_set_mathalphabet_pos:nnnn {cal} {I} {up,it} {#1}
2526 \__um_set_mathalphabet_pos:nnnn {cal} {L} {up,it} {#1}
2527 \__um_set_mathalphabet_pos:nnnn {cal} {M} {up,it} {#1}
2528 \__um_set_mathalphabet_pos:nnnn {cal} {R} {up,it} {#1}
2529 }
2530 \__um_new_alphabet_config:nnn {cal} {latin}
2531 {
2532 \__um_set_mathalphabet_latin:nnn {cal} {up,it} {#1}
2533 \__um_set_mathalphabet_pos:nnnn {cal} {e} {up,it} {#1}
2534 \__um_set_mathalphabet_pos:nnnn {cal} {g} {up,it} {#1}
2535 \__um_set_mathalphabet_pos:nnnn {cal} {o} {up,it} {#1}
2536 }
2537 \__um_new_alphabet_config:nnn {frak} {Latin}
2538 {
2539 \__um_set_mathalphabet_Latin:nnn {frak} {up,it} {#1}
2540 \__um_set_mathalphabet_pos:nnnn {frak} {C} {up,it} {#1}
2541 \__um_set_mathalphabet_pos:nnnn {frak} {H} {up,it} {#1}
2542 \__um_set_mathalphabet_pos:nnnn {frak} {I} {up,it} {#1}
2543 \__um_set_mathalphabet_pos:nnnn {frak} {R} {up,it} {#1}
2544 \__um_set_mathalphabet_pos:nnnn {frak} {Z} {up,it} {#1}
2545 }
2546 \__um_new_alphabet_config:nnn {frak} {latin}
2547 {
2548 \__um_set_mathalphabet_latin:nnn {frak} {up,it} {#1}
2549 }
2550 \__um_new_alphabet_config:nnn {sfup} {num}
2551 {
2552 \__um_set_mathalphabet_numbers:nnn {sf} {up} {#1}
2553 \__um_set_mathalphabet_numbers:nnn {sfup} {up} {#1}
2554 }
2555 \__um_new_alphabet_config:nnn {sfup} {Latin}
2556 {
2557 \bool_if:NTF \g__um_sfliteral_bool
2558 {
2559 \__um_set_normal_Latin:nn {sfup} {#1}
2560 \__um_set_mathalphabet_Latin:nnn {sf} {up} {#1}
2561 }
2562 {
2563 \bool_if:NT \g__um_upsans_bool
2564 {
2565 \__um_set_normal_Latin:nn {sfup,sfit} {#1}
2566 \__um_set_mathalphabet_Latin:nnn {sf} {up,it} {#1}
2567 }
2568 }
2569 \__um_set_mathalphabet_Latin:nnn {sfup} {up,it} {#1}
2570 }
2571
2572 \__um_new_alphabet_config:nnn {sfup} {latin}
2573 {
2574 \bool_if:NTF \g__um_sfliteral_bool
2575 {
2576 \__um_set_normal_latin:nn {sfup} {#1}
2577 \__um_set_mathalphabet_latin:nnn {sf} {up} {#1}
2578 }
2579 {
2580 \bool_if:NT \g__um_upsans_bool
2581 {
2582 \__um_set_normal_latin:nn {sfup,sfit} {#1}
2583 \__um_set_mathalphabet_latin:nnn {sf} {up,it} {#1}
2584 }
2585 }
2586 \__um_set_mathalphabet_latin:nnn {sfup} {up,it} {#1}
2587 }
2588 \__um_new_alphabet_config:nnn {sfit} {Latin}
2589 {
2590 \bool_if:NTF \g__um_sfliteral_bool
2591 {
2592 \__um_set_normal_Latin:nn {sfit} {#1}
2593 \__um_set_mathalphabet_Latin:nnn {sf} {it} {#1}
2594 }
2595 {
2596 \bool_if:NF \g__um_upsans_bool
2597 {
2598 \__um_set_normal_Latin:nn {sfup,sfit} {#1}
2599 \__um_set_mathalphabet_Latin:nnn {sf} {up,it} {#1}
2600 }
2601 }
2602 \__um_set_mathalphabet_Latin:nnn {sfit} {up,it} {#1}
2603 }
2604
2605 \__um_new_alphabet_config:nnn {sfit} {latin}
2606 {
2607 \bool_if:NTF \g__um_sfliteral_bool
2608 {
2609 \__um_set_normal_latin:nn {sfit} {#1}
2610 \__um_set_mathalphabet_latin:nnn {sf} {it}{#1}
2611 }
2612 {
2613 \bool_if:NF \g__um_upsans_bool
2614 {
2615 \__um_set_normal_latin:nn {sfup,sfit} {#1}
2616 \__um_set_mathalphabet_latin:nnn {sf} {up,it}{#1}
2617 }
2618 }
2619 \__um_set_mathalphabet_latin:nnn {sfit} {up,it}{#1}
2620 }
2621 \__um_new_alphabet_config:nnn {tt} {num}
2622 {
2623 \__um_set_mathalphabet_numbers:nnn {tt} {up}{#1}
2624 }
2625 \__um_new_alphabet_config:nnn {tt} {Latin}
2626 {
2627 \__um_set_mathalphabet_Latin:nnn {tt} {up,it}{#1}
2628 }
2629 \__um_new_alphabet_config:nnn {tt} {latin}
2630 {
2631 \__um_set_mathalphabet_latin:nnn {tt} {up,it}{#1}
2632 }
2633 \__um_new_alphabet_config:nnn {bfit} {Latin}
2634 {
2635 \bool_if:NF \g__um_bfupLatin_bool
2636 {
2637 \__um_set_normal_Latin:nn {bfup,bfit} {#1}
2638 }
2639 \__um_set_mathalphabet_Latin:nnn {bfit} {up,it}{#1}
2640 \bool_if:NTF \g__um_bfliteral_bool
2641 {
2642 \__um_set_normal_Latin:nn {bfit} {#1}
2643 \__um_set_mathalphabet_Latin:nnn {bf} {it}{#1}
2644 }
2645 {
2646 \bool_if:NF \g__um_bfupLatin_bool
2647 {
2648 \__um_set_normal_Latin:nn {bfup,bfit} {#1}
2649 \__um_set_mathalphabet_Latin:nnn {bf} {up,it}{#1}
2650 }
2651 }
2652 }
2653
2654 \__um_new_alphabet_config:nnn {bfit} {latin}
2655 {
2656 \bool_if:NF \g__um_bfuplatin_bool
2657 {
2658 \__um_set_normal_latin:nn {bfup,bfit} {#1}
2659 }
2660 \__um_set_mathalphabet_latin:nnn {bfit} {up,it}{#1}
2661 \bool_if:NTF \g__um_bfliteral_bool
2662 {
2663 \__um_set_normal_latin:nn {bfit} {#1}
2664 \__um_set_mathalphabet_latin:nnn {bf} {it}{#1}
2665 }
2666 {
2667 \bool_if:NF \g__um_bfuplatin_bool
2668 {
2669 \__um_set_normal_latin:nn {bfup,bfit} {#1}
2670 \__um_set_mathalphabet_latin:nnn {bf} {up,it}{#1}
2671 }
2672 }
2673 }
2674
2675 \__um_new_alphabet_config:nnn {bfit} {Greek}
2676 {
2677 \__um_set_mathalphabet_Greek:nnn {bfit} {up,it}{#1}
2678 \bool_if:NTF \g__um_bfliteral_bool
2679 {
2680 \__um_set_normal_Greek:nn {bfit}{#1}
2681 \__um_set_mathalphabet_Greek:nnn {bf} {it}{#1}
2682 }
2683 {
2684 \bool_if:NF \g__um_bfupGreek_bool
2685 {
2686 \__um_set_normal_Greek:nn {bfup,bfit}{#1}
2687 \__um_set_mathalphabet_Greek:nnn {bf} {up,it}{#1}
2688 }
2689 }
2690 }
2691
2692 \__um_new_alphabet_config:nnn {bfit} {greek}
2693 {
2694 \__um_set_mathalphabet_greek:nnn {bfit} {up,it} {#1}
2695 \bool_if:NTF \g__um_bfliteral_bool
2696 {
2697 \__um_set_normal_greek:nn {bfit} {#1}
2698 \__um_set_mathalphabet_greek:nnn {bf} {it} {#1}
2699 }
2700 {
2701 \bool_if:NF \g__um_bfupgreek_bool
2702 {
2703 \__um_set_normal_greek:nn {bfit,bfup} {#1}
2704 \__um_set_mathalphabet_greek:nnn {bf} {up,it} {#1}
2705 }
2706 }
2707 }
2708
2709 \__um_new_alphabet_config:nnn {bfit} {misc}
2710 {
2711 \bool_if:NTF \g__um_literal_Nabla_bool
2712 { \__um_set_normal_char:nnn {Nabla} {bfit} {#1} }
2713 {
2714 \bool_if:NF \g__um_upNabla_bool
2715 { \__um_set_normal_char:nnn {Nabla} {bfup,bfit} {#1} }
2716 }
2717
2718 \bool_if:NTF \g__um_literal_partial_bool
2719 { \__um_set_normal_char:nnn {partial} {bfit} {#1} }
2720 {
2721 \bool_if:NF \g__um_uppartial_bool
2722 { \__um_set_normal_char:nnn {partial} {bfup,bfit} {#1} }
2723 }
2724
2725 \__um_set_mathalphabet_pos:nnnn {bfit} {partial} {up,it} {#1}
2726 \__um_set_mathalphabet_pos:nnnn {bfit} {Nabla} {up,it} {#1}
2727
2728 \bool_if:NTF \g__um_literal_partial_bool
2729 {
2730 \__um_set_mathalphabet_pos:nnnn {bf} {partial} {it}{#1}
2731 }
2732 {
2733 \bool_if:NF \g__um_uppartial_bool
2734 {
2735 \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up,it}{#1}
2736 }
2737 }
2738
2739 \bool_if:NTF \g__um_literal_Nabla_bool
2740 {
2741 \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {it}{#1}
2742 }
2743 {
2744 \bool_if:NF \g__um_upNabla_bool
2745 {
2746 \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up,it}{#1}
2747 }
2748 }
2749 }
2750 \__um_new_alphabet_config:nnn {bfup} {num}
2751 {
2752 \__um_set_mathalphabet_numbers:nnn {bf} {up} {#1}
2753 \__um_set_mathalphabet_numbers:nnn {bfup} {up} {#1}
2754 }
2755
2756 \__um_new_alphabet_config:nnn {bfup} {Latin}
2757 {
2758 \bool_if:NT \g__um_bfupLatin_bool
2759 {
2760 \__um_set_normal_Latin:nn {bfup,bfit} {#1}
2761 }
2762 \__um_set_mathalphabet_Latin:nnn {bfup} {up,it} {#1}
2763 \bool_if:NTF \g__um_bfliteral_bool
2764 {
2765 \__um_set_normal_Latin:nn {bfup} {#1}
2766 \__um_set_mathalphabet_Latin:nnn {bf} {up} {#1}
2767 }
2768 {
2769 \bool_if:NT \g__um_bfupLatin_bool
2770 {
2771 \__um_set_normal_Latin:nn {bfup,bfit} {#1}
2772 \__um_set_mathalphabet_Latin:nnn {bf} {up,it} {#1}
2773 }
2774 }
2775 }
2776
2777 \__um_new_alphabet_config:nnn {bfup} {latin}
2778 {
2779 \bool_if:NT \g__um_bfuplatin_bool
2780 {
2781 \__um_set_normal_latin:nn {bfup,bfit} {#1}
2782 }
2783 \__um_set_mathalphabet_latin:nnn {bfup} {up,it} {#1}
2784 \bool_if:NTF \g__um_bfliteral_bool
2785 {
2786 \__um_set_normal_latin:nn {bfup} {#1}
2787 \__um_set_mathalphabet_latin:nnn {bf} {up} {#1}
2788 }
2789 {
2790 \bool_if:NT \g__um_bfuplatin_bool
2791 {
2792 \__um_set_normal_latin:nn {bfup,bfit} {#1}
2793 \__um_set_mathalphabet_latin:nnn {bf} {up,it} {#1}
2794 }
2795 }
2796 }
2797
2798 \__um_new_alphabet_config:nnn {bfup} {Greek}
2799 {
2800 \__um_set_mathalphabet_Greek:nnn {bfup} {up,it} {#1}
2801 \bool_if:NTF \g__um_bfliteral_bool
2802 {
2803 \__um_set_normal_Greek:nn {bfup} {#1}
2804 \__um_set_mathalphabet_Greek:nnn {bf} {up} {#1}
2805 }
2806 {
2807 \bool_if:NT \g__um_bfupGreek_bool
2808 {
2809 \__um_set_normal_Greek:nn {bfup,bfit} {#1}
2810 \__um_set_mathalphabet_Greek:nnn {bf} {up,it} {#1}
2811 }
2812 }
2813 }
2814
2815 \__um_new_alphabet_config:nnn {bfup} {greek}
2816 {
2817 \__um_set_mathalphabet_greek:nnn {bfup} {up,it} {#1}
2818 \bool_if:NTF \g__um_bfliteral_bool
2819 {
2820 \__um_set_normal_greek:nn {bfup} {#1}
2821 \__um_set_mathalphabet_greek:nnn {bf} {up} {#1}
2822 }
2823 {
2824 \bool_if:NT \g__um_bfupgreek_bool
2825 {
2826 \__um_set_normal_greek:nn {bfup,bfit} {#1}
2827 \__um_set_mathalphabet_greek:nnn {bf} {up,it} {#1}
2828 }
2829 }
2830 }
2831
2832 \__um_new_alphabet_config:nnn {bfup} {misc}
2833 {
2834 \bool_if:NTF \g__um_literal_Nabla_bool
2835 {
2836 \__um_set_normal_char:nnn {Nabla} {bfup} {#1}
2837 }
2838 {
2839 \bool_if:NT \g__um_upNabla_bool
2840 {
2841 \__um_set_normal_char:nnn {Nabla} {bfup,bfit} {#1}
2842 }
2843 }
2844 \bool_if:NTF \g__um_literal_partial_bool
2845 {
2846 \__um_set_normal_char:nnn {partial} {bfup} {#1}
2847 }
2848 {
2849 \bool_if:NT \g__um_uppartial_bool
2850 {
2851 \__um_set_normal_char:nnn {partial} {bfup,bfit} {#1}
2852 }
2853 }
2854 \__um_set_mathalphabet_pos:nnnn {bfup} {partial} {up,it} {#1}
2855 \__um_set_mathalphabet_pos:nnnn {bfup} {Nabla} {up,it} {#1}
2856 \__um_set_mathalphabet_pos:nnnn {bfup} {digamma} {up} {#1}
2857 \__um_set_mathalphabet_pos:nnnn {bfup} {Digamma} {up} {#1}
2858 \__um_set_mathalphabet_pos:nnnn {bf} {digamma} {up} {#1}
2859 \__um_set_mathalphabet_pos:nnnn {bf} {Digamma} {up} {#1}
2860 \bool_if:NTF \g__um_literal_partial_bool
2861 {
2862 \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up} {#1}
2863 }
2864 {
2865 \bool_if:NT \g__um_uppartial_bool
2866 {
2867 \__um_set_mathalphabet_pos:nnnn {bf} {partial} {up,it} {#1}
2868 }
2869 }
2870 \bool_if:NTF \g__um_literal_Nabla_bool
2871 {
2872 \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up}{#1}
2873 }
2874 {
2875 \bool_if:NT \g__um_upNabla_bool
2876 {
2877 \__um_set_mathalphabet_pos:nnnn {bf} {Nabla} {up,it} {#1}
2878 }
2879 }
2880 }
2881 \__um_new_alphabet_config:nnn {bffrak} {Latin}
2882 {
2883 \__um_set_mathalphabet_Latin:nnn {bffrak} {up,it}{#1}
2884 }
2885
2886 \__um_new_alphabet_config:nnn {bffrak} {latin}
2887 {
2888 \__um_set_mathalphabet_latin:nnn {bffrak} {up,it}{#1}
2889 }
2890 \__um_new_alphabet_config:nnn {bfscr} {Latin}
2891 {
2892 \__um_set_mathalphabet_Latin:nnn {bfscr} {up,it}{#1}
2893 }
2894 \__um_new_alphabet_config:nnn {bfscr} {latin}
2895 {
2896 \__um_set_mathalphabet_latin:nnn {bfscr} {up,it}{#1}
2897 }
2898 \__um_new_alphabet_config:nnn {bfcal} {Latin}
2899 {
2900 \__um_set_mathalphabet_Latin:nnn {bfcal} {up,it}{#1}
2901 }
2902 \__um_new_alphabet_config:nnn {bfcal} {latin}
2903 {
2904 \__um_set_mathalphabet_latin:nnn {bfcal} {up,it}{#1}
2905 }
2906 \__um_new_alphabet_config:nnn {bfsfup} {num}
2907 {
2908 \__um_set_mathalphabet_numbers:nnn {bfsf} {up}{#1}
2909 \__um_set_mathalphabet_numbers:nnn {bfsfup} {up}{#1}
2910 }
2911 \__um_new_alphabet_config:nnn {bfsfup} {Latin}
2912 {
2913 \bool_if:NTF \g__um_sfliteral_bool
2914 {
2915 \__um_set_normal_Latin:nn {bfsfup} {#1}
2916 \__um_set_mathalphabet_Latin:nnn {bfsf} {up}{#1}
2917 }
2918 {
2919 \bool_if:NT \g__um_upsans_bool
2920 {
2921 \__um_set_normal_Latin:nn {bfsfup,bfsfit} {#1}
2922 \__um_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1}
2923 }
2924 }
2925 \__um_set_mathalphabet_Latin:nnn {bfsfup} {up,it}{#1}
2926 }
2927
2928 \__um_new_alphabet_config:nnn {bfsfup} {latin}
2929 {
2930 \bool_if:NTF \g__um_sfliteral_bool
2931 {
2932 \__um_set_normal_latin:nn {bfsfup} {#1}
2933 \__um_set_mathalphabet_latin:nnn {bfsf} {up}{#1}
2934 }
2935 {
2936 \bool_if:NT \g__um_upsans_bool
2937 {
2938 \__um_set_normal_latin:nn {bfsfup,bfsfit} {#1}
2939 \__um_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1}
2940 }
2941 }
2942 \__um_set_mathalphabet_latin:nnn {bfsfup} {up,it}{#1}
2943 }
2944
2945 \__um_new_alphabet_config:nnn {bfsfup} {Greek}
2946 {
2947 \bool_if:NTF \g__um_sfliteral_bool
2948 {
2949 \__um_set_normal_Greek:nn {bfsfup}{#1}
2950 \__um_set_mathalphabet_Greek:nnn {bfsf} {up}{#1}
2951 }
2952 {
2953 \bool_if:NT \g__um_upsans_bool
2954 {
2955 \__um_set_normal_Greek:nn {bfsfup,bfsfit}{#1}
2956 \__um_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1}
2957 }
2958 }
2959 \__um_set_mathalphabet_Greek:nnn {bfsfup} {up,it}{#1}
2960 }
2961
2962 \__um_new_alphabet_config:nnn {bfsfup} {greek}
2963 {
2964 \bool_if:NTF \g__um_sfliteral_bool
2965 {
2966 \__um_set_normal_greek:nn {bfsfup} {#1}
2967 \__um_set_mathalphabet_greek:nnn {bfsf} {up} {#1}
2968 }
2969 {
2970 \bool_if:NT \g__um_upsans_bool
2971 {
2972 \__um_set_normal_greek:nn {bfsfup,bfsfit} {#1}
2973 \__um_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1}
2974 }
2975 }
2976 \__um_set_mathalphabet_greek:nnn {bfsfup} {up,it} {#1}
2977 }
2978
2979 \__um_new_alphabet_config:nnn {bfsfup} {misc}
2980 {
2981 \bool_if:NTF \g__um_literal_Nabla_bool
2982 {
2983 \__um_set_normal_char:nnn {Nabla}{bfsfup}{#1}
2984 }
2985 {
2986 \bool_if:NT \g__um_upNabla_bool
2987 {
2988 \__um_set_normal_char:nnn {Nabla}{bfsfup,bfsfit}{#1}
2989 }
2990 }
2991 \bool_if:NTF \g__um_literal_partial_bool
2992 {
2993 \__um_set_normal_char:nnn {partial}{bfsfup}{#1}
2994 }
2995 {
2996 \bool_if:NT \g__um_uppartial_bool
2997 {
2998 \__um_set_normal_char:nnn {partial}{bfsfup,bfsfit}{#1}
2999 }
3000 }
3001 \__um_set_mathalphabet_pos:nnnn {bfsfup} {partial} {up,it}{#1}
3002 \__um_set_mathalphabet_pos:nnnn {bfsfup} {Nabla} {up,it}{#1}
3003 \bool_if:NTF \g__um_literal_partial_bool
3004 {
3005 \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up}{#1}
3006 }
3007 {
3008 \bool_if:NT \g__um_uppartial_bool
3009 {
3010 \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up,it}{#1}
3011 }
3012 }
3013 \bool_if:NTF \g__um_literal_Nabla_bool
3014 {
3015 \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {up}{#1}
3016 }
3017 {
3018 \bool_if:NT \g__um_upNabla_bool
3019 {
3020 \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {up,it}{#1}
3021 }
3022 }
3023 }
3024 \__um_new_alphabet_config:nnn {bfsfit} {Latin}
3025 {
3026 \bool_if:NTF \g__um_sfliteral_bool
3027 {
3028 \__um_set_normal_Latin:nn {bfsfit} {#1}
3029 \__um_set_mathalphabet_Latin:nnn {bfsf} {it}{#1}
3030 }
3031 {
3032 \bool_if:NF \g__um_upsans_bool
3033 {
3034 \__um_set_normal_Latin:nn {bfsfup,bfsfit} {#1}
3035 \__um_set_mathalphabet_Latin:nnn {bfsf} {up,it}{#1}
3036 }
3037 }
3038 \__um_set_mathalphabet_Latin:nnn {bfsfit} {up,it}{#1}
3039 }
3040
3041 \__um_new_alphabet_config:nnn {bfsfit} {latin}
3042 {
3043 \bool_if:NTF \g__um_sfliteral_bool
3044 {
3045 \__um_set_normal_latin:nn {bfsfit} {#1}
3046 \__um_set_mathalphabet_latin:nnn {bfsf} {it}{#1}
3047 }
3048 {
3049 \bool_if:NF \g__um_upsans_bool
3050 {
3051 \__um_set_normal_latin:nn {bfsfup,bfsfit} {#1}
3052 \__um_set_mathalphabet_latin:nnn {bfsf} {up,it}{#1}
3053 }
3054 }
3055 \__um_set_mathalphabet_latin:nnn {bfsfit} {up,it}{#1}
3056 }
3057
3058 \__um_new_alphabet_config:nnn {bfsfit} {Greek}
3059 {
3060 \bool_if:NTF \g__um_sfliteral_bool
3061 {
3062 \__um_set_normal_Greek:nn {bfsfit}{#1}
3063 \__um_set_mathalphabet_Greek:nnn {bfsf} {it}{#1}
3064 }
3065 {
3066 \bool_if:NF \g__um_upsans_bool
3067 {
3068 \__um_set_normal_Greek:nn {bfsfup,bfsfit}{#1}
3069 \__um_set_mathalphabet_Greek:nnn {bfsf} {up,it}{#1}
3070 }
3071 }
3072 \__um_set_mathalphabet_Greek:nnn {bfsfit} {up,it}{#1}
3073 }
3074
3075 \__um_new_alphabet_config:nnn {bfsfit} {greek}
3076 {
3077 \bool_if:NTF \g__um_sfliteral_bool
3078 {
3079 \__um_set_normal_greek:nn {bfsfit} {#1}
3080 \__um_set_mathalphabet_greek:nnn {bfsf} {it} {#1}
3081 }
3082 {
3083 \bool_if:NF \g__um_upsans_bool
3084 {
3085 \__um_set_normal_greek:nn {bfsfup,bfsfit} {#1}
3086 \__um_set_mathalphabet_greek:nnn {bfsf} {up,it} {#1}
3087 }
3088 }
3089 \__um_set_mathalphabet_greek:nnn {bfsfit} {up,it} {#1}
3090 }
3091
3092 \__um_new_alphabet_config:nnn {bfsfit} {misc}
3093 {
3094 \bool_if:NTF \g__um_literal_Nabla_bool
3095 {
3096 \__um_set_normal_char:nnn {Nabla}{bfsfit}{#1}
3097 }
3098 {
3099 \bool_if:NF \g__um_upNabla_bool
3100 {
3101 \__um_set_normal_char:nnn {Nabla}{bfsfup,bfsfit}{#1}
3102 }
3103 }
3104 \bool_if:NTF \g__um_literal_partial_bool
3105 {
3106 \__um_set_normal_char:nnn {partial}{bfsfit}{#1}
3107 }
3108 {
3109 \bool_if:NF \g__um_uppartial_bool
3110 {
3111 \__um_set_normal_char:nnn {partial}{bfsfup,bfsfit}{#1}
3112 }
3113 }
3114 \__um_set_mathalphabet_pos:nnnn {bfsfit} {partial} {up,it}{#1}
3115 \__um_set_mathalphabet_pos:nnnn {bfsfit} {Nabla} {up,it}{#1}
3116 \bool_if:NTF \g__um_literal_partial_bool
3117 {
3118 \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {it}{#1}
3119 }
3120 {
3121 \bool_if:NF \g__um_uppartial_bool
3122 {
3123 \__um_set_mathalphabet_pos:nnnn {bfsf} {partial} {up,it}{#1}
3124 }
3125 }
3126 \bool_if:NTF \g__um_literal_Nabla_bool
3127 {
3128 \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {it}{#1}
3129 }
3130 {
3131 \bool_if:NF \g__um_upNabla_bool
3132 {
3133 \__um_set_mathalphabet_pos:nnnn {bfsf} {Nabla} {up,it}{#1}
3134 }
3135 }
3136 }
3137
3138 %%^^A%% um-code-primes.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
3139 %%^^A%% The definitions needed for the input of primes.
3140
3141 \cs_new:Nn \__um_arg_i_before_egroup:n {#1\egroup}
3142 \cs_new:Nn \__um_superscript:n
3143 {
3144 ^\bgroup #1
3145 \peek_meaning_remove:NTF ^ \__um_arg_i_before_egroup:n \egroup
3146 }
3147 \cs_new:Nn \__um_nprimes:Nn
3148 {
3149 \__um_superscript:n
3150 {
3151 #1
3152 \prg_replicate:nn {#2-1} { \mskip \g__um_primekern_muskip #1 }
3153 }
3154 }
3155 \cs_new:Nn \__um_nprimes_select:nn
3156 {
3157 \int_case:nnF {#2}
3158 {
3159 {1} { \__um_superscript:n {#1} }
3160 {2} {
3161 \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2033}
3162 { \__um_superscript:n {\__um_prime_double_mchar} }
3163 { \__um_nprimes:Nn #1 {#2} }
3164 }
3165 {3} {
3166 \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2034}
3167 { \__um_superscript:n {\__um_prime_triple_mchar} }
3168 { \__um_nprimes:Nn #1 {#2} }
3169 }
3170 {4} {
3171 \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2057}
3172 { \__um_superscript:n {\__um_prime_quad_mchar} }
3173 { \__um_nprimes:Nn #1 {#2} }
3174 }
3175 }
3176 {
3177 \__um_nprimes:Nn #1 {#2}
3178 }
3179 }
3180 \cs_new:Nn \__um_nbackprimes_select:nn
3181 {
3182 \int_case:nnF {#2}
3183 {
3184 {1} { \__um_superscript:n {#1} }
3185 {2} {
3186 \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2036}
3187 { \__um_superscript:n {\__um_backprime_double_mchar} }
3188 { \__um_nprimes:Nn #1 {#2} }
3189 }
3190 {3} {
3191 \__um_glyph_if_exist:NnTF \g__um_prime_font_cmd_tl {"2037}
3192 { \__um_superscript:n {\__um_backprime_triple_mchar} }
3193 { \__um_nprimes:Nn #1 {#2} }
3194 }
3195 }
3196 {
3197 \__um_nprimes:Nn #1 {#2}
3198 }
3199 }
3200 \cs_new:Npn \__um_scan_prime:
3201 {
3202 \cs_set_eq:NN \__um_superscript:n \use:n
3203 \int_zero:N \l__um_primecount_int
3204 \__um_scanprime_collect:N \__um_prime_single_mchar
3205 }
3206 \cs_new:Npn \__um_scan_dprime:
3207 {
3208 \cs_set_eq:NN \__um_superscript:n \use:n
3209 \int_set:Nn \l__um_primecount_int {1}
3210 \__um_scanprime_collect:N \__um_prime_single_mchar
3211 }
3212 \cs_new:Npn \__um_scan_trprime:
3213 {
3214 \cs_set_eq:NN \__um_superscript:n \use:n
3215 \int_set:Nn \l__um_primecount_int {2}
3216 \__um_scanprime_collect:N \__um_prime_single_mchar
3217 }
3218 \cs_new:Npn \__um_scan_qprime:
3219 {
3220 \cs_set_eq:NN \__um_superscript:n \use:n
3221 \int_set:Nn \l__um_primecount_int {3}
3222 \__um_scanprime_collect:N \__um_prime_single_mchar
3223 }
3224 \cs_new:Npn \__um_scan_sup_prime:
3225 {
3226 \int_zero:N \l__um_primecount_int
3227 \__um_scanprime_collect:N \__um_prime_single_mchar
3228 }
3229 \cs_new:Npn \__um_scan_sup_dprime:
3230 {
3231 \int_set:Nn \l__um_primecount_int {1}
3232 \__um_scanprime_collect:N \__um_prime_single_mchar
3233 }
3234 \cs_new:Npn \__um_scan_sup_trprime:
3235 {
3236 \int_set:Nn \l__um_primecount_int {2}
3237 \__um_scanprime_collect:N \__um_prime_single_mchar
3238 }
3239 \cs_new:Npn \__um_scan_sup_qprime:
3240 {
3241 \int_set:Nn \l__um_primecount_int {3}
3242 \__um_scanprime_collect:N \__um_prime_single_mchar
3243 }
3244 \cs_new:Nn \__um_scanprime_collect:N
3245 {
3246 \int_incr:N \l__um_primecount_int
3247 \peek_meaning_remove:NTF '
3248 { \__um_scanprime_collect:N #1 }
3249 {
3250 \peek_meaning_remove:NTF \__um_scan_prime:
3251 { \__um_scanprime_collect:N #1 }
3252 {
3253 \peek_meaning_remove:NTF ^^^^2032
3254 { \__um_scanprime_collect:N #1 }
3255 {
3256 \peek_meaning_remove:NTF \__um_scan_dprime:
3257 {
3258 \int_incr:N \l__um_primecount_int
3259 \__um_scanprime_collect:N #1
3260 }
3261 {
3262 \peek_meaning_remove:NTF ^^^^2033
3263 {
3264 \int_incr:N \l__um_primecount_int
3265 \__um_scanprime_collect:N #1
3266 }
3267 {
3268 \peek_meaning_remove:NTF \__um_scan_trprime:
3269 {
3270 \int_add:Nn \l__um_primecount_int {2}
3271 \__um_scanprime_collect:N #1
3272 }
3273 {
3274 \peek_meaning_remove:NTF ^^^^2034
3275 {
3276 \int_add:Nn \l__um_primecount_int {2}
3277 \__um_scanprime_collect:N #1
3278 }
3279 {
3280 \peek_meaning_remove:NTF \__um_scan_qprime:
3281 {
3282 \int_add:Nn \l__um_primecount_int {3}
3283 \__um_scanprime_collect:N #1
3284 }
3285 {
3286 \peek_meaning_remove:NTF ^^^^2057
3287 {
3288 \int_add:Nn \l__um_primecount_int {3}
3289 \__um_scanprime_collect:N #1
3290 }
3291 {
3292 \__um_nprimes_select:nn {#1} {\l__um_primecount_int}
3293 }
3294 }
3295 }
3296 }
3297 }
3298 }
3299 }
3300 }
3301 }
3302 }
3303 \cs_new:Npn \__um_scan_backprime:
3304 {
3305 \cs_set_eq:NN \__um_superscript:n \use:n
3306 \int_zero:N \l__um_primecount_int
3307 \__um_scanbackprime_collect:N \__um_backprime_single_mchar
3308 }
3309 \cs_new:Npn \__um_scan_backdprime:
3310 {
3311 \cs_set_eq:NN \__um_superscript:n \use:n
3312 \int_set:Nn \l__um_primecount_int {1}
3313 \__um_scanbackprime_collect:N \__um_backprime_single_mchar
3314 }
3315 \cs_new:Npn \__um_scan_backtrprime:
3316 {
3317 \cs_set_eq:NN \__um_superscript:n \use:n
3318 \int_set:Nn \l__um_primecount_int {2}
3319 \__um_scanbackprime_collect:N \__um_backprime_single_mchar
3320 }
3321 \cs_new:Npn \__um_scan_sup_backprime:
3322 {
3323 \int_zero:N \l__um_primecount_int
3324 \__um_scanbackprime_collect:N \__um_backprime_single_mchar
3325 }
3326 \cs_new:Npn \__um_scan_sup_backdprime:
3327 {
3328 \int_set:Nn \l__um_primecount_int {1}
3329 \__um_scanbackprime_collect:N \__um_backprime_single_mchar
3330 }
3331 \cs_new:Npn \__um_scan_sup_backtrprime:
3332 {
3333 \int_set:Nn \l__um_primecount_int {2}
3334 \__um_scanbackprime_collect:N \__um_backprime_single_mchar
3335 }
3336 \cs_new:Nn \__um_scanbackprime_collect:N
3337 {
3338 \int_incr:N \l__um_primecount_int
3339 \peek_meaning_remove:NTF `
3340 {
3341 \__um_scanbackprime_collect:N #1
3342 }
3343 {
3344 \peek_meaning_remove:NTF \__um_scan_backprime:
3345 {
3346 \__um_scanbackprime_collect:N #1
3347 }
3348 {
3349 \peek_meaning_remove:NTF ^^^^2035
3350 {
3351 \__um_scanbackprime_collect:N #1
3352 }
3353 {
3354 \peek_meaning_remove:NTF \__um_scan_backdprime:
3355 {
3356 \int_incr:N \l__um_primecount_int
3357 \__um_scanbackprime_collect:N #1
3358 }
3359 {
3360 \peek_meaning_remove:NTF ^^^^2036
3361 {
3362 \int_incr:N \l__um_primecount_int
3363 \__um_scanbackprime_collect:N #1
3364 }
3365 {
3366 \peek_meaning_remove:NTF \__um_scan_backtrprime:
3367 {
3368 \int_add:Nn \l__um_primecount_int {2}
3369 \__um_scanbackprime_collect:N #1
3370 }
3371 {
3372 \peek_meaning_remove:NTF ^^^^2037
3373 {
3374 \int_add:Nn \l__um_primecount_int {2}
3375 \__um_scanbackprime_collect:N #1
3376 }
3377 {
3378 \__um_nbackprimes_select:nn {#1} {\l__um_primecount_int}
3379 }
3380 }
3381 }
3382 }
3383 }
3384 }
3385 }
3386 }
3387 \AtBeginDocument { \__um_define_prime_commands: \__um_define_prime_chars: }
3388 \cs_new:Nn \__um_define_prime_commands:
3389 {
3390 \cs_set_eq:NN \prime \__um_prime_single_mchar
3391 \cs_set_eq:NN \dprime \__um_prime_double_mchar
3392 \cs_set_eq:NN \trprime \__um_prime_triple_mchar
3393 \cs_set_eq:NN \qprime \__um_prime_quad_mchar
3394 \cs_set_eq:NN \backprime \__um_backprime_single_mchar
3395 \cs_set_eq:NN \backdprime \__um_backprime_double_mchar
3396 \cs_set_eq:NN \backtrprime \__um_backprime_triple_mchar
3397 }
3398 \group_begin:
3399 \char_set_catcode_active:N \'
3400 \char_set_catcode_active:N \`
3401 \char_set_catcode_active:n {"2032}
3402 \char_set_catcode_active:n {"2033}
3403 \char_set_catcode_active:n {"2034}
3404 \char_set_catcode_active:n {"2057}
3405 \char_set_catcode_active:n {"2035}
3406 \char_set_catcode_active:n {"2036}
3407 \char_set_catcode_active:n {"2037}
3408 \cs_gset:Nn \__um_define_prime_chars:
3409 {
3410 \cs_set_eq:NN ' \__um_scan_sup_prime:
3411 \cs_set_eq:NN ^^^^2032 \__um_scan_sup_prime:
3412 \cs_set_eq:NN ^^^^2033 \__um_scan_sup_dprime:
3413 \cs_set_eq:NN ^^^^2034 \__um_scan_sup_trprime:
3414 \cs_set_eq:NN ^^^^2057 \__um_scan_sup_qprime:
3415 \cs_set_eq:NN ` \__um_scan_sup_backprime:
3416 \cs_set_eq:NN ^^^^2035 \__um_scan_sup_backprime:
3417 \cs_set_eq:NN ^^^^2036 \__um_scan_sup_backdprime:
3418 \cs_set_eq:NN ^^^^2037 \__um_scan_sup_backtrprime:
3419 }
3420 \group_end:
3421
3422 \cs_set_eq:NN \active@math@prime \__um_scan_sup_prime:
3423
3424 %%^^A%% um-code-sscript.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
3425 %%^^A%% Setup for active chars needed to process subscript/superscript input chars.
3426
3427 \cs_new:Nn \__um_setup_active_superscript:nn
3428 {
3429 \prop_gput:Nxn \g__um_supers_prop { \int_eval:n {#1} } {#2}
3430 \__um_mathactive_remap:nn {#1}
3431 {
3432 \tl_set:Nn \l__um_ss_chain_tl {#2}
3433 \cs_set_eq:NN \__um_sub_or_super:n \sp
3434 \tl_set:Nn \l__um_tmpa_tl {supers}
3435 \__um_scan_sscript:
3436 }
3437 }
3438 \cs_new:Nn \__um_setup_active_subscript:nn
3439 {
3440 \prop_gput:Nxn \g__um_subs_prop { \int_eval:n {#1} } {#2}
3441 \__um_mathactive_remap:nn {#1}
3442 {
3443 \tl_set:Nn \l__um_ss_chain_tl {#2}
3444 \cs_set_eq:NN \__um_sub_or_super:n \sb
3445 \tl_set:Nn \l__um_tmpa_tl {subs}
3446 \__um_scan_sscript:
3447 }
3448 }
3449 \__um_cs_new:Nn \__um_scan_sscript:
3450 {
3451 \__um_scan_sscript:TF
3452 { \__um_scan_sscript: }
3453 { \__um_sub_or_super:n {\l__um_ss_chain_tl} }
3454 }
3455 \__um_cs_new:Nn \__um_scan_sscript:TF
3456 {
3457 \peek_N_type:TF
3458 {
3459 \group_align_safe_begin:
3460 \__um_scan_sscript_aux:nnN {#1} {#2}
3461 }
3462 {#2}
3463 }
3464 \__um_cs_new:Nn \__um_scan_sscript_aux:nnN
3465 {
3466 \tl_set:Nx \l__um_tmpa_key_tl { \tl_to_str:n {#3} }
3467 \prop_get:cxNTF {g__um_\l__um_tmpa_tl _prop}
3468 { \int_eval:n { \exp_after:wN ` \l__um_tmpa_key_tl } }
3469 \l__um_tmpb_tl
3470 {
3471 \tl_put_right:NV \l__um_ss_chain_tl \l__um_tmpb_tl
3472 \group_align_safe_end:
3473 #1
3474 }
3475 { \group_align_safe_end: #2 #3 }
3476 }
3477 \__um_setup_active_superscript:nn {"2070} {0}
3478 \__um_setup_active_superscript:nn {"00B9} {1}
3479 \__um_setup_active_superscript:nn {"00B2} {2}
3480 \__um_setup_active_superscript:nn {"00B3} {3}
3481 \__um_setup_active_superscript:nn {"2074} {4}
3482 \__um_setup_active_superscript:nn {"2075} {5}
3483 \__um_setup_active_superscript:nn {"2076} {6}
3484 \__um_setup_active_superscript:nn {"2077} {7}
3485 \__um_setup_active_superscript:nn {"2078} {8}
3486 \__um_setup_active_superscript:nn {"2079} {9}
3487 \__um_setup_active_superscript:nn {"207A} {+}
3488 \__um_setup_active_superscript:nn {"207B} {-}
3489 \__um_setup_active_superscript:nn {"207C} {=}
3490 \__um_setup_active_superscript:nn {"207D} {(}
3491 \__um_setup_active_superscript:nn {"207E} {)}
3492 \__um_setup_active_superscript:nn {"1D2C} {A}
3493 \__um_setup_active_superscript:nn {"1D2E} {B}
3494 \__um_setup_active_superscript:nn {"1D30} {D}
3495 \__um_setup_active_superscript:nn {"1D31} {E}
3496 \__um_setup_active_superscript:nn {"1D33} {G}
3497 \__um_setup_active_superscript:nn {"1D34} {H}
3498 \__um_setup_active_superscript:nn {"1D35} {I}
3499 \__um_setup_active_superscript:nn {"1D36} {J}
3500 \__um_setup_active_superscript:nn {"1D37} {K}
3501 \__um_setup_active_superscript:nn {"1D38} {L}
3502 \__um_setup_active_superscript:nn {"1D39} {M}
3503 \__um_setup_active_superscript:nn {"1D3A} {N}
3504 \__um_setup_active_superscript:nn {"1D3C} {O}
3505 \__um_setup_active_superscript:nn {"1D3E} {P}
3506 \__um_setup_active_superscript:nn {"1D3F} {R}
3507 \__um_setup_active_superscript:nn {"1D40} {T}
3508 \__um_setup_active_superscript:nn {"1D41} {U}
3509 \__um_setup_active_superscript:nn {"2C7D} {V}
3510 \__um_setup_active_superscript:nn {"1D42} {W}
3511 \__um_setup_active_superscript:nn {"1D43} {a}
3512 \__um_setup_active_superscript:nn {"1D47} {b}
3513 \__um_setup_active_superscript:nn {"1D9C} {c}
3514 \__um_setup_active_superscript:nn {"1D48} {d}
3515 \__um_setup_active_superscript:nn {"1D49} {e}
3516 \__um_setup_active_superscript:nn {"1DA0} {f}
3517 \__um_setup_active_superscript:nn {"1D4D} {g}
3518 \__um_setup_active_superscript:nn {"02B0} {h}
3519 \__um_setup_active_superscript:nn {"2071} {i}
3520 \__um_setup_active_superscript:nn {"02B2} {j}
3521 \__um_setup_active_superscript:nn {"1D4F} {k}
3522 \__um_setup_active_superscript:nn {"02E1} {l}
3523 \__um_setup_active_superscript:nn {"1D50} {m}
3524 \__um_setup_active_superscript:nn {"207F} {n}
3525 \__um_setup_active_superscript:nn {"1D52} {o}
3526 \__um_setup_active_superscript:nn {"1D56} {p}
3527 \__um_setup_active_superscript:nn {"02B3} {r}
3528 \__um_setup_active_superscript:nn {"02E2} {s}
3529 \__um_setup_active_superscript:nn {"1D57} {t}
3530 \__um_setup_active_superscript:nn {"1D58} {u}
3531 \__um_setup_active_superscript:nn {"1D5B} {v}
3532 \__um_setup_active_superscript:nn {"02B7} {w}
3533 \__um_setup_active_superscript:nn {"02E3} {x}
3534 \__um_setup_active_superscript:nn {"02B8} {y}
3535 \__um_setup_active_superscript:nn {"1DBB} {z}
3536 \__um_setup_active_superscript:nn {"1D5D} {\beta}
3537 \__um_setup_active_superscript:nn {"1D5E} {\gamma}
3538 \__um_setup_active_superscript:nn {"1D5F} {\delta}
3539 \__um_setup_active_superscript:nn {"1D60} {\phi}
3540 \__um_setup_active_superscript:nn {"1D61} {\chi}
3541 \__um_setup_active_superscript:nn {"1DBF} {\theta}
3542 \__um_setup_active_subscript:nn {"2080} {0}
3543 \__um_setup_active_subscript:nn {"2081} {1}
3544 \__um_setup_active_subscript:nn {"2082} {2}
3545 \__um_setup_active_subscript:nn {"2083} {3}
3546 \__um_setup_active_subscript:nn {"2084} {4}
3547 \__um_setup_active_subscript:nn {"2085} {5}
3548 \__um_setup_active_subscript:nn {"2086} {6}
3549 \__um_setup_active_subscript:nn {"2087} {7}
3550 \__um_setup_active_subscript:nn {"2088} {8}
3551 \__um_setup_active_subscript:nn {"2089} {9}
3552 \__um_setup_active_subscript:nn {"208A} {+}
3553 \__um_setup_active_subscript:nn {"208B} {-}
3554 \__um_setup_active_subscript:nn {"208C} {=}
3555 \__um_setup_active_subscript:nn {"208D} {(}
3556 \__um_setup_active_subscript:nn {"208E} {)}
3557 \__um_setup_active_subscript:nn {"2090} {a}
3558 \__um_setup_active_subscript:nn {"2091} {e}
3559 \__um_setup_active_subscript:nn {"2095} {h}
3560 \__um_setup_active_subscript:nn {"1D62} {i}
3561 \__um_setup_active_subscript:nn {"2C7C} {j}
3562 \__um_setup_active_subscript:nn {"2096} {k}
3563 \__um_setup_active_subscript:nn {"2097} {l}
3564 \__um_setup_active_subscript:nn {"2098} {m}
3565 \__um_setup_active_subscript:nn {"2099} {n}
3566 \__um_setup_active_subscript:nn {"2092} {o}
3567 \__um_setup_active_subscript:nn {"209A} {p}
3568 \__um_setup_active_subscript:nn {"1D63} {r}
3569 \__um_setup_active_subscript:nn {"209B} {s}
3570 \__um_setup_active_subscript:nn {"209C} {t}
3571 \__um_setup_active_subscript:nn {"1D64} {u}
3572 \__um_setup_active_subscript:nn {"1D65} {v}
3573 \__um_setup_active_subscript:nn {"2093} {x}
3574 \__um_setup_active_subscript:nn {"1D66} {\beta}
3575 \__um_setup_active_subscript:nn {"1D67} {\gamma}
3576 \__um_setup_active_subscript:nn {"1D68} {\rho}
3577 \__um_setup_active_subscript:nn {"1D69} {\phi}
3578 \__um_setup_active_subscript:nn {"1D6A} {\chi}
3579
3580 %%^^A%% um-code-compat.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
3581 %%^^A%% Compatibility with 3rd party packages.
3582
3583 \__um_after_package:nNn {url} \__um_patch_url:
3584 {
3585 \tl_put_left:Nn \Url@FormatString { \__um_switch_to:n {literal} }
3586 \tl_put_right:Nn \UrlSpecials
3587 {
3588 \do \` { \mathchar`\` }
3589 \do \' { \mathchar`\' }
3590 \do \$ { \mathchar`\$ }
3591 \do \& { \mathchar`\& }
3592 }
3593 }
3594 \__um_after_package:nNn { mathtools } \__um_patch_mathtools_A:
3595 {
3596 \cs_set_nopar:Npn \MT_cramped_internal:Nn ##1 ##2
3597 {
3598 \hbox_set:Nn \l_tmpa_box
3599 {
3600 \color@setgroup \c_math_toggle_token \m@th
3601 ##1
3602 \dim_zero:N \nulldelimiterspace
3603 \XeTeXradical 255 ~ 0 ~ { ##2 }
3604 \c_math_toggle_token \color@endgroup
3605 }
3606 \box_set_ht:Nn \l_tmpa_box
3607 {
3608 \box_ht:N \l_tmpa_box - \__um_radical_vgap:N ##1
3609 }
3610 \box_use_drop:N \l_tmpa_box
3611 }
3612 }
3613 \__um_after_package:nNn { mathtools } \__um_patch_mathtools_B:
3614 {
3615 \cs_set_eq:NN \MToverbracket \overbracket
3616 \cs_set_eq:NN \MTunderbracket \underbracket
3617
3618 \AtBeginDocument
3619 {
3620 \msg_warning:nn { unicode-math } { mathtools-overbracket }
3621
3622 \cs_set:Npn \downbracketfill ##1 ##2
3623 {
3624 \tl_set:Nn \l_MT_bracketheight_fdim {.27ex}
3625 \downbracketend {##1} {##2}
3626 \leaders \vrule \@height ##1 \@depth \z@ \hfill
3627 \downbracketend {##1} {##2}
3628 }
3629
3630 \cs_set:Npn \upbracketfill ##1 ##2
3631 {
3632 \tl_set:Nn \l_MT_bracketheight_fdim {.27ex}
3633 \upbracketend {##1} {##2}
3634 \leaders \vrule \@height \z@ \@depth ##1 \hfill
3635 \upbracketend {##1} {##2}
3636 }
3637
3638 \cs_set_eq:NN \Uoverbracket \overbracket
3639 \cs_set_eq:NN \Uunderbracket \underbracket
3640 \cs_set_eq:NN \overbracket \MToverbracket
3641 \cs_set_eq:NN \underbracket \MTunderbracket
3642 }
3643 }
3644 \__um_after_package:nNn { mathtools } \__um_patch_mathtools_C:
3645 {
3646 \msg_warning:nn { unicode-math } { mathtools-colon }
3647 \DeclareDocumentCommand \dblcolon { } { \Colon }
3648 \DeclareDocumentCommand \coloneqq { } { \coloneq }
3649 \DeclareDocumentCommand \Coloneqq { } { \Coloneq }
3650 \DeclareDocumentCommand \eqqcolon { } { \eqcolon }
3651 }
3652
3653 %%^^A%% um-code-amsmath.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
3654 %%^^A%% Compatibility with amsmath.
3655
3656 \tl_remove_once:Nn \@begindocumenthook
3657 {
3658 \mathchardef\std@minus\mathcode`\-\relax
3659 \mathchardef\std@equal\mathcode`\=\relax
3660 }
3661 \AtBeginDocument
3662 {
3663 \Umathcharnumdef\std@minus\Umathcodenum`-
3664 \Umathcharnumdef\std@equal\Umathcodenum`=
3665 }
3666 \cs_set:Npn \@cdots {\mathinner{\unicodecdots}}
3667 \cs_set_eq:NN \dotsb@ \cdots
3668 \def \resetMathstrut@
3669 {%
3670 \setbox\z@\hbox{$($}%)
3671 \ht\Mathstrutbox@\ht\z@ \dp\Mathstrutbox@\dp\z@
3672 }
3673 \cs_set:Npn \subarray #1
3674 {
3675 \vcenter
3676 \c_group_begin_token
3677 \Let@
3678 \restore@math@cr
3679 \default@tag
3680 \skip_set:Nn \baselineskip
3681 {
3682 \__um_stack_num_up:N \scriptstyle
3683 + \__um_stack_denom_down:N \scriptstyle
3684 }
3685 \lineskip \__um_stack_vgap:N \scriptstyle
3686 \lineskiplimit \lineskip
3687 \ialign
3688 \c_group_begin_token
3689 \token_if_eq_meaning:NNT c #1 { \hfil }
3690 \c_math_toggle_token
3691 \m@th
3692 \scriptstyle
3693 \c_parameter_token \c_parameter_token
3694 \c_math_toggle_token
3695 \hfil
3696 \crcr
3697 }
3698 \cs_set_nopar:Npn \r@@t #1 #2
3699 {
3700 \hbox_set:Nn \l_tmpa_box
3701 {
3702 \c_math_toggle_token \m@th
3703 #1 \sqrtsign { #2 }
3704 \c_math_toggle_token
3705 }
3706 \hbox_set:Nn \l_tmpb_box
3707 {
3708 \c_math_toggle_token \m@th
3709 #1 \mskip \uproot@ mu
3710 \c_math_toggle_token
3711 }
3712 \mkern -\leftroot@ mu
3713 \__um_mathstyle_scale:NnnN #1 { \kern } { \fontdimen 63 \g__um_sqrt_font_cmd_tl } \g__um_sqrt_font_cmd_tl
3714 \box_move_up:nn
3715 {
3716 \box_wd:N \l_tmpb_box + (\box_ht:N \l_tmpa_box - \box_dp:N \l_tmpa_box)
3717 * \number \fontdimen 65 \g__um_sqrt_font_cmd_tl / 100
3718 }
3719 { \box_use:N \rootbox }
3720 \__um_mathstyle_scale:NnnN #1 { \kern } { \fontdimen 64 \g__um_sqrt_font_cmd_tl } \g__um_sqrt_font_cmd_tl
3721 \mkern \leftroot@ mu
3722 \box_use_drop:N \l_tmpa_box
3723 }
3724
3725 %%^^A%% um-code-epilogue.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
3726 %%^^A%% Assorted definitions to close up.
3727
3728 \AtBeginDocument { \debug_suspend: \__um_resolve_greek: \debug_resume: }
3729 \cs_new:Npn \__um_resolve_greek:
3730 {
3731 \clist_map_inline:nn
3732 {
3733 Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,
3734 alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,
3735 Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,
3736 mu,nu,xi,omicron,pi,rho,sigma,tau,upsilon,phi,chi,psi,omega,
3737 varTheta,varsigma,vartheta,varkappa,varrho,varpi,varepsilon,varphi
3738 }
3739 {
3740 \tl_set:cx {##1} { \exp_not:c { mit ##1 } }
3741 \tl_set:cx {up ##1} { \exp_not:N \symup \exp_not:c { ##1 } }
3742 \tl_set:cx {it ##1} { \exp_not:N \symit \exp_not:c { ##1 } }
3743 }
3744 }
3745 \cs_new:Nn \__um_which_frac:nn
3746 {
3747 \bool_if:NTF \l__um_smallfrac_bool {\tfrac} {\frac} {#1} {#2}
3748 }
3749 \cs_new:Npn \__um_setup_active_frac:
3750 {
3751 \__um_mathactive_remap:nn {"2189} { \__um_which_frac:nn {0} {3} }
3752 \__um_mathactive_remap:nn {"2152} { \__um_which_frac:nn {1} {10} }
3753 \__um_mathactive_remap:nn {"2151} { \__um_which_frac:nn {1} {9} }
3754 \__um_mathactive_remap:nn {"215B} { \__um_which_frac:nn {1} {8} }
3755 \__um_mathactive_remap:nn {"2150} { \__um_which_frac:nn {1} {7} }
3756 \__um_mathactive_remap:nn {"2159} { \__um_which_frac:nn {1} {6} }
3757 \__um_mathactive_remap:nn {"2155} { \__um_which_frac:nn {1} {5} }
3758 \__um_mathactive_remap:nn {"00BC} { \__um_which_frac:nn {1} {4} }
3759 \__um_mathactive_remap:nn {"2153} { \__um_which_frac:nn {1} {3} }
3760 \__um_mathactive_remap:nn {"215C} { \__um_which_frac:nn {3} {8} }
3761 \__um_mathactive_remap:nn {"2156} { \__um_which_frac:nn {2} {5} }
3762 \__um_mathactive_remap:nn {"00BD} { \__um_which_frac:nn {1} {2} }
3763 \__um_mathactive_remap:nn {"2157} { \__um_which_frac:nn {3} {5} }
3764 \__um_mathactive_remap:nn {"215D} { \__um_which_frac:nn {5} {8} }
3765 \__um_mathactive_remap:nn {"2154} { \__um_which_frac:nn {2} {3} }
3766 \__um_mathactive_remap:nn {"00BE} { \__um_which_frac:nn {3} {4} }
3767 \__um_mathactive_remap:nn {"2158} { \__um_which_frac:nn {4} {5} }
3768 \__um_mathactive_remap:nn {"215A} { \__um_which_frac:nn {5} {6} }
3769 \__um_mathactive_remap:nn {"215E} { \__um_which_frac:nn {7} {8} }
3770 }
3771 \AtBeginDocument { \__um_setup_active_frac: }
3772 \protected\def\to{\rightarrow}
3773 \protected\def\le{\leq}
3774 \protected\def\ge{\geq}
3775 \protected\def\neq{\ne}
3776 \protected\def\triangle{\mathord{\bigtriangleup}}
3777 \protected\def\bigcirc{\mdlgwhtcircle}
3778 \protected\def\circ{\vysmwhtcircle}
3779 \protected\def\bullet{\smblkcircle}
3780 \protected\def\mathyen{\yen}
3781 \protected\def\mathsterling{\sterling}
3782 \protected\def\diamond{\smwhtdiamond}
3783 \protected\def\emptyset{\varnothing}
3784 \protected\def\hbar{\hslash}
3785 \protected\def\land{\wedge}
3786 \protected\def\lor{\vee}
3787 \protected\def\owns{\ni}
3788 \protected\def\gets{\leftarrow}
3789 \protected\def\mathring{\ocirc}
3790 \protected\def\lnot{\neg}
3791 \protected\def\longdivision{\longdivisionsign}
3792 \protected\def\backepsilon{\upbackepsilon}
3793 \protected\def\eth{\matheth}
3794 \protected\def\dbkarow {\dbkarrow}
3795 \protected\def\drbkarow{\drbkarrow}
3796 \protected\def\hksearow{\hksearrow}
3797 \protected\def\hkswarow{\hkswarrow}
3798 \protected\def\smallint{\mathop{\textstyle\int}\limits}
3799 \cs_set_eq:NN \latexe_underbar:n \underbar
3800 \renewcommand\underbar
3801 {
3802 \mode_if_math:TF \mathunderbar \latexe_underbar:n
3803 }
3804 \cs_set_protected:Npn \smallsetminus { \mathbin{ \mathpalette \__um_smallsetminus: \relax} }
3805 \cs_set:Npn \__um_smallsetminus: #1 { \rotatebox{135}{ \smash{ \raisebox{-\height}{$#1\minus$} } }}
3806 \cs_set_protected:Npn \digamma {\updigamma}
3807 \cs_set_protected:Npn \Digamma {\upDigamma}
3808 \cs_set_protected:Npn \| {\Vert}
3809 \cs_set_protected:Npn \mathellipsis {\mathinner{\unicodeellipsis}}
3810 \cs_set_protected:Npn \cdots {\mathinner{\unicodecdots}}
3811 \cs_set_eq:NN \__um_text_slash: \slash
3812 \cs_set_protected:Npn \slash
3813 {
3814 \mode_if_math:TF {\mathslash} {\__um_text_slash:}
3815 }
3816 \DeclareDocumentCommand \not {m}
3817 {
3818 \tl_set:Nx \l__um_not_token_name_tl { \cs_to_str:N #1 }
3819 \tl_if_empty:NT \l__um_not_token_name_tl
3820 {
3821 \tl_set:Nx \l__um_not_token_name_tl { \token_to_str:N #1 }
3822 }
3823 \cs_if_exist:cTF { not \l__um_not_token_name_tl }
3824 {
3825 \use:c { not \l__um_not_token_name_tl }
3826 }
3827 {
3828 \cs_if_exist:cTF { n \l__um_not_token_name_tl }
3829 {
3830 \use:c { n \l__um_not_token_name_tl }
3831 }
3832 {
3833 \tl_if_eq:nnTF {#1} {$} { \notaccent{} } { \notaccent } #1
3834 }
3835 }
3836 }
3837 \DeclareDocumentCommand \NewNegationCommand {mm}
3838 {
3839 \__um_set_negation_command:Nnn \cs_new_protected:cpn {#1} {#2}
3840 }
3841 \DeclareDocumentCommand \RenewNegationCommand {mm}
3842 {
3843 \__um_set_negation_command:Nnn \cs_set_protected:cpn {#1} {#2}
3844 }
3845 \cs_set:Nn \__um_set_negation_command:Nnn
3846 {
3847 \tl_set:Nx \l__um_not_token_name_tl { \cs_to_str:N #2 }
3848 \tl_if_empty:NT \l__um_not_token_name_tl
3849 {
3850 \tl_set:Nx \l__um_not_token_name_tl { \token_to_str:N #2 }
3851 }
3852 #1 { not \l__um_not_token_name_tl } { #3 }
3853 }
3854 \NewNegationCommand { = } { \neq }
3855 \NewNegationCommand { < } { \nless }
3856 \NewNegationCommand { > } { \ngtr }
3857 \NewNegationCommand { \gets } { \nleftarrow }
3858 \NewNegationCommand { \simeq } { \nsime }
3859 \NewNegationCommand { \equal } { \ne }
3860 \NewNegationCommand { \le } { \nleq }
3861 \NewNegationCommand { \ge } { \ngeq }
3862 \NewNegationCommand { \greater } { \ngtr }
3863 \NewNegationCommand { \forksnot } { \forks }
3864 \int_step_inline:nnnn {0} {1} {9}
3865 {
3866 \__um_mathactive_remap:nn {"FF10+#1} {\char\int_eval:n{`\0+#1}}
3867 }
3868 \int_step_inline:nnnn {0} {1} {26}
3869 {
3870 \__um_mathactive_remap:nn {"FF21+#1} {\char\int_eval:n{`\A+#1}}
3871 \__um_mathactive_remap:nn {"FF41+#1} {\char\int_eval:n{`\a+#1}}
3872 }
3873 \cs_new:Nn \__um_undeclare_symbol:N
3874 {
3875 \cs_set_protected:Npn #1
3876 { \__um_error:nx {legacy-char-not-supported} { \token_to_str:N #1 } }
3877 }
3878 \__um_undeclare_symbol:N \arrowvert
3879 \__um_undeclare_symbol:N \Arrowvert
3880 \__um_undeclare_symbol:N \bracevert
3881 \endinput
3882