texlive[72720] Master/texmf-dist: spbmark (31oct24)

commits+karl at tug.org commits+karl at tug.org
Thu Oct 31 21:33:30 CET 2024


Revision: 72720
          https://tug.org/svn/texlive?view=revision&revision=72720
Author:   karl
Date:     2024-10-31 21:33:29 +0100 (Thu, 31 Oct 2024)
Log Message:
-----------
spbmark (31oct24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/spbmark/README.md
    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/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spbmark/README.md	2024-10-31 20:33:20 UTC (rev 72719)
+++ trunk/Master/texmf-dist/doc/latex/spbmark/README.md	2024-10-31 20:33:29 UTC (rev 72720)
@@ -1,5 +1,5 @@
 # The `spbmark` package
-Customize superscripts and subscripts (v1.46r)
+Customize superscripts and subscripts (v1.46t)
 
 ## Abstract
 `spbmark` provides three commands `\super`, `\sub` and `\supersub` to improve the layout of superscripts and subscripts which can be adjusted the relative position and format, and can be used in text and math mode.

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	2024-10-31 20:33:20 UTC (rev 72719)
+++ trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.tex	2024-10-31 20:33:29 UTC (rev 72720)
@@ -8,8 +8,8 @@
 \setcnltx
   {
     package           = spbmark,
-    version           = v1.46r,
-    date              = 2024/10/29,
+    version           = v1.46t,
+    date              = 2024/10/31,
     authors           = Qu Yi,
     title             = \spbmark{} package,
     info              = Customize superscripts and subscripts,
@@ -171,7 +171,7 @@
 \begin{demohigh}
 \spbset{sbhmove=-\llastwd,sbthiswd=auto,sbcmd=\color{red}}
 1A\super{bcd}\sub[thiswd=keep]{e}Some texts\sub{e} \\
-3A\super{bcd}\sub{e}Some texts\sub{e} \\
+2A\super{bcd}\sub{e}Some texts\sub{e} \\
 3A\sub{bcd}[thiswd=keep]\sub{e}Some texts\sub{e} \\
 4A\sub{bcd}\sub{e}Some texts\sub{e}
 \end{demohigh}
@@ -259,7 +259,7 @@
   \command{AddToHookWithArguments}[\Marg{spb/super/after}\oarg{label}\marg{code}]\nonl
   \command{AddToHookWithArguments}[\Marg{spb/sub/before}\oarg{label}\marg{code}]\nonl
   \command{AddToHookWithArguments}[\Marg{spb/sub/after}\oarg{label}\marg{code}]\newtag{New\\v1.46r}%
-  \pkg*{spbmark} gives hooks to markers with arguments in front and back positions, this feature requires support in the \hologo{LaTeX} kernel after \textbf{2023/06/01}. Argument \code{\#1} in the \meta{code} represents \code{super} or \code{sub}, and argument \code{\#2} represents the marker content itself.
+  \pkg*{spbmark} provides hooks to markers of \cs{super} and \cs{sub} with arguments in front and back positions, this feature requires support in the \hologo{LaTeX} kernel after \textbf{2023/06/01}. Argument \code{\#1} in the \meta{code} represents \code{super} or \code{sub}, and argument \code{\#2} represents the marker content itself.
 \begin{demohigh}
 \AddToHookWithArguments{spb/super/before}{\spbifmath{(#1-#2)}{[#1-#2]}}
 $\super{a}$\super{b}
@@ -266,6 +266,18 @@
 \RemoveFromHook{spb/super/before}
 \end{demohigh}
 \end{commands}
+\begin{commands}\setlength{\itemsep}{0pt}
+  \command{AddToHookWithArguments}[\Marg{spb/super*/before}\oarg{label}\marg{code}]\nonl
+  \command{AddToHookWithArguments}[\Marg{spb/super*/after}\oarg{label}\marg{code}]\nonl
+  \command{AddToHookWithArguments}[\Marg{spb/sub*/before}\oarg{label}\marg{code}]\nonl
+  \command{AddToHookWithArguments}[\Marg{spb/sub*/after}\oarg{label}\marg{code}]
+  Hook name with an asterisk indicates that this is the hook for the marker in the \cs{supersub} command.
+\end{commands}
+\begin{commands}\setlength{\itemsep}{0pt}
+  \command{AddToHookWithArguments}[\Marg{cmd+/super/after}\oarg{label}\marg{code}]\nonl
+  \command{AddToHookWithArguments}[\Marg{cmd+/sub/after}\oarg{label}\marg{code}]
+  The above hooks are located in the marker horizontal boxes, and these two hooks are located at the end of the group outside of the \cs{super} and \cs{sub} commands. Due to the addition of the peek command at the end of marker commands, using such as \code{cmd/super/after} hook directly would result in a peek error.
+\end{commands}
 
 \section{Examples of use}
 Here is a list of the three commands, please pay attention to the usage of optional parameter. Note when the horizontal move is negative, the starting point is at the right end of the mark.

Modified: trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty	2024-10-31 20:33:20 UTC (rev 72719)
+++ trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty	2024-10-31 20:33:29 UTC (rev 72720)
@@ -9,7 +9,7 @@
 %   https://creativecommons.org/licenses/by/4.0/legalcode
 \NeedsTeXFormat{LaTeX2e}[2018/12/31]
 \RequirePackage{xparse}
-\ProvidesExplPackage{spbmark}{2024/10/29}{1.46r}
+\ProvidesExplPackage{spbmark}{2024/10/31}{1.46t}
   {Customize superscripts and subscripts}
 
 \cs_generate_variant:Nn \box_set_ht:Nn { cv }
@@ -339,58 +339,62 @@
 \NewHookWithArguments{spb/super/after}{2}
 \NewHookWithArguments{spb/sub/before}{2}
 \NewHookWithArguments{spb/sub/after}{2}
-\cs_new:Npn \spb_math_print_store_i:nn #1#2
+\NewHookWithArguments{spb/super*/before}{2}
+\NewHookWithArguments{spb/super*/after}{2}
+\NewHookWithArguments{spb/sub*/before}{2}
+\NewHookWithArguments{spb/sub*/after}{2}
+\NewHookWithArguments{cmd+/super/after}{2}
+\NewHookWithArguments{cmd+/sub/after}{2}
+\cs_new:Npn \spb_math_print_store_i:nnnn #1#2#3#4
   {
     \hbox_gset:cn { g__#1_i_inner_box }
       {
-        \ensuremath
-          {
+        #3{
             \UseHookWithArguments{spb/#1/before}{2}{#1}{#2}
-            \use:c { spb at math@#1 at core }
-              { \tl_use:c { l__spb_#1_cmd_i_tl }{#2} }
+            \use:c {#4} { \tl_use:c { l__spb_#1_cmd_i_tl }{#2} }
             \UseHookWithArguments{spb/#1/after}{2}{#1}{#2}
           }
       }
     \dim_gset:Nv \rlastwd { l__spb_box_#1_wd_i_tl }
   }
+\cs_new:Npn \spb_math_print_store_i:nn #1#2
+  {
+    \spb_math_print_store_i:nnnn
+      {#1} {#2} { \ensuremath } { spb at math@#1 at core }
+  }
 \cs_new:Npn \spb_text_print_store_i:nn #1#2
   {
-    \hbox_gset:cn { g__#1_i_inner_box }
-      {
-        \UseHookWithArguments{spb/#1/before}{2}{#1}{#2}
-        \use:c { spb at text#1script at core }
-          { \tl_use:c { l__spb_#1_cmd_i_tl }{#2} }
-        \UseHookWithArguments{spb/#1/after}{2}{#1}{#2}
-      }
-    \dim_gset:Nv \rlastwd { l__spb_box_#1_wd_i_tl }
+    \spb_math_print_store_i:nnnn
+      {#1} {#2} { \use:n } { spb at text#1script at core }
   }
-\cs_new:Npn \spb_math_print_store_ii:nn #1#2
+\cs_new:Npn \spb_math_print_store_ii:nnnnn #1#2#3#4#5
   {
     \hbox_gset:Nn \g__super_ii_box
       {
-        \ensuremath
-          {
-            \UseHookWithArguments{spb/super/before}{2}{super}{#1}
-            \spb at math@super at core{\l__spb_super_cmd_ii_tl{#1}}
-            \UseHookWithArguments{spb/super/after}{2}{super}{#1}
+        #3{
+            \UseHookWithArguments{spb/super*/before}{2}{super}{#1}
+            #4{\l__spb_super_cmd_ii_tl{#1}}
+            \UseHookWithArguments{spb/super*/after}{2}{super}{#1}
           }
-       }
+      }
     \hbox_gset:Nn \g__sub_ii_box
       {
-        \ensuremath
-          {
-            \UseHookWithArguments{spb/sub/before}{2}{sub}{#2}
-            \spb at math@sub at core{\l__spb_sub_cmd_ii_tl{#2}}
-            \UseHookWithArguments{spb/sub/after}{2}{sub}{#2}
+        #3{
+            \UseHookWithArguments{spb/sub*/before}{2}{sub}{#2}
+            #5{\l__spb_sub_cmd_ii_tl{#2}}
+            \UseHookWithArguments{spb/sub*/after}{2}{sub}{#2}
           }
       }
   }
+\cs_new:Npn \spb_math_print_store_ii:nn #1#2
+  {
+    \spb_math_print_store_ii:nnnnn {#1} {#2}
+      { \ensuremath } { \spb at math@super at core } { \spb at math@sub at core }
+  }
 \cs_new:Npn \spb_text_print_store_ii:nn #1#2
   {
-    \hbox_gset:Nn \g__super_ii_box
-      { \spb at textsuperscript@core{\l__spb_super_cmd_ii_tl{#1}} }
-    \hbox_gset:Nn \g__sub_ii_box
-      { \spb at textsubscript@core{\l__spb_sub_cmd_ii_tl{#2}} }
+    \spb_math_print_store_ii:nnnnn {#1} {#2}
+      { \use:n } { \spb at textsuperscript@core } { \spb at textsubscript@core }
   }
 \cs_set_eq:NN \spbifmath \use_ii:nn
 \cs_new:Npn \spb at ifmathtrue { \cs_set_eq:NN \spbifmath \use_i:nn }
@@ -494,6 +498,7 @@
         \exp_last_unbraced:Nx
         \group_end:
           {
+            \UseHookWithArguments{cmd+/#1/after}{2}{#1}{##4}
             \exp_args:Nv \str_if_eq:nnT
               { l__spb_#1_thiswd_mode_tl } { auto }
               { \spb_clear_thiswd:n {#1} }



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