From 88c79b1089afed4ca1c72394817bb8f55bd1e9aa Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 13 Jan 2018 22:25:39 +0000 Subject: unicode-math (13jan18) git-svn-id: svn://tug.org/texlive/trunk@46300 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/unicode-math/unicode-math-luatex.sty | 461 ++++++++++----------- 1 file changed, 230 insertions(+), 231 deletions(-) (limited to 'Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty') diff --git a/Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty b/Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty index fa0711b6f1e..950a76f2a99 100644 --- a/Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty +++ b/Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty @@ -5,7 +5,6 @@ %% The original source files were: %% %% unicode-math.dtx (with options: `package,LU') -%% um-code-base.dtx (with options: `package,LU') %% um-code-opening.dtx (with options: `package,LU') %% um-code-variables.dtx (with options: `package,LU') %% um-code-api.dtx (with options: `package,LU') @@ -21,11 +20,12 @@ %% um-code-mathmap.dtx (with options: `package,LU') %% um-code-sym-commands.dtx (with options: `package,LU') %% um-code-alphabets.dtx (with options: `package,LU') -%% um-code-epilogue.dtx (with options: `package,LU') %% um-code-primes.dtx (with options: `package,LU') %% um-code-sscript.dtx (with options: `package,LU') %% um-code-compat.dtx (with options: `package,LU') %% um-code-amsmath.dtx (with options: `package,LU') +%% um-code-epilogue.dtx (with options: `package,LU') +%% %% ------------------------------------------------ %% The UNICODE-MATH package %% ------------------------------------------------ @@ -33,26 +33,26 @@ %% the conditions of the LaTeX Project Public License, version 1.3c or higher %% (your choice): . %% ------------------------------------------------ -%% Copyright 2006-2017 Will Robertson, LPPL "maintainer" +%% Copyright 2006-2018 Will Robertson, LPPL "maintainer" %% Copyright 2010-2017 Philipp Stephani %% Copyright 2011-2017 Joseph Wright %% Copyright 2012-2015 Khaled Hosny %% ------------------------------------------------ +%% %%^^A%% unicode-math.dtx -- part of UNICODE-MATH %%^^A%% Metadata for the package code, including files and versioning -\ProvidesPackage{unicode-math-luatex} - [2018/01/07 v0.8j Unicode maths in XeLaTeX and LuaLaTeX] - -%%^^A%% um-code-base.dtx -- part of UNICODE-MATH -%%^^A%% Definition of unicode-math.sty, which splits and loads according to engine. - +\ProvidesExplPackage{unicode-math-luatex} + {2018/01/13} {v0.8k} {Unicode maths in XeLaTeX and LuaLaTeX} %%^^A%% um-code-opening.dtx -- part of UNICODE-MATH %%^^A%% Assorted initialisation tasks, including some low-level function definitions. +\RequirePackage{xparse,l3keys2e} +\RequirePackage{fontspec} +\RequirePackage{filehook} +\RequirePackage{fix-cm} \RequirePackage{lualatex-math} -\ExplSyntaxOn \cs_set_protected_nopar:Npn \exp_last_unbraced:NNx { \::N \::x_unbraced \::: } \cs_generate_variant:Nn \fontspec_set_family:Nnn {Nx} \cs_generate_variant:Nn \prop_get:NnNTF {cx} @@ -73,7 +73,7 @@ { \tex_global:D \tex_let:D #1 #2 } -\cs_generate_variant:Nn \__um_fontface_gset_eq:NN {NV,cV} +\cs_generate_variant:Nn \__um_fontface_gset_eq:NN {cN} \cs_set:Npn \__um_set_mathcode:nnnn #1#2#3#4 { \Umathcode \int_eval:n {#1} = @@ -1198,7 +1198,7 @@ \group_begin: \fontfamily { \l__um_trial_family_tl } \selectfont - \__um_fontface_gset_eq:NV \g__um_trial_font \font@name + \exp_last_unbraced:NNo \__um_fontface_gset_eq:NN \g__um_trial_font \font@name \fontspec_if_script:nF {math} { \bool_gset_false:N \l__um_ot_math_bool @@ -1242,11 +1242,11 @@ \int_gincr:N \g__um_fonts_used_int \group_begin: \fontfamily { \l__um_family_tl } \selectfont - \__um_fontface_gset_eq:cV {g__um_mathfont_ \int_use:N \g__um_fonts_used_int _font} \font@name + \exp_last_unbraced:Nno \__um_fontface_gset_eq:cN {g__um_mathfont_ \int_use:N \g__um_fonts_used_int _font} \font@name \tl_gset:Nx \g__um_curr_font_cmd_tl { \exp_not:c {g__um_mathfont_ \int_use:N \g__um_fonts_used_int _font} } \bool_if:NT \l__um_init_bool { -\__um_fontface_gset_eq:NV \l__um_font \font@name +\exp_last_unbraced:NNo \__um_fontface_gset_eq:NN \l__um_font \font@name } \fontspec_if_script:nF {math} { @@ -1819,63 +1819,61 @@ \cs_new:Npn \__um_setup_alphabets: { - - \bool_if:NTF \l__um_init_bool + \bool_if:NTF \l__um_init_bool { \__um_setup_alphabets_implicit: } { - % IMPLICIT - \__um_log:n {setup-implicit} - \seq_gset_eq:NN \g__um_mathalph_seq \g__um_default_mathalph_seq - \bool_set_true:N \l__um_implicit_alph_bool - \__um_maybe_init_alphabet:n {sf} - \__um_maybe_init_alphabet:n {bf} - \__um_maybe_init_alphabet:n {bfsf} - \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_noparse:nnn - \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_noparse:nn - \__um_mathalph_map: - \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } } + \seq_if_empty:NF \g__um_mathalph_seq { \__um_setup_alphabets_explicit: } + \clist_if_empty:NF \l__um_mathmap_charints_clist { \__um_setup_alphabets_inherit: } } + } +\cs_new:Nn \__um_setup_alphabets_implicit: + { + \__um_log:n {setup-implicit} + \seq_gset_eq:NN \g__um_mathalph_seq \g__um_default_mathalph_seq + \bool_set_true:N \l__um_implicit_alph_bool + \__um_maybe_init_alphabet:n {sf} + \__um_maybe_init_alphabet:n {bf} + \__um_maybe_init_alphabet:n {bfsf} + \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_noparse:nnn + \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_noparse:nn + \__um_mathalph_map: + \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } } + } +\cs_new:Nn \__um_setup_alphabets_explicit: + { + \__um_log:n {setup-explicit} + \bool_set_false:N \l__um_implicit_alph_bool + \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_noparse:nnn + \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_noparse:nn + \__um_mathalph_map: + \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } } + } +\cs_new:Nn \__um_setup_alphabets_inherit: + { + \seq_gclear:N \g__um_mathalph_seq + \seq_map_inline:Nn \g__um_default_mathalph_seq { - \seq_if_empty:NF \g__um_mathalph_seq - { - % EXPLICIT - \__um_log:n {setup-explicit} - \bool_set_false:N \l__um_implicit_alph_bool - \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_noparse:nnn - \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_noparse:nn - \__um_mathalph_map: - \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } } - } + \tl_set:No \l__um_style_tl { \use_i:nnn ##1 } + \clist_set:No \l__um_alphabet_clist { \use_ii:nnn ##1 } - % INHERIT - \clist_if_empty:NF \l__um_mathmap_charints_clist + \clist_map_inline:Nn \l__um_alphabet_clist { - \seq_gclear:N \g__um_mathalph_seq - \seq_map_inline:Nn \g__um_default_mathalph_seq + \clist_map_inline:cn {g__um_named_slots_ \l__um_style_tl _ ####1 _clist} { - \tl_set:No \l__um_style_tl { \use_i:nnn ##1 } - \clist_set:No \l__um_alphabet_clist { \use_ii:nnn ##1 } - - \clist_map_inline:Nn \l__um_alphabet_clist + \clist_map_inline:Nn \l__um_mathmap_charints_clist { - \clist_map_inline:cn {g__um_named_slots_ \l__um_style_tl _ ####1 _clist} + \__um_int_if_slot_in_range:nnT {################1} {########1} { - \clist_map_inline:Nn \l__um_mathmap_charints_clist - { - \__um_int_if_slot_in_range:nnT {################1} {########1} - { - \seq_gput_right:Nn \g__um_mathalph_seq {##1} - \clist_map_break:n { \clist_map_break:n { \clist_map_break: } } - } - } + \seq_gput_right:Nn \g__um_mathalph_seq {##1} + \clist_map_break:n { \clist_map_break:n { \clist_map_break: } } } } } } - - \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_parse:nnn - \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_parse:nn - \__um_mathalph_map: } + + \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_parse:nnn + \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_parse:nn + \__um_mathalph_map: } \cs_set:Nn \__um_mathalph_map: { @@ -3120,179 +3118,6 @@ } } -%%^^A%% um-code-epilogue.dtx -- part of UNICODE-MATH -%%^^A%% Assorted definitions to close up. - -\AtBeginDocument { \__um_resolve_greek: } -\cs_new:Npn \__um_resolve_greek: - { - \clist_map_inline:nn - { - Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda, - alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda, - Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega, - mu,nu,xi,omicron,pi,rho,sigma,tau,upsilon,phi,chi,psi,omega, - varTheta,varsigma,vartheta,varkappa,varrho,varpi,varepsilon,varphi - } - { - \tl_set:cx {##1} { \exp_not:c { mit ##1 } } - \tl_set:cx {up ##1} { \exp_not:N \symup \exp_not:c { ##1 } } - \tl_set:cx {it ##1} { \exp_not:N \symit \exp_not:c { ##1 } } - } - } -\AtBeginDocument{ \@ifpackageloaded { amsmath } { } { \__um_redefine_radical: } } -\cs_new:Nn \__um_redefine_radical: - { - \cs_set:Npn \root ##1 \of ##2 - { - \Uroot \l__um_radical_sqrt_tl { ##1 } { ##2 } - } - } -\cs_new:Nn \__um_which_frac:nn - { - \bool_if:NTF \l__um_smallfrac_bool {\tfrac} {\frac} {#1} {#2} - } -\cs_new:Npn \__um_setup_active_frac: - { - \__um_mathactive_remap:nn {"2189} { \__um_which_frac:nn {0} {3} } - \__um_mathactive_remap:nn {"2152} { \__um_which_frac:nn {1} {10} } - \__um_mathactive_remap:nn {"2151} { \__um_which_frac:nn {1} {9} } - \__um_mathactive_remap:nn {"215B} { \__um_which_frac:nn {1} {8} } - \__um_mathactive_remap:nn {"2150} { \__um_which_frac:nn {1} {7} } - \__um_mathactive_remap:nn {"2159} { \__um_which_frac:nn {1} {6} } - \__um_mathactive_remap:nn {"2155} { \__um_which_frac:nn {1} {5} } - \__um_mathactive_remap:nn {"00BC} { \__um_which_frac:nn {1} {4} } - \__um_mathactive_remap:nn {"2153} { \__um_which_frac:nn {1} {3} } - \__um_mathactive_remap:nn {"215C} { \__um_which_frac:nn {3} {8} } - \__um_mathactive_remap:nn {"2156} { \__um_which_frac:nn {2} {5} } - \__um_mathactive_remap:nn {"00BD} { \__um_which_frac:nn {1} {2} } - \__um_mathactive_remap:nn {"2157} { \__um_which_frac:nn {3} {5} } - \__um_mathactive_remap:nn {"215D} { \__um_which_frac:nn {5} {8} } - \__um_mathactive_remap:nn {"2154} { \__um_which_frac:nn {2} {3} } - \__um_mathactive_remap:nn {"00BE} { \__um_which_frac:nn {3} {4} } - \__um_mathactive_remap:nn {"2158} { \__um_which_frac:nn {4} {5} } - \__um_mathactive_remap:nn {"215A} { \__um_which_frac:nn {5} {6} } - \__um_mathactive_remap:nn {"215E} { \__um_which_frac:nn {7} {8} } - } -\AtBeginDocument { \__um_setup_active_frac: } -\protected\def\to{\rightarrow} -\protected\def\le{\leq} -\protected\def\ge{\geq} -\protected\def\neq{\ne} -\protected\def\triangle{\mathord{\bigtriangleup}} -\protected\def\bigcirc{\mdlgwhtcircle} -\protected\def\circ{\vysmwhtcircle} -\protected\def\bullet{\smblkcircle} -\protected\def\mathyen{\yen} -\protected\def\mathsterling{\sterling} -\protected\def\diamond{\smwhtdiamond} -\protected\def\emptyset{\varnothing} -\protected\def\hbar{\hslash} -\protected\def\land{\wedge} -\protected\def\lor{\vee} -\protected\def\owns{\ni} -\protected\def\gets{\leftarrow} -\protected\def\mathring{\ocirc} -\protected\def\lnot{\neg} -\protected\def\longdivision{\longdivisionsign} -\protected\def\backepsilon{\upbackepsilon} -\protected\def\eth{\matheth} -\protected\def\dbkarow {\dbkarrow} -\protected\def\drbkarow{\drbkarrow} -\protected\def\hksearow{\hksearrow} -\protected\def\hkswarow{\hkswarrow} -\protected\def\smallint{\mathop{\textstyle\int}\limits} -\cs_set_eq:NN \latexe_underbar:n \underbar -\renewcommand\underbar - { - \mode_if_math:TF \mathunderbar \latexe_underbar:n - } -\@ifpackageloaded{amsmath} - { - % define their own colon, perhaps I should just steal it. (It does look much better.) - } - { - \cs_set_protected:Npn \colon - { - \bool_if:NTF \g__um_literal_colon_bool {:} { \mathpunct{:} } - } - } -\protected\def\digamma{\updigamma} -\protected\def\Digamma{\upDigamma} -\cs_set_protected:Npn \| {\Vert} -\cs_set_protected:Npn \mathellipsis {\mathinner{\unicodeellipsis}} -\cs_set_protected:Npn \cdots {\mathinner{\unicodecdots}} -\cs_set_eq:NN \__um_text_slash: \slash -\cs_set_protected:Npn \slash - { - \mode_if_math:TF {\mathslash} {\__um_text_slash:} - } -\DeclareDocumentCommand \not {m} - { - \tl_set:Nx \l__um_not_token_name_tl { \cs_to_str:N #1 } - \tl_if_empty:NT \l__um_not_token_name_tl - { - \tl_set:Nx \l__um_not_token_name_tl { \token_to_str:N #1 } - } - \cs_if_exist:cTF { not \l__um_not_token_name_tl } - { - \use:c { not \l__um_not_token_name_tl } - } - { - \cs_if_exist:cTF { n \l__um_not_token_name_tl } - { - \use:c { n \l__um_not_token_name_tl } - } - { - \tl_if_eq:nnTF {#1} {$} { \notaccent{} } { \notaccent } #1 - } - } - } -\DeclareDocumentCommand \NewNegationCommand {mm} - { - \__um_set_negation_command:Nnn \cs_new_protected:cpn {#1} {#2} - } -\DeclareDocumentCommand \RenewNegationCommand {mm} - { - \__um_set_negation_command:Nnn \cs_set_protected:cpn {#1} {#2} - } -\cs_set:Nn \__um_set_negation_command:Nnn - { - \tl_set:Nx \l__um_not_token_name_tl { \cs_to_str:N #2 } - \tl_if_empty:NT \l__um_not_token_name_tl - { - \tl_set:Nx \l__um_not_token_name_tl { \token_to_str:N #2 } - } - #1 { not \l__um_not_token_name_tl } { #3 } - } -\NewNegationCommand { = } { \neq } -\NewNegationCommand { < } { \nless } -\NewNegationCommand { > } { \ngtr } -\NewNegationCommand { \gets } { \nleftarrow } -\NewNegationCommand { \simeq } { \nsime } -\NewNegationCommand { \equal } { \ne } -\NewNegationCommand { \le } { \nleq } -\NewNegationCommand { \ge } { \ngeq } -\NewNegationCommand { \greater } { \ngtr } -\NewNegationCommand { \forksnot } { \forks } -\int_step_inline:nnnn {0} {1} {9} - { - \__um_mathactive_remap:nn {"FF10+#1} {\char\int_eval:n{`\0+#1}} - } -\int_step_inline:nnnn {0} {1} {26} - { - \__um_mathactive_remap:nn {"FF21+#1} {\char\int_eval:n{`\A+#1}} - \__um_mathactive_remap:nn {"FF41+#1} {\char\int_eval:n{`\a+#1}} - } -\cs_new:Nn \__um_undeclare_symbol:N - { - \cs_set_protected:Npn #1 - { \__um_error:nx {legacy-char-not-supported} { \token_to_str:N #1 } } - } -\__um_undeclare_symbol:N \arrowvert -\__um_undeclare_symbol:N \Arrowvert -\__um_undeclare_symbol:N \bracevert - %%^^A%% um-code-primes.dtx -- part of UNICODE-MATH %%^^A%% The definitions needed for the input of primes. @@ -3874,3 +3699,177 @@ } } +%%^^A%% um-code-epilogue.dtx -- part of UNICODE-MATH +%%^^A%% Assorted definitions to close up. + +\AtBeginDocument { \__um_resolve_greek: } +\cs_new:Npn \__um_resolve_greek: + { + \clist_map_inline:nn + { + Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda, + alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda, + Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega, + mu,nu,xi,omicron,pi,rho,sigma,tau,upsilon,phi,chi,psi,omega, + varTheta,varsigma,vartheta,varkappa,varrho,varpi,varepsilon,varphi + } + { + \tl_set:cx {##1} { \exp_not:c { mit ##1 } } + \tl_set:cx {up ##1} { \exp_not:N \symup \exp_not:c { ##1 } } + \tl_set:cx {it ##1} { \exp_not:N \symit \exp_not:c { ##1 } } + } + } +\AtBeginDocument{ \@ifpackageloaded { amsmath } { } { \__um_redefine_radical: } } +\cs_new:Nn \__um_redefine_radical: + { + \cs_set:Npn \root ##1 \of ##2 + { + \Uroot \l__um_radical_sqrt_tl { ##1 } { ##2 } + } + } +\cs_new:Nn \__um_which_frac:nn + { + \bool_if:NTF \l__um_smallfrac_bool {\tfrac} {\frac} {#1} {#2} + } +\cs_new:Npn \__um_setup_active_frac: + { + \__um_mathactive_remap:nn {"2189} { \__um_which_frac:nn {0} {3} } + \__um_mathactive_remap:nn {"2152} { \__um_which_frac:nn {1} {10} } + \__um_mathactive_remap:nn {"2151} { \__um_which_frac:nn {1} {9} } + \__um_mathactive_remap:nn {"215B} { \__um_which_frac:nn {1} {8} } + \__um_mathactive_remap:nn {"2150} { \__um_which_frac:nn {1} {7} } + \__um_mathactive_remap:nn {"2159} { \__um_which_frac:nn {1} {6} } + \__um_mathactive_remap:nn {"2155} { \__um_which_frac:nn {1} {5} } + \__um_mathactive_remap:nn {"00BC} { \__um_which_frac:nn {1} {4} } + \__um_mathactive_remap:nn {"2153} { \__um_which_frac:nn {1} {3} } + \__um_mathactive_remap:nn {"215C} { \__um_which_frac:nn {3} {8} } + \__um_mathactive_remap:nn {"2156} { \__um_which_frac:nn {2} {5} } + \__um_mathactive_remap:nn {"00BD} { \__um_which_frac:nn {1} {2} } + \__um_mathactive_remap:nn {"2157} { \__um_which_frac:nn {3} {5} } + \__um_mathactive_remap:nn {"215D} { \__um_which_frac:nn {5} {8} } + \__um_mathactive_remap:nn {"2154} { \__um_which_frac:nn {2} {3} } + \__um_mathactive_remap:nn {"00BE} { \__um_which_frac:nn {3} {4} } + \__um_mathactive_remap:nn {"2158} { \__um_which_frac:nn {4} {5} } + \__um_mathactive_remap:nn {"215A} { \__um_which_frac:nn {5} {6} } + \__um_mathactive_remap:nn {"215E} { \__um_which_frac:nn {7} {8} } + } +\AtBeginDocument { \__um_setup_active_frac: } +\protected\def\to{\rightarrow} +\protected\def\le{\leq} +\protected\def\ge{\geq} +\protected\def\neq{\ne} +\protected\def\triangle{\mathord{\bigtriangleup}} +\protected\def\bigcirc{\mdlgwhtcircle} +\protected\def\circ{\vysmwhtcircle} +\protected\def\bullet{\smblkcircle} +\protected\def\mathyen{\yen} +\protected\def\mathsterling{\sterling} +\protected\def\diamond{\smwhtdiamond} +\protected\def\emptyset{\varnothing} +\protected\def\hbar{\hslash} +\protected\def\land{\wedge} +\protected\def\lor{\vee} +\protected\def\owns{\ni} +\protected\def\gets{\leftarrow} +\protected\def\mathring{\ocirc} +\protected\def\lnot{\neg} +\protected\def\longdivision{\longdivisionsign} +\protected\def\backepsilon{\upbackepsilon} +\protected\def\eth{\matheth} +\protected\def\dbkarow {\dbkarrow} +\protected\def\drbkarow{\drbkarrow} +\protected\def\hksearow{\hksearrow} +\protected\def\hkswarow{\hkswarrow} +\protected\def\smallint{\mathop{\textstyle\int}\limits} +\cs_set_eq:NN \latexe_underbar:n \underbar +\renewcommand\underbar + { + \mode_if_math:TF \mathunderbar \latexe_underbar:n + } +\@ifpackageloaded{amsmath} + { + % define their own colon, perhaps I should just steal it. (It does look much better.) + } + { + \cs_set_protected:Npn \colon + { + \bool_if:NTF \g__um_literal_colon_bool {:} { \mathpunct{:} } + } + } +\protected\def\digamma{\updigamma} +\protected\def\Digamma{\upDigamma} +\cs_set_protected:Npn \| {\Vert} +\cs_set_protected:Npn \mathellipsis {\mathinner{\unicodeellipsis}} +\cs_set_protected:Npn \cdots {\mathinner{\unicodecdots}} +\cs_set_eq:NN \__um_text_slash: \slash +\cs_set_protected:Npn \slash + { + \mode_if_math:TF {\mathslash} {\__um_text_slash:} + } +\DeclareDocumentCommand \not {m} + { + \tl_set:Nx \l__um_not_token_name_tl { \cs_to_str:N #1 } + \tl_if_empty:NT \l__um_not_token_name_tl + { + \tl_set:Nx \l__um_not_token_name_tl { \token_to_str:N #1 } + } + \cs_if_exist:cTF { not \l__um_not_token_name_tl } + { + \use:c { not \l__um_not_token_name_tl } + } + { + \cs_if_exist:cTF { n \l__um_not_token_name_tl } + { + \use:c { n \l__um_not_token_name_tl } + } + { + \tl_if_eq:nnTF {#1} {$} { \notaccent{} } { \notaccent } #1 + } + } + } +\DeclareDocumentCommand \NewNegationCommand {mm} + { + \__um_set_negation_command:Nnn \cs_new_protected:cpn {#1} {#2} + } +\DeclareDocumentCommand \RenewNegationCommand {mm} + { + \__um_set_negation_command:Nnn \cs_set_protected:cpn {#1} {#2} + } +\cs_set:Nn \__um_set_negation_command:Nnn + { + \tl_set:Nx \l__um_not_token_name_tl { \cs_to_str:N #2 } + \tl_if_empty:NT \l__um_not_token_name_tl + { + \tl_set:Nx \l__um_not_token_name_tl { \token_to_str:N #2 } + } + #1 { not \l__um_not_token_name_tl } { #3 } + } +\NewNegationCommand { = } { \neq } +\NewNegationCommand { < } { \nless } +\NewNegationCommand { > } { \ngtr } +\NewNegationCommand { \gets } { \nleftarrow } +\NewNegationCommand { \simeq } { \nsime } +\NewNegationCommand { \equal } { \ne } +\NewNegationCommand { \le } { \nleq } +\NewNegationCommand { \ge } { \ngeq } +\NewNegationCommand { \greater } { \ngtr } +\NewNegationCommand { \forksnot } { \forks } +\int_step_inline:nnnn {0} {1} {9} + { + \__um_mathactive_remap:nn {"FF10+#1} {\char\int_eval:n{`\0+#1}} + } +\int_step_inline:nnnn {0} {1} {26} + { + \__um_mathactive_remap:nn {"FF21+#1} {\char\int_eval:n{`\A+#1}} + \__um_mathactive_remap:nn {"FF41+#1} {\char\int_eval:n{`\a+#1}} + } +\cs_new:Nn \__um_undeclare_symbol:N + { + \cs_set_protected:Npn #1 + { \__um_error:nx {legacy-char-not-supported} { \token_to_str:N #1 } } + } +\__um_undeclare_symbol:N \arrowvert +\__um_undeclare_symbol:N \Arrowvert +\__um_undeclare_symbol:N \bracevert +\endinput + -- cgit v1.2.3