From 472bc9cb1b41fa04197e7684ac38bb1ea6550ee0 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Mon, 28 Jun 2021 20:37:07 +0000
Subject: spbmark (28jun21)

git-svn-id: svn://tug.org/texlive/trunk@59739 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/spbmark/spbmark.sty | 50 +++++++++++++++++--------
 1 file changed, 34 insertions(+), 16 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/spbmark/spbmark.sty')

diff --git a/Master/texmf-dist/tex/latex/spbmark/spbmark.sty b/Master/texmf-dist/tex/latex/spbmark/spbmark.sty
index addec2be2ef..2eb7406a8dc 100644
--- a/Master/texmf-dist/tex/latex/spbmark/spbmark.sty
+++ b/Master/texmf-dist/tex/latex/spbmark/spbmark.sty
@@ -13,7 +13,7 @@
 %%   https://creativecommons.org/licenses/by/4.0/legalcode
 \NeedsTeXFormat{LaTeX2e}[2020/10/01]
 \RequirePackage{l3keys2e}
-\ProvidesExplPackage{spbmark}{2021/06/26}{1.00}{beta}
+\ProvidesExplPackage{spbmark}{2021/06/28}{1.00a}{beta}
 
 \cs_new_protected:Npn \spb_define:n { \keys_define:nn { spbmark } }
 \cs_new_protected:Npn \spbset { \keys_set:nn { spbmark } }
@@ -43,10 +43,13 @@
     supersubalign .tl_set:N   = \l__spb_supersub_script_align_tl,
     supersubalign .initial:n  = l
   }
+
 \tl_set:Nn \l__spb_boxa_wd_tl { \box_wd:N \l_tmpa_box }
 \tl_set:Nn \l__spb_boxb_wd_tl { \box_wd:N \l_tmpb_box }
 \cs_new:Npn \spb_tmp_boxa_use: { \box_use:N \l_tmpa_box }
 \cs_new:Npn \spb_tmp_boxb_use: { \box_use:N \l_tmpb_box }
+\cs_new:Npn \spb_tmp_hboxa_set:n #1 { \hbox_set:Nn \l_tmpa_box {#1} }
+\cs_new:Npn \spb_tmp_hboxb_set:n #1 { \hbox_set:Nn \l_tmpb_box {#1} }
 \cs_new:Npn \spb_box_max_dim_horizontal:
   {
     \skip_horizontal:n
@@ -74,27 +77,34 @@
         { sub } { \sb }
       }
   }
+\cs_new_protected:Npn \spb_box_dp_ht_assign:nn #1#2
+  {
+    \tl_if_empty:nF {#1} { \box_set_ht:Nn \l_tmpb_box {#1} }
+    \tl_if_novalue:nF {#2} { \box_set_dp:Nn \l_tmpb_box {#2} }
+  }
 \clist_map_inline:nn
   { super,sub }
   {
     \exp_args:Nc \NewDocumentCommand {#1}
       {
-        sO{\dim_use:c { l__spb_#1_script_vshift_dim }}D(){}m
-        O{\dim_use:c { l__spb_#1_script_hshift_dim }}
+        sO{\dim_use:c { l__spb_#1_script_vshift_dim }}
+        >{\SplitArgument{1}{,}}O{}D(){}
+        mO{\dim_use:c { l__spb_#1_script_hshift_dim }}
       }
       {
         \IfBooleanTF{##1}
-          {\hbox_set:Nn \l_tmpa_box { $##3{\spb_math:nn {#1} {##4}}$ }}
+          {\spb_tmp_hboxa_set:n { $##4{\spb_math:nn {#1} {##5}}$ }}
           {
             \mode_if_math:TF
-              { \hbox_set:Nn \l_tmpa_box { $##3{\spb_math:nn {#1} {##4}}$ } }
+              { \spb_tmp_hboxa_set:n { $##4{\spb_math:nn {#1} {##5}}$ } }
               {
-                \hbox_set:Nn \l_tmpa_box
-                  { ##3{\use:c { spb@text#1script@save }{##4}} }
+                \spb_tmp_hboxa_set:n
+                  { ##4{\use:c { spb@text#1script@save }{##5}} }
               }
           }
-        \hbox_set_to_wd:Nnn \l_tmpb_box { \l__spb_boxa_wd_tl + ##5 }
+        \hbox_set_to_wd:Nnn \l_tmpb_box { \l__spb_boxa_wd_tl + ##6 }
           { \hss\box_move_up:nn {##2} { \spb_tmp_boxa_use: } }
+        \spb_box_dp_ht_assign:nn ##3
         \spb_tmp_boxb_use:
       }
   }
@@ -106,30 +116,33 @@
   {
     \IfBooleanTF{#1}
       {
-        \hbox_set:Nn \l_tmpa_box { $#4{\sp{#5}}$ }
-        \hbox_set:Nn \l_tmpb_box { $#8{\sb{#6}}$ }
+        \spb_tmp_hboxa_set:n { $#4{\sp{#5}}$ }
+        \spb_tmp_hboxb_set:n  { $#8{\sb{#6}}$ }
       }{
         \mode_if_math:TF
           {
-            \hbox_set:Nn \l_tmpa_box { $#4{\sp{#5}}$ }
-            \hbox_set:Nn \l_tmpb_box { $#8{\sb{#6}}$ }
+            \spb_tmp_hboxa_set:n { $#4{\sp{#5}}$ }
+            \spb_tmp_hboxb_set:n  { $#8{\sb{#6}}$ }
           }
           {
-            \hbox_set:Nn \l_tmpa_box { #4{\spb@textsuperscript@save{#5}} }
-            \hbox_set:Nn \l_tmpb_box { #8{\spb@textsubscript@save{#6}} }
+            \spb_tmp_hboxa_set:n { #4{\spb@textsuperscript@save{#5}} }
+            \spb_tmp_hboxb_set:n  { #8{\spb@textsubscript@save{#6}} }
           }
       }
     \hbox_set_to_wd:Nnn \l_tmpa_box { \l__spb_boxa_wd_tl + #7 }
       { \hss\box_move_up:nn {#2} { \spb_tmp_boxa_use: } }
     \hbox_set_to_wd:Nnn \l_tmpb_box { \l__spb_boxb_wd_tl + #7 }
       { \hss\box_move_down:nn {#2} { \spb_tmp_boxb_use: } }
-    \str_case:nnF {#3}
+    \str_case:onF {#3}
       {
         { l } { \use_i:nnn }
         { c } { \use_ii:nnn }
         { r } { \use_iii:nnn }
       }
-      { \use_i:nnn }
+      {
+        \msg_warning:nn { spbmark } { unsupported-align }
+        \use_i:nnn
+      }
       {
         \hbox_overlap_right:n { \spb_tmp_boxa_use: }
         \hbox_overlap_right:n { \spb_tmp_boxb_use: }
@@ -146,6 +159,11 @@
         \hbox_overlap_left:n { \spb_tmp_boxb_use: }
       }
   }
+\msg_new:nnn { spbmark } { unsupported-align }
+  {
+    Alignment~only~supports~l,~c,~and~r. \\
+    The~l~parameter~will~be~used~by~default.
+  }
 \cs_set_eq:NN \textsuperscript \super
 \cs_set_eq:NN \textsubscript \sub
 \cs_set:Npn \@makefnmark
-- 
cgit v1.2.3

