From d9ef526456b0d9228572bf242690d1e9941d1b5b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 30 Jul 2012 22:41:34 +0000 Subject: unicode-math (30jul12) git-svn-id: svn://tug.org/texlive/trunk@27257 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/unicode-math/README | 4 + .../latex/unicode-math/unicode-math-testsuite.pdf | Bin 2280136 -> 2587827 bytes .../doc/latex/unicode-math/unicode-math.pdf | Bin 408085 -> 406852 bytes .../doc/latex/unicode-math/unimath-symbols.pdf | Bin 1821239 -> 1796753 bytes .../source/latex/unicode-math/unicode-math.dtx | 369 +++++++++------------ .../tex/latex/unicode-math/unicode-math-luatex.sty | 13 +- .../tex/latex/unicode-math/unicode-math-xetex.sty | 13 +- .../tex/latex/unicode-math/unicode-math.sty | 344 +++++++++---------- 8 files changed, 330 insertions(+), 413 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/unicode-math/README b/Master/texmf-dist/doc/latex/unicode-math/README index b438c21793b..615e66e0981 100644 --- a/Master/texmf-dist/doc/latex/unicode-math/README +++ b/Master/texmf-dist/doc/latex/unicode-math/README @@ -153,6 +153,10 @@ standard behaviour. CHANGE HISTORY -------------- +- v0.7a (2012/07/28) + + * Keep in sync with expl3 changes. + - v0.7 (2012/05/30): The TeX Live 2012 release. * Most changes (and all significant ones) in this release thanks to Khaled diff --git a/Master/texmf-dist/doc/latex/unicode-math/unicode-math-testsuite.pdf b/Master/texmf-dist/doc/latex/unicode-math/unicode-math-testsuite.pdf index 20cf3d72051..244b466d45d 100644 Binary files a/Master/texmf-dist/doc/latex/unicode-math/unicode-math-testsuite.pdf and b/Master/texmf-dist/doc/latex/unicode-math/unicode-math-testsuite.pdf differ diff --git a/Master/texmf-dist/doc/latex/unicode-math/unicode-math.pdf b/Master/texmf-dist/doc/latex/unicode-math/unicode-math.pdf index a7ace83a454..c6244056b0b 100644 Binary files a/Master/texmf-dist/doc/latex/unicode-math/unicode-math.pdf and b/Master/texmf-dist/doc/latex/unicode-math/unicode-math.pdf differ diff --git a/Master/texmf-dist/doc/latex/unicode-math/unimath-symbols.pdf b/Master/texmf-dist/doc/latex/unicode-math/unimath-symbols.pdf index 1133fda8ec4..90ba414785a 100644 Binary files a/Master/texmf-dist/doc/latex/unicode-math/unimath-symbols.pdf and b/Master/texmf-dist/doc/latex/unicode-math/unimath-symbols.pdf differ diff --git a/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx b/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx index c045a13e3c7..33b2a23260f 100644 --- a/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx +++ b/Master/texmf-dist/source/latex/unicode-math/unicode-math.dtx @@ -60,7 +60,7 @@ This work is "author-maintained" by Will Robertson. %\ProvidesPackage{unicode-math-xetex} %\ProvidesPackage{unicode-math-luatex} %<*preamble> - [2012/05/30 v0.7 Unicode maths in XeLaTeX and LuaLaTeX] + [2012/07/28 v0.7a Unicode maths in XeLaTeX and LuaLaTeX] % %<*internal> \documentclass[a4paper]{ltxdoc} @@ -1179,13 +1179,14 @@ This work is "author-maintained" by Will Robertson. % \begin{macro}{\um_glyph_if_exist:nTF} %: TODO: Generalise for arbitrary fonts! \cs{l_um_font} is not always the one used for a specific glyph!! % \begin{macrocode} -\prg_new_conditional:Nnn \um_glyph_if_exist:n {p,TF,T,F} { - \iffontchar \l_um_font #1 \scan_stop: +\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_generate_variant:Nn \um_glyph_if_exist_p:n {c} \cs_generate_variant:Nn \um_glyph_if_exist:nTF {c} \cs_generate_variant:Nn \um_glyph_if_exist:nT {c} @@ -1206,237 +1207,206 @@ This work is "author-maintained" by Will Robertson. % This macro can be used in lieu of or later to override % options declared when the package is loaded. % \begin{macrocode} -\DeclareDocumentCommand \unimathsetup {m} { +\DeclareDocumentCommand \unimathsetup {m} + { \keys_set:nn {unicode-math} {#1} -} + } % \end{macrocode} % \end{macro} % +% \begin{macrocode} +\cs_new:Nn \um_tl_map_dbl:nN + { + \__um_tl_map_dbl:Nnn #2 #1 \q_recursion_tail {}{} \q_recursion_stop + } +\cs_new:Nn \__um_tl_map_dbl:Nnn + { + \quark_if_recursion_tail_stop:n {#2} + \quark_if_recursion_tail_stop:n {#3} + #1 {#2} {#3} + \__um_tl_map_dbl:Nnn #1 + } +\cs_new:Nn \um_keys_choices:nn + { + \cs_set:Npn \um_keys_choices_fn:nn { \um_keys_choices_aux:nnn {#1} } + \use:x + { + \exp_not:N \keys_define:nn {unicode-math} + { + #1 .choice: , + \um_tl_map_dbl:nN {#2} \um_keys_choices_fn:nn + } + } + } +\cs_new:Nn \um_keys_choices_aux:nnn { #1 / #2 .code:n = { \exp_not:n {#3} } , } +% \end{macrocode} % % \paragraph{math-style} % \begin{macrocode} -\keys_define:nn {unicode-math} { - normal-style .choice_code:n = - { - \bool_set_false:N \g_um_literal_bool - \ifcase \l_keys_choice_int - \bool_set_false:N \g_um_upGreek_bool - \bool_set_false:N \g_um_upgreek_bool - \bool_set_false:N \g_um_upLatin_bool - \bool_set_false:N \g_um_uplatin_bool - \or - \bool_set_true:N \g_um_upGreek_bool - \bool_set_false:N \g_um_upgreek_bool - \bool_set_false:N \g_um_upLatin_bool - \bool_set_false:N \g_um_uplatin_bool - \or - \bool_set_true:N \g_um_upGreek_bool - \bool_set_true:N \g_um_upgreek_bool - \bool_set_true:N \g_um_upLatin_bool - \bool_set_false:N \g_um_uplatin_bool - \or - \bool_set_true:N \g_um_upGreek_bool - \bool_set_true:N \g_um_upgreek_bool - \bool_set_true:N \g_um_upLatin_bool - \bool_set_true:N \g_um_uplatin_bool - \or - \bool_set_true:N \g_um_literal_bool - \fi - } , - normal-style .generate_choices:n = {ISO,TeX,french,upright,literal} , -} +\um_keys_choices:nn {normal-style} + { + {ISO} { + \bool_set_false:N \g_um_literal_bool + \bool_set_false:N \g_um_upGreek_bool + \bool_set_false:N \g_um_upgreek_bool + \bool_set_false:N \g_um_upLatin_bool + \bool_set_false:N \g_um_uplatin_bool } + {TeX} { + \bool_set_false:N \g_um_literal_bool + \bool_set_true:N \g_um_upGreek_bool + \bool_set_false:N \g_um_upgreek_bool + \bool_set_false:N \g_um_upLatin_bool + \bool_set_false:N \g_um_uplatin_bool } + {french} { + \bool_set_false:N \g_um_literal_bool + \bool_set_true:N \g_um_upGreek_bool + \bool_set_true:N \g_um_upgreek_bool + \bool_set_true:N \g_um_upLatin_bool + \bool_set_false:N \g_um_uplatin_bool } + {upright} { + \bool_set_false:N \g_um_literal_bool + \bool_set_true:N \g_um_upGreek_bool + \bool_set_true:N \g_um_upgreek_bool + \bool_set_true:N \g_um_upLatin_bool + \bool_set_true:N \g_um_uplatin_bool } + {literal} { + \bool_set_true:N \g_um_literal_bool } + } % \end{macrocode} % % \begin{macrocode} -\keys_define:nn {unicode-math} { - math-style .choice_code:n = - { - \ifcase \l_keys_choice_int - \unimathsetup { - normal-style=ISO, - bold-style=ISO, - sans-style=italic, - nabla=upright, - partial=italic, - } - \or - \unimathsetup { - normal-style=TeX, - bold-style=TeX, - sans-style=upright, - nabla=upright, - partial=italic, - } - \or - \unimathsetup { - normal-style=french, - bold-style=upright, - sans-style=upright, - nabla=upright, - partial=upright, - } - \or - \unimathsetup { - normal-style=upright, - bold-style=upright, - sans-style=upright, - nabla=upright, - partial=upright, - } - \or - \unimathsetup { - normal-style=literal, - bold-style=literal, - sans-style=literal, - colon=literal, - nabla=literal, - partial=literal, - } - \fi - } , - math-style .generate_choices:n = {ISO,TeX,french,upright,literal} , -} +\um_keys_choices:nn {math-style} + { + {ISO} { + \unimathsetup { nabla=upright, partial=italic, + normal-style=ISO, bold-style=ISO, sans-style=italic } } + {TeX} { + \unimathsetup { nabla=upright, partial=italic, + normal-style=TeX, bold-style=TeX, sans-style=upright } } + {french} { + \unimathsetup { nabla=upright, partial=upright, + normal-style=french, bold-style=upright, sans-style=upright } } + {upright} { + \unimathsetup { nabla=upright, partial=upright, + normal-style=upright, bold-style=upright, sans-style=upright } } + {literal} { + \unimathsetup { colon=literal, nabla=literal, partial=literal, + normal-style=literal, bold-style=literal, sans-style=literal } } + } % \end{macrocode} % % \paragraph{bold-style} % \begin{macrocode} -\keys_define:nn {unicode-math} { - bold-style .choice_code:n = { - \bool_set_false:N \g_um_bfliteral_bool - \ifcase \l_keys_choice_int +\um_keys_choices:nn {bold-style} + { + {ISO} { + \bool_set_false:N \g_um_bfliteral_bool \bool_set_false:N \g_um_bfupGreek_bool \bool_set_false:N \g_um_bfupgreek_bool \bool_set_false:N \g_um_bfupLatin_bool - \bool_set_false:N \g_um_bfuplatin_bool - \or + \bool_set_false:N \g_um_bfuplatin_bool } + {TeX} { + \bool_set_false:N \g_um_bfliteral_bool \bool_set_true:N \g_um_bfupGreek_bool \bool_set_false:N \g_um_bfupgreek_bool \bool_set_true:N \g_um_bfupLatin_bool - \bool_set_true:N \g_um_bfuplatin_bool - \or + \bool_set_true:N \g_um_bfuplatin_bool } + {upright} { + \bool_set_false:N \g_um_bfliteral_bool \bool_set_true:N \g_um_bfupGreek_bool \bool_set_true:N \g_um_bfupgreek_bool \bool_set_true:N \g_um_bfupLatin_bool - \bool_set_true:N \g_um_bfuplatin_bool - \or - \bool_set_true:N \g_um_bfliteral_bool - \fi - } , - bold-style .generate_choices:n = {ISO,TeX,upright,literal} , -} + \bool_set_true:N \g_um_bfuplatin_bool } + {literal} { + \bool_set_true:N \g_um_bfliteral_bool } + } % \end{macrocode} % % \paragraph{sans-style} % \begin{macrocode} -\keys_define:nn {unicode-math} { - sans-style .choice_code:n = { - \ifcase \l_keys_choice_int - \bool_set_false:N \g_um_upsans_bool - \or - \bool_set_true:N \g_um_upsans_bool - \or - \bool_set_true:N \g_um_sfliteral_bool - \fi - } , - sans-style .generate_choices:n = {italic,upright,literal} , -} +\um_keys_choices:nn {sans-style} + { + {italic} { \bool_set_false:N \g_um_upsans_bool } + {upright} { \bool_set_true:N \g_um_upsans_bool } + {literal} { \bool_set_true:N \g_um_sfliteral_bool } + } % \end{macrocode} % % % \paragraph{Nabla and partial} % \begin{macrocode} -\keys_define:nn {unicode-math} { - nabla .choice_code:n = { - \bool_set_false:N \g_um_literal_Nabla_bool - \ifcase \l_keys_choice_int - \bool_set_true:N \g_um_upNabla_bool - \or - \bool_set_false:N \g_um_upNabla_bool - \or - \bool_set_true:N \g_um_literal_Nabla_bool - \fi - } , - nabla .generate_choices:n = {upright,italic,literal} , -} +\um_keys_choices:nn {nabla} + { + {upright} { \bool_set_false:N \g_um_literal_Nabla_bool + \bool_set_true:N \g_um_upNabla_bool } + {italic} { \bool_set_false:N \g_um_literal_Nabla_bool + \bool_set_false:N \g_um_upNabla_bool } + {literal} { \bool_set_true:N \g_um_literal_Nabla_bool } + } % \end{macrocode} % % \begin{macrocode} -\keys_define:nn {unicode-math} { - partial .choice_code:n = { - \bool_set_false:N \g_um_literal_partial_bool - \ifcase \l_keys_choice_int - \bool_set_true:N \g_um_uppartial_bool - \or - \bool_set_false:N \g_um_uppartial_bool - \or - \bool_set_true:N \g_um_literal_partial_bool - \fi - } , - partial .generate_choices:n = {upright,italic,literal} , -} +\um_keys_choices:nn {partial} + { + {upright} { \bool_set_false:N \g_um_literal_partial_bool + \bool_set_true:N \g_um_uppartial_bool } + {italic} { \bool_set_false:N \g_um_literal_partial_bool + \bool_set_false:N \g_um_uppartial_bool } + {literal} { \bool_set_true:N \g_um_literal_partial_bool } + } % \end{macrocode} % % \paragraph{Epsilon and phi shapes} % \begin{macrocode} -\keys_define:nn {unicode-math} { - vargreek-shape .choice: , - vargreek-shape / unicode .code:n = { - \bool_set_false:N \g_um_texgreek_bool - } , - vargreek-shape / TeX .code:n = { - \bool_set_true:N \g_um_texgreek_bool - } -} +\um_keys_choices:nn {vargreek-shape} + { + {unicode} {\bool_set_false:N \g_um_texgreek_bool} + {TeX} {\bool_set_true:N \g_um_texgreek_bool} + } % \end{macrocode} % % \paragraph{Colon style} % \begin{macrocode} -\keys_define:nn {unicode-math} { - colon .choice: , - colon / literal .code:n = { - \bool_set_true:N \g_um_literal_colon_bool - } , - colon / TeX .code:n = { - \bool_set_false:N \g_um_literal_colon_bool - } -} +\um_keys_choices:nn {colon} + { + {literal} {\bool_set_true:N \g_um_literal_colon_bool} + {TeX} {\bool_set_false:N \g_um_literal_colon_bool} + } % \end{macrocode} % % \paragraph{Slash delimiter style} % \begin{macrocode} -\keys_define:nn {unicode-math} { - slash-delimiter .choice: , - slash-delimiter / ascii .code:n = { - \tl_set:Nn \g_um_slash_delimiter_usv {"002F} - } , - slash-delimiter / frac .code:n = { - \tl_set:Nn \g_um_slash_delimiter_usv {"2044} - } , - slash-delimiter / div .code:n = { - \tl_set:Nn \g_um_slash_delimiter_usv {"2215} - } -} +\um_keys_choices:nn {slash-delimiter} + { + {ascii} {\tl_set:Nn \g_um_slash_delimiter_usv {"002F}} + {frac} {\tl_set:Nn \g_um_slash_delimiter_usv {"2044}} + {div} {\tl_set:Nn \g_um_slash_delimiter_usv {"2215}} + } % \end{macrocode} % % % \paragraph{Active fraction style} % \begin{macrocode} -\keys_define:nn {unicode-math} { - active-frac .choice: , - active-frac / small .code:n = { - \cs_if_exist:NTF \tfrac { +\um_keys_choices:nn {active-frac} + { + {small} + { + \cs_if_exist:NTF \tfrac + { \bool_set_true:N \l_um_smallfrac_bool - }{ + }{ \um_warning:n {no-tfrac} \bool_set_false:N \l_um_smallfrac_bool - } - \use:c{um_setup_active_frac:} - } , - active-frac / normalsize .code:n = { + } + \use:c {um_setup_active_frac:} + } + + {normalsize} + { \bool_set_false:N \l_um_smallfrac_bool - \use:c{um_setup_active_frac:} - } -} + \use:c {um_setup_active_frac:} + } + } % \end{macrocode} % % \paragraph{Debug/tracing} @@ -1454,27 +1424,19 @@ This work is "author-maintained" by Will Robertson. % \end{macrocode} % % \begin{macrocode} -\keys_define:nn {unicode-math} { - trace .choice: , - trace / debug .code:n = { - \msg_redirect_module:nnn { unicode-math } { log } { warning } - } , - trace / on .code:n = { - % default - } , - trace / off .code:n = { - \msg_redirect_module:nnn { unicode-math } { log } { none } - } , -} +\um_keys_choices:nn {trace} + { + {on} {} % default + {debug} { \msg_redirect_module:nnn { unicode-math } { log } { warning } } + {off} { \msg_redirect_module:nnn { unicode-math } { log } { none } } + } % \end{macrocode} % % \begin{macrocode} \unimathsetup {math-style=TeX} \unimathsetup {slash-delimiter=ascii} \unimathsetup {trace=off} -\cs_if_exist:NT \tfrac { - \unimathsetup {active-frac=small} -} +\cs_if_exist:NT \tfrac { \unimathsetup {active-frac=small} } \ProcessKeysOptions {unicode-math} % \end{macrocode} % @@ -5288,9 +5250,9 @@ luatexbase.add_to_callback("luaotfload.patch_font", patch_cambria_domh, "cambria % TODO: move all this to expl3, and don't use internal expl3 macros. % \begin{macrocode} \cs_new:Npn \um_scan_sscript:TF #1#2 { - \tl_set:Nx \peek_true_aux:w { \exp_not:n{ #1 } } - \tl_set_eq:NN \peek_true:w \peek_true_remove:w - \tl_set:Nx \peek_false:w { \exp_not:n { \group_align_safe_end: #2 } } + \tl_set:Nx \__peek_true_aux:w { \exp_not:n{ #1 } } + \tl_set_eq:NN \__peek_true:w \__peek_true_remove:w + \tl_set:Nx \__peek_false:w { \exp_not:n { \group_align_safe_end: #2 } } \group_align_safe_begin: \peek_after:Nw \um_peek_execute_branches_ss: } @@ -5304,7 +5266,7 @@ luatexbase.add_to_callback("luaotfload.patch_font", patch_cambria_domh, "cambria \token_if_eq_catcode_p:NN \l_peek_token \c_group_end_token || \token_if_eq_meaning_p:NN \l_peek_token \c_space_token } - { \peek_false:w } + { \__peek_false:w } { \um_peek_execute_branches_ss_aux: } } % \end{macrocode} @@ -5326,9 +5288,9 @@ luatexbase.add_to_callback("luaotfload.patch_font", patch_cambria_domh, "cambria \prop_get:cxN {g_um_\l_um_tmpa_tl _prop} {\meaning\l_peek_token} \l_um_tmpb_tl \tl_put_right:NV \l_um_ss_chain_tl \l_um_tmpb_tl - \peek_true:w + \__peek_true:w } - { \peek_false:w } + { \__peek_false:w } } % \end{macrocode} % @@ -5461,13 +5423,6 @@ luatexbase.add_to_callback("luaotfload.patch_font", patch_cambria_domh, "cambria \def\operator@font{\um_switchto_mathup:} % \end{macrocode} % -% \begin{macro}{\um_tmpa:w} -% A scratch macro. -% \begin{macrocode} -\chk_if_free_cs:N \um_tmpa:w -% \end{macrocode} -% \end{macro} -% % \begin{macro}{\um_check_and_fix:NNnnnn} % \darg{command} % \darg{factory command} 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 1f851aaac03..0d1316b9ab4 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 @@ -2174,9 +2174,9 @@ } } \cs_new:Npn \um_scan_sscript:TF #1#2 { - \tl_set:Nx \peek_true_aux:w { \exp_not:n{ #1 } } - \tl_set_eq:NN \peek_true:w \peek_true_remove:w - \tl_set:Nx \peek_false:w { \exp_not:n { \group_align_safe_end: #2 } } + \tl_set:Nx \__peek_true_aux:w { \exp_not:n{ #1 } } + \tl_set_eq:NN \__peek_true:w \__peek_true_remove:w + \tl_set:Nx \__peek_false:w { \exp_not:n { \group_align_safe_end: #2 } } \group_align_safe_begin: \peek_after:Nw \um_peek_execute_branches_ss: } @@ -2186,7 +2186,7 @@ \token_if_eq_catcode_p:NN \l_peek_token \c_group_end_token || \token_if_eq_meaning_p:NN \l_peek_token \c_space_token } - { \peek_false:w } + { \__peek_false:w } { \um_peek_execute_branches_ss_aux: } } \cs_new:Npn \um_peek_execute_branches_ss_aux: { @@ -2196,9 +2196,9 @@ \prop_get:cxN {g_um_\l_um_tmpa_tl _prop} {\meaning\l_peek_token} \l_um_tmpb_tl \tl_put_right:NV \l_um_ss_chain_tl \l_um_tmpb_tl - \peek_true:w + \__peek_true:w } - { \peek_false:w } + { \__peek_false:w } } \cs_new:Npn \um_define_active_frac:Nw #1 #2/#3 { \char_set_catcode_active:N #1 @@ -2272,7 +2272,6 @@ \def\digamma{\updigamma} \def\Digamma{\upDigamma} \def\operator@font{\um_switchto_mathup:} -\chk_if_free_cs:N \um_tmpa:w \cs_new_protected_nopar:Npn \um_check_and_fix:NNnnnn #1 #2 #3 #4 #5 #6 { \cs_if_exist:NT #1 { \token_if_macro:NTF #1 { 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 863e495ce2c..9c4035b1179 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 @@ -2221,9 +2221,9 @@ } } \cs_new:Npn \um_scan_sscript:TF #1#2 { - \tl_set:Nx \peek_true_aux:w { \exp_not:n{ #1 } } - \tl_set_eq:NN \peek_true:w \peek_true_remove:w - \tl_set:Nx \peek_false:w { \exp_not:n { \group_align_safe_end: #2 } } + \tl_set:Nx \__peek_true_aux:w { \exp_not:n{ #1 } } + \tl_set_eq:NN \__peek_true:w \__peek_true_remove:w + \tl_set:Nx \__peek_false:w { \exp_not:n { \group_align_safe_end: #2 } } \group_align_safe_begin: \peek_after:Nw \um_peek_execute_branches_ss: } @@ -2233,7 +2233,7 @@ \token_if_eq_catcode_p:NN \l_peek_token \c_group_end_token || \token_if_eq_meaning_p:NN \l_peek_token \c_space_token } - { \peek_false:w } + { \__peek_false:w } { \um_peek_execute_branches_ss_aux: } } \cs_new:Npn \um_peek_execute_branches_ss_aux: { @@ -2243,9 +2243,9 @@ \prop_get:cxN {g_um_\l_um_tmpa_tl _prop} {\meaning\l_peek_token} \l_um_tmpb_tl \tl_put_right:NV \l_um_ss_chain_tl \l_um_tmpb_tl - \peek_true:w + \__peek_true:w } - { \peek_false:w } + { \__peek_false:w } } \cs_new:Npn \um_define_active_frac:Nw #1 #2/#3 { \char_set_catcode_active:N #1 @@ -2319,7 +2319,6 @@ \def\digamma{\updigamma} \def\Digamma{\upDigamma} \def\operator@font{\um_switchto_mathup:} -\chk_if_free_cs:N \um_tmpa:w \cs_new_protected_nopar:Npn \um_check_and_fix:NNnnnn #1 #2 #3 #4 #5 #6 { \cs_if_exist:NT #1 { \token_if_macro:NTF #1 { 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 b272784c348..3a2d27a216d 100644 --- a/Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty +++ b/Master/texmf-dist/tex/latex/unicode-math/unicode-math.sty @@ -17,7 +17,7 @@ %% %% This work is "author-maintained" by Will Robertson. \ProvidesPackage{unicode-math} - [2012/05/30 v0.7 Unicode maths in XeLaTeX and LuaLaTeX] + [2012/07/28 v0.7a Unicode maths in XeLaTeX and LuaLaTeX] \usepackage{ifxetex,ifluatex} \ifxetex \ifdim\number\XeTeXversion\XeTeXrevision in<0.9998in% @@ -88,208 +88,176 @@ \tl_const:Nn \c_um_math_alphabet_name_Greek_tl {Greek,~uppercase} \tl_const:Nn \c_um_math_alphabet_name_num_tl {Numerals} \tl_const:Nn \c_um_math_alphabet_name_misc_tl {Misc.} -\prg_new_conditional:Nnn \um_glyph_if_exist:n {p,TF,T,F} { - \iffontchar \l_um_font #1 \scan_stop: +\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_generate_variant:Nn \um_glyph_if_exist_p:n {c} \cs_generate_variant:Nn \um_glyph_if_exist:nTF {c} \cs_generate_variant:Nn \um_glyph_if_exist:nT {c} \cs_generate_variant:Nn \um_glyph_if_exist:nF {c} \cs_generate_variant:Nn \fontspec_set_family:Nnn {Nx} \cs_generate_variant:Nn \fontspec_set_fontface:NNnn {NNx} -\DeclareDocumentCommand \unimathsetup {m} { +\DeclareDocumentCommand \unimathsetup {m} + { \keys_set:nn {unicode-math} {#1} -} -\keys_define:nn {unicode-math} { - normal-style .choice_code:n = + } +\cs_new:Nn \um_tl_map_dbl:nN { - \bool_set_false:N \g_um_literal_bool - \ifcase \l_keys_choice_int - \bool_set_false:N \g_um_upGreek_bool - \bool_set_false:N \g_um_upgreek_bool - \bool_set_false:N \g_um_upLatin_bool - \bool_set_false:N \g_um_uplatin_bool - \or - \bool_set_true:N \g_um_upGreek_bool - \bool_set_false:N \g_um_upgreek_bool - \bool_set_false:N \g_um_upLatin_bool - \bool_set_false:N \g_um_uplatin_bool - \or - \bool_set_true:N \g_um_upGreek_bool - \bool_set_true:N \g_um_upgreek_bool - \bool_set_true:N \g_um_upLatin_bool - \bool_set_false:N \g_um_uplatin_bool - \or - \bool_set_true:N \g_um_upGreek_bool - \bool_set_true:N \g_um_upgreek_bool - \bool_set_true:N \g_um_upLatin_bool - \bool_set_true:N \g_um_uplatin_bool - \or - \bool_set_true:N \g_um_literal_bool - \fi - } , - normal-style .generate_choices:n = {ISO,TeX,french,upright,literal} , -} -\keys_define:nn {unicode-math} { - math-style .choice_code:n = + \__um_tl_map_dbl:Nnn #2 #1 \q_recursion_tail {}{} \q_recursion_stop + } +\cs_new:Nn \__um_tl_map_dbl:Nnn { - \ifcase \l_keys_choice_int - \unimathsetup { - normal-style=ISO, - bold-style=ISO, - sans-style=italic, - nabla=upright, - partial=italic, - } - \or - \unimathsetup { - normal-style=TeX, - bold-style=TeX, - sans-style=upright, - nabla=upright, - partial=italic, - } - \or - \unimathsetup { - normal-style=french, - bold-style=upright, - sans-style=upright, - nabla=upright, - partial=upright, - } - \or - \unimathsetup { - normal-style=upright, - bold-style=upright, - sans-style=upright, - nabla=upright, - partial=upright, - } - \or - \unimathsetup { - normal-style=literal, - bold-style=literal, - sans-style=literal, - colon=literal, - nabla=literal, - partial=literal, - } - \fi - } , - math-style .generate_choices:n = {ISO,TeX,french,upright,literal} , -} -\keys_define:nn {unicode-math} { - bold-style .choice_code:n = { - \bool_set_false:N \g_um_bfliteral_bool - \ifcase \l_keys_choice_int + \quark_if_recursion_tail_stop:n {#2} + \quark_if_recursion_tail_stop:n {#3} + #1 {#2} {#3} + \__um_tl_map_dbl:Nnn #1 + } +\cs_new:Nn \um_keys_choices:nn + { + \cs_set:Npn \um_keys_choices_fn:nn { \um_keys_choices_aux:nnn {#1} } + \use:x + { + \exp_not:N \keys_define:nn {unicode-math} + { + #1 .choice: , + \um_tl_map_dbl:nN {#2} \um_keys_choices_fn:nn + } + } + } +\cs_new:Nn \um_keys_choices_aux:nnn { #1 / #2 .code:n = { \exp_not:n {#3} } , } +\um_keys_choices:nn {normal-style} + { + {ISO} { + \bool_set_false:N \g_um_literal_bool + \bool_set_false:N \g_um_upGreek_bool + \bool_set_false:N \g_um_upgreek_bool + \bool_set_false:N \g_um_upLatin_bool + \bool_set_false:N \g_um_uplatin_bool } + {TeX} { + \bool_set_false:N \g_um_literal_bool + \bool_set_true:N \g_um_upGreek_bool + \bool_set_false:N \g_um_upgreek_bool + \bool_set_false:N \g_um_upLatin_bool + \bool_set_false:N \g_um_uplatin_bool } + {french} { + \bool_set_false:N \g_um_literal_bool + \bool_set_true:N \g_um_upGreek_bool + \bool_set_true:N \g_um_upgreek_bool + \bool_set_true:N \g_um_upLatin_bool + \bool_set_false:N \g_um_uplatin_bool } + {upright} { + \bool_set_false:N \g_um_literal_bool + \bool_set_true:N \g_um_upGreek_bool + \bool_set_true:N \g_um_upgreek_bool + \bool_set_true:N \g_um_upLatin_bool + \bool_set_true:N \g_um_uplatin_bool } + {literal} { + \bool_set_true:N \g_um_literal_bool } + } +\um_keys_choices:nn {math-style} + { + {ISO} { + \unimathsetup { nabla=upright, partial=italic, + normal-style=ISO, bold-style=ISO, sans-style=italic } } + {TeX} { + \unimathsetup { nabla=upright, partial=italic, + normal-style=TeX, bold-style=TeX, sans-style=upright } } + {french} { + \unimathsetup { nabla=upright, partial=upright, + normal-style=french, bold-style=upright, sans-style=upright } } + {upright} { + \unimathsetup { nabla=upright, partial=upright, + normal-style=upright, bold-style=upright, sans-style=upright } } + {literal} { + \unimathsetup { colon=literal, nabla=literal, partial=literal, + normal-style=literal, bold-style=literal, sans-style=literal } } + } +\um_keys_choices:nn {bold-style} + { + {ISO} { + \bool_set_false:N \g_um_bfliteral_bool \bool_set_false:N \g_um_bfupGreek_bool \bool_set_false:N \g_um_bfupgreek_bool \bool_set_false:N \g_um_bfupLatin_bool - \bool_set_false:N \g_um_bfuplatin_bool - \or + \bool_set_false:N \g_um_bfuplatin_bool } + {TeX} { + \bool_set_false:N \g_um_bfliteral_bool \bool_set_true:N \g_um_bfupGreek_bool \bool_set_false:N \g_um_bfupgreek_bool \bool_set_true:N \g_um_bfupLatin_bool - \bool_set_true:N \g_um_bfuplatin_bool - \or + \bool_set_true:N \g_um_bfuplatin_bool } + {upright} { + \bool_set_false:N \g_um_bfliteral_bool \bool_set_true:N \g_um_bfupGreek_bool \bool_set_true:N \g_um_bfupgreek_bool \bool_set_true:N \g_um_bfupLatin_bool - \bool_set_true:N \g_um_bfuplatin_bool - \or - \bool_set_true:N \g_um_bfliteral_bool - \fi - } , - bold-style .generate_choices:n = {ISO,TeX,upright,literal} , -} -\keys_define:nn {unicode-math} { - sans-style .choice_code:n = { - \ifcase \l_keys_choice_int - \bool_set_false:N \g_um_upsans_bool - \or - \bool_set_true:N \g_um_upsans_bool - \or - \bool_set_true:N \g_um_sfliteral_bool - \fi - } , - sans-style .generate_choices:n = {italic,upright,literal} , -} -\keys_define:nn {unicode-math} { - nabla .choice_code:n = { - \bool_set_false:N \g_um_literal_Nabla_bool - \ifcase \l_keys_choice_int - \bool_set_true:N \g_um_upNabla_bool - \or - \bool_set_false:N \g_um_upNabla_bool - \or - \bool_set_true:N \g_um_literal_Nabla_bool - \fi - } , - nabla .generate_choices:n = {upright,italic,literal} , -} -\keys_define:nn {unicode-math} { - partial .choice_code:n = { - \bool_set_false:N \g_um_literal_partial_bool - \ifcase \l_keys_choice_int - \bool_set_true:N \g_um_uppartial_bool - \or - \bool_set_false:N \g_um_uppartial_bool - \or - \bool_set_true:N \g_um_literal_partial_bool - \fi - } , - partial .generate_choices:n = {upright,italic,literal} , -} -\keys_define:nn {unicode-math} { - vargreek-shape .choice: , - vargreek-shape / unicode .code:n = { - \bool_set_false:N \g_um_texgreek_bool - } , - vargreek-shape / TeX .code:n = { - \bool_set_true:N \g_um_texgreek_bool - } -} -\keys_define:nn {unicode-math} { - colon .choice: , - colon / literal .code:n = { - \bool_set_true:N \g_um_literal_colon_bool - } , - colon / TeX .code:n = { - \bool_set_false:N \g_um_literal_colon_bool - } -} -\keys_define:nn {unicode-math} { - slash-delimiter .choice: , - slash-delimiter / ascii .code:n = { - \tl_set:Nn \g_um_slash_delimiter_usv {"002F} - } , - slash-delimiter / frac .code:n = { - \tl_set:Nn \g_um_slash_delimiter_usv {"2044} - } , - slash-delimiter / div .code:n = { - \tl_set:Nn \g_um_slash_delimiter_usv {"2215} - } -} -\keys_define:nn {unicode-math} { - active-frac .choice: , - active-frac / small .code:n = { - \cs_if_exist:NTF \tfrac { + \bool_set_true:N \g_um_bfuplatin_bool } + {literal} { + \bool_set_true:N \g_um_bfliteral_bool } + } +\um_keys_choices:nn {sans-style} + { + {italic} { \bool_set_false:N \g_um_upsans_bool } + {upright} { \bool_set_true:N \g_um_upsans_bool } + {literal} { \bool_set_true:N \g_um_sfliteral_bool } + } +\um_keys_choices:nn {nabla} + { + {upright} { \bool_set_false:N \g_um_literal_Nabla_bool + \bool_set_true:N \g_um_upNabla_bool } + {italic} { \bool_set_false:N \g_um_literal_Nabla_bool + \bool_set_false:N \g_um_upNabla_bool } + {literal} { \bool_set_true:N \g_um_literal_Nabla_bool } + } +\um_keys_choices:nn {partial} + { + {upright} { \bool_set_false:N \g_um_literal_partial_bool + \bool_set_true:N \g_um_uppartial_bool } + {italic} { \bool_set_false:N \g_um_literal_partial_bool + \bool_set_false:N \g_um_uppartial_bool } + {literal} { \bool_set_true:N \g_um_literal_partial_bool } + } +\um_keys_choices:nn {vargreek-shape} + { + {unicode} {\bool_set_false:N \g_um_texgreek_bool} + {TeX} {\bool_set_true:N \g_um_texgreek_bool} + } +\um_keys_choices:nn {colon} + { + {literal} {\bool_set_true:N \g_um_literal_colon_bool} + {TeX} {\bool_set_false:N \g_um_literal_colon_bool} + } +\um_keys_choices:nn {slash-delimiter} + { + {ascii} {\tl_set:Nn \g_um_slash_delimiter_usv {"002F}} + {frac} {\tl_set:Nn \g_um_slash_delimiter_usv {"2044}} + {div} {\tl_set:Nn \g_um_slash_delimiter_usv {"2215}} + } +\um_keys_choices:nn {active-frac} + { + {small} + { + \cs_if_exist:NTF \tfrac + { \bool_set_true:N \l_um_smallfrac_bool - }{ + }{ \um_warning:n {no-tfrac} \bool_set_false:N \l_um_smallfrac_bool - } - \use:c{um_setup_active_frac:} - } , - active-frac / normalsize .code:n = { + } + \use:c {um_setup_active_frac:} + } + + {normalsize} + { \bool_set_false:N \l_um_smallfrac_bool - \use:c{um_setup_active_frac:} - } -} + \use:c {um_setup_active_frac:} + } + } \keys_define:nn {unicode-math} { warnings-off .code:n = @@ -298,24 +266,16 @@ { \msg_redirect_name:nnn { unicode-math } { ##1 } { none } } } } -\keys_define:nn {unicode-math} { - trace .choice: , - trace / debug .code:n = { - \msg_redirect_module:nnn { unicode-math } { log } { warning } - } , - trace / on .code:n = { - % default - } , - trace / off .code:n = { - \msg_redirect_module:nnn { unicode-math } { log } { none } - } , -} +\um_keys_choices:nn {trace} + { + {on} {} % default + {debug} { \msg_redirect_module:nnn { unicode-math } { log } { warning } } + {off} { \msg_redirect_module:nnn { unicode-math } { log } { none } } + } \unimathsetup {math-style=TeX} \unimathsetup {slash-delimiter=ascii} \unimathsetup {trace=off} -\cs_if_exist:NT \tfrac { - \unimathsetup {active-frac=small} -} +\cs_if_exist:NT \tfrac { \unimathsetup {active-frac=small} } \ProcessKeysOptions {unicode-math} \cs_new:Npn \um_warning:n { \msg_warning:nn {unicode-math} } \cs_new:Npn \um_log:n { \msg_log:nn {unicode-math} } -- cgit v1.2.3