Debian Codegraph @

texmf-dist/tex/lualatex/lua-unicode-math/lua-unicode-math.sty

raw
1 %%
2 %% This is file `lua-unicode-math.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% lua-unicode-math.dtx
8 %%
9 %% IMPORTANT NOTICE:
10 %%
11 %% For the copyright see the source file.
12 %%
13 %% Any modified versions of this file must be renamed
14 %% with new filenames distinct from lua-unicode-math.sty.
15 %%
16 %% For distribution of the original source see the terms
17 %% for copying and modification in the file lua-unicode-math.dtx.
18 %%
19 %% This generated file may be distributed as long as the
20 %% original source files, as listed above, are part of the
21 %% same distribution. (The sources need not necessarily be
22 %% in the same archive or directory.)
23 %% Copyright (C) 2026 by Marcel Krueger
24 %%
25 %% This file may be distributed and/or modified under the
26 %% conditions of the LaTeX Project Public License, either
27 %% version 1.3c of this license or (at your option) any later
28 %% version. The latest version of this license is in:
29 %%
30 %% http://www.latex-project.org/lppl.txt
31 %%
32 %% and version 1.3 or later is part of all distributions of
33 %% LaTeX version 2005/12/01 or later.
34 \ProvidesExplPackage
35 {lua-unicode-math}
36 {2026-03-24}
37 {0.8}
38 {Opentype Math support for LuaLaTeX}
39
40 \int_new:N \g__l_uni_math_font_count_int
41 \tl_new:N \l__l_uni_math_main_family_tl
42 \tl_new:N \l__l_uni_math_script_family_tl
43 \tl_new:N \l__l_uni_math_scriptscript_family_tl
44
45 \cs_generate_variant:Nn \tl_if_eq:nnT {o}
46
47 \msg_new:nnn { lua-unicode-math } { engine-unsupported } {
48 lua-unicode-math~can~only~be~used~with~LuaTeX.
49 }
50
51 \sys_if_engine_luatex:F {
52 \msg_critical:nn { lua-unicode-math } { engine-unsupported }
53 }
54
55 \msg_new:nnn { lua-unicode-math } { unicode-math-suppressed } {
56 You~tried~to~load~both~lua-unicode-math~and~unicode-math~
57 in~the~same~document.~This~is~not~supported,~unicode-math~
58 will~be~suppressed.~There~is~a~good~chance~that~this~will~
59 break~your~document.~Change~your~document~to~only~use~lua-unicode-math~
60 so~solve~this.
61 }
62 \msg_new:nnn { lua-unicode-math } { unicode-math-loaded } {
63 You~tried~to~load~lua-unicode-math~while~unicode-math~
64 was~already~loaded.~This~does~not~work.~Please~avoid~loading~
65 unicode-math.~If~that~is~not~possible~and~you~are~feeling~adventurous~
66 you~can~try~loading~the~lua-unicode-math~package~at~the~beginning~
67 of~your~document~instead~to~suppress~unicode-math.
68 }
69 \disable@package@load{unicode-math} {
70 \msg_warning:nn { lua-unicode-math } {unicode-math-suppressed }
71 }
72 \IfPackageLoadedTF {unicode-math} {
73 \msg_critical:nn { lua-unicode-math } {unicode-math-loaded }
74 } {}
75
76 \IfFormatAtLeastTF{2026/01/01}{}{
77 \cs_set:Npn \DeclareMathScriptfontMapping #1 #2 #3 #4 #5 #6 {
78 \cs_gset:cpn { __nfss_mapped_scriptfont_family_sf_ #1 / #2 } { #3 / #4 }
79 \cs_gset:cpn { __nfss_mapped_scriptfont_family_ssf_ #1 / #2 } { #5 / #6 }
80 }
81 }
82
83 \hook_gput_code:nnn { package/fontspec/after } {.} {
84 \bool_gset_false:N \g__fontspec_math_bool
85
86 \NewDocumentCommand \setmathfont { O{} m O{} } {
87 \int_incr:N \g__l_uni_math_font_count_int
88 \exp_args:Nc \newfontfamily
89 { g__l_uni_math_font_ \int_use:N \g__l_uni_math_font_count_int _text_font }
90 { #2 }
91 [ #1, #3, Script = Math, Renderer = Base ]
92 \tl_set_eq:NN \l__l_uni_math_main_family_tl \l_fontspec_family_tl
93
94 \exp_args:Nc \newfontfamily
95 { g__l_uni_math_font_ \int_use:N \g__l_uni_math_font_count_int _script_font }
96 { #2 }
97 [ #1, #3, Script = Math, Renderer = Base, Style = MathScript ]
98 \tl_set_eq:NN \l__l_uni_math_script_family_tl \l_fontspec_family_tl
99
100 \exp_args:Nc \newfontfamily
101 { g__l_uni_math_font_ \int_use:N \g__l_uni_math_font_count_int _scriptscript_font }
102 { #2 }
103 [ #1, #3, Script = Math, Renderer = Base, Style = MathScriptScript ]
104 \tl_set_eq:NN \l__l_uni_math_scriptscript_family_tl \l_fontspec_family_tl
105
106 \DeclareMathScriptfontMapping {TU} {\l__l_uni_math_main_family_tl} {TU} {\l__l_uni_math_script_family_tl} {TU} {\l__l_uni_math_scriptscript_family_tl}
107
108 \exp_args:NnnV \DeclareSymbolFont {lummain} {TU} \l__l_uni_math_main_family_tl {m} {n}
109 \exp_args:NnnnV \SetSymbolFont {lummain} {bold} {TU} \l__l_uni_math_main_family_tl {b} {n}
110 }
111
112 \cs_set:Nn \__fontspec_setmainfont_hook:nn
113 {
114 \tl_if_eq:onT {\g__fontspec_mathrm_tl} {\rmdefault}
115 {
116 \fontspec_gset_family:Nnn \g__fontspec_mathrm_tl {Renderer=Basic,#1} {#2}
117 \__fontspec_setmathrm_hook:nn {#1} {#2}
118 }
119 }
120 \cs_set:Nn \__fontspec_setsansfont_hook:nn
121 {
122 \tl_if_eq:onT {\g__fontspec_mathsf_tl} {\sfdefault}
123 {
124 \fontspec_gset_family:Nnn \g__fontspec_mathsf_tl {Renderer=Basic,#1} {#2}
125 \__fontspec_setmathsf_hook:nn {#1} {#2}
126 }
127 }
128 \cs_set:Nn \__fontspec_setmonofont_hook:nn
129 {
130 \tl_if_eq:onT {\g__fontspec_mathtt_tl} {\ttdefault}
131 {
132 \fontspec_gset_family:Nnn \g__fontspec_mathtt_tl {Renderer=Basic,#1} {#2}
133 \__fontspec_setmathtt_hook:nn {#1} {#2}
134 }
135 }
136 \cs_set:Nn \__fontspec_setmathrm_hook:nn
137 {
138 \SetMathAlphabet \mathrm { normal } \g_fontspec_encoding_tl \g__fontspec_mathrm_tl { \mdseries@rm } \shapedefault
139 \SetMathAlphabet \mathit { normal } \g_fontspec_encoding_tl \g__fontspec_mathrm_tl { \mdseries@rm } \itdefault
140 \SetMathAlphabet \mathbf { normal } \g_fontspec_encoding_tl \g__fontspec_mathrm_tl { \bfseries@rm } \shapedefault
141 }
142 \cs_set:Nn \__fontspec_setboldmathrm_hook:nn
143 {
144 \SetMathAlphabet \mathrm { bold } \g_fontspec_encoding_tl \g__fontspec_bfmathrm_tl { \mdseries@rm } \shapedefault
145 \SetMathAlphabet \mathit { bold } \g_fontspec_encoding_tl \g__fontspec_bfmathrm_tl { \mdseries@rm } \itdefault
146 \SetMathAlphabet \mathbf { bold } \g_fontspec_encoding_tl \g__fontspec_bfmathrm_tl { \bfseries@rm } \shapedefault
147 }
148 \cs_set:Nn \__fontspec_setmathsf_hook:nn
149 {
150 \SetMathAlphabet \mathsf { normal } \g_fontspec_encoding_tl \g__fontspec_mathsf_tl { \mdseries@rm } \shapedefault
151 \SetMathAlphabet \mathsf { bold } \g_fontspec_encoding_tl \g__fontspec_mathsf_tl { \bfseries@rm } \shapedefault
152 }
153 \cs_set:Nn \__fontspec_setmathtt_hook:nn
154 {
155 \SetMathAlphabet \mathtt { normal } \g_fontspec_encoding_tl \g__fontspec_mathtt_tl { \mdseries@rm } \shapedefault
156 \SetMathAlphabet \mathtt { bold } \g_fontspec_encoding_tl \g__fontspec_mathtt_tl { \bfseries@rm } \shapedefault
157 }
158 %
159 \__fontspec_setmathrm_hook:nn {} {}
160 \__fontspec_setmathsf_hook:nn {} {}
161 \__fontspec_setmathtt_hook:nn {} {}
162 }
163
164 \cs_set_protected:Npn \operator@font {
165 \@fontswitch { \font@warning{Math~mode~required~for~\string\operator@font.} } { \mathtextrm }
166 }
167
168 \DeclareSymbolFont {lummain} {TU} {lmm} {m} {n}
169 \SetSymbolFont {lummain} {bold} {TU} {lmm} {b} {n}
170
171 \newattribute \mathfamattr
172
173 \cs_if_exist:NF \slimits@ {
174 \cs_set_eq:NN \slimits@ \displaylimits
175 }
176 \cs_if_exist:NF \ilimits@ {
177 \cs_set_eq:NN \ilimits@ \nolimits
178 }
179 \chardef \g_l_uni_math_dots_binary_char = `⋯
180 \chardef \g_l_uni_math_dots_comma_char = `…
181 \chardef \g_l_uni_math_dots_int_char = `⋯
182 \chardef \g_l_uni_math_dots_other_char = `…
183
184 \cs_set_protected:Npn \DOTSB {
185 \__l_uni_math_set_previous_dots_type:w \g_l_uni_math_dots_binary_char
186 }
187
188 \cs_set_protected:Npn \DOTSX {
189 \__l_uni_math_set_previous_dots_type:w \g_l_uni_math_dots_other_char
190 }
191
192 \cs_set_protected:Npn \DOTSI {
193 \__l_uni_math_set_previous_dots_type:w \g_l_uni_math_dots_int_char
194 }
195
196 \cs_set_protected:Npn \DOTSC {
197 \__l_uni_math_set_previous_dots_type:w \g_l_uni_math_dots_comma_char
198 }
199
200 \lua_load_module:n { lua-unicode-math }
201
202 \cs_new_protected:Npn \__l_uni_math_define_mathstyle_cmd:n #1 {
203 \cs_new_protected:cpx { sym #1 } ##1 {
204 \group_begin:
205 \mathfamattr = \use:c { c__l_uni_math_attribute_sym #1 _int }
206 ##1
207 \group_end:
208 }
209 }
210
211 \int_new:N \g__l_uni_math_max_mathstyle_int
212 \int_gset:Nn \g__l_uni_math_max_mathstyle_int { 1024 }
213 \cs_new:Npn \__l_uni_math_provide_mathstyle_id:n #1 {
214 \cs_if_exist:cF { c__l_uni_math_attribute_sym #1 _int } {
215 \int_const:cn { c__l_uni_math_attribute_sym #1 _int } { \g__l_uni_math_max_mathstyle_int }
216 \int_incr:N \g__l_uni_math_max_mathstyle_int
217 \__l_uni_math_define_mathstyle_cmd:n { #1 }
218 }
219 }
220
221 \tex_Umathchardef:D \c__l_uni_math_attribute_symnormal_int = "0 "80 "1 \scan_stop:
222 \__l_uni_math_define_mathstyle_cmd:n {normal}
223 \cs_gset:Npn \mathnormal { \symnormal }
224
225 \seq_set_from_clist:Nn \l_tmpa_seq {
226 up, rm, it, tt, bf, sf
227 }
228 \seq_map_inline:Nn \l_tmpa_seq {
229 \cs_new_eq:cc { mathtext #1 } { math #1 }
230 }
231 \prop_set_from_keyval:Nn \l_tmpa_prop {
232 up = 0, bfup = 1, it = 2, bfit = 3,
233 sfup = 4, bfsfup = 5, sfit = 6, bfsfit = 7,
234 cal = 8, bfcal = 9,
235 scr = 12, bfscr = 13,
236 frak = 16, bffrak = 17,
237 tt = 20,
238 bb = 24,
239 }
240 \prop_map_inline:Nn \l_tmpa_prop {
241 \int_const:cn { c__l_uni_math_attribute_sym #1 _int } { #2 }
242 \__l_uni_math_define_mathstyle_cmd:n { #1 }
243 \cs_set_eq:cc { math #1 } { sym #1 }
244 }
245 \cs_set_eq:NN \symrm \symup
246 \cs_set_eq:NN \mathtextup \mathtextrm
247 \cs_set_eq:NN \mathtextsf \mathsf
248 \cs_set:Npn \mathbfsf { \symbfsf }
249
250 \seq_map_inline:Nn \l_tmpa_seq {
251 \cs_set_eq:cc { math #1 } { mathtext #1 }
252 }
253
254 \cs_new:cpn { __l_uni_math_UnicodeMathSymbol_ \token_to_str:N \mathord :nn } #1 #2 {
255 \cs_set:Npx #1 {
256 \char_generate:nn {#2} {12}
257 }
258 }
259 \tl_map_inline:nn {\mathbin \mathclose \mathpunct \mathrel} {
260 \cs_new_eq:cc
261 { __l_uni_math_UnicodeMathSymbol_ \token_to_str:N #1 :nn }
262 { __l_uni_math_UnicodeMathSymbol_ \token_to_str:N \mathord :nn }
263 }
264
265 \cs_new:cpn { __l_uni_math_UnicodeMathSymbol_ \token_to_str:N \mathop :nn } #1 #2 {
266 \exp_args:Nc \Umathchardef { \cs_to_str:N #1 op } 1~\symlummain #2~
267 \cs_set:Npx #1 {
268 \char_generate:nn {#2} {12}
269 }
270 \mathcode #2 = "8000~
271 \cs_set:cpx { \char_generate:nn {"FFFF} {12} \char_generate:nn {#2} {12} } {
272 \__l_uni_math_is_integral_cp:wTF #2 { \DOTSI } { \DOTSB }
273 \use:c { \cs_to_str:N #1 op }
274 \__l_uni_math_is_integral_cp:wTF #2 { \ilimits@ } { \slimits@ }
275 }
276 }
277
278 \cs_new:cpn { __l_uni_math_UnicodeMathSymbol_ \token_to_str:N \mathopen :nn } #1 #2 {
279 \token_if_eq_meaning:NNTF #1 \sqrt {
280 \cs_set:Npx \sqrtsign {
281 \Uradical \symlummain #2~
282 }
283 \cs_set:Npx \root ##1 \of {
284 \Uroot \symlummain #2~ { ##1 }
285 }
286 }{
287 \cs_set:Npx #1 {
288 \char_generate:nn {#2} {12}
289 }
290 }
291 }
292
293 \cs_new_protected:Npn \__l_uni_math_uproot_assign_mup_char:nNn #1 #2 #3 {
294 \cs_set:Npx #2 {
295 \symup {\char_generate:nn {#3} {12}}
296 }
297 \cs_set:cpx {#1} {
298 \char_generate:nn {#3} {12}
299 }
300 }
301
302 \cs_new_protected:Npn \__l_uni_math_uproot_assign_nonmup_alpha:nNn #1 #2 #3 {
303 \cs_set:Npx #2 {
304 \char_generate:nn {#3} {12}
305 }
306 }
307
308 \group_begin:
309 \cs_set:Npn \l_tmp_cs:n #1 {
310 \group_end:
311
312 \cs_new_protected:Npn \__l_uni_math__check_mup_helper:w ##1 #1 ##2 \q_mark ##3 ##4 \q_stop {
313 ##3 {##2}
314 }
315
316 \cs_new:cpn { __l_uni_math_UnicodeMathSymbol_ \token_to_str:N \mathalpha :nn } ##1 {
317 \exp_after:wN \__l_uni_math__check_mup_helper:w \token_to_str:N ##1 \q_mark \__l_uni_math_uproot_assign_mup_char:nNn #1 \q_mark \__l_uni_math_uproot_assign_nonmup_alpha:nNn \q_stop ##1
318 }
319 }
320
321 \exp_args:No \l_tmp_cs:n {
322 \token_to_str:N \mup
323 }
324
325 \cs_new:cpn { __l_uni_math_UnicodeMathSymbol_ \token_to_str:N \mathfence :nn } #1 #2 {
326 \cs_set:Npx #1 {
327 \char_generate:nn {#2} {12}
328 }
329 \cs_set:cpx {l \cs_to_str:N #1} {
330 \Udelimiter 4 ~ \symlummain #2 ~
331 }
332 \cs_set:cpx {r \cs_to_str:N #1} {
333 \Udelimiter 5 ~ \symlummain #2 ~
334 }
335 }
336
337 \cs_new:cpn { __l_uni_math_UnicodeMathSymbol_ \token_to_str:N \mathaccent :nn } #1 #2 {
338 \cs_set_protected:Npx #1 {
339 \Umathaccent fixed 0 ~ \symlummain #2 ~
340 }
341 }
342
343 \cs_new:cpn { __l_uni_math_UnicodeMathSymbol_ \token_to_str:N \mathbotaccent :nn } #1 #2 {
344 \cs_set:Npx #1 {
345 \Umathaccent bottom~fixed 0 ~ \symlummain #2 ~
346 }
347 }
348
349 \cs_new:cpn { __l_uni_math_UnicodeMathSymbol_ \token_to_str:N \mathaccentwide :nn } #1 #2 {
350 \cs_set:Npx #1 {
351 \Umathaccent 0 ~ \symlummain #2 ~
352 }
353 }
354
355 \cs_new:cpn { __l_uni_math_UnicodeMathSymbol_ \token_to_str:N \mathbotaccentwide :nn } #1 #2 {
356 \cs_set:Npx #1 {
357 \Umathaccent bottom 0 ~ \symlummain #2 ~
358 }
359 }
360
361 \cs_new:cpn { __l_uni_math_UnicodeMathSymbol_ \token_to_str:N \mathaccentoverlay :nn } #1 #2 {
362 \cs_set:Npx #1 {
363 \Umathaccent overlay 0 ~ \symlummain #2 ~
364 }
365 }
366
367 \cs_new:cpn { __l_uni_math_UnicodeMathSymbol_ \token_to_str:N \mathover :nn } #1 #2 {
368 \cs_set:Npx #1 ##1 {
369 \mathop {
370 \Udelimiterover \symlummain #2 { ##1 }
371 }
372 \limits
373 }
374 }
375
376 \cs_new:cpn { __l_uni_math_UnicodeMathSymbol_ \token_to_str:N \mathunder :nn } #1 #2 {
377 \cs_set:Npx #1 ##1 {
378 \mathop {
379 \Udelimiterunder \symlummain #2 { ##1 }
380 }
381 \limits
382 }
383 }
384
385 \cs_generate_variant:Nn \exp_args:Ne {c}
386 \cs_new:Npn \UnicodeMathSymbol #1 #2 #3 #4 {
387 \use:c { __l_uni_math_UnicodeMathSymbol_ \token_to_str:N #3 :nn }
388 {#2} {#1}
389 }
390 \input {unicode-math-table}
391 \cs_undefine:N \UnicodeMathSymbol
392
393 \cs_set_protected:Npn \triangle { \mathord { \bigtriangleup } }
394 \cs_set_protected:Npn \mathellipsis { \mathinner { \unicodeellipsis } }
395 \cs_set_protected:Npn \cdots { \mathinner { \unicodecdots } }
396
397 \clist_map_inline:nn {
398 \to \rightarrow,
399 \le \leq,
400 \ge \geq,
401 \neq \ne,
402 \bigcirc \mdlgwhtcircle,
403 \circ \vysmwhtcircle,
404 \bullet \smblkcircle,
405 \mathyen \yen,
406 \mathsterling \sterling,
407 \diamond \smwhtdiamond,
408 \emptyset \varnothing,
409 \hbar \hslash,
410 \land \wedge,
411 \lor \vee,
412 \owns \ni,
413 \gets \leftarrow,
414 \mathring \ocirc,
415 \lnot \neg,
416 \longdivision \longdivisionsign,
417 \backepsilon \upbackepsilon,
418 \eth \matheth,
419 \dotsb@ \cdots,
420 \@cdots \cdots,
421 } {
422 \cs_set_eq:NN #1
423 }
424
425 \cs_set_protected:cpx { \char_generate:nn {"FFFF} {12} ' } {
426 \prime_helper:w "2032~
427 }
428
429 \cs_set_protected:Npn \uproot #1 {
430 \__l_uni_math_uproot:w #1 \scan_stop:
431 }
432
433 \cs_set_protected:Npn \leftroot #1 {
434 \__l_uni_math_leftroot:w #1 \scan_stop:
435 }
436 \tl_const:Nn \c__l_uni_math_amsmath_cmds_tl {
437 \uproot
438 \leftroot
439 \iint
440 \iiint
441 \iiiint
442 \dddot
443 \ddddot
444 \overleftrightarrow
445 \underrightarrow
446 \underleftarrow
447 \underleftrightarrow
448 \hat
449 \check
450 \tilde
451 \acute
452 \grave
453 \dot
454 \ddot
455 \breve
456 \bar
457 \vec
458 \mathring
459 \DOTSC
460 \DOTSI
461 \DOTSX
462 \DOTSB
463 \mdots@
464 }
465 \tl_const:Nn \c__l_uni_math_amsmath_cmds_defined_tl {
466 \prod
467 \coprod
468 \bigwedge
469 \bigvee
470 \bigcap
471 \bigcup
472 \bigodot
473 \bigoplus
474 \bigotimes
475 \bigsqcup
476 \root
477 \int
478 \oint
479 \overrightarrow
480 \overleftarrow
481 }
482 \hook_gput_code:nnn { package/amsmath/before } {.} {
483 \tl_map_inline:Nn \c__l_uni_math_amsmath_cmds_tl {
484 \cs_new_eq:cN { __l_uni_math_saved_ \cs_to_str:N #1 } #1
485 \cs_undefine:N #1
486 }
487 \tl_map_inline:Nn \c__l_uni_math_amsmath_cmds_defined_tl {
488 \cs_new_eq:cN { __l_uni_math_saved_ \cs_to_str:N #1 } #1
489 }
490 \cs_set:Npn \varGamma { \temporary_definition_do_not_use }
491 }
492 \hook_gput_code:nnn { package/amsmath/after } {.} {
493 \tl_map_inline:Nn \c__l_uni_math_amsmath_cmds_tl {
494 \cs_set_eq:Nc #1 { __l_uni_math_saved_ \cs_to_str:N #1 }
495 \cs_undefine:c { __l_uni_math_saved_ \cs_to_str:N #1 }
496 }
497 \tl_map_inline:Nn \c__l_uni_math_amsmath_cmds_defined_tl {
498 \cs_set_eq:Nc #1 { __l_uni_math_saved_ \cs_to_str:N #1 }
499 \cs_undefine:c { __l_uni_math_saved_ \cs_to_str:N #1 }
500 }
501 \cs_undefine:N \varGamma
502 }
503 \addto@hook \every@math@size {
504 \__l_uni_math_every_math_size:
505 }
506 \NewTemplateType {lua-unicode-math-style} {0}
507 \NewTemplateType {lua-unicode-math-style-cmd} {1}
508 \DeclareTemplateInterface {lua-unicode-math-style} {substyles} {0} {
509 normal: instance {lua-unicode-math-style-cmd},
510 bf: instance {lua-unicode-math-style-cmd},
511 sf: instance {lua-unicode-math-style-cmd},
512 bfsf: instance {lua-unicode-math-style-cmd},
513 }
514 \DeclareTemplateInterface {lua-unicode-math-style-cmd} {alphabet-style-mapping} {1} {
515 Latin: tokenlist,
516 latin: tokenlist,
517 Greek: tokenlist,
518 greek: tokenlist,
519 digit: tokenlist,
520 }
521 \DeclareTemplateCode {lua-unicode-math-style} {substyles} {0} {
522 normal = \__l_uni_math_instance_normal:n,
523 bf = \__l_uni_math_instance_bf:n,
524 sf = \__l_uni_math_instance_sf:n,
525 bfsf = \__l_uni_math_instance_bfsf:n,
526 } {
527 \__l_uni_math_instance_normal:n { normal }
528 \__l_uni_math_instance_bf:n { bf }
529 \__l_uni_math_instance_sf:n { sf }
530 \__l_uni_math_instance_bfsf:n { bfsf }
531 }
532 \cs_generate_variant:Nn \__l_uni_math_set_mathstyle_mappings:NNNNNN { cccccc }
533 \tl_new:N \l__l_uni_math_Latin_style_tl
534 \tl_new:N \l__l_uni_math_latin_style_tl
535 \tl_new:N \l__l_uni_math_Greek_style_tl
536 \tl_new:N \l__l_uni_math_greek_style_tl
537 \tl_new:N \l__l_uni_math_digit_style_tl
538 \DeclareTemplateCode {lua-unicode-math-style-cmd} {alphabet-style-mapping} {1} {
539 Latin = \l__l_uni_math_Latin_style_tl,
540 latin = \l__l_uni_math_latin_style_tl,
541 Greek = \l__l_uni_math_Greek_style_tl,
542 greek = \l__l_uni_math_greek_style_tl,
543 digit = \l__l_uni_math_digit_style_tl,
544 } {
545 \__l_uni_math_provide_mathstyle_id:n { #1 }
546 \__l_uni_math_set_mathstyle_mappings:cccccc
547 { c__l_uni_math_attribute_sym #1 _int }
548 { c__l_uni_math_attribute_sym \l__l_uni_math_Latin_style_tl _int }
549 { c__l_uni_math_attribute_sym \l__l_uni_math_latin_style_tl _int }
550 { c__l_uni_math_attribute_sym \l__l_uni_math_Greek_style_tl _int }
551 { c__l_uni_math_attribute_sym \l__l_uni_math_greek_style_tl _int }
552 { c__l_uni_math_attribute_sym \l__l_uni_math_digit_style_tl _int }
553 }
554 \DeclareInstance{lua-unicode-math-style}{TeX}{substyles}{
555 normal = TeX,
556 bf = TeX-bf,
557 sf = upright-sf,
558 bfsf = upright-bfsf,
559 }
560 \DeclareInstance{lua-unicode-math-style}{ISO80000-2}{substyles}{
561 normal = ISO80000-2,
562 bf = ISO80000-2-bf,
563 sf = italic-sf,
564 bfsf = italic-bfsf,
565 }
566 \DeclareInstance{lua-unicode-math-style}{french}{substyles}{
567 normal = french,
568 bf = upright-bf,
569 sf = upright-sf,
570 bfsf = upright-bfsf,
571 }
572 \DeclareInstance{lua-unicode-math-style}{upright}{substyles}{
573 normal = upright,
574 bf = upright-bf,
575 sf = upright-sf,
576 bfsf = upright-bfsf,
577 }
578 \DeclareInstance{lua-unicode-math-style-cmd}{TeX}{alphabet-style-mapping}{
579 Latin = it,
580 latin = it,
581 Greek = up,
582 greek = it,
583 digit = up,
584 }
585 \DeclareInstance{lua-unicode-math-style-cmd}{TeX-bf}{alphabet-style-mapping}{
586 Latin = bfup,
587 latin = bfup,
588 Greek = bfup,
589 greek = bfit,
590 digit = bfup,
591 }
592 \DeclareInstance{lua-unicode-math-style-cmd}{ISO80000-2}{alphabet-style-mapping}{
593 Latin = it,
594 latin = it,
595 Greek = it,
596 greek = it,
597 digit = up,
598 }
599 \DeclareInstance{lua-unicode-math-style-cmd}{ISO80000-2-bf}{alphabet-style-mapping}{
600 Latin = bfit,
601 latin = bfit,
602 Greek = bfit,
603 greek = bfit,
604 digit = bfup,
605 }
606 \DeclareInstance{lua-unicode-math-style-cmd}{french}{alphabet-style-mapping}{
607 Latin = up,
608 latin = it,
609 Greek = up,
610 greek = up,
611 digit = up,
612 }
613 \DeclareInstance{lua-unicode-math-style-cmd}{upright}{alphabet-style-mapping}{
614 Latin = up,
615 latin = up,
616 Greek = up,
617 greek = up,
618 digit = up,
619 }
620 \DeclareInstance{lua-unicode-math-style-cmd}{upright-bf}{alphabet-style-mapping}{
621 Latin = bfup,
622 latin = bfup,
623 Greek = bfup,
624 greek = bfup,
625 digit = bfup,
626 }
627 \DeclareInstance{lua-unicode-math-style-cmd}{upright-sf}{alphabet-style-mapping}{
628 Latin = sfup,
629 latin = sfup,
630 Greek = sfup,
631 greek = sfup,
632 digit = sfup,
633 }
634 \DeclareInstance{lua-unicode-math-style-cmd}{italic-sf}{alphabet-style-mapping}{
635 Latin = sfit,
636 latin = sfit,
637 Greek = sfit,
638 greek = sfit,
639 digit = sfit,
640 }
641 \DeclareInstance{lua-unicode-math-style-cmd}{upright-bfsf}{alphabet-style-mapping}{
642 Latin = bfsfup,
643 latin = bfsfup,
644 Greek = bfsfup,
645 greek = bfsfup,
646 digit = bfsfup,
647 }
648 \DeclareInstance{lua-unicode-math-style-cmd}{italic-bfsf}{alphabet-style-mapping}{
649 Latin = bfsfit,
650 latin = bfsfit,
651 Greek = bfsfit,
652 greek = bfsfit,
653 digit = bfsfit,
654 }
655 \UseInstance {lua-unicode-math-style} {TeX}
656 \endinput
657 %%
658 %% End of file `lua-unicode-math.sty'.