texlive[60893] Master/texmf-dist: spbmark (29oct21)

commits+karl at tug.org commits+karl at tug.org
Fri Oct 29 23:32:57 CEST 2021


Revision: 60893
          http://tug.org/svn/texlive?view=revision&revision=60893
Author:   karl
Date:     2021-10-29 23:32:57 +0200 (Fri, 29 Oct 2021)
Log Message:
-----------
spbmark (29oct21)

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-10-29 21:32:45 UTC (rev 60892)
+++ trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.tex	2021-10-29 21:32:57 UTC (rev 60893)
@@ -6,8 +6,8 @@
   {
     package   = spbmark,
     title     = the spbmark package,
-    version   = v1.1D,
-    date      = 2021/10/16,
+    version   = v1.1F,
+    date      = 2021/10/29,
     authors   = Qu Yi,
     info      = Customize superscript and subscript,
     email     = q1jx at foxmail.com,
@@ -44,8 +44,12 @@
 \begin{options}
   \opt{ctex}\Default!
   This option works with the C\TeX{} document class used by simplified Chinese users, there's actually no functional change. Adding path \module*{style} to \cs*{ctexset} command, which is equivalent to using \cs{spbset}.
-  \keybool{newsupb}\Default{true}
-  \option{newsupb} is a boolean option with a default value of true that redefines the \LaTeX{} kernel commands to cause \cs{sp} and \cs{textsuperscript} are equivalent to \cs{super} command, and \cs{sb} and \cs{textsubscript} are equivalent to \cs{sub} command.
+  \keychoice{newsupb}{text,math,foot,all}\Default
+  \option{newsupb} is a compound option that can select multiple values and will redefine the subscript commands of the \LaTeX{} kernel. \code{text} stands for \cs{textsuperscript} and \cs{textsubscript} are equivalent to the \cs{super} and \cs{sub} commands. \code{math} indicates that \cs{sp} and \cs{sb} are equivalent to the \cs{super} and \cs{sub} commands. \code{foot} will make the format of the footnote mark match the superscript offsets and format of the \cs{spbset} global setting. \code{all} will selects all previous three values at the same time.
+  \begin{example}[code-only]
+  \usepackage[newsupb = {text,math,foot}]{spbmark}
+  \usepackage[newsupb = all]{spbmark}
+  \end{example}
 \end{options}
 
 \section{User commands}
@@ -130,7 +134,7 @@
 \begin{example}
 \unit[mode = math]{kg.m/s\super*[-1pt]{2}} \\
 \qty[mode = text]{30}{A\supersub{b}{c}[1pt](\color{red})} \\
-\spbset{sub-hshift = 2pt}\unit[mode = text]{A_b}
+\spbset{sub-hshift = 2pt}\unit[mode = text]{A\sub{b}}
 \end{example}
 
 \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.

Modified: trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty	2021-10-29 21:32:45 UTC (rev 60892)
+++ trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty	2021-10-29 21:32:57 UTC (rev 60893)
@@ -9,21 +9,27 @@
 %   https://creativecommons.org/licenses/by/4.0/legalcode
 \NeedsTeXFormat{LaTeX2e}[2018/12/31]
 \RequirePackage{xparse,l3keys2e}
-\ProvidesExplPackage{spbmark}{2021/10/16}{1.1D}
+\ProvidesExplPackage{spbmark}{2021/10/29}{1.1F}
   {Customize superscripts and subscripts}
 
 \cs_new_protected:Npn \spb_define:n { \keys_define:nn { spbmark } }
 \cs_new_protected:Npn \spbset { \keys_set:nn { spbmark } }
+\bool_new:N \l_spb_newsupb_text_bool
+\bool_new:N \l_spb_newsupb_math_bool
+\bool_new:N \l_spb_newsupb_foot_bool
+\bool_new:N \l_spb_newsupb_all_bool
+
 \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
+    newsupb .multichoices:nn  =
+      { text,math,foot,all }
+      { \bool_set_true:c { l_spb_newsupb_#1_bool } },
+    newsupb .default:n        = all
   }
 
 \ProcessKeysOptions{spbmark/option}
@@ -254,21 +260,28 @@
     The~l~parameter~will~be~used~by~default.
   }
 
-\bool_if:NT \l__spb_new_supersub_bool
+\bool_if:NT \l_spb_newsupb_all_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
-      }
+    \bool_set_true:N \l_spb_newsupb_text_bool
+    \bool_set_true:N \l_spb_newsupb_math_bool
+    \bool_set_true:N \l_spb_newsupb_foot_bool
   }
+\bool_if:NT \l_spb_newsupb_text_bool
+  {
+    \cs_set_eq:NN \textsuperscript \super
+    \cs_set_eq:NN \textsubscript \sub
+  }
+\bool_if:NT \l_spb_newsupb_math_bool
+  {
+    \cs_set_eq:NN \sp \super
+    \cs_set_eq:NN \sb \sub
+  }
+\bool_if:NT \l_spb_newsupb_foot_bool
+  {
+    \cs_set:Npn \@makefnmark
+      { \hbox:n { \fnmarkfont\super{\@thefnmark} } }
+  }
 \cs_set_eq:NN \spb \supersub
-\cs_set:Npn \@makefnmark
-  { \hbox:n { \fnmarkfont\super{\@thefnmark}[0pt] } }
 \tl_if_exist:NTF \ftntm at font
   { \tl_set_eq:NN \fnmarkfont \ftntm at font }
   { \tl_set_eq:NN \fnmarkfont \normalfont }



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