diff options
author | Karl Berry <karl@freefriends.org> | 2021-12-17 22:39:01 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-12-17 22:39:01 +0000 |
commit | 7a3cf7246192fea096bd094f8bed55cf879a458a (patch) | |
tree | 8e45b51712285a86f03b8f60f53516dc3cb9e689 /Master/texmf-dist/tex/latex | |
parent | 1a8e14082561ae158650ab8bb04fdcbc54802cac (diff) |
spbmark (17dec21)
git-svn-id: svn://tug.org/texlive/trunk@61337 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/spbmark/spbmark.sty | 54 |
1 files changed, 22 insertions, 32 deletions
diff --git a/Master/texmf-dist/tex/latex/spbmark/spbmark.sty b/Master/texmf-dist/tex/latex/spbmark/spbmark.sty index 37be59700cc..72c6240a5fe 100644 --- a/Master/texmf-dist/tex/latex/spbmark/spbmark.sty +++ b/Master/texmf-dist/tex/latex/spbmark/spbmark.sty @@ -9,7 +9,7 @@ % https://creativecommons.org/licenses/by/4.0/legalcode \NeedsTeXFormat{LaTeX2e}[2018/12/31] \RequirePackage{xparse,l3keys2e} -\ProvidesExplPackage{spbmark}{2021/12/15}{1.2A} +\ProvidesExplPackage{spbmark}{2021/12/16}{1.2B} {Customize superscripts and subscripts} \cs_generate_variant:Nn \dim_max:nn { VV } @@ -130,50 +130,40 @@ } \cs_set_eq:NN \spb@textsuperscript@save \textsuperscript \cs_set_eq:NN \spb@textsubscript@save \textsubscript -\cs_set_eq:NN \spb@sp@save \sp -\cs_set_eq:NN \spb@sb@save \sb -\cs_new:Npn \spb_math:nn #1 - { - \str_case:nn {#1} - { - { super } { \spb@sp@save } - { sub } { \spb@sb@save } - } - } +\cs_set_eq:NN \spb@math@super@save \sp +\cs_set_eq:NN \spb@math@sub@save \sb \cs_new:Npn \spb_math_print_store_i:nn #1#2 { \hbox_set:Nn \l_tmpa_box - { \ensuremath{\tl_use:c { l__spb_#1_cmd_i_tl }{\spb_math:nn {#1} {#2}}} } + { + \ensuremath + { + \use:c { spb@math@#1@save } + { \tl_use:c { l__spb_#1_cmd_i_tl }{#2} } + } + } } \cs_new:Npn \spb_text_print_store_i:nn #1#2 { \hbox_set:Nn \l_tmpa_box - { \tl_use:c { l__spb_#1_cmd_i_tl }{\use:c { spb@text#1script@save }{#2}} } + { + \use:c { spb@text#1script@save } + { \tl_use:c { l__spb_#1_cmd_i_tl }{#2} } + } } \cs_new:Npn \spb_math_print_store_ii:nn #1#2 { - \hbox_set:Nn \l_tmpa_box - { \ensuremath{\l__spb_super_cmd_ii_tl{\spb@sp@save{#1}}} } + \hbox_set:Nn \l_tmpa_box + { \ensuremath{\spb@math@super@save{\l__spb_super_cmd_ii_tl{#1}}} } \hbox_set:Nn \l_tmpb_box - { - \ensuremath - { - \tl_if_novalue:VF \l__spb_sub_cmd_ii_tl - { \l__spb_sub_cmd_ii_tl } - { \spb@sb@save{#2} } - } - } + { \ensuremath{\spb@math@sub@save{\l__spb_sub_cmd_ii_tl{#2}}} } } \cs_new:Npn \spb_text_print_store_ii:nn #1#2 { \hbox_set:Nn \l_tmpa_box - { \l__spb_super_cmd_ii_tl{\spb@textsuperscript@save{#1}} } + { \spb@textsuperscript@save{\l__spb_super_cmd_ii_tl{#1}} } \hbox_set:Nn \l_tmpb_box - { - \tl_if_novalue:VF \l__spb_sub_cmd_ii_tl - { \l__spb_sub_cmd_ii_tl } - { \spb@textsubscript@save{#2} } - } + { \spb@textsubscript@save{\l__spb_sub_cmd_ii_tl{#2}} } } \cs_new_protected:Npn \spb_box_ht_dp_assign:nn #1#2 { @@ -199,7 +189,7 @@ { match } {#3} } } -\cs_new_protected:Npn \spb_local_value_init:n #1 +\cs_new_protected:Npn \spb_global_value_init:n #1 { \tl_gset:Nn \g__spb_hshift_init_tl {#1} \tl_gset:Nn \g__spb_vshift_init_tl {#1} @@ -212,7 +202,7 @@ {O{}>{\SplitArgument{1}{,}}O{}mO{}} { \group_begin: - \spb_local_value_init:n {#1} + \spb_global_value_init:n {#1} \keys_set:nn { ctex/style } {##1,##4} \spb_mode_switch:nnn { \spb_math_print_store_i:nn {#1} {##3} } @@ -261,7 +251,7 @@ \NewDocumentCommand{\supersub}{O{}mmO{}} { \group_begin: - \spb_local_value_init:n { supersub } + \spb_global_value_init:n { supersub } \keys_set:nn { ctex/style } {#1,#4} \spb_mode_switch:nnn { \spb_math_print_store_ii:nn {#2} {#3} } |