texlive[59777] Master/texmf-dist: spbmark (30jun21)

commits+karl at tug.org commits+karl at tug.org
Wed Jun 30 23:18:14 CEST 2021


Revision: 59777
          http://tug.org/svn/texlive?view=revision&revision=59777
Author:   karl
Date:     2021-06-30 23:18:14 +0200 (Wed, 30 Jun 2021)
Log Message:
-----------
spbmark (30jun21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.pdf
    trunk/Master/texmf-dist/source/latex/spbmark/spbmark.dtx
    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/source/latex/spbmark/spbmark.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/spbmark/spbmark.dtx	2021-06-30 21:17:59 UTC (rev 59776)
+++ trunk/Master/texmf-dist/source/latex/spbmark/spbmark.dtx	2021-06-30 21:18:14 UTC (rev 59777)
@@ -23,7 +23,7 @@
 %
 % \title{\pkg{spbmark} -- Superscript and subscript of text}
 % \author{Qu Yi}
-% \date{2021/06/28\hskip 1em\relax v1.00a\thanks{\url{https://github.com/texl3/spbmark}}}
+% \date{2021/06/30\hskip 1em\relax v1.01\thanks{\url{https://github.com/texl3/spbmark}}}
 %
 % \maketitle
 % \begin{abstract}
@@ -32,12 +32,17 @@
 % \tableofcontents
 %
 % \section{Macro package options}
+% \label{sec:macro package options}
 % \begin{function}[added = 2021-06-26]{ctex}
-%   This option works with the C\TeX{} document class used by simplified Chinese users, there's actually no functional change. Adding path \texttt{style} to \tn{ctexset} command, which is equivalent to using \tn{spbset}.
+% This option works with the C\TeX{} document class used by simplified Chinese users, there's actually no functional change. Adding path \texttt{style} to \tn{ctexset} command, which is equivalent to using \tn{spbset}.
 % \end{function}
 %
+% \begin{function}[added = 2021-06-30]{newsupb}
+% \texttt{newsupb} is a boolean option with a default value of true that redefines the \LaTeX{} kernel commands to cause \tn{sp} and \tn{textsuperscript} are equivalent to \tn{super} command, and \tn{sb} and \tn{textsubscript} are equivalent to \tn{sub} command.
+% \end{function}
+%
 % \section{User commands}
-% \begin{function}[added = 2021-06-26,updated = 2021-06-28]{\super,\sub,\supersub,\textsuperscript,\textsubscript}
+% \begin{function}[added = 2021-06-26,updated = 2021-06-28]{\super,\sub,\supersub}
 % \begin{syntax}
 %   \tn{super*}\oarg{vshift}[<height>,<depth>]\parg{code}\marg{content}\oarg{hshift}
 %   \tn{sub*}\oarg{vshift}[<height>,<depth>]\parg{code}\marg{content}\oarg{hshift}
@@ -54,8 +59,12 @@
 %
 % The \meta{code} is used to format superscripts and subscripts, 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.
 %
-% The \tn{textsuperscript} and \tn{textsubscript} commands have been redefined to be equivalent to \tn{super} and \tn{sub} respectively, if you need to use their original definitions, then \tn{spb at textsuperscript@save} and \tn{spb at textsubscript@save} will be available.
+% \begin{function}[added = 2021-06-30]{\sp,\sb,\spb,\textsuperscript,\textsubscript}
+% Except for the \tn{spb} command which is equivalent to \tn{supersub}, the others are \LaTeX{} kernel commands. If you use the \texttt{newsupb} package options then they will be redefined to make the command shorter, see section \ref{sec:macro package options}.
 %
+% If you need to use the original definitions of \tn{textsuperscript} and \tn{textsubscript}, then \tn{spb at textsuperscript@save} and \tn{spb at textsubscript@save} will be available. If you need to use the original definitions of \tn{sp} and \tn{sb}, then \tn{spb at sp@save} and \tn{spb at sb@save} will be available.
+% \end{function}
+%
 % \section{Global control interface}
 % \begin{function}[added = 2021-06-26]{\spbset}
 % \begin{syntax}
@@ -125,19 +134,23 @@
 %
 % \StopEventually{}
 %<*package>
-\NeedsTeXFormat{LaTeX2e}[2020/10/01]
-\RequirePackage{l3keys2e}
-\ProvidesExplPackage{spbmark}{2021/06/28}{1.00a}{beta}
+\NeedsTeXFormat{LaTeX2e}[2018/12/31]
+\RequirePackage{xparse,l3keys2e}
+\ProvidesExplPackage{spbmark}{2021/06/30}{1.01}
+  {Customize superscripts and subscripts}
 
 \cs_new_protected:Npn \spb_define:n { \keys_define:nn { spbmark } }
 \cs_new_protected:Npn \spbset { \keys_set:nn { spbmark } }
 \keys_define:nn { spbmark/option }
   {
-    ctex .code:n =
+    ctex .code:n        =
       {
         \cs_set:Npn \spb_define:n { \keys_define:nn { ctex/style } }
         \cs_set:Npn \spbset { \keys_set:nn { ctex/style } }
-      }
+      },
+    newsupb .bool_set:N = \l__spb_new_supersub_bool,
+    newsupb .default:n  = true,
+    newsupb .initial:n  = true
   }
 
 \ProcessKeysOptions{spbmark/option}
@@ -183,15 +196,17 @@
   }
 \cs_set_eq:NN \spb at textsuperscript@save \textsuperscript
 \cs_set_eq:NN \spb at textsubscript@save \textsubscript
+\cs_set_eq:NN \spb at sp@save \sp
+\cs_set_eq:NN \spb at sb@save \sb
 \cs_new:Npn \spb_math:nn #1
   {
     \str_case:nn {#1}
       {
-        { super } { \sp }
-        { sub } { \sb }
+        { super } { \spb at sp@save }
+        { sub } { \spb at sb@save }
       }
   }
-\cs_new_protected:Npn \spb_box_dp_ht_assign:nn #1#2
+\cs_new_protected:Npn \spb_box_ht_dp_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} }
@@ -218,7 +233,7 @@
           }
         \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_box_ht_dp_assign:nn ##3
         \spb_tmp_boxb_use:
       }
   }
@@ -230,13 +245,13 @@
   {
     \IfBooleanTF{#1}
       {
-        \spb_tmp_hboxa_set:n { $#4{\sp{#5}}$ }
-        \spb_tmp_hboxb_set:n  { $#8{\sb{#6}}$ }
+        \spb_tmp_hboxa_set:n { $#4{\spb at sp@save{#5}}$ }
+        \spb_tmp_hboxb_set:n  { $#8{\spb at sb@save{#6}}$ }
       }{
         \mode_if_math:TF
           {
-            \spb_tmp_hboxa_set:n { $#4{\sp{#5}}$ }
-            \spb_tmp_hboxb_set:n  { $#8{\sb{#6}}$ }
+            \spb_tmp_hboxa_set:n { $#4{\spb at sp@save{#5}}$ }
+            \spb_tmp_hboxb_set:n  { $#8{\spb at sb@save{#6}}$ }
           }
           {
             \spb_tmp_hboxa_set:n { #4{\spb at textsuperscript@save{#5}} }
@@ -278,8 +293,20 @@
     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
+
+\bool_if:NT \l__spb_new_supersub_bool
+  {
+    \clist_map_inline:nn
+      {
+        { sp,sb },
+        { textsuperscript,textsubscript }
+      }
+      {
+        \cs_set_eq:cN { \clist_item:nn {#1} { 1 } } \super
+        \cs_set_eq:cN { \clist_item:nn {#1} { 2 } } \sub
+      }
+  }
+\cs_set_eq:NN \spb \supersub
 \cs_set:Npn \@makefnmark
   { \hbox:n { \fnmarkfont\super{\@thefnmark}[0pt] } }
 \cs_if_exist:NTF \ftntm at font

Modified: trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty	2021-06-30 21:17:59 UTC (rev 59776)
+++ trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty	2021-06-30 21:18:14 UTC (rev 59777)
@@ -11,19 +11,23 @@
 %% 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]
-\RequirePackage{l3keys2e}
-\ProvidesExplPackage{spbmark}{2021/06/28}{1.00a}{beta}
+\NeedsTeXFormat{LaTeX2e}[2018/12/31]
+\RequirePackage{xparse,l3keys2e}
+\ProvidesExplPackage{spbmark}{2021/06/30}{1.01}
+  {Customize superscripts and subscripts}
 
 \cs_new_protected:Npn \spb_define:n { \keys_define:nn { spbmark } }
 \cs_new_protected:Npn \spbset { \keys_set:nn { spbmark } }
 \keys_define:nn { spbmark/option }
   {
-    ctex .code:n =
+    ctex .code:n        =
       {
         \cs_set:Npn \spb_define:n { \keys_define:nn { ctex/style } }
         \cs_set:Npn \spbset { \keys_set:nn { ctex/style } }
-      }
+      },
+    newsupb .bool_set:N = \l__spb_new_supersub_bool,
+    newsupb .default:n  = true,
+    newsupb .initial:n  = true
   }
 
 \ProcessKeysOptions{spbmark/option}
@@ -69,15 +73,17 @@
   }
 \cs_set_eq:NN \spb at textsuperscript@save \textsuperscript
 \cs_set_eq:NN \spb at textsubscript@save \textsubscript
+\cs_set_eq:NN \spb at sp@save \sp
+\cs_set_eq:NN \spb at sb@save \sb
 \cs_new:Npn \spb_math:nn #1
   {
     \str_case:nn {#1}
       {
-        { super } { \sp }
-        { sub } { \sb }
+        { super } { \spb at sp@save }
+        { sub } { \spb at sb@save }
       }
   }
-\cs_new_protected:Npn \spb_box_dp_ht_assign:nn #1#2
+\cs_new_protected:Npn \spb_box_ht_dp_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} }
@@ -104,7 +110,7 @@
           }
         \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_box_ht_dp_assign:nn ##3
         \spb_tmp_boxb_use:
       }
   }
@@ -116,13 +122,13 @@
   {
     \IfBooleanTF{#1}
       {
-        \spb_tmp_hboxa_set:n { $#4{\sp{#5}}$ }
-        \spb_tmp_hboxb_set:n  { $#8{\sb{#6}}$ }
+        \spb_tmp_hboxa_set:n { $#4{\spb at sp@save{#5}}$ }
+        \spb_tmp_hboxb_set:n  { $#8{\spb at sb@save{#6}}$ }
       }{
         \mode_if_math:TF
           {
-            \spb_tmp_hboxa_set:n { $#4{\sp{#5}}$ }
-            \spb_tmp_hboxb_set:n  { $#8{\sb{#6}}$ }
+            \spb_tmp_hboxa_set:n { $#4{\spb at sp@save{#5}}$ }
+            \spb_tmp_hboxb_set:n  { $#8{\spb at sb@save{#6}}$ }
           }
           {
             \spb_tmp_hboxa_set:n { #4{\spb at textsuperscript@save{#5}} }
@@ -164,8 +170,20 @@
     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
+
+\bool_if:NT \l__spb_new_supersub_bool
+  {
+    \clist_map_inline:nn
+      {
+        { sp,sb },
+        { textsuperscript,textsubscript }
+      }
+      {
+        \cs_set_eq:cN { \clist_item:nn {#1} { 1 } } \super
+        \cs_set_eq:cN { \clist_item:nn {#1} { 2 } } \sub
+      }
+  }
+\cs_set_eq:NN \spb \supersub
 \cs_set:Npn \@makefnmark
   { \hbox:n { \fnmarkfont\super{\@thefnmark}[0pt] } }
 \cs_if_exist:NTF \ftntm at font



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