Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add special "double mapping" for better keyoption definitions

  • Loading branch information...
commit 2cedf8b5eb52eebc9948530bf7d091621e83abbb 1 parent 5e70535
@wspr authored
Showing with 76 additions and 62 deletions.
  1. +4 −0 README.markdown
  2. +72 −62 unicode-math.dtx
View
4 README.markdown
@@ -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
View
134 unicode-math.dtx
@@ -60,7 +60,7 @@ This work is "author-maintained" by Will Robertson.
%<preamble&XE>\ProvidesPackage{unicode-math-xetex}
%<preamble&LU>\ProvidesPackage{unicode-math-luatex}
%<*preamble>
- [2012/07/26 v0.7a Unicode maths in XeLaTeX and LuaLaTeX]
+ [2012/07/28 v0.7a Unicode maths in XeLaTeX and LuaLaTeX]
%</preamble>
%<*internal>
\documentclass[a4paper]{ltxdoc}
@@ -1215,72 +1215,83 @@ This work is "author-maintained" by Will Robertson.
% \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:n ##1 { \um_keys_choices_aux:nnn {#1} ##1 , }
+ \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: ,
- \tl_map_function:nN {#2} \um_keys_choices_fn:n
+ \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} } }
+\cs_new:Nn \um_keys_choices_aux:nnn { #1 / #2 .code:n = { \exp_not:n {#3} } , }
% \end{macrocode}
%
% \paragraph{math-style}
% \begin{macrocode}
\um_keys_choices:nn {normal-style}
{
- { {ISO} {
+ {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_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_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_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 } }
+ \bool_set_true:N \g_um_uplatin_bool }
+ {literal} {
+ \bool_set_true:N \g_um_literal_bool }
}
% \end{macrocode}
%
% \begin{macrocode}
\um_keys_choices:nn {math-style}
{
- { {ISO} {
+ {ISO} {
\unimathsetup { nabla=upright, partial=italic,
- normal-style=ISO, bold-style=ISO, sans-style=italic } } }
- { {TeX} {
+ 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} {
+ 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} {
+ 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} {
+ 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 } } }
+ normal-style=literal, bold-style=literal, sans-style=literal } }
}
% \end{macrocode}
%
@@ -1288,26 +1299,26 @@ This work is "author-maintained" by Will Robertson.
% \begin{macrocode}
\um_keys_choices:nn {bold-style}
{
- {{ISO} {
+ {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 }}
- {{TeX} {
+ \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 }}
- {{upright} {
+ \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 }}
- {{literal} {
- \bool_set_true:N \g_um_bfliteral_bool }}
+ \bool_set_true:N \g_um_bfuplatin_bool }
+ {literal} {
+ \bool_set_true:N \g_um_bfliteral_bool }
}
% \end{macrocode}
%
@@ -1315,9 +1326,9 @@ This work is "author-maintained" by Will Robertson.
% \begin{macrocode}
\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 } }
+ {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}
%
@@ -1326,22 +1337,22 @@ This work is "author-maintained" by Will Robertson.
% \begin{macrocode}
\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 } }
+ {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}
\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 } }
+ {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}
%
@@ -1349,8 +1360,8 @@ This work is "author-maintained" by Will Robertson.
% \begin{macrocode}
\um_keys_choices:nn {vargreek-shape}
{
- {{unicode} {\bool_set_false:N \g_um_texgreek_bool}}
- {{TeX} {\bool_set_true:N \g_um_texgreek_bool}}
+ {unicode} {\bool_set_false:N \g_um_texgreek_bool}
+ {TeX} {\bool_set_true:N \g_um_texgreek_bool}
}
% \end{macrocode}
%
@@ -1358,8 +1369,8 @@ This work is "author-maintained" by Will Robertson.
% \begin{macrocode}
\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}}
+ {literal} {\bool_set_true:N \g_um_literal_colon_bool}
+ {TeX} {\bool_set_false:N \g_um_literal_colon_bool}
}
% \end{macrocode}
%
@@ -1367,9 +1378,9 @@ This work is "author-maintained" by Will Robertson.
% \begin{macrocode}
\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}}}
+ {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}
%
@@ -1378,7 +1389,7 @@ This work is "author-maintained" by Will Robertson.
% \begin{macrocode}
\um_keys_choices:nn {active-frac}
{
- {{small}
+ {small}
{
\cs_if_exist:NTF \tfrac
{
@@ -1388,12 +1399,13 @@ This work is "author-maintained" by Will Robertson.
\bool_set_false:N \l_um_smallfrac_bool
}
\use:c {um_setup_active_frac:}
- }}
- {{normalsize}
+ }
+
+ {normalsize}
{
\bool_set_false:N \l_um_smallfrac_bool
\use:c {um_setup_active_frac:}
- }}
+ }
}
% \end{macrocode}
%
@@ -1414,9 +1426,9 @@ This work is "author-maintained" by Will Robertson.
% \begin{macrocode}
\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 } } }
+ {on} {} % default
+ {debug} { \msg_redirect_module:nnn { unicode-math } { log } { warning } }
+ {off} { \msg_redirect_module:nnn { unicode-math } { log } { none } }
}
% \end{macrocode}
%
@@ -1424,9 +1436,7 @@ This work is "author-maintained" by Will Robertson.
\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}
%
Please sign in to comment.
Something went wrong with that request. Please try again.