summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/spbmark
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-01-29 03:00:41 +0000
committerNorbert Preining <norbert@preining.info>2022-01-29 03:00:41 +0000
commit2df1fd0d0099108f6d3d3e58dce35a3d2e185d4f (patch)
treef7e5765a88db1ee36ffdbebfbc2ea73336a1fb86 /macros/latex/contrib/spbmark
parentaef84c3078da1ba1bad9754ea0555ac9bc1c0aac (diff)
CTAN sync 202201290300
Diffstat (limited to 'macros/latex/contrib/spbmark')
-rw-r--r--macros/latex/contrib/spbmark/spbmark.pdfbin71793 -> 74237 bytes
-rw-r--r--macros/latex/contrib/spbmark/spbmark.sty4
-rw-r--r--macros/latex/contrib/spbmark/spbmark.tex43
3 files changed, 30 insertions, 17 deletions
diff --git a/macros/latex/contrib/spbmark/spbmark.pdf b/macros/latex/contrib/spbmark/spbmark.pdf
index 0f6853ca4c..956ba69d9e 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 1ab56b6bf3..6b1f60022e 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}{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,
diff --git a/macros/latex/contrib/spbmark/spbmark.tex b/macros/latex/contrib/spbmark/spbmark.tex
index b68e0bb169..fd16319223 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.32,
- date = 2022/01/25,
+ version = v1.33,
+ date = 2022/01/28,
authors = Qu Yi,
info = Customize superscript and subscript,
email = q1jx@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 following macro package options will redefine the scripts commands of the \L
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 @@ There are currently three commands to set superscript and subscript. Their forma
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 @@ The following list of keys control the format of superscript and subscript.
\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 @@ 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[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.