texlive[60106] Master/texmf-dist: spbmark (28jul21)

commits+karl at tug.org commits+karl at tug.org
Wed Jul 28 22:48:42 CEST 2021


Revision: 60106
          http://tug.org/svn/texlive?view=revision&revision=60106
Author:   karl
Date:     2021-07-28 22:48:41 +0200 (Wed, 28 Jul 2021)
Log Message:
-----------
spbmark (28jul21)

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	2021-07-28 20:48:28 UTC (rev 60105)
+++ trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.tex	2021-07-28 20:48:41 UTC (rev 60106)
@@ -6,8 +6,8 @@
   {
     package   = spbmark,
     title     = the spbmark package,
-    version   = v1.06,
-    date      = 2021/07/26,
+    version   = v1.08,
+    date      = 2021/07/28,
     authors   = Qu Yi,
     info      = Customize superscript and subscript,
     email     = quee123 at foxmail.com,
@@ -23,6 +23,26 @@
     pre-output        = {\parindent = 0em}
   }
 
+\makeatletter
+\newcommand{\splitmeta}[2]
+  {%
+    \ensuremath{\langle}%
+    \textcolor{meta}{\argumentformat #1}%
+    \ensuremath{\rangle,\langle}%
+    \textcolor{meta}{\argumentformat #2}%
+    \ensuremath{\rangle}%
+  }
+\newcommand{\newsplitarg}[4][\splitmeta]
+  {
+    \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}}}
+\newsplitarg{\splitoarg}{[}{]}
+\newsplitarg{\splitmarg}{\{}{\}}
+\makeatother
+
 \begin{document}
 
 \section{Macro package options}
@@ -37,20 +57,18 @@
 \section{User commands}
 There are currently three commands to set superscript and subscript. Their format can be set temporarily using the optional parameters of the command, or set globally using a key-value list, see section \ref{sec:global control interface}.
 \begin{commands}
-  \command{super}[\sarg\oarg{vshift}\oarg{height,depth}\darg{code}\marg{content}\oarg{hshift}]
-  This is a superscript output command.
-  \command{sub}[\sarg\oarg{vshift}\oarg{height,depth}\darg{code}\marg{content}\oarg{hshift}]
-  This is a subscript output command.
+  \command{super}[\sarg\oarg{vshift}\splitoarg{height}{depth}\darg{code}\marg{content}\oarg{hshift}]
+  This is a superscript output command. If \meta{vshift} or \meta{hshift} is a positive value, the superscript moves up or to the right, if it's negative, the superscript moves down or to the left.
+  \command{sub}[\sarg\oarg{vshift}\splitoarg{height}{depth}\darg{code}\marg{content}\oarg{hshift}]
+  This is a subscript output command. If \meta{vshift} or \meta{hshift} is a positive value, the subscript moves down or to the right, if it's negative, the subscript moves up or to the left.
   \command{supersub}[\sarg\oarg{vsep}\oarg{align}\darg{sup code}\marg{sup cont}\marg{sub cont}\oarg{hshift}\darg{sub code}]
-  This is a command that outputs both superscript and subscript at the same time.
+  This is a command that outputs both superscript and subscript at the same time. The \meta{vsep} represents the vertical spacing between superscript and subscript, same as option \option{supersubsep}. The parameters of \meta{align} are the same as the \option{supersubalign}.
 \end{commands}
 
 These commands can match the corresponding pattern depending on whether they are currently in text mode or mathematical mode, or they can use an asterisk variant to force the mathematical pattern. 
 
-The \meta{vshift} and \meta{hshift} represent respectively vertical and horizontal offsets of superscript or subscript, their default value is \code{0pt}. If it is positive, move up or right, or if it is negative, move left or down. The parameters of \meta{script align} are the same as the \option{supersubalign}.
+The optional parameter \splitmeta{height}{depth} generally does not need to be used. The \meta{height} and \meta{depth} are separated by commas. Only the front part indicates the \meta{height} of the superscript or subscript, and only the back part indicates the \meta{depth}.
 
