summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/spbmark
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-12-22 03:01:35 +0000
committerNorbert Preining <norbert@preining.info>2021-12-22 03:01:35 +0000
commit9105ca38c03b7a88ed0c306472d9560cc5f206bd (patch)
treec3fb0be880a7aa14f36f5d05a0137c9ee61d9603 /macros/latex/contrib/spbmark
parent3bffd8b7dfcee8333bb2841ea194a0daa26af8cd (diff)
CTAN sync 202112220301
Diffstat (limited to 'macros/latex/contrib/spbmark')
-rw-r--r--macros/latex/contrib/spbmark/spbmark.pdfbin70115 -> 70953 bytes
-rw-r--r--macros/latex/contrib/spbmark/spbmark.sty9
-rw-r--r--macros/latex/contrib/spbmark/spbmark.tex11
3 files changed, 16 insertions, 4 deletions
diff --git a/macros/latex/contrib/spbmark/spbmark.pdf b/macros/latex/contrib/spbmark/spbmark.pdf
index 0dc97fd394..90254e4b4e 100644
--- a/macros/latex/contrib/spbmark/spbmark.pdf
+++ b/macros/latex/contrib/spbmark/spbmark.pdf
Binary files differ
diff --git a/macros/latex/contrib/spbmark/spbmark.sty b/macros/latex/contrib/spbmark/spbmark.sty
index 10defa9e25..3bc3a3dd01 100644
--- a/macros/latex/contrib/spbmark/spbmark.sty
+++ b/macros/latex/contrib/spbmark/spbmark.sty
@@ -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
}
diff --git a/macros/latex/contrib/spbmark/spbmark.tex b/macros/latex/contrib/spbmark/spbmark.tex
index 93620fd8a7..12c8cacfd0 100644
--- a/macros/latex/contrib/spbmark/spbmark.tex
+++ b/macros/latex/contrib/spbmark/spbmark.tex
@@ -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@foxmail.com,
@@ -67,6 +67,8 @@ There are currently three commands to set superscript and subscript. Their forma
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 options common to \meta{kv list} of the three commands are as follows. They
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 @@ The following list of keys control the format of superscript and subscript.
\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}