texlive[61777] Master/texmf-dist: spbmark (28jan22)

commits+karl at tug.org commits+karl at tug.org
Fri Jan 28 23:24:34 CET 2022


Revision: 61777
          http://tug.org/svn/texlive?view=revision&revision=61777
Author:   karl
Date:     2022-01-28 23:24:34 +0100 (Fri, 28 Jan 2022)
Log Message:
-----------
spbmark (28jan22)

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	2022-01-28 22:24:21 UTC (rev 61776)
+++ trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.tex	2022-01-28 22:24:34 UTC (rev 61777)
@@ -6,8 +6,8 @@
   {
     package           = spbmark,
     title             = the spbmark package,
-    version           = v1.32,
-    date              = 2022/01/25,
+    version           = v1.33,
+    date              = 2022/01/28,
     authors           = Qu Yi,
     info              = Customize superscript and subscript,
     email             = q1jx at foxmail.com,
@@ -19,7 +19,7 @@
     color-scheme      = blue,
     title-format      = \huge\bfseries\scshape,
     add-frame-options = {innerleftmargin = 2em},
-    listings-options  = {numbers = none},
+    listings-options  = {numbers = none,gobble = 2},
     pre-output        = {\parindent = 0em}
   }
 
@@ -40,7 +40,7 @@
 
 \section{Macro package options}
 \label{sec:macro package options}
-The following macro package options will redefine the scripts commands of the \LaTeX{} kernel. If you do not specify the values of boolean options, they default to \code{true}.
+The following macro package options will redefine the script commands of the \LaTeX{} kernel. If you do not specify the values of boolean options, they default to \code{true}.
 \begin{options}
   \keybool{text}\Default{false}
   \cs{textsuperscript} and \cs{textsubscript} are equivalent to the \cs{super} and \cs{sub} commands.
@@ -54,7 +54,7 @@
   The values of \option{text}, \option{math} and \option{foot} three options are \code{true} at the same time.
   \begin{example}[code-only]
   \usepackage[both]{spbmark}
-  \usepackage[text,foot = true]{spbmark}
+  \usepackage[text,foot=true]{spbmark}
   \end{example}
 \end{options}
 
@@ -71,8 +71,19 @@
   Defines the style of the superscript or subscript used for the \option{style} option.
   \command{spbifmath}[\marg{math code}\marg{text code}]
   In some cases, \code{math} or \code{text} output modes require different code for format or move. This command can be used when using the \code{match} option or changing the output mode locally, whitch should be used in the move or format options. It can switch the corresponding code according to different output modes.
+  \command{spbshortkv}[\marg{short opt}\marg{key value}]
+  Converts any existing key-value pair to a shorthand option. The value of key \code{\#1} indicates that the shorthand option needs to be assigned a value.
+  \begin{example}
+  \spbshortkv{x}{sphmove=#1}
+  \defspbstyle{fancy}{sbcmd=\color{blue},mode=math}
+  \spbshortkv{mysb}{style=fancy}
+  A\super[x=2pt]{b} \\
+  A\sub{b}[mysb]
+  \end{example}
 \end{commands}
 
+Since the \cs{super} and \cs{sub} commands enclose the scripts in a horizontal box, the horizontal positions are staggered when using both superscript and subscript, which is different from the simultaneous use of \code{\^{}} and \code{\_} symbols in math mode. In this case, you need to adjust the horizontal offset of the latter command or use the \cs{supersub} command.
+
 The options common to \meta{kv list} of the three commands are as follows. They can be used in \meta{key-value list} for the \cs{spbset} command. When the following options are used in the \cs{spbset} command, in addition to \option{style} and \option{mode}, they are set according to the type of the previous most recent command.
 \begin{options}
   \keyval{vmove}{fixed length}\Default{0pt}
@@ -138,9 +149,9 @@
 \begin{options}
   \keyval{spbhmove}{fixed length}\Default{0pt}
   Extra vertical move of the superscript and the subscript.
-  \kvsplit{spbcmd}{super cmds}{sub cmds}
+  \kvsplit{spbcmd}{super cmds}{sub cmds} \newline
   The format commands of superscript and subscript. The first part is in superscript format, and the latter part is in subscript format. They are separated by commas, or only the first part exists.
-  \kvsplit{spbcmd+}{super cmds}{sub cmds}
+  \kvsplit{spbcmd+}{super cmds}{sub cmds} \newline
   Add code to the previous global superscript and subscript format commands.
   \keyval{spbheight}{fixed length}
   The distance between the superscript baseline and the previous line.
@@ -155,19 +166,19 @@
 \section{Examples of use}
 Here is a list of the three commands, please pay attention to the usage of optional parameters. Note when the horizontal move is negative, the starting point is at the right end of the mark.
 \begin{example}
-\defspbstyle{fancy}{cmd=\color{purple}}
-\spbset{spbcmd={\spbifmath{\mathtt}{\ttfamily},\color{blue}}}
-A\super[vmove=0.2ex,hmove=0.2em,cmd=\textcolor{red}]{exam}B \\
-$A\sub[style=fancy,cmd+=\mathsf,mode=math]{exam}B$ \\
-A\supersub[vsep=0.6ex,halign=c]{examsuper}{sub}B \\
-A\super{c}[vmove=5pt,hmove=-5.5pt]B\sub[vmove=5pt,hmove=-5pt]{d}AB
+  \defspbstyle{fancy}{cmd=\color{purple}}
+  \spbset{spbcmd={\spbifmath{\mathtt}{\ttfamily},\color{blue}}}
+  A\super[vmove=0.2ex,hmove=0.2em,cmd=\textcolor{red}]{exam}B \\
+  $A\sub[style=fancy,cmd+=\mathsf,mode=math]{exam}B$ \\
+  A\supersub[vsep=0.6ex,halign=c]{examsuper}{sub}B \\
+  A\super{c}[vmove=5pt,hmove=-5.5pt]B\sub[vmove=5pt,hmove=-5pt]{d}AB
 \end{example}
 
 It can also be used with the \pkg*{siunitx} package to output superscript and subscript in the unit:
 \begin{example}
-\unit[mode=math]{kg.m/s\super[vmove=-1pt]{2}} \\
-\qty[mode=text]{30}{A\supersub[hmove=1pt,cmd=\color{red}]{b}{c}} \\
-\spbset{sbhmove=2pt}\unit[mode=text]{A\sub{b}}
+  \unit[mode=math]{kg.m/s\super[vmove=-1pt]{2}} \\
+  \qty[mode=text]{30}{A\supersub[hmove=1pt,cmd=\color{red}]{b}{c}} \\
+  \spbset{sbhmove=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 move 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	2022-01-28 22:24:21 UTC (rev 61776)
+++ trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty	2022-01-28 22:24:34 UTC (rev 61777)
@@ -9,7 +9,7 @@
 %   https://creativecommons.org/licenses/by/4.0/legalcode
 \NeedsTeXFormat{LaTeX2e}[2018/12/31]
 \RequirePackage{xparse,l3keys2e}
-\ProvidesExplPackage{spbmark}{2022/01/25}{1.32}
+\ProvidesExplPackage{spbmark}{2022/01/28}{1.33}
   {Customize superscripts and subscripts}
 
 \cs_generate_variant:Nn \box_set_ht:Nn { cv }
@@ -62,6 +62,8 @@
         style/#1 .code:n = \keys_set:nn { ctex/style } {#2}
       }
   }
+\cs_new_protected:Npn \spbshortkv #1#2
+  { \spb_define:n { #1 .meta:n = {#2} } }
 \spb_define:n
   {
     mode .tl_set:N      = \l__spb_mode_value_tl,



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