-The optional parameter \meta{height,depth} generally does not need to be used. The \meta{height} and \meta{depth} are separated by commas. Only the front part indicates the height of the superscript or subscript, and only the back part indicates the depth.
-
 The \meta{code} is used to format superscript and subscript, and can insert commands such as fonts or colors. The last command in the code can take an argument, which is either a superscript or a subscript.
 
 If you need to use the original definitions of \cs{textsuperscript}, \cs{textsubscript}, \cs{sp} and \cs{sb} after using the \option{newsupb} option, then you can use the following commands:
@@ -92,7 +110,7 @@
 \begin{options}
   \keyval{supersub-hshift}{fixed length}\Default{0pt}
   Extra vertical shift of the superscript and the subscript.
-  \keyval{supersub-format}{super code,sub code}\Default{0pt}
+  \kvsplit{supersub-format}{super code}{sub code}\Default{0pt}
   Control the format of superscript or subscript. The first part is in superscript format, and the latter part is in subscript format. The two are separated by commas, or only the first part exists.
   \keyval{supersubsep}{rubber length}\Default{0.3ex}
   The distance between superscript and subscript, its default value is \code{0.3ex}.
@@ -120,7 +138,7 @@
 \pkg*{spbmark} also patches the footer markers for standard document class and \cls*{KOMA-Script}. You can format the footer markers by redefining the \cs{fnmarkfont} command. Note that extra horizontal shift does not work with footnote markers.
 
 \section{Known issues}
-At present, the vertical and horizontal offsets are effective for the unit commands in the \pkg*{siunitx} macro package. However, due to the special mechanism that the decimal point is not recognized correctly because it is converted to a space in the \cs*{unit} command, it is recommended to use \code{pt} as the unit of offset.
+At present, the vertical and horizontal offsets are effective for the unit commands in the \pkg*{siunitx} macro package. However, due to the special mechanism that the decimal point is not recognized correctly because it's converted to a space in the \cs*{unit} command, it's recommended to use \code{pt} as the unit of offset.
 
 \nocite{*}
 

Modified: trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty	2021-07-28 20:48:28 UTC (rev 60105)
+++ trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty	2021-07-28 20:48:41 UTC (rev 60106)
@@ -7,9 +7,9 @@
 % conditions of the CC-BY 4.0 License.
 % The latest version of this license is in
 %   https://creativecommons.org/licenses/by/4.0/legalcode
-\NeedsTeXFormat{LaTeX2e}[2020/10/01]
+\NeedsTeXFormat{LaTeX2e}[2018/12/31]
 \RequirePackage{xparse,l3keys2e}
-\ProvidesExplPackage{spbmark}{2021/07/26}{1.06}
+\ProvidesExplPackage{spbmark}{2021/07/28}{1.08}
   {Customize superscripts and subscripts}
 
 \cs_new_protected:Npn \spb_define:n { \keys_define:nn { spbmark } }
@@ -55,12 +55,16 @@
 \tl_set:Nn \l__spb_boxb_wd_tl { \box_wd:N \l_tmpb_box }
 \tl_set:Nn \l__spb_box_max_wd_tl
   { \dim_max:nn { \l__spb_boxa_wd_tl } { \l__spb_boxb_wd_tl } }
