texlive[61369] Master/texmf-dist: spbmark (21dec21)
commits+karl at tug.org
commits+karl at tug.org
Tue Dec 21 22:46:08 CET 2021
Revision: 61369
http://tug.org/svn/texlive?view=revision&revision=61369
Author: karl
Date: 2021-12-21 22:46:08 +0100 (Tue, 21 Dec 2021)
Log Message:
-----------
spbmark (21dec21)
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-12-21 21:45:56 UTC (rev 61368)
+++ trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.tex 2021-12-21 21:46:08 UTC (rev 61369)
@@ -6,8 +6,8 @@
{
package = spbmark,
title = the spbmark package,
- version = v1.2E,
- date = 2021/12/20,
+ version = v1.2F,
+ date = 2021/12/21,
authors = Qu Yi,
info = Customize superscript and subscript,
email = q1jx at foxmail.com,
@@ -67,6 +67,8 @@
This is a subscript output command. The two \meta{kv list} are equivalent.
\command{supersub}[\oarg{kv list}\marg{super cont}\marg{sub cont}\oarg{kv list}]
This is a command that outputs both superscript and subscript at the same time. You can also use the shorter command \cs{spb} instead of it. The two \meta{kv list} are equivalent.
+ \command{defspbstyle}[\marg{style name}\marg{kv list}]
+ 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.
\end{commands}
@@ -83,6 +85,8 @@
The format commands of superscript or subscript. The last command can take a parameter, which accepts superscript or subscript. Represents the format of superscript and subscript in the superscript and subscript commands.
\keyval{cmd+}{format cmds}\Default
Add code to the previous global superscript or subscript format commands.
+ \keyval{style}{style name}\Default
+ Use the \meta{style name} defined by the \cs{defspbstyle} command to make it work global or local.
\keychoice{mode}{text,math,match}\Default{match}
The mode of superscript or subscript output can be \code{text} or \code{math} mode. The \code{match} option automatically matches output modes according to the current mode.
\end{options}
@@ -137,9 +141,10 @@
\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[cmd=\mathsf,mode=math]{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}
Modified: trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty 2021-12-21 21:45:56 UTC (rev 61368)
+++ trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty 2021-12-21 21:46:08 UTC (rev 61369)
@@ -9,7 +9,7 @@
% https://creativecommons.org/licenses/by/4.0/legalcode
\NeedsTeXFormat{LaTeX2e}[2018/12/31]
\RequirePackage{xparse,l3keys2e}
-\ProvidesExplPackage{spbmark}{2021/12/20}{1.2E}
+\ProvidesExplPackage{spbmark}{2021/12/21}{1.2F}
{Customize superscripts and subscripts}
\cs_generate_variant:Nn \dim_max:nn { VV }
@@ -53,6 +53,11 @@
{ supersub } {#4}
}
}
+\cs_new_protected:Npn \defspbstyle #1#2
+ {
+ \spb_define:n
+ { style/#1 .code:n = \keys_set:nn { ctex/style } {#2} }
+ }
\spb_define:n
{
spvmove .tl_set:N = \l__spb_super_vmove_tl,
@@ -105,6 +110,8 @@
vsep .initial:n = 0.6ex,
halign .tl_set:N = \l__spb_supersub_halign_tl,
halign .initial:n = l,
+ style .choice:,
+ style .value_required:n = true,
mode .tl_set:N = \l__spb_mode_value_tl,
mode .initial:n = match
}
More information about the tex-live-commits
mailing list.