summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty')
-rw-r--r--Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty397
1 files changed, 207 insertions, 190 deletions
diff --git a/Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty b/Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty
index f282fb48645..10187f64053 100644
--- a/Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty
+++ b/Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty
@@ -16,7 +16,7 @@
%%
%% This work is "author-maintained" by Will Robertson.
\ProvidesPackage{unicode-math}
- [2011/01/29 v0.5d Unicode maths in XeLaTeX and LuaLaTeX]
+ [2011/07/31 v0.5e Unicode maths in XeLaTeX and LuaLaTeX]
\usepackage{ifxetex,ifluatex}
\ifxetex\else\ifluatex\else
\PackageError{unicode-math}{%
@@ -29,10 +29,20 @@
\RequirePackage{l3keys2e}
\RequirePackage{fontspec}[2010/10/25]
\RequirePackage{catchfile}
-\RequirePackage{trimspaces}
+\RequirePackage{trimspaces}% I'd like to incorporate this into expl3...
\RequirePackage{fix-cm} % avoid some warnings
\RequirePackage{filehook}[2011/01/03]
\ExplSyntaxOn
+\cs_if_exist:NF \char_set_catcode_other:N
+ {
+ \cs_set_eq:NN \c_math_toggle_token \c_math_shift_token
+ \cs_set_eq:NN \char_set_catcode_other:N \char_make_other:N
+ \cs_set_eq:NN \char_set_catcode_active:N \char_make_active:N
+ \cs_set_eq:NN \char_set_catcode_active:n \char_make_active:n
+ \cs_set_eq:NN \char_set_catcode_escape:N \char_make_escape:N
+ \cs_set_eq:NN \char_set_catcode_math_superscript:N
+ \char_make_math_superscript:N
+ }
\cs_generate_variant:Nn \tl_put_right:Nn {cx}
\cs_generate_variant:Nn \seq_if_in:NnTF {NV}
\cs_generate_variant:Nn \prop_gput:Nnn {Nxn}
@@ -43,8 +53,11 @@
\cs:w #3 \exp_after:wN \cs_end:
\cs:w #4 \cs_end:
}
-\bool_new:N \c_um_have_fixed_accents_bool
-\bool_set:Nn \c_um_have_fixed_accents_bool {
+\cs_new_protected_nopar:Npn \bool_const:Nn #1 #2 {
+ \bool_new:N #1
+ \bool_set:Nn #1 { #2 }
+}
+\bool_const:Nn \c_um_have_fixed_accents_bool {
\c_luatex_is_engine_bool && \int_compare_p:n { \luatexversion > 64 }
}
\bool_new:N \l_um_ot_math_bool
@@ -100,7 +113,15 @@
\um_cs_compat:n {radical}
\um_cs_compat:n {mathaccent}
\um_cs_compat:n {delimiter}
+\luatex_if_engine:T {
+ \RequirePackage { lualatex-math } [ 2011/05/05 ]
+}
\cs_generate_variant:Nn \fontspec_select:nn {x}
+\luatex_if_engine:T {
+ \RequirePackage { luatexbase }
+ \RequirePackage { luaotfload } [ 2010/11/26 ]
+ \RequireLuaModule { unicode-math } [ 2011/04/23 ]
+}
\cs_new:Npn \um_warning:n { \msg_warning:nn {unicode-math} }
\cs_new:Npn \um_trace:n { \msg_trace:nn {unicode-math} }
\cs_new:Npn \um_trace:nx { \msg_trace:nnx {unicode-math} }
@@ -134,6 +155,15 @@
{
Setup~ alphabet:~ #1.
}
+\msg_new:nnnn { unicode-math } { no-font-selected } {
+ You've~ loaded~ the~ unicode-math~ package,~ but~ you~ forgot~ to~ select \\
+ a~ Unicode~ math~ font.~ Please~ select~ one~ with~ the~ \token_to_str:N \setmathfont \\
+ command.
+} {
+ Loading~ the~ unicode-math~ package~ without~ using~ a~ Unicode~ math~ font \\
+ is~ not~ supported.~ Either~ select~ a~ Unicode~ math~ font,~ or~ don't~ load \\
+ the~ unicode-math~ package.
+}
\msg_new:nnn {unicode-math} {macro-expected}
{
I've~ expected~ that~ #1~ is~ a~ macro,~ but~ it~ isn't.
@@ -820,33 +850,33 @@
}
\mathopen {
\tl_if_in:NnTF \l_um_radicals_tl {#2} {
- \cs_gset:cpx {\cs_to_str:N #2 sign} { \um_radical:nn {#1} {#4} }
+ \cs_gset_protected_nopar:cpx {\cs_to_str:N #2 sign} { \um_radical:nn {#1} {#4} }
\tl_set:cn {l_um_radical_\cs_to_str:N #2_tl} {\use:c{sym #1}~ #4}
}{
\um_set_delcode:nnn {#1} {#4} {#4}
\um_set_mathcode:nnn {#4} \mathopen {#1}
- \cs_gset:Npx #2 { \um_delimiter:Nnn \mathopen {#1} {#4} }
+ \cs_gset_protected_nopar:Npx #2 { \um_delimiter:Nnn \mathopen {#1} {#4} }
}
}
\mathclose {
\um_set_delcode:nnn {#1} {#4} {#4}
\um_set_mathcode:nnn {#4} \mathclose {#1}
- \cs_gset:Npx #2 { \um_delimiter:Nnn \mathclose {#1} {#4} }
+ \cs_gset_protected_nopar:Npx #2 { \um_delimiter:Nnn \mathclose {#1} {#4} }
}
\mathaccent {
- \cs_gset:Npx #2 { \um_accent:Nnn #3 {#1} {#4} }
+ \cs_gset_protected_nopar:Npx #2 { \um_accent:Nnn #3 {#1} {#4} }
}
\mathfence {
\um_set_mathcode:nnn {#4} {#3} {#1}
\um_set_delcode:nnn {#1} {#4} {#4}
- \cs_gset:cpx {l \cs_to_str:N #2} { \um_delimiter:Nnn \mathopen {#1} {#4} }
- \cs_gset:cpx {r \cs_to_str:N #2} { \um_delimiter:Nnn \mathclose {#1} {#4} }
+ \cs_gset_protected_nopar:cpx {l \cs_to_str:N #2} { \um_delimiter:Nnn \mathopen {#1} {#4} }
+ \cs_gset_protected_nopar:cpx {r \cs_to_str:N #2} { \um_delimiter:Nnn \mathclose {#1} {#4} }
}
\mathover { % LuaTeX only
- \cs_set:Npn #2 ##1 { \mathop { \um_overbrace:nnn {#1} {#4} {##1} } \limits }
+ \cs_set_protected_nopar:Npn #2 ##1 { \mathop { \um_overbrace:nnn {#1} {#4} {##1} } \limits }
}
\mathunder { % LuaTeX only
- \cs_set:Npn #2 ##1 { \mathop { \um_underbrace:nnn {#1} {#4} {##1} } \limits }
+ \cs_set_protected_nopar:Npn #2 ##1 { \mathop { \um_underbrace:nnn {#1} {#4} {##1} } \limits }
}
}{
\um_set_mathcode:nnn {#4} {#3} {#1}
@@ -857,7 +887,7 @@
\edef\mathunder{\string\mathunder}
\cs_new:Npn \um_set_big_operator:nnn #1#2#3 {
\group_begin:
- \char_make_active:n {#3}
+ \char_set_catcode_active:n {#3}
\char_gmake_mathactive:n {#3}
\um_active_char_set:wc #3 \q_nil { \cs_to_str:N #2 _sym }
\group_end:
@@ -868,16 +898,16 @@
}
}
\cs_set:Npn \um_set_mathcode:nnnn #1#2#3#4 {
- \Umathcode \intexpr_eval:n {#1} =
- \mathchar@type#2 \csname sym#3\endcsname \intexpr_eval:n {#4} \scan_stop:
+ \Umathcode \int_eval:n {#1} =
+ \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#4} \scan_stop:
}
\cs_set:Npn \um_set_mathcode:nnn #1#2#3 {
- \Umathcode \intexpr_eval:n {#1} =
- \mathchar@type#2 \csname sym#3\endcsname \intexpr_eval:n {#1} \scan_stop:
+ \Umathcode \int_eval:n {#1} =
+ \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#1} \scan_stop:
}
\cs_set:Npn \um_set_mathchar:NNnn #1#2#3#4 {
\Umathchardef #1 =
- \mathchar@type#2 \csname sym#3\endcsname \intexpr_eval:n {#4} \scan_stop:
+ \mathchar@type#2 \csname sym#3\endcsname \int_eval:n {#4} \scan_stop:
}
\cs_new:Npn \um_set_delcode:nnn #1#2#3 {
\Udelcode#2 = \csname sym#1\endcsname #3
@@ -891,7 +921,7 @@
\xetex_or_luatex:nnn { \cs_new:Npn \um_accent:Nnn #1#2#3 } {
\Umathaccent \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop:
} {
- \Umathaccent \um_accent_keyword: \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop:
+ \Umathaccent \c_um_accent_keyword_tl \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop:
}
\luatex_if_engine:T {
\cs_new_nopar:Npn \um_wide_top_accent:Nnn #1 #2 #3 {
@@ -901,11 +931,9 @@
\cs_new_nopar:Npn \um_wide_bottom_accent:Nnn #1 #2 #3 {
\Umathaccent bottom~ \mathchar@type #1 \use:c { sym #2 } #3 \scan_stop:
}
- \cs_new_protected_nopar:Npn \um_accent_keyword: {
- \bool_if:NF \l_um_growing_accents_bool { fixed~ }
- }
+ \tl_const:Nn \c_um_accent_keyword_tl { fixed }
} {
- \cs_new_nopar:Npn \um_accent_keyword: { }
+ \tl_const:Nn \c_um_accent_keyword_tl { }
}
}
\cs_generate_variant:Nn \um_set_mathchar:NNnn {c}
@@ -921,8 +949,29 @@
\cs_new:Npn \char_gmake_mathactive:n #1 {
\global\mathcode #1 = "8000 \scan_stop:
}
+\cs_new_eq:NN \um_saved_ltxe_glb_settings: \glb@settings
+\CheckCommand * \glb@settings {
+ \expandafter\ifx\csname S@\f@size\endcsname\relax
+ \calculate@math@sizes
+ \fi
+ \csname S@\f@size\endcsname
+ \ifmath@fonts
+ \begingroup
+ \escapechar\m@ne
+ \csname mv@\math@version \endcsname
+ \globaldefs\@ne
+ \math@fonts
+ \let \glb@currsize \f@size
+ \endgroup
+ \the\every@math@size
+ \fi
+}
+\cs_set_protected_nopar:Npn \glb@settings {
+ \msg_error:nn { unicode-math } { no-font-selected }
+}
\cs_new:Npn \um_init: {
\let\glb@currsize\relax
+ \cs_set_eq:NN \glb@settings \um_saved_ltxe_glb_settings:
\bool_set_true:N \l_um_init_bool
\seq_clear:N \l_um_char_range_seq
\clist_clear:N \l_um_char_num_range_clist
@@ -932,6 +981,7 @@
}
\DeclareDocumentCommand \setmathfont { O{} m } {
\um_init:
+ \cs_if_exist:cF { S@ \f@size } { \calculate@math@sizes }
\csname S@\f@size\endcsname
\tl_set:Nn \l_um_mversion_tf {normal}
\DeclareMathVersion{\l_um_mversion_tf}
@@ -948,7 +998,7 @@
{\bool_gset_false:N \l_um_ot_math_bool}
\group_end:
\bool_if:NTF \l_um_init_bool {
- \tl_set:Nn \um_symfont_tl {um_allsym}
+ \tl_set:Nn \um_symfont_tl {operators}
\msg_trace:nnx {unicode-math} {default-math-font} {#2}
\cs_set_eq:NN \_um_sym:nnn \um_process_symbol_noparse:nnn
\cs_set_eq:NN \um_set_mathalphabet_char:Nnn \um_mathmap_noparse:Nnn
@@ -1312,7 +1362,7 @@
}
}
\prg_new_conditional:Nnn \um_if_mathalph_decl:n {TF} {
- \KV_remove_surrounding_spaces:nw {\tl_set:Nf\l_um_tmpa_tl} #1 \q_nil
+ \tl_set:Nx \l_um_tmpa_tl { \trim@spaces@noexp {#1} }
\tl_clear:N \l_um_tmpb_tl
\tl_clear:N \l_um_tmpc_tl
\tl_if_in:NnT \l_um_tmpa_tl {->} {
@@ -1355,7 +1405,7 @@
\expandafter\um@parse@range\@ii-\@marker-\@nil#1\@nil
\fi
\if@tempswa
- \clist_put_right:Nx \l_um_char_num_range_clist { \intexpr_eval:n {#1} }
+ \clist_put_right:Nx \l_um_char_num_range_clist { \int_eval:n {#1} }
#4
\fi
\fi
@@ -1368,16 +1418,16 @@
\def\@tempa{#1}
\def\@tempb{#2}
\expandafter\ifx\expandafter\@marker\@tempb\relax
- \intexpr_compare:nT {#4=#1} \@tempswatrue
+ \int_compare:nT {#4=#1} \@tempswatrue
\else
\ifx\@empty\@tempb
- \intexpr_compare:nT {#4>#1-1} \@tempswatrue
+ \int_compare:nT {#4>#1-1} \@tempswatrue
\else
\ifx\@empty\@tempa
- \intexpr_compare:nT {#4<#2+1} \@tempswatrue
+ \int_compare:nT {#4<#2+1} \@tempswatrue
\else
- \intexpr_compare:nT {#4>#1-1} {
- \intexpr_compare:nT {#4<#2+1} \@tempswatrue
+ \int_compare:nT {#4>#1-1} {
+ \int_compare:nT {#4<#2+1} \@tempswatrue
}
\fi
\fi
@@ -2320,15 +2370,15 @@
\CatchFileEdef \g_um_mathtable_tl {unicode-math-table.tex} {\um_symbol_setup:}
\cs_new:Npn \um_input_math_symbol_table: {\g_um_mathtable_tl}
\begingroup
- \char_make_other:N \^
+ \char_set_catcode_other:N \^
\cs_gset:Npn \um_cs_set_eq_active_char:Nw #1 = "#2 \q_nil {
\lowercase{
\tl_rescan:nn {
- \char_make_other:N \{
- \char_make_other:N \}
- \char_make_other:N \&
- \char_make_other:N \%
- \char_make_other:N \$
+ \char_set_catcode_other:N \{
+ \char_set_catcode_other:N \}
+ \char_set_catcode_other:N \&
+ \char_set_catcode_other:N \%
+ \char_set_catcode_other:N \$
}{
\global\let#1=^^^^^#2
}
@@ -2349,7 +2399,7 @@
\AtBeginDocument{\um_define_math_chars:}
\cs_set:Nn \um_define_math_chars: {
\group_begin:
- \char_make_math_superscript:N \^
+ \char_set_catcode_math_superscript:N \^
\cs_set:Npn \_um_sym:nnn ##1##2##3 {
\bool_if:nF { \cs_if_eq_p:NN ##3 \mathaccent ||
\cs_if_eq_p:NN ##3 \mathopen ||
@@ -2359,14 +2409,14 @@
\um_cs_set_eq_active_char:Nw ##2 = ##1 \q_nil \ignorespaces
}
}
- \char_make_other:N \#
+ \char_set_catcode_other:N \#
\um_input_math_symbol_table:
\group_end:
}
\group_begin:
\lccode`\*=`\\
- \char_make_escape:N \|
- \char_make_other:N \\
+ \char_set_catcode_escape:N \|
+ \char_set_catcode_other:N \\
|lowercase{
|AtBeginDocument{
|let|backslash=*
@@ -2575,7 +2625,7 @@
\AtBeginDocument{\um_define_prime_commands: \um_define_prime_chars:}
\cs_set:Nn \um_define_prime_commands: {
\cs_set_eq:NN \prime \um_prime_single_mchar
- \cs_set_eq:NN \drime \um_prime_double_mchar
+ \cs_set_eq:NN \dprime \um_prime_double_mchar
\cs_set_eq:NN \trprime \um_prime_triple_mchar
\cs_set_eq:NN \qprime \um_prime_quad_mchar
\cs_set_eq:NN \backprime \um_backprime_single_mchar
@@ -2583,15 +2633,15 @@
\cs_set_eq:NN \backtrprime \um_backprime_triple_mchar
}
\group_begin:
- \char_make_active:N \'
- \char_make_active:N \`
- \char_make_active:n {"2032}
- \char_make_active:n {"2033}
- \char_make_active:n {"2034}
- \char_make_active:n {"2057}
- \char_make_active:n {"2035}
- \char_make_active:n {"2036}
- \char_make_active:n {"2037}
+ \char_set_catcode_active:N \'
+ \char_set_catcode_active:N \`
+ \char_set_catcode_active:n {"2032}
+ \char_set_catcode_active:n {"2033}
+ \char_set_catcode_active:n {"2034}
+ \char_set_catcode_active:n {"2057}
+ \char_set_catcode_active:n {"2035}
+ \char_set_catcode_active:n {"2036}
+ \char_set_catcode_active:n {"2037}
\cs_gset:Nn \um_define_prime_chars: {
\cs_set_eq:NN ' \um_scan_sup_prime:
\cs_set_eq:NN ^^^^2032 \um_scan_sup_prime:
@@ -2609,11 +2659,11 @@
\@ifpackageloaded { amsmath } { } {
\cs_set_nopar:Npn \r@@t ##1 ##2 {
\hbox_set:Nn \l_tmpa_box {
- \c_math_shift_token
+ \c_math_toggle_token
\m@th
##1
\sqrtsign { ##2 }
- \c_math_shift_token
+ \c_math_toggle_token
}
\um_mathstyle_scale:Nnn ##1 { \kern } {
\fontdimen 63 \l_um_font
@@ -2656,7 +2706,7 @@
\group_begin:
\cs_set:Npn \um_setup_active_superscript:nn #1#2 {
\prop_gput:Nxn \g_um_supers_prop {\meaning #1} {#2}
- \char_make_active:N #1
+ \char_set_catcode_active:N #1
\char_gmake_mathactive:N #1
\scantokens{
\cs_gset:Npn #1 {
@@ -2686,7 +2736,7 @@
\um_setup_active_superscript:nn {^^^^207f} {n}
\cs_set:Npn \um_setup_active_subscript:nn #1#2 {
\prop_gput:Nxn \g_um_subs_prop {\meaning #1} {#2}
- \char_make_active:N #1
+ \char_set_catcode_active:N #1
\char_gmake_mathactive:N #1
\scantokens{
\cs_gset:Npn #1 {
@@ -2764,7 +2814,7 @@
{\l_peek_false_tl}
}
\cs_new:Npn \um_define_active_frac:Nw #1 #2/#3 {
- \char_make_active:N #1
+ \char_set_catcode_active:N #1
\char_gmake_mathactive:N #1
\tl_rescan:nn {
\catcode`\_=11\relax
@@ -2817,6 +2867,7 @@
\def\lor{\vee}
\def\owns{\ni}
\def\gets{\leftarrow}
+\def\mathring{\ocirc}
\def\backepsilon{\upbackepsilon}
\def\eth{\matheth}
\def\smallint{{\textstyle\int}\limits}
@@ -2864,22 +2915,6 @@
}
}
\cs_generate_variant:Nn \um_check_and_fix_luatex:NNnnn { c }
-\luatex_if_engine:T {
- \AtBeginDocument{\um_patch_amsmath:}
- \cs_set:Nn \um_patch_amsmath: {
- \@ifpackageloaded { amsmath } { } {
- \um_check_and_fix:NNnnn \frac \cs_set_nopar:Npn { ##1 ##2 } {
- {
- \begingroup ##1 \endgroup \over ##2
- }
- } {
- {
- \luatexUstack { \group_begin: ##1 \group_end: \over ##2 }
- }
- }
- }
- }
-}
\AtEndOfPackageFile * {url} {
\tl_put_left:Nn \Url@FormatString { \um_switchto_mathup: }
\tl_put_right:Nn \UrlSpecials {
@@ -2890,79 +2925,61 @@
}
}
\AtEndOfPackageFile * {amsmath} {
- \tl_remove_in:Nn \@begindocumenthook {
- \mathchardef\std@minus\mathcode`\-\relax
- \mathchardef\std@equal\mathcode`\=\relax
+ \xetex_if_engine:T {
+ \tl_remove_in:Nn \@begindocumenthook {
+ \mathchardef\std@minus\mathcode`\-\relax
+ \mathchardef\std@equal\mathcode`\=\relax
+ }
+ \def\std@minus{\Umathcharnum\Umathcodenum`\-\relax}
+ \def\std@equal{\Umathcharnum\Umathcodenum`\=\relax}
}
- \def\std@minus{\Umathcharnum\Umathcodenum`\-\relax}
- \def\std@equal{\Umathcharnum\Umathcodenum`\=\relax}
\cs_set:Npn \@cdots {\mathinner{\cdots}}
\cs_set_eq:NN \dotsb@ \cdots
- \def \resetMathstrut@ {%
- \setbox\z@\hbox{$($}%)
- \ht\Mathstrutbox@\ht\z@ \dp\Mathstrutbox@\dp\z@
- }
- \um_check_and_fix:NNnnn \subarray \cs_set:Npn { #1 } {
- \vcenter
- \bgroup
- \Let@
- \restore@math@cr
- \default@tag
- \baselineskip \fontdimen 10~ \scriptfont \tw@
- \advance \baselineskip \fontdimen 12~ \scriptfont \tw@
- \lineskip \thr@@ \fontdimen 8~ \scriptfont \thr@@
- \lineskiplimit \lineskip
- \ialign
- \bgroup
- \ifx c #1 \hfil \fi
- $ \m@th \scriptstyle ## $
- \hfil
- \crcr
- } {
- \vcenter
- \c_group_begin_token
- \Let@
- \restore@math@cr
- \default@tag
- \skip_set:Nn \baselineskip {
- \um_stack_num_up:N \scriptstyle
- + \um_stack_denom_down:N \scriptstyle
- }
- \lineskip \um_stack_vgap:N \scriptstyle
- \lineskiplimit \lineskip
- \ialign
- \c_group_begin_token
- \token_if_eq_meaning:NNT c #1 { \hfil }
- \c_math_shift_token
- \m@th
- \scriptstyle
- \c_parameter_token \c_parameter_token
- \c_math_shift_token
- \hfil
- \crcr
- }
- \um_check_and_fix_luatex:cNnnn { frac~ } \cs_set:Npn { #1 #2 } {
- {
- \begingroup #1 \endgroup \@@over #2
- }
- } {
- {
- \luatexUstack { \group_begin: #1 \group_end: \@@over #2 }
+ \xetex_if_engine:T {
+ \def \resetMathstrut@ {%
+ \setbox\z@\hbox{$($}%)
+ \ht\Mathstrutbox@\ht\z@ \dp\Mathstrutbox@\dp\z@
}
}
- \um_check_and_fix_luatex:NNnnn \@genfrac \cs_set_nopar:Npn {
- #1 #2 #3 #4 #5
- } {
- {
- #1 { \begingroup #4 \endgroup #2 #3 \relax #5 }
- }
- } {
- {
- #1 {
- \luatexUstack {
- \group_begin: #4 \group_end: #2 #3 \scan_stop: #5
- }
+ \xetex_if_engine:T {
+ \um_check_and_fix:NNnnn \subarray \cs_set:Npn { #1 } {
+ \vcenter
+ \bgroup
+ \Let@
+ \restore@math@cr
+ \default@tag
+ \baselineskip \fontdimen 10~ \scriptfont \tw@
+ \advance \baselineskip \fontdimen 12~ \scriptfont \tw@
+ \lineskip \thr@@ \fontdimen 8~ \scriptfont \thr@@
+ \lineskiplimit \lineskip
+ \ialign
+ \bgroup
+ \ifx c #1 \hfil \fi
+ $ \m@th \scriptstyle ## $
+ \hfil
+ \crcr
+ } {
+ \vcenter
+ \c_group_begin_token
+ \Let@
+ \restore@math@cr
+ \default@tag
+ \skip_set:Nn \baselineskip {
+ \um_stack_num_up:N \scriptstyle
+ + \um_stack_denom_down:N \scriptstyle
}
+ \lineskip \um_stack_vgap:N \scriptstyle
+ \lineskiplimit \lineskip
+ \ialign
+ \c_group_begin_token
+ \token_if_eq_meaning:NNT c #1 { \hfil }
+ \c_math_toggle_token
+ \m@th
+ \scriptstyle
+ \c_parameter_token \c_parameter_token
+ \c_math_toggle_token
+ \hfil
+ \crcr
}
}
\um_check_and_fix_luatex:NNnnn \plainroot@ \cs_set_nopar:Npn { #1 \of #2 } {
@@ -2983,10 +3000,10 @@
\luatexUroot \l_um_radical_sqrt_tl { #1 } { #2 }
} {
\hbox_set:Nn \rootbox {
- \c_math_shift_token
+ \c_math_toggle_token
\m@th
\scriptscriptstyle { #1 }
- \c_math_shift_token
+ \c_math_toggle_token
}
\mathchoice
{ \r@@t \displaystyle { #2 } }
@@ -3010,21 +3027,21 @@
\boxz@
} {
\hbox_set:Nn \l_tmpa_box {
- \c_math_shift_token
+ \c_math_toggle_token
\m@th
#1
\mskip \uproot@ mu
- \c_math_shift_token
+ \c_math_toggle_token
}
\luatexUroot \l_um_radical_sqrt_tl {
\box_move_up:nn { \box_wd:N \l_tmpa_box } {
\hbox:n {
- \c_math_shift_token
+ \c_math_toggle_token
\m@th
\mkern -\leftroot@ mu
\box_use:N \rootbox
\mkern \leftroot@ mu
- \c_math_shift_token
+ \c_math_toggle_token
}
}
} {
@@ -3032,18 +3049,18 @@
}
} {
\hbox_set:Nn \l_tmpa_box {
- \c_math_shift_token
+ \c_math_toggle_token
\m@th
#1
\sqrtsign { #2 }
- \c_math_shift_token
+ \c_math_toggle_token
}
\hbox_set:Nn \l_tmpb_box {
- \c_math_shift_token
+ \c_math_toggle_token
\m@th
#1
\mskip \uproot@ mu
- \c_math_shift_token
+ \c_math_toggle_token
}
\mkern -\leftroot@ mu
\um_mathstyle_scale:Nnn #1 { \kern } {
@@ -3119,52 +3136,52 @@
\mode_if_math:TF {\mathslash} {\um_text_slash:}
}
\AtEndOfPackageFile * { mathtools } {
- \um_check_and_fix:NNnnnn \MT_cramped_internal:Nn \cs_set_nopar:Npn { #1 #2 } {
- \sbox \z@ {
- $
- \m@th
- #1
- \nulldelimiterspace = \z@
- \radical \z@ { #2 }
- $
- }
- \ifx #1 \displaystyle
- \dimen@ = \fontdimen 8 \textfont 3
- \advance \dimen@ .25 \fontdimen 5 \textfont 2
- \else
- \dimen@ = 1.25 \fontdimen 8
- \ifx #1 \textstyle
- \textfont
+ \xetex_if_engine:T {
+ \um_check_and_fix:NNnnn \MT_cramped_internal:Nn \cs_set_nopar:Npn { #1 #2 } {
+ \sbox \z@ {
+ $
+ \m@th
+ #1
+ \nulldelimiterspace = \z@
+ \radical \z@ { #2 }
+ $
+ }
+ \ifx #1 \displaystyle
+ \dimen@ = \fontdimen 8 \textfont 3
+ \advance \dimen@ .25 \fontdimen 5 \textfont 2
\else
- \ifx #1 \scriptstyle
- \scriptfont
+ \dimen@ = 1.25 \fontdimen 8
+ \ifx #1 \textstyle
+ \textfont
\else
- \scriptscriptfont
+ \ifx #1 \scriptstyle
+ \scriptfont
+ \else
+ \scriptscriptfont
+ \fi
\fi
+ 3
\fi
- 3
- \fi
- \advance \dimen@ -\ht\z@
- \ht\z@ = -\dimen@
- \box\z@
- } {
- \use:c { luatexcramped \cs_to_str:N #1 } #2
- } {
- \hbox_set:Nn \l_tmpa_box {
- \color@setgroup
- \c_math_shift_token
- \m@th
- #1
- \dim_zero:N \nulldelimiterspace
- \radical \c_zero { #2 }
- \c_math_shift_token
- \color@endgroup
- }
- \box_set_ht:Nn \l_tmpa_box {
- \box_ht:N \l_tmpa_box
- - \um_radical_vgap:N #1
+ \advance \dimen@ -\ht\z@
+ \ht\z@ = -\dimen@
+ \box\z@
+ } {
+ \hbox_set:Nn \l_tmpa_box {
+ \color@setgroup
+ \c_math_toggle_token
+ \m@th
+ #1
+ \dim_zero:N \nulldelimiterspace
+ \radical \c_zero { #2 }
+ \c_math_toggle_token
+ \color@endgroup
+ }
+ \box_set_ht:Nn \l_tmpa_box {
+ \box_ht:N \l_tmpa_box
+ - \um_radical_vgap:N #1
+ }
+ \box_use_clear:N \l_tmpa_box
}
- \box_use_clear:N \l_tmpa_box
}
\msg_warning:nn { unicode-math } { mathtools }
\NewDocumentCommand \dblcolon { } { \Colon }