summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-11-18 21:45:46 +0000
committerKarl Berry <karl@freefriends.org>2017-11-18 21:45:46 +0000
commit9746eec6f52784c17ea0fdd0c1d47e8deb9ca0f8 (patch)
tree093bb019d314b4b6e27f3f9dca5f69308ac68fb8 /Master/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty
parentff1a4fd0b6a85c7280ae498ad531d5397bedea87 (diff)
unicode-math (18nov17)
git-svn-id: svn://tug.org/texlive/trunk@45845 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty')
-rw-r--r--Master/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty834
1 files changed, 412 insertions, 422 deletions
diff --git a/Master/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty b/Master/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty
index 84c3c217745..97ac7035626 100644
--- a/Master/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty
+++ b/Master/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty
@@ -5,39 +5,140 @@
%% The original source files were:
%%
%% unicode-math.dtx (with options: `package,XE')
-%% unicode-math-preamble.dtx (with options: `package,XE')
-%% unicode-math-pkgopt.dtx (with options: `package,XE')
-%% unicode-math-msg.dtx (with options: `package,XE')
-%% unicode-math-usv.dtx (with options: `package,XE')
-%% unicode-math-setchar.dtx (with options: `package,XE')
-%% unicode-math-mathtext.dtx (with options: `package,XE')
-%% unicode-math-main.dtx (with options: `package,XE')
-%% unicode-math-fontopt.dtx (with options: `package,XE')
-%% unicode-math-fontparam.dtx (with options: `package,XE')
-%% unicode-math-mathmap.dtx (with options: `package,XE')
-%% unicode-math-mathtext.dtx (with options: `package,XE')
-%% unicode-math-epilogue.dtx (with options: `package,XE')
-%% unicode-math-primes.dtx (with options: `package,XE')
-%% unicode-math-sscript.dtx (with options: `package,XE')
-%% unicode-math-compat.dtx (with options: `package,XE')
-%% unicode-math-alphabets.dtx (with options: `package,XE')
-%%
-%% Copyright 2006-2017 Will Robertson <will.robertson@latex-project.org>
-%% Copyright 2010-2013 Philipp Stephani <st_philipp@yahoo.de>
-%% Copyright 2012-2015 Khaled Hosny <khaledhosny@eglug.org>
-%%
+%% um-code-base.dtx (with options: `package,XE')
+%% um-code-opening.dtx (with options: `package,XE')
+%% um-code-variables.dtx (with options: `package,XE')
+%% um-code-api.dtx (with options: `package,XE')
+%% um-code-ui.dtx (with options: `package,XE')
+%% um-code-pkgopt.dtx (with options: `package,XE')
+%% um-code-msg.dtx (with options: `package,XE')
+%% um-code-usv.dtx (with options: `package,XE')
+%% um-code-setchar.dtx (with options: `package,XE')
+%% um-code-mathtext.dtx (with options: `package,XE')
+%% um-code-main.dtx (with options: `package,XE')
+%% um-code-fontopt.dtx (with options: `package,XE')
+%% um-code-fontparam.dtx (with options: `package,XE')
+%% um-code-mathmap.dtx (with options: `package,XE')
+%% um-code-epilogue.dtx (with options: `package,XE')
+%% um-code-primes.dtx (with options: `package,XE')
+%% um-code-sscript.dtx (with options: `package,XE')
+%% um-code-compat.dtx (with options: `package,XE')
+%% um-code-alphabets.dtx (with options: `package,XE')
+%% ------------------------------------------------
+%% The UNICODE-MATH package <wspr.io/unicode-math>
+%% ------------------------------------------------
%% This package is free software and may be redistributed and/or modified under
%% the conditions of the LaTeX Project Public License, version 1.3c or higher
%% (your choice): <http://www.latex-project.org/lppl/>.
-%%
-%% This work is "maintained" by Will Robertson.
+%% ------------------------------------------------
+%% Copyright 2006-2017 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 <wspr.io/unicode-math>
+
\ProvidesPackage{unicode-math-xetex}
- [2017/10/09 v0.8h Unicode maths in XeLaTeX and LuaLaTeX]
+ [2017/11/18 v0.8i Unicode maths in XeLaTeX and LuaLaTeX]
+
+%%^^A%% um-code-base.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+
+
+%%^^A%% um-code-opening.dtx -- part of UNICODE-MATH <wspr.io/unicode-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 \fontspec_set_fontface:NNnn {NNx}
+\prg_new_conditional:Nnn \__um_glyph_if_exist:Nn {p,TF,T,F}
+ {
+ \etex_iffontchar:D #1 #2 \scan_stop:
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\cs_set:Npn \__um_set_mathcode:nnnn #1#2#3#4
+ {
+ \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 \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 \int_eval:n {#4} \scan_stop:
+ }
+\cs_generate_variant:Nn \__um_set_mathchar:NNnn {c}
+\cs_new:Nn \__um_set_delcode:nnn
+ {
+ \Udelcode#2 = \csname sym#1\endcsname #3 \scan_stop:
+ }
+\cs_new:Nn \__um_radical:nn
+ {
+ \Uradical \csname sym#1\endcsname #2 \scan_stop:
+ }
+\cs_new:Nn \__um_delimiter:Nnn
+ {
+ \Udelimiter \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop:
+ }
+\cs_new:Nn \__um_accent:nnn
+ {
+ \Umathaccent #1~ \mathchar@type\mathaccent \use:c { sym #2 } #3 \scan_stop:
+ }
+\cs_new:Nn \__um_char_gmake_mathactive:N
+ {
+ \global\mathcode `#1 = "8000 \scan_stop:
+ }
+\cs_new:Nn \__um_char_gmake_mathactive:n
+ {
+ \global\mathcode #1 = "8000 \scan_stop:
+ }
+\cs_new:Nn \__um_copy_fontparam:nnn
+ {
+ \fontdimen #1 \font = \__um_get_fontparam:nn {#2} {#3}
+ }
+\cs_new:Nn \__um_zero_fontparam:n
+ {
+ \fontdimen #1 \font = 0pt\relax
+ }
+\cs_new:Nn \__um_get_fontparam:nn
+ {
+ \the\fontdimen#1\l__um_font\relax
+ }
+\cs_new:Nn \usv_set:nnn { \tl_const:cn { c__um_#1_#2_usv } {#3} }
+\cs_new:Nn \__um_to_usv:nn { \use:c { c__um_#1_#2_usv } }
+\prg_new_conditional:Nnn \__um_usv_if_exist:nn {T,F,TF}
+ {
+ \cs_if_exist:cTF { c__um_#1_#2_usv }
+ \prg_return_true: \prg_return_false:
+ }
+\tl_map_inline:nn
+ {
+ \new@mathgroup\cdp@list\cdp@elt\DeclareMathSizes
+ \@DeclareMathSizes\newmathalphabet\newmathalphabet__um\newmathalphabet__um@
+ \DeclareMathVersion\define@mathalphabet\define@mathgroup\addtoversion
+ \version@list\version@elt\alpha@list\alpha@elt
+ \restore@mathversion\init@restore@version\dorestore@version\process@table
+ \new@mathversion\DeclareSymbolFont\group@list\group@elt
+ \new@symbolfont\SetSymbolFont\SetSymbolFont@\get@cdp
+ \DeclareMathAlphabet\new@mathalphabet\SetMathAlphabet\SetMathAlphabet@
+ \DeclareMathAccent\set@mathaccent\DeclareMathSymbol\set@mathchar
+ \set@mathsymbol\DeclareMathDelimiter\@xxDeclareMathDelimiter
+ \@DeclareMathDelimiter\@xDeclareMathDelimiter\set@mathdelimiter
+ \set__ummathdelimiter\DeclareMathRadical\mathchar@type
+ \DeclareSymbolFontAlphabet\DeclareSymbolFontAlphabet@
+ }
+ {
+ \tl_remove_once:Nn \@preamblecmds {\do#1}
+ }
+
+%%^^A%% um-code-variables.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+
\bool_new:N \l__um_ot_math_bool
\bool_new:N \l__um_init_bool
\bool_new:N \l__um_implicit_alph_bool
@@ -115,79 +216,42 @@
\tl_new:N \g__um_family_tl
\tl_new:N \g__um_style_tl
\tl_new:N \g__um_remap_style_tl
-\prg_new_conditional:Nnn \__um_glyph_if_exist:n {p,TF,T,F}
- {
- \etex_iffontchar:D \l__um_font #1 \scan_stop:
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_set:Npn \__um_set_mathcode:nnnn #1#2#3#4 {
- \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 \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 \int_eval:n {#4} \scan_stop:
-}
-\cs_new:Nn \__um_set_delcode:nnn {
- \Udelcode#2 = \csname sym#1\endcsname #3 \scan_stop:
-}
-\cs_new:Nn \__um_radical:nn {
- \Uradical \csname sym#1\endcsname #2 \scan_stop:
-}
-\cs_new:Nn \__um_delimiter:Nnn {
- \Udelimiter \mathchar@type#1 \csname sym#2\endcsname #3 \scan_stop:
-}
-\cs_new:Nn \__um_accent:nnn {
- \Umathaccent #1~ \mathchar@type\mathaccent \use:c { sym #2 } #3 \scan_stop:
-}
-\cs_generate_variant:Nn \__um_set_mathchar:NNnn {c}
-\cs_new:Nn \__um_char_gmake_mathactive:N
- {
- \global\mathcode `#1 = "8000 \scan_stop:
- }
-\cs_new:Nn \__um_char_gmake_mathactive:n
- {
- \global\mathcode #1 = "8000 \scan_stop:
- }
-\cs_new:Nn \usv_set:nnn { \tl_const:cn { c__um_#1_#2_usv } {#3} }
-\cs_new:Nn \__um_to_usv:nn { \use:c { c__um_#1_#2_usv } }
-\prg_new_conditional:Nnn \__um_usv_if_exist:nn {T,F,TF}
- {
- \cs_if_exist:cTF { c__um_#1_#2_usv }
- \prg_return_true: \prg_return_false:
- }
+
+%%^^A%% um-code-api.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+
\cs_new:Nn \unimath_get_mathstyle:
{
\tl_use:N \l__um_mathstyle_tl
}
-\tl_map_inline:nn
- {
- \new@mathgroup\cdp@list\cdp@elt\DeclareMathSizes
- \@DeclareMathSizes\newmathalphabet\newmathalphabet__um\newmathalphabet__um@
- \DeclareMathVersion\define@mathalphabet\define@mathgroup\addtoversion
- \version@list\version@elt\alpha@list\alpha@elt
- \restore@mathversion\init@restore@version\dorestore@version\process@table
- \new@mathversion\DeclareSymbolFont\group@list\group@elt
- \new@symbolfont\SetSymbolFont\SetSymbolFont@\get@cdp
- \DeclareMathAlphabet\new@mathalphabet\SetMathAlphabet\SetMathAlphabet@
- \DeclareMathAccent\set@mathaccent\DeclareMathSymbol\set@mathchar
- \set@mathsymbol\DeclareMathDelimiter\@xxDeclareMathDelimiter
- \@DeclareMathDelimiter\@xDeclareMathDelimiter\set@mathdelimiter
- \set__ummathdelimiter\DeclareMathRadical\mathchar@type
- \DeclareSymbolFontAlphabet\DeclareSymbolFontAlphabet@
- }
- {
- \tl_remove_once:Nn \@preamblecmds {\do#1}
- }
-\DeclareDocumentCommand \unimathsetup {m} { \keys_set:nn {unicode-math} {#1} }
+%%^^A%% um-code-ui.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+
+\NewDocumentCommand \unimathsetup {m} { \keys_set:nn {unicode-math} {#1} }
+\NewDocumentCommand \setmathfont { O{} m O{} }
+ {
+ \__um_setmathfont:nn {#1,#3} {#2}
+ }
+\NewDocumentCommand \setmathfontface { m O{} m O{} }
+ {
+ \__um_setmathfontface:Nnn #1 {#2,#4} {#3}
+ }
+\@onlypreamble \setmathfontface
+\NewDocumentCommand \setoperatorfont {m}
+ {
+ \tl_set:Nn \g__um_operator_mathfont_tl {#1}
+ }
+\setoperatorfont{\mathrm}
+\NewDocumentCommand \addnolimits {m}
+ {
+ \tl_put_right:Nn \l__um_nolimits_tl {#1}
+ }
+\NewDocumentCommand \removenolimits {m}
+ {
+ \tl_remove_all:Nn \l__um_nolimits_tl {#1}
+ }
+
+%%^^A%% um-code-pkgopt.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+
\cs_new:Nn \__um_keys_choices:nn
{
\cs_set:Npn \__um_keys_choices_fn:nn { \__um_keys_choices_aux:nnn {#1} }
@@ -407,6 +471,8 @@
\cs_if_exist:NT \tfrac { \unimathsetup {active-frac=small} }
\ProcessKeysOptions {unicode-math}
+%%^^A%% um-code-msg.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+
\cs_new:Npn \__um_error:n { \msg_error:nn {unicode-math} }
\cs_new:Npn \__um_warning:n { \msg_warning:nn {unicode-math} }
\cs_new:Npn \__um_warning:nnn { \msg_warning:nnxx {unicode-math} }
@@ -499,6 +565,8 @@
any~ effect~ on~ the~ re-defined~ commands.
}
+%%^^A%% um-code-usv.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+
\usv_set:nnn {normal} {num} {48}
\usv_set:nnn {normal} {Latin}{"1D434}
\usv_set:nnn {normal} {latin}{"1D44E}
@@ -745,6 +813,8 @@
\usv_set:nnn {frak}{R}{"211C}
\usv_set:nnn {frak}{Z}{"2128}
+%%^^A%% um-code-setchar.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+
\cs_new:Npn \__um_symbol_setup:
{
\cs_set:Npn \UnicodeMathSymbol ##1##2##3##4
@@ -872,16 +942,19 @@
}
}
+%%^^A%% um-code-mathtext.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+
\keys_define:nn {__um_mathface}
{
version .code:n =
{ \tl_set:Nn \l__um_mversion_tl {#1} }
}
-\DeclareDocumentCommand \setmathfontface { m O{} m O{} }
+\cs_set:Nn \__um_setmathfontface:Nnn
{
\tl_clear:N \l__um_mversion_tl
- \keys_set_known:nnN {__um_mathface} {#2,#4} \l__um_keyval_clist
+ \keys_set_known:nnN {__um_mathface} {#2} \l__um_keyval_clist
+
\exp_args:Nnx \fontspec_set_family:Nxn \l__um_tmpa_tl
{ ItalicFont={}, BoldFont={}, \exp_not:V \l__um_keyval_clist } {#3}
@@ -890,6 +963,7 @@
\tl_set:Nn \l__um_mversion_tl {normal}
\DeclareMathAlphabet #1 {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault}
}
+
\SetMathAlphabet #1 {\l__um_mversion_tl} {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault}
% integrate with fontspec's \setmathrm etc:
@@ -900,10 +974,6 @@
\mathtt { \cs_set_eq:NN \g__fontspec_mathtt_tl \l__um_tmpa_tl }
}
}
-\@onlypreamble \setmathfontface
-\DeclareDocumentCommand \setoperatorfont {m}
- { \tl_set:Nn \g__um_operator_mathfont_tl {#1} }
-\setoperatorfont{\mathrm}
\cs_generate_variant:Nn \tl_if_eq:nnT {o}
\cs_set:Nn \__fontspec_setmainfont_hook:nn
{
@@ -958,49 +1028,48 @@
\SetMathAlphabet\mathtt{bold} \g_fontspec_encoding_tl\g__fontspec_mathtt_tl\bfdefault\updefault
}
-\DeclareDocumentCommand \setmathfont { O{} m O{} }
- {
- \__um_setmathfont:nn {#1,#3} {#2}
- }
+%%^^A%% um-code-main.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+
\cs_set:Nn \__um_setmathfont:nn
- {
- \tl_set:Nn \l__um_fontname_tl {#2}
- \__um_init:
- \cs_if_exist:cF { S@ \f@size } { \calculate@math@sizes }
- \csname S@\f@size\endcsname
- \keys_set_known:nnN {unicode-math} {#1} \l__um_unknown_keys_clist
- \bool_if:NT \l__um_init_bool { \__um_log:n {default-math-font} }
- \__um_fontspec_select_font:
- \bool_if:nT { \l__um_ot_math_bool && !\g__um_mainfont_already_set_bool }
- {
- \__um_declare_math_sizes:
+ {
+ \tl_set:Nn \l__um_fontname_tl {#2}
+ \cs_set_eq:NN \glb@currsize \scan_stop:
+ \__um_init:
+ \cs_if_exist:cF { S@ \f@size } { \calculate@math@sizes }
+ \csname S@\f@size\endcsname
+ \keys_set_known:nnN {unicode-math} {#1} \l__um_unknown_keys_clist
+ \bool_if:NT \l__um_init_bool { \__um_log:n {default-math-font} }
\__um_fontspec_select_font:
- }
- \cs_if_exist:cF { sym \__um_symfont_tl }
- {
- \DeclareSymbolFont{\__um_symfont_tl}
- {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault}
- }
- \SetSymbolFont{\__um_symfont_tl}{\l__um_mversion_tl}
- {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault}
- \str_if_eq_x:nnT {\l__um_mversion_tl} {normal}
- {
- \SetSymbolFont{\__um_symfont_tl}{bold}
- {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault}
- }
- \bool_if:nT { \l__um_ot_math_bool && !\g__um_mainfont_already_set_bool }
- {
- \bool_set_true:N \g__um_mainfont_already_set_bool
- \__um_setup_legacy_fam_two:
- \__um_setup_legacy_fam_three:
- }
- \__um_input_math_symbol_table:
- \__um_remap_symbols:
- \__um_setup_mathactives:
- \__um_setup_delcodes:
- \__um_setup_alphabets:
- \__um_setup_negations:
- }
+ \bool_if:nT { \l__um_ot_math_bool && !\g__um_mainfont_already_set_bool }
+ {
+ \__um_declare_math_sizes:
+ \__um_fontspec_select_font:
+ }
+ \cs_if_exist:cF { sym \l__um_symfont_label_tl }
+ {
+ \DeclareSymbolFont{\l__um_symfont_label_tl}
+ {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault}
+ }
+ \SetSymbolFont{\l__um_symfont_label_tl}{\l__um_mversion_tl}
+ {\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault}
+ \str_if_eq_x:nnT {\l__um_mversion_tl} {normal}
+ {
+ \SetSymbolFont{\l__um_symfont_label_tl}{bold}
+ {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault}
+ }
+ \bool_if:nT { \l__um_ot_math_bool && !\g__um_mainfont_already_set_bool }
+ {
+ \bool_set_true:N \g__um_mainfont_already_set_bool
+ \__um_setup_legacy_fam_two:
+ \__um_setup_legacy_fam_three:
+ }
+ \__um_input_math_symbol_table:
+ \__um_remap_symbols:
+ \__um_setup_mathactives:
+ \__um_setup_delcodes:
+ \__um_setup_alphabets:
+ \__um_setup_negations:
+ }
\AtBeginDocument { \__um_load_lm_if_necessary: }
\cs_new:Nn \__um_load_lm_if_necessary:
{
@@ -1012,28 +1081,27 @@
}
}
\cs_new:Nn \__um_init:
- {
- \bool_set_true:N \l__um_ot_math_bool
- \cs_set_eq:NN \glb@currsize \scan_stop:
- \bool_set_true:N \l__um_init_bool
- \seq_clear:N \l__um_char_range_seq
- \clist_clear:N \l__um_char_nrange_clist
- \seq_clear:N \l__um_mathalph_seq
- \seq_clear:N \l__um_missing_alph_seq
- \tl_set:Nn \l__um_mversion_tl {normal}
- \tl_set:Nn \__um_symfont_tl {operators}
- \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
- \cs_set_eq:NN \__um_remap_symbol:nnn \__um_remap_symbol_noparse:nnn
- \cs_set_eq:NN \__um_maybe_init_alphabet:n \__um_init_alphabet:n
- \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_noparse:nn
- \cs_set_eq:NN \__um_assign_delcode:nn \__um_assign_delcode_noparse:nn
- \cs_set_eq:NN \__um_make_mathactive:nNN \__um_make_mathactive_noparse:nNN
- \tl_set:Nn \l__um_script_features_tl {Style=MathScript}
- \tl_set:Nn \l__um_sscript_features_tl {Style=MathScriptScript}
- \tl_set_eq:NN \l__um_script_font_tl \l__um_fontname_tl
- \tl_set_eq:NN \l__um_sscript_font_tl \l__um_fontname_tl
- }
+ {
+ \bool_set_true:N \l__um_ot_math_bool
+ \tl_set:Nn \l__um_mversion_tl {normal}
+ \tl_set:Nn \l__um_symfont_label_tl {operators}
+ \tl_set:Nn \l__um_script_features_tl {Style=MathScript}
+ \tl_set:Nn \l__um_sscript_features_tl {Style=MathScriptScript}
+ \tl_set_eq:NN \l__um_script_font_tl \l__um_fontname_tl
+ \tl_set_eq:NN \l__um_sscript_font_tl \l__um_fontname_tl
+ \bool_set_true:N \l__um_init_bool
+ \seq_clear:N \l__um_char_range_seq
+ \clist_clear:N \l__um_char_nrange_clist
+ \seq_clear:N \l__um_mathalph_seq
+ \seq_clear:N \l__um_missing_alph_seq
+ \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
+ \cs_set_eq:NN \__um_remap_symbol:nnn \__um_remap_symbol_noparse:nnn
+ \cs_set_eq:NN \__um_maybe_init_alphabet:n \__um_init_alphabet:n
+ \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_noparse:nn
+ \cs_set_eq:NN \__um_assign_delcode:nn \__um_assign_delcode_noparse:nn
+ \cs_set_eq:NN \__um_make_mathactive:nNN \__um_make_mathactive_noparse:nNN
+ }
\cs_new:Nn \__um_declare_math_sizes:
{
\dim_compare:nF { \fontdimen 10 \l__um_font == 0pt }
@@ -1047,26 +1115,26 @@
{
\fontspec_set_family:Nxn \l__um_family_tl
{
- \l__um_font_keyval_tl,
- Scale=1.00001,
- FontAdjustment =
- {
- \fontdimen8\font= \__um_get_fontparam:nn {43} {FractionNumeratorDisplayStyleShiftUp}\relax
- \fontdimen9\font= \__um_get_fontparam:nn {42} {FractionNumeratorShiftUp}\relax
- \fontdimen10\font=\__um_get_fontparam:nn {32} {StackTopShiftUp}\relax
- \fontdimen11\font=\__um_get_fontparam:nn {45} {FractionDenominatorDisplayStyleShiftDown}\relax
- \fontdimen12\font=\__um_get_fontparam:nn {44} {FractionDenominatorShiftDown}\relax
- \fontdimen13\font=\__um_get_fontparam:nn {21} {SuperscriptShiftUp}\relax
- \fontdimen14\font=\__um_get_fontparam:nn {21} {SuperscriptShiftUp}\relax
- \fontdimen15\font=\__um_get_fontparam:nn {22} {SuperscriptShiftUpCramped}\relax
- \fontdimen16\font=\__um_get_fontparam:nn {18} {SubscriptShiftDown}\relax
- \fontdimen17\font=\__um_get_fontparam:nn {18} {SubscriptShiftDownWithSuperscript}\relax
- \fontdimen18\font=\__um_get_fontparam:nn {24} {SuperscriptBaselineDropMax}\relax
- \fontdimen19\font=\__um_get_fontparam:nn {20} {SubscriptBaselineDropMin}\relax
- \fontdimen20\font=0pt\relax % delim1 = FractionDelimiterDisplaySize
- \fontdimen21\font=0pt\relax % delim2 = FractionDelimiterSize
- \fontdimen22\font=\__um_get_fontparam:nn {15} {AxisHeight}\relax
- }
+ \l__um_font_keyval_tl,
+ Scale=1.00001,
+ FontAdjustment =
+ {
+ \__um_copy_fontparam:nnn { 8} {43} {FractionNumeratorDisplayStyleShiftUp}\relax
+ \__um_copy_fontparam:nnn { 9} {42} {FractionNumeratorShiftUp}\relax
+ \__um_copy_fontparam:nnn {10} {32} {StackTopShiftUp}\relax
+ \__um_copy_fontparam:nnn {11} {45} {FractionDenominatorDisplayStyleShiftDown}\relax
+ \__um_copy_fontparam:nnn {12} {44} {FractionDenominatorShiftDown}\relax
+ \__um_copy_fontparam:nnn {13} {21} {SuperscriptShiftUp}\relax
+ \__um_copy_fontparam:nnn {14} {21} {SuperscriptShiftUp}\relax
+ \__um_copy_fontparam:nnn {15} {22} {SuperscriptShiftUpCramped}\relax
+ \__um_copy_fontparam:nnn {16} {18} {SubscriptShiftDown}\relax
+ \__um_copy_fontparam:nnn {17} {18} {SubscriptShiftDownWithSuperscript}\relax
+ \__um_copy_fontparam:nnn {18} {24} {SuperscriptBaselineDropMax}\relax
+ \__um_copy_fontparam:nnn {19} {20} {SubscriptBaselineDropMin}\relax
+ \__um_zero_fontparam:n {20} % delim1 = FractionDelimiterDisplaySize
+ \__um_zero_fontparam:n {21} % delim2 = FractionDelimiterSize
+ \__um_copy_fontparam:nnn {22} {15} {AxisHeight}\relax
+ }
} {\l__um_fontname_tl}
\SetSymbolFont{symbols}{\l__um_mversion_tl}
@@ -1074,111 +1142,108 @@
\str_if_eq_x:nnT {\l__um_mversion_tl} {normal}
{
- \SetSymbolFont{symbols}{bold}
- {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault}
+ \SetSymbolFont{symbols}{bold}
+ {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault}
}
}
\cs_new:Nn \__um_setup_legacy_fam_three:
{
\fontspec_set_family:Nxn \l__um_family_tl
{
- \l__um_font_keyval_tl,
- Scale=0.99999,
- FontAdjustment={
- \fontdimen8\font= \__um_get_fontparam:nn {48} {FractionRuleThickness}\relax
- \fontdimen9\font= \__um_get_fontparam:nn {28} {UpperLimitGapMin}\relax
- \fontdimen10\font=\__um_get_fontparam:nn {30} {LowerLimitGapMin}\relax
- \fontdimen11\font=\__um_get_fontparam:nn {29} {UpperLimitBaselineRiseMin}\relax
- \fontdimen12\font=\__um_get_fontparam:nn {31} {LowerLimitBaselineDropMin}\relax
- \fontdimen13\font=0pt\relax
- }
- } {\l__um_fontname_tl}
+ \l__um_font_keyval_tl,
+ Scale=0.99999,
+ FontAdjustment = {
+ \__um_copy_fontparam:nnn { 8} {48} {FractionRuleThickness}\relax
+ \__um_copy_fontparam:nnn { 9} {28} {UpperLimitGapMin}\relax
+ \__um_copy_fontparam:nnn {10} {30} {LowerLimitGapMin}\relax
+ \__um_copy_fontparam:nnn {11} {29} {UpperLimitBaselineRiseMin}\relax
+ \__um_copy_fontparam:nnn {12} {31} {LowerLimitBaselineDropMin}\relax
+ \__um_zero_fontparam:n {13}
+ }
+ } {\l__um_fontname_tl}
\SetSymbolFont{largesymbols}{\l__um_mversion_tl}
{\encodingdefault}{\l__um_family_tl}{\mddefault}{\updefault}
\str_if_eq_x:nnT {\l__um_mversion_tl} {normal}
{
- \SetSymbolFont{largesymbols}{bold}
- {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault}
+ \SetSymbolFont{largesymbols}{bold}
+ {\encodingdefault}{\l__um_family_tl}{\bfdefault}{\updefault}
}
}
-\cs_new:Nn \__um_get_fontparam:nn
- {
- \the\fontdimen#1\l__um_font\relax
- }
\cs_new:Nn \__um_fontspec_select_font:
- {
- \tl_set:Nx \l__um_font_keyval_tl {
- BoldItalicFont = {}, ItalicFont = {},
- Script = Math,
- SizeFeatures =
- {
- {
- Size = \tf@size-
- } ,
- {
- Size = \sf@size-\tf@size ,
- Font = \l__um_script_font_tl ,
- \l__um_script_features_tl
- } ,
- {
- Size = -\sf@size ,
- Font = \l__um_sscript_font_tl ,
- \l__um_sscript_features_tl
- }
- } ,
- \l__um_unknown_keys_clist
- }
+ {
+ \tl_set:Nx \l__um_font_keyval_tl {
+ BoldItalicFont = {}, ItalicFont = {},
+ Script = Math,
+ SizeFeatures =
+ {
+ {
+ Size = \tf@size-
+ } ,
+ {
+ Size = \sf@size-\tf@size ,
+ Font = \l__um_script_font_tl ,
+ \l__um_script_features_tl
+ } ,
+ {
+ Size = -\sf@size ,
+ Font = \l__um_sscript_font_tl ,
+ \l__um_sscript_features_tl
+ }
+ } ,
+ \l__um_unknown_keys_clist
+ }
+
\fontspec_set_fontface:NNxn \l__um_font \l__um_family_tl
{\l__um_font_keyval_tl} {\l__um_fontname_tl}
- \group_begin:
- \fontfamily{\l__um_family_tl}\selectfont
- \fontspec_if_script:nF {math} {\bool_gset_false:N \l__um_ot_math_bool}
- \group_end:
- }
+ \group_begin:
+ \fontfamily{\l__um_family_tl}\selectfont
+ \fontspec_if_script:nF {math} {\bool_gset_false:N \l__um_ot_math_bool}
+ \group_end:
+ }
\cs_set:Nn \__um_process_symbol_noparse:nnn
- {
- \__um_set_mathsymbol:nNNn {\__um_symfont_tl} #2 #3 {#1}
- }
+ {
+ \__um_set_mathsymbol:nNNn {\l__um_symfont_label_tl} #2 #3 {#1}
+ }
\cs_set:Nn \__um_process_symbol_parse:nnn
- {
- \__um_if_char_spec:nNNT {#1} {#2} {#3}
- {
- \__um_process_symbol_noparse:nnn {#1} {#2} {#3}
- }
- }
+ {
+ \__um_if_char_spec:nNNT {#1} {#2} {#3}
+ {
+ \__um_process_symbol_noparse:nnn {#1} {#2} {#3}
+ }
+ }
\cs_new:Npn \__um_remap_symbols:
- {
- \__um_remap_symbol:nnn{`\-}{\mathbin}{"02212}% hyphen to minus
- \__um_remap_symbol:nnn{`\*}{\mathbin}{"02217}% text asterisk to "centred asterisk"
- \bool_if:NF \g__um_literal_colon_bool
- {
- \__um_remap_symbol:nnn{`\:}{\mathrel}{"02236}% colon to ratio (i.e., punct to rel)
- }
- }
+ {
+ \__um_remap_symbol:nnn{`\-}{\mathbin}{"02212}% hyphen to minus
+ \__um_remap_symbol:nnn{`\*}{\mathbin}{"02217}% text asterisk to "centred asterisk"
+ \bool_if:NF \g__um_literal_colon_bool
+ {
+ \__um_remap_symbol:nnn{`\:}{\mathrel}{"02236}% colon to ratio (i.e., punct to rel)
+ }
+ }
\cs_new:Nn \__um_remap_symbol_parse:nnn
- {
- \__um_if_char_spec:nNNT {#3} {\@nil} {#2}
- { \__um_remap_symbol_noparse:nnn {#1} {#2} {#3} }
- }
+ {
+ \__um_if_char_spec:nNNT {#3} {\@nil} {#2}
+ { \__um_remap_symbol_noparse:nnn {#1} {#2} {#3} }
+ }
\cs_new:Nn \__um_remap_symbol_noparse:nnn
- {
- \clist_map_inline:nn {#1}
- { \__um_set_mathcode:nnnn {##1} {#2} {\__um_symfont_tl} {#3} }
- }
+ {
+ \clist_map_inline:nn {#1}
+ { \__um_set_mathcode:nnnn {##1} {#2} {\l__um_symfont_label_tl} {#3} }
+ }
\cs_new:Npn \__um_setup_mathactives:
- {
- \__um_make_mathactive:nNN {"2032} \__um_prime_single_mchar \mathord
- \__um_make_mathactive:nNN {"2033} \__um_prime_double_mchar \mathord
- \__um_make_mathactive:nNN {"2034} \__um_prime_triple_mchar \mathord
- \__um_make_mathactive:nNN {"2057} \__um_prime_quad_mchar \mathord
- \__um_make_mathactive:nNN {"2035} \__um_backprime_single_mchar \mathord
- \__um_make_mathactive:nNN {"2036} \__um_backprime_double_mchar \mathord
- \__um_make_mathactive:nNN {"2037} \__um_backprime_triple_mchar \mathord
- \__um_make_mathactive:nNN {`\'} \mathstraightquote \mathord
- \__um_make_mathactive:nNN {`\`} \mathbacktick \mathord
- }
+ {
+ \__um_make_mathactive:nNN {"2032} \__um_prime_single_mchar \mathord
+ \__um_make_mathactive:nNN {"2033} \__um_prime_double_mchar \mathord
+ \__um_make_mathactive:nNN {"2034} \__um_prime_triple_mchar \mathord
+ \__um_make_mathactive:nNN {"2057} \__um_prime_quad_mchar \mathord
+ \__um_make_mathactive:nNN {"2035} \__um_backprime_single_mchar \mathord
+ \__um_make_mathactive:nNN {"2036} \__um_backprime_double_mchar \mathord
+ \__um_make_mathactive:nNN {"2037} \__um_backprime_triple_mchar \mathord
+ \__um_make_mathactive:nNN {`\'} \mathstraightquote \mathord
+ \__um_make_mathactive:nNN {`\`} \mathbacktick \mathord
+ }
\cs_new:Nn \__um_make_mathactive_parse:nNN
{
\__um_if_char_spec:nNNT {#1} #2 #3
@@ -1186,79 +1251,73 @@
}
\cs_new:Nn \__um_make_mathactive_noparse:nNN
{
- \__um_set_mathchar:NNnn #2 #3 {\__um_symfont_tl} {#1}
+ \__um_set_mathchar:NNnn #2 #3 {\l__um_symfont_label_tl} {#1}
\__um_char_gmake_mathactive:n {#1}
}
\cs_new:Nn \__um_assign_delcode_noparse:nn
- {
- \__um_set_delcode:nnn \__um_symfont_tl {#1} {#2}
- }
+ {
+ \__um_set_delcode:nnn \l__um_symfont_label_tl {#1} {#2}
+ }
\cs_new:Nn \__um_assign_delcode_parse:nn
- {
- \__um_if_char_spec:nNNT {#2} {\@nil} {\@nil}
- {
- \__um_assign_delcode_noparse:nn {#1} {#2}
- }
- }
+ {
+ \__um_if_char_spec:nNNT {#2} {\@nil} {\@nil}
+ {
+ \__um_assign_delcode_noparse:nn {#1} {#2}
+ }
+ }
\cs_new:Nn \__um_assign_delcode:n { \__um_assign_delcode:nn {#1} {#1} }
\cs_new:Npn \__um_setup_delcodes:
- {
- % ensure \left. and \right. work:
- \__um_set_delcode:nnn \__um_symfont_tl {`\.} {\c_zero}
- % this is forcefully done to fix a bug -- indicates a larger problem!
-
- \__um_assign_delcode:nn {`\/} {\g__um_slash_delimiter_usv}
- \__um_assign_delcode:nn {"2044} {\g__um_slash_delimiter_usv} % fracslash
- \__um_assign_delcode:nn {"2215} {\g__um_slash_delimiter_usv} % divslash
- \__um_assign_delcode:n {"005C} % backslash
- \__um_assign_delcode:nn {`\<} {"27E8} % angle brackets with ascii notation
- \__um_assign_delcode:nn {`\>} {"27E9} % angle brackets with ascii notation
- \__um_assign_delcode:n {"2191} % up arrow
- \__um_assign_delcode:n {"2193} % down arrow
- \__um_assign_delcode:n {"2195} % updown arrow
- \__um_assign_delcode:n {"219F} % up arrow twohead
- \__um_assign_delcode:n {"21A1} % down arrow twohead
- \__um_assign_delcode:n {"21A5} % up arrow from bar
- \__um_assign_delcode:n {"21A7} % down arrow from bar
- \__um_assign_delcode:n {"21A8} % updown arrow from bar
- \__um_assign_delcode:n {"21BE} % up harpoon right
- \__um_assign_delcode:n {"21BF} % up harpoon left
- \__um_assign_delcode:n {"21C2} % down harpoon right
- \__um_assign_delcode:n {"21C3} % down harpoon left
- \__um_assign_delcode:n {"21C5} % arrows up down
- \__um_assign_delcode:n {"21F5} % arrows down up
- \__um_assign_delcode:n {"21C8} % arrows up up
- \__um_assign_delcode:n {"21CA} % arrows down down
- \__um_assign_delcode:n {"21D1} % double up arrow
- \__um_assign_delcode:n {"21D3} % double down arrow
- \__um_assign_delcode:n {"21D5} % double updown arrow
- \__um_assign_delcode:n {"21DE} % up arrow double stroke
- \__um_assign_delcode:n {"21DF} % down arrow double stroke
- \__um_assign_delcode:n {"21E1} % up arrow dashed
- \__um_assign_delcode:n {"21E3} % down arrow dashed
- \__um_assign_delcode:n {"21E7} % up white arrow
- \__um_assign_delcode:n {"21E9} % down white arrow
- \__um_assign_delcode:n {"21EA} % up white arrow from bar
- \__um_assign_delcode:n {"21F3} % updown white arrow
- }
+ {
+ % ensure \left. and \right. work:
+ \__um_set_delcode:nnn \l__um_symfont_label_tl {`\.} {\c_zero}
+ % this is forcefully done to fix a bug -- indicates a larger problem!
+
+ \__um_assign_delcode:nn {`\/} {\g__um_slash_delimiter_usv}
+ \__um_assign_delcode:nn {"2044} {\g__um_slash_delimiter_usv} % fracslash
+ \__um_assign_delcode:nn {"2215} {\g__um_slash_delimiter_usv} % divslash
+ \__um_assign_delcode:n {"005C} % backslash
+ \__um_assign_delcode:nn {`\<} {"27E8} % angle brackets with ascii notation
+ \__um_assign_delcode:nn {`\>} {"27E9} % angle brackets with ascii notation
+ \__um_assign_delcode:n {"2191} % up arrow
+ \__um_assign_delcode:n {"2193} % down arrow
+ \__um_assign_delcode:n {"2195} % updown arrow
+ \__um_assign_delcode:n {"219F} % up arrow twohead
+ \__um_assign_delcode:n {"21A1} % down arrow twohead
+ \__um_assign_delcode:n {"21A5} % up arrow from bar
+ \__um_assign_delcode:n {"21A7} % down arrow from bar
+ \__um_assign_delcode:n {"21A8} % updown arrow from bar
+ \__um_assign_delcode:n {"21BE} % up harpoon right
+ \__um_assign_delcode:n {"21BF} % up harpoon left
+ \__um_assign_delcode:n {"21C2} % down harpoon right
+ \__um_assign_delcode:n {"21C3} % down harpoon left
+ \__um_assign_delcode:n {"21C5} % arrows up down
+ \__um_assign_delcode:n {"21F5} % arrows down up
+ \__um_assign_delcode:n {"21C8} % arrows up up
+ \__um_assign_delcode:n {"21CA} % arrows down down
+ \__um_assign_delcode:n {"21D1} % double up arrow
+ \__um_assign_delcode:n {"21D3} % double down arrow
+ \__um_assign_delcode:n {"21D5} % double updown arrow
+ \__um_assign_delcode:n {"21DE} % up arrow double stroke
+ \__um_assign_delcode:n {"21DF} % down arrow double stroke
+ \__um_assign_delcode:n {"21E1} % up arrow dashed
+ \__um_assign_delcode:n {"21E3} % down arrow dashed
+ \__um_assign_delcode:n {"21E7} % up white arrow
+ \__um_assign_delcode:n {"21E9} % down white arrow
+ \__um_assign_delcode:n {"21EA} % up white arrow from bar
+ \__um_assign_delcode:n {"21F3} % updown white arrow
+ }
\tl_set:Nn \l__um_nolimits_tl
- {
- \int\iint\iiint\iiiint\oint\oiint\oiiint
- \intclockwise\varointclockwise\ointctrclockwise\sumint
- \intbar\intBar\fint\cirfnint\awint\rppolint
- \scpolint\npolint\pointint\sqint\intlarhk\intx
- \intcap\intcup\upint\lowint
- }
-\DeclareDocumentCommand \addnolimits {m}
- {
- \tl_put_right:Nn \l__um_nolimits_tl {#1}
- }
-\DeclareDocumentCommand \removenolimits {m}
- {
- \tl_remove_all:Nn \l__um_nolimits_tl {#1}
- }
+ {
+ \int\iint\iiint\iiiint\oint\oiint\oiiint
+ \intclockwise\varointclockwise\ointctrclockwise\sumint
+ \intbar\intBar\fint\cirfnint\awint\rppolint
+ \scpolint\npolint\pointint\sqint\intlarhk\intx
+ \intcap\intcup\upint\lowint
+ }
\tl_set:Nn \l__um_radicals_tl {\sqrt \longdivision}
+%%^^A%% um-code-fontopt.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+
\keys_define:nn {unicode-math}
{
version .code:n =
@@ -1280,7 +1339,7 @@
{
\bool_set_false:N \l__um_init_bool
\int_incr:N \g__um_fam_int
- \tl_set:Nx \__um_symfont_tl {__um_fam\int_use:N\g__um_fam_int}
+ \tl_set:Nx \l__um_symfont_label_tl {__um_fam\int_use:N\g__um_fam_int}
\cs_set_eq:NN \__um_sym:nnn \__um_process_symbol_parse:nnn
\cs_set_eq:NN \__um_set_mathalphabet_char:Nnn \__um_mathmap_parse:Nnn
\cs_set_eq:NN \__um_remap_symbol:nnn \__um_remap_symbol_parse:nnn
@@ -1389,6 +1448,8 @@
} } }
}
+%%^^A%% um-code-fontparam.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+
\cs_new_protected_nopar:Nn \__um_new_cramped_style:N
{ \quark_new:N #1 }
\__um_new_cramped_style:N \crampeddisplaystyle
@@ -1521,6 +1582,8 @@
\fi
}
+%%^^A%% um-code-mathmap.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+
\cs_set:Npn \use@mathgroup #1 #2
{
\mode_if_math:T % <- not sure if this is really necessary since we've just checked for mmode and raised an error if not!
@@ -1701,7 +1764,7 @@
\clist_map_break:
}
{
- \__um_glyph_if_exist:nT { \__um_to_usv:nn {\l__um_style_tl} {\l__um_alphabet_tl} }
+ \__um_glyph_if_exist:NnT \l__um_font { \__um_to_usv:nn {\l__um_style_tl} {\l__um_alphabet_tl} }
{
\__um_maybe_init_alphabet:n \l__um_style_tl
\clist_map_break:
@@ -1721,7 +1784,7 @@
\__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl}
}
{
- \__um_glyph_if_exist:nTF { \__um_to_usv:nn {\l__um_remap_style_tl} {\l__um_alphabet_tl} }
+ \__um_glyph_if_exist:NnTF \l__um_font { \__um_to_usv:nn {\l__um_remap_style_tl} {\l__um_alphabet_tl} }
{
\__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)}
\__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl}
@@ -1744,7 +1807,7 @@
}
}
\cs_new:Nn \__um_map_char_noparse:nn
- { \__um_set_mathcode:nnnn {#1}{\mathalpha}{\__um_symfont_tl}{#2} }
+ { \__um_set_mathcode:nnnn {#1}{\mathalpha}{\l__um_symfont_label_tl}{#2} }
\cs_new:Nn \__um_map_char_parse:nn
{
\__um_if_char_spec:nNNT {#1} {\@nil} {\mathalpha}
@@ -1833,7 +1896,7 @@
{
\tl_put_right:cx {__um_switchto_#1:}
{
- \__um_set_mathcode:nnnn {##1} {\mathalpha} {\__um_symfont_tl} {#3}
+ \__um_set_mathcode:nnnn {##1} {\mathalpha} {\l__um_symfont_label_tl} {#3}
}
}
}
@@ -1907,91 +1970,7 @@
}
}
-\keys_define:nn {__um_mathface}
- {
- version .code:n =
- { \tl_set:Nn \l__um_mversion_tl {#1} }
- }
-\DeclareDocumentCommand \setmathfontface { m O{} m O{} }
- {
- \tl_clear:N \l__um_mversion_tl
-
- \keys_set_known:nnN {__um_mathface} {#2,#4} \l__um_keyval_clist
- \exp_args:Nnx \fontspec_set_family:Nxn \l__um_tmpa_tl
- { ItalicFont={}, BoldFont={}, \exp_not:V \l__um_keyval_clist } {#3}
-
- \tl_if_empty:NT \l__um_mversion_tl
- {
- \tl_set:Nn \l__um_mversion_tl {normal}
- \DeclareMathAlphabet #1 {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault}
- }
- \SetMathAlphabet #1 {\l__um_mversion_tl} {\g_fontspec_encoding_tl} {\l__um_tmpa_tl} {\mddefault} {\updefault}
-
- % integrate with fontspec's \setmathrm etc:
- \tl_case:Nn #1
- {
- \mathrm { \cs_set_eq:NN \g__fontspec_mathrm_tl \l__um_tmpa_tl }
- \mathsf { \cs_set_eq:NN \g__fontspec_mathsf_tl \l__um_tmpa_tl }
- \mathtt { \cs_set_eq:NN \g__fontspec_mathtt_tl \l__um_tmpa_tl }
- }
- }
-\@onlypreamble \setmathfontface
-\DeclareDocumentCommand \setoperatorfont {m}
- { \tl_set:Nn \g__um_operator_mathfont_tl {#1} }
-\setoperatorfont{\mathrm}
-\cs_generate_variant:Nn \tl_if_eq:nnT {o}
-\cs_set:Nn \__fontspec_setmainfont_hook:nn
- {
- \tl_if_eq:onT {\g__fontspec_mathrm_tl} {\rmdefault}
- {
- \fontspec_set_family:Nnn \g__fontspec_mathrm_tl {#1} {#2}
- \SetMathAlphabet\mathrm{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\updefault
- \SetMathAlphabet\mathit{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\itdefault
- \SetMathAlphabet\mathbf{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\bfdefault\updefault
- }
- }
-
-\cs_set:Nn \__fontspec_setsansfont_hook:nn
- {
- \tl_if_eq:onT {\g__fontspec_mathsf_tl} {\sfdefault}
- {
- \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {#1} {#2}
- \SetMathAlphabet\mathsf{normal}\g_fontspec_encoding_tl\g__fontspec_mathsf_tl\mddefault\updefault
- \SetMathAlphabet\mathsf{bold} \g_fontspec_encoding_tl\g__fontspec_mathsf_tl\bfdefault\updefault
- }
- }
-
-\cs_set:Nn \__fontspec_setmonofont_hook:nn
- {
- \tl_if_eq:onT {\g__fontspec_mathtt_tl} {\ttdefault}
- {
- \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {#1} {#2}
- \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g__fontspec_mathtt_tl\mddefault\updefault
- \SetMathAlphabet\mathtt{bold} \g_fontspec_encoding_tl\g__fontspec_mathtt_tl\bfdefault\updefault
- }
- }
-\cs_set:Nn \__fontspec_setmathrm_hook:nn
- {
- \SetMathAlphabet\mathrm{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\updefault
- \SetMathAlphabet\mathit{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\mddefault\itdefault
- \SetMathAlphabet\mathbf{normal}\g_fontspec_encoding_tl\g__fontspec_mathrm_tl\bfdefault\updefault
- }
-\cs_set:Nn \__fontspec_setboldmathrm_hook:nn
- {
- \SetMathAlphabet\mathrm{bold}\g_fontspec_encoding_tl\g__fontspec_bfmathrm_tl\mddefault\updefault
- \SetMathAlphabet\mathbf{bold}\g_fontspec_encoding_tl\g__fontspec_bfmathrm_tl\bfdefault\updefault
- \SetMathAlphabet\mathit{bold}\g_fontspec_encoding_tl\g__fontspec_bfmathrm_tl\mddefault\itdefault
- }
-\cs_set:Nn \__fontspec_setmathsf_hook:nn
- {
- \SetMathAlphabet\mathsf{normal}\g_fontspec_encoding_tl\g__fontspec_mathsf_tl\mddefault\updefault
- \SetMathAlphabet\mathsf{bold} \g_fontspec_encoding_tl\g__fontspec_mathsf_tl\bfdefault\updefault
- }
-\cs_set:Nn \__fontspec_setmathtt_hook:nn
- {
- \SetMathAlphabet\mathtt{normal}\g_fontspec_encoding_tl\g__fontspec_mathtt_tl\mddefault\updefault
- \SetMathAlphabet\mathtt{bold} \g_fontspec_encoding_tl\g__fontspec_mathtt_tl\bfdefault\updefault
- }
+%%^^A%% um-code-epilogue.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
\AtBeginDocument{\__um_resolve_greek:}
\cs_new:Npn \__um_resolve_greek:
@@ -2170,6 +2149,8 @@
\cs_gset:Npn \nforksnot { \forks }
}
+%%^^A%% um-code-primes.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+
\cs_new:Nn \__um_arg_i_before_egroup:n {#1\egroup}
\cs_new:Nn \__um_superscript:n
{
@@ -2190,17 +2171,17 @@
{
{1} { \__um_superscript:n {#1} }
{2} {
- \__um_glyph_if_exist:nTF {"2033}
+ \__um_glyph_if_exist:NnTF \l__um_font {"2033}
{ \__um_superscript:n {\__um_prime_double_mchar} }
{ \__um_nprimes:Nn #1 {#2} }
}
{3} {
- \__um_glyph_if_exist:nTF {"2034}
+ \__um_glyph_if_exist:NnTF \l__um_font {"2034}
{ \__um_superscript:n {\__um_prime_triple_mchar} }
{ \__um_nprimes:Nn #1 {#2} }
}
{4} {
- \__um_glyph_if_exist:nTF {"2057}
+ \__um_glyph_if_exist:NnTF \l__um_font {"2057}
{ \__um_superscript:n {\__um_prime_quad_mchar} }
{ \__um_nprimes:Nn #1 {#2} }
}
@@ -2215,12 +2196,12 @@
{
{1} { \__um_superscript:n {#1} }
{2} {
- \__um_glyph_if_exist:nTF {"2036}
+ \__um_glyph_if_exist:NnTF \l__um_font {"2036}
{ \__um_superscript:n {\__um_backprime_double_mchar} }
{ \__um_nprimes:Nn #1 {#2} }
}
{3} {
- \__um_glyph_if_exist:nTF {"2037}
+ \__um_glyph_if_exist:NnTF \l__um_font {"2037}
{ \__um_superscript:n {\__um_backprime_triple_mchar} }
{ \__um_nprimes:Nn #1 {#2} }
}
@@ -2451,6 +2432,8 @@
}
\group_end:
+%%^^A%% um-code-sscript.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+
\group_begin:
\cs_new:Nn \__um_setup_active_superscript:nn
{
@@ -2573,6 +2556,9 @@
}
{ \group_align_safe_end: #2 #3 }
}
+
+%%^^A%% um-code-compat.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+
\cs_new_protected_nopar:Nn \__um_check_and_fix:NNnnnn
{
\cs_if_exist:NT #1
@@ -2909,6 +2895,9 @@
\RenewDocumentCommand \equalscolon { } { \eqcolon }
\RenewDocumentCommand \coloncolonequals { } { \Coloneq }
}
+
+%%^^A%% um-code-alphabets.dtx -- part of UNICODE-MATH <wspr.io/unicode-math>
+
\__um_new_alphabet_config:nnn {up} {num}
{
\__um_set_normal_numbers:nn {up} {#1}
@@ -3733,3 +3722,4 @@
}
}
}
+