-\cs_new:Npn \spb_tmp_boxa_use_vmove:n #1
+\providecommand{\hbox_overlap_center:n}[1]
+  { \hbox_to_zero:n { \hss #1\hss } }
+\cs_new:Npn \spb_boxa_move_up:n #1
   { \box_move_up:nn {#1} { \box_use:N \l_tmpa_box } }
-\cs_new:Npn \spb_hbox_overlap_position:n #1
+\cs_new:Npn \spb_boxb_move_down:n #1
+  { \box_move_down:nn {#1} { \box_use:N \l_tmpb_box } }
+\cs_new:Npn \spb_hbox_overlap_vshift:n #1#2
   {
-    \use:c { hbox_overlap_#1:n } { \box_use:N \l_tmpa_box }
-    \use:c { hbox_overlap_#1:n } { \box_use:N \l_tmpb_box }
+    \use:c { hbox_overlap_#2:n } { \spb_boxa_move_up:n {#1} }
+    \use:c { hbox_overlap_#2:n } { \spb_boxb_move_down:n {#1} }
   }
 \cs_new:Npn \spb_math_print_store:nnn #1#2#3
   {
@@ -128,7 +132,7 @@
               { \spb_math_print_store:nnn {##4} {#1} {##5} }
               { \spb_text_print_store:nnn {##4} {#1} {##5} }
           }
-        \hbox_set:Nn \l_tmpb_box
+        \hbox_set:Nn \l_tmpa_box
           {
             \dim_compare:nNnTF {##6} < { 0pt }
               {
@@ -135,16 +139,16 @@
                 \hbox_overlap_left:n
                   {
                     \hbox_to_wd:nn { \l__spb_boxa_wd_tl - ##6 }
-                      { \spb_tmp_boxa_use_vmove:n {##2}\hss }
+                      { \spb_boxa_move_up:n {##2}\hss }
                   }
               }
               {
                 \hbox_to_wd:nn { \l__spb_boxa_wd_tl + ##6 }
-                  { \hss\spb_tmp_boxa_use_vmove:n {##2} }
+                  { \hss\spb_boxa_move_up:n {##2} }
               }
           }
         \spb_box_ht_dp_assign:nn ##3
-        \box_use:N \l_tmpb_box
+        \box_use:N \l_tmpa_box
       }
   }
 \NewDocumentCommand{\supersub}
@@ -163,10 +167,6 @@
           { \spb_math_print_store:nnnn {#4} {#5} {#8} {#6} }
           { \spb_text_print_store:nnnn {#4} {#5} {#8} {#6} }
       }
-    \hbox_set:Nn \l_tmpa_box
-      { \box_move_up:nn {#2} { \box_use:N \l_tmpa_box } }
-    \hbox_set:Nn \l_tmpb_box
-      { \box_move_down:nn {#2} { \box_use:N \l_tmpb_box } }
     \str_case:onF {#3}
       {
         { l } { \use_i:nnn }
@@ -182,14 +182,17 @@
           {
             \hbox_overlap_left:n
               {
-                \spb_hbox_overlap_position:n { right }
+                \spb_hbox_overlap_vshift:n {#2} { right } 
                 \skip_horizontal:n { -#7 }
               }
           }
           {
-            \skip_horizontal:n {#7}
-            \spb_hbox_overlap_position:n { right }
-            \skip_horizontal:n { \l__spb_box_max_wd_tl }
+            \hbox:n
+              {
+                \skip_horizontal:n {#7}
+                \spb_hbox_overlap_vshift:n {#2} { right } 
+                \skip_horizontal:n { \l__spb_box_max_wd_tl }
+              }
           }
       }
       {
@@ -197,14 +200,17 @@
           {
             \hbox_overlap_left:n
               {
-                \spb_hbox_overlap_position:n { center }
+                \spb_hbox_overlap_vshift:n {#2} { center } 
                 \skip_horizontal:n { \l__spb_box_max_wd_tl/2 - #7 }
               }
           }
           {
-            \skip_horizontal:n { \l__spb_box_max_wd_tl/2 + #7 }
-            \spb_hbox_overlap_position:n { center }
-            \skip_horizontal:n { \l__spb_box_max_wd_tl/2 }
+            \hbox:n
+              {
+                \skip_horizontal:n { \l__spb_box_max_wd_tl/2 + #7 }
+                \spb_hbox_overlap_vshift:n {#2} { center } 
+                \skip_horizontal:n { \l__spb_box_max_wd_tl/2 }
+              }
           }
       }
       {
@@ -212,13 +218,16 @@
           {
             \hbox_overlap_left:n
               {
-                \spb_hbox_overlap_position:n { left }
+                \spb_hbox_overlap_vshift:n {#2} { left } 
                 \skip_horizontal:n { -#7 }
               }
           }
           {
-            \skip_horizontal:n { \l__spb_box_max_wd_tl + #7 }
-            \spb_hbox_overlap_position:n { left }
+            \hbox:n
+              {
+                \skip_horizontal:n { \l__spb_box_max_wd_tl + #7 }
+                \spb_hbox_overlap_vshift:n {#2} { left } 
+              }
           }
       }
   }



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