From 28da595db46ec1bef5fdb9a83d37bc5d9b98db76 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 16 Feb 2022 22:44:32 +0000 Subject: spbmark (15feb22) git-svn-id: svn://tug.org/texlive/trunk@62049 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/spbmark/spbmark.sty | 33 +++++++++++++++++-------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/spbmark/spbmark.sty b/Master/texmf-dist/tex/latex/spbmark/spbmark.sty index 9b3b44c9177..f273b8a9782 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}{2022/02/12}{1.36} +\ProvidesExplPackage{spbmark}{2022/02/15}{1.37} {Customize superscripts and subscripts} \cs_generate_variant:Nn \box_set_ht:Nn { cv } @@ -19,6 +19,7 @@ \cs_generate_variant:Nn \msg_warning:nnn { nnV } \cs_generate_variant:Nn \str_case:nn { x } \cs_generate_variant:Nn \tl_if_novalue:nF { V } +\cs_generate_variant:Nn \tl_if_blank:nF { v } \cs_new_protected:Npn \spb_define:n { \keys_define:nn { ctex/style } } \cs_new_protected:Npn \spbset { \keys_set:nn { ctex/style } } @@ -54,6 +55,21 @@ { supersub } {#3} } } +\NewDocumentCommand{\spb@both@vsep@assign} + {>{\SplitArgument{1}{,}}m} + {\spb_supersub_both_vsep:nn #1} +\cs_new_protected:Npn \spb_supersub_both_vsep:nn #1#2 + { + \tl_if_novalue:nTF {#2} + { + \tl_set:Nn \l__spb_super_vsep_ii_tl { #1/2 } + \tl_set:Nn \l__spb_sub_vsep_ii_tl { #1/2 } + } + { + \tl_set:Nn \l__spb_super_vsep_ii_tl {#1} + \tl_set:Nn \l__spb_sub_vsep_ii_tl {#2} + } + } \cs_new_protected:Npn \defspbstyle #1#2 { \spb_define:n @@ -70,7 +86,7 @@ mode .initial:n = match, style .choice:, style .value_required:n = true, - vsep .tl_set:N = \l__spb_supersub_vsep_tl, + vsep .code:n = \spb@both@vsep@assign{#1}, vsep .initial:n = 0.6ex, halign .tl_set:N = \l__spb_supersub_halign_tl, halign .initial:n = l, @@ -89,7 +105,7 @@ \spb_local_case_init:nnn { \tl_set:Nn \l__spb_super_vmove_tl {#1} } { \tl_set:Nn \l__spb_sub_vmove_tl {#1} } - { \tl_set:Nn \l__spb_supersub_vsep_tl {#1} } + { \spb@both@vsep@assign{#1} } }, hmove .code:n = { @@ -119,17 +135,14 @@ } \cs_generate_variant:Nn \spb_box_super_move_up_ii:n { V } \cs_generate_variant:Nn \spb_box_sub_move_down_ii:n { V } -\dim_new:N \l__spb_supersub_half_vsep_tl \providecommand{\hbox_overlap_center:n}[1] { \hbox_to_zero:n { \hss #1\hss } } \cs_new:Npn \spb_hbox_overlap_vmove_ii:n #1 { - \tl_set:Nn \l__spb_supersub_half_vsep_tl - { \l__spb_supersub_vsep_tl/2 } \use:c { hbox_overlap_#1:n } - { \spb_box_super_move_up_ii:V \l__spb_supersub_half_vsep_tl } + { \spb_box_super_move_up_ii:V \l__spb_super_vsep_ii_tl } \use:c { hbox_overlap_#1:n } - { \spb_box_sub_move_down_ii:V \l__spb_supersub_half_vsep_tl } + { \spb_box_sub_move_down_ii:V \l__spb_sub_vsep_ii_tl } } \tl_new:N \l__spb_super_cmd_ii_tl @@ -203,9 +216,9 @@ } \cs_new_protected:Npn \spb_ht_dp_assign:nnn #1#2#3 { - \tl_if_empty:cF { l__#1_height_#3_tl } + \tl_if_blank:vF { l__#1_height_#3_tl } { \box_set_ht:cv { l__#1_#3_box } { l__#1_height_#3_tl } } - \tl_if_empty:cF { l__#1_depth_i_tl } + \tl_if_blank:vF { l__#1_depth_i_tl } { \box_set_dp:cv { l__#2_#3_box } { l__#2_depth_#3_tl } } } -- cgit v1.2.3