texlive[62049] Master/texmf-dist: spbmark (15feb22)

commits+karl at tug.org commits+karl at tug.org
Wed Feb 16 23:44:32 CET 2022


Revision: 62049
          http://tug.org/svn/texlive?view=revision&revision=62049
Author:   karl
Date:     2022-02-16 23:44:32 +0100 (Wed, 16 Feb 2022)
Log Message:
-----------
spbmark (15feb22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.pdf
    trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.tex
    trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty

Modified: trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.tex	2022-02-16 22:44:12 UTC (rev 62048)
+++ trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.tex	2022-02-16 22:44:32 UTC (rev 62049)
@@ -6,8 +6,8 @@
   {
     package           = spbmark,
     title             = the spbmark package,
-    version           = v1.36,
-    date              = 2022/02/12,
+    version           = v1.37,
+    date              = 2022/02/15,
     authors           = Qu Yi,
     info              = Customize superscript and subscript,
     email             = q1jx at foxmail.com,
@@ -30,7 +30,11 @@
     \newcommand{#2}[2]
       {\code{\textcolor{argument}{#3\textnormal{#1{##1}{##2}}#4}}}
   }
-\newcommand{\kvsplit}[3]{\item\code{\option{#1}\cnltx at isvalue\splitmarg{#2}{#3}}}
+\newcommand{\kvsplit}[3]
+  {
+    \item\code{\option{#1}\cnltx at isvalue\splitmarg{#2}{#3}}
+    \cnltx at checkdefault{\hfill\newline}
+  }
 \newsplitarg{\splitoarg}{[}{]}
 \newsplitarg{\splitmarg}{\{}{\}}
 \newsplitarg{\splitdarg}{(}{)}
@@ -112,7 +116,7 @@
   \pkg*{spbmark} uses the \cs{spbset} command to control the global default format of superscript and subscript. These options also apply to \meta{kv list} of the above commands. The values ​​set by it will be overwritten by the optional parameters of the superscript and other commands.
 \end{commands}
 
-The following list of keys control the format both of superscript or subscript.
+The following list of keys control the format both of superscript \textcolor{red}{or} subscript.
 \begin{options}
   \keyval{spvmove}{fixed length}\Default{0pt}
   Extra vertical move of the superscript. 
@@ -144,22 +148,22 @@
   The distance between the subscript baseline and the next line.
 \end{options}
 
-If \option{sphmove} is positive, the superscript or subscript moves to the right, conversely it moves to the left. However, for superscript, if \option{spvmove} is positive, the superscript moves up, conversely it moves down. For subscript, if \option{spvmove} is positive, the subscript moves down, conversely it moves up.
+If \option{sphmove} is positive, the superscript or subscript moves to the right, conversely it moves to the left. The positive direction of vertical offset of subscript and superscript is opposite. For superscript, if \option{spvmove} is positive, the superscript moves up, conversely it moves down. For subscript, if \option{spvmove} is positive, the subscript moves down, conversely it moves up.
 
-The following list of keys control the format of superscript and subscript.
+The following list of keys control the format of superscript \textcolor{red}{and} subscript.
 \begin{options}
   \keyval{spbhmove}{fixed length}\Default{0pt}
   Extra vertical move of the superscript and the subscript.
-  \kvsplit{spbcmd}{super cmds}{sub cmds} \newline
+  \kvsplit{spbcmd}{super cmds}{sub cmds}
   The format commands of superscript and subscript. The first part is in superscript format, and the latter part is in subscript format. They are separated by commas, or only the first part exists.
-  \kvsplit{spbcmd+}{super cmds}{sub cmds} \newline
+  \kvsplit{spbcmd+}{super cmds}{sub cmds}
   Add code to the previous global superscript and subscript format commands.
   \keyval{spbheight}{fixed length}
   The distance between the superscript baseline and the previous line.
   \keyval{spbdepth}{fixed length}
   The distance between the subscript baseline and the next line.
-  \keyval{vsep}{fixed length}\Default{0.6ex}
-  The extra vertical distance between superscript and subscript.
+  \kvsplit{vsep}{super move}{sub move}\Default{0.6ex}\newtag[Changed]%
+  The extra vertical distance between superscript and subscript. The front part is the movement amount of the superscript, and the latter part is the movement amount of the subscript. If only the front part means that both are vertically shifted by one-half of the current value.
   \keychoice{halign}{l,c,r}\Default{l}
   The alignment of superscript and subscript, which contains \code{l}, \code{c}, and \code{r} parameters respectively for left, center, and right alignment.
 \end{options}

Modified: trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty	2022-02-16 22:44:12 UTC (rev 62048)
+++ trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty	2022-02-16 22:44:32 UTC (rev 62049)
@@ -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 at both@vsep at 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 at both@vsep at 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 at both@vsep at 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 } }
   }
 



More information about the tex-live-commits mailing list.