summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-02-16 22:44:32 +0000
committerKarl Berry <karl@freefriends.org>2022-02-16 22:44:32 +0000
commit28da595db46ec1bef5fdb9a83d37bc5d9b98db76 (patch)
treef37b3d192eb71c4249a72f567d9fee86454d3077
parent6d61a2cc468f99649f3e0617eef1f36e6d115e57 (diff)
spbmark (15feb22)
git-svn-id: svn://tug.org/texlive/trunk@62049 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/spbmark/spbmark.pdfbin75046 -> 76051 bytes
-rw-r--r--Master/texmf-dist/doc/latex/spbmark/spbmark.tex24
-rw-r--r--Master/texmf-dist/tex/latex/spbmark/spbmark.sty33
3 files changed, 37 insertions, 20 deletions
diff --git a/Master/texmf-dist/doc/latex/spbmark/spbmark.pdf b/Master/texmf-dist/doc/latex/spbmark/spbmark.pdf
index f7ef48f0cd3..3593e9e4ad9 100644
--- a/Master/texmf-dist/doc/latex/spbmark/spbmark.pdf
+++ b/Master/texmf-dist/doc/latex/spbmark/spbmark.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/spbmark/spbmark.tex b/Master/texmf-dist/doc/latex/spbmark/spbmark.tex
index 4a3c3dcef64..11d7c9a8396 100644
--- a/Master/texmf-dist/doc/latex/spbmark/spbmark.tex
+++ b/Master/texmf-dist/doc/latex/spbmark/spbmark.tex
@@ -6,8 +6,8 @@
{
package = spbmark,
title = the spbmark package,
- version = v1.36,
- date = 2022/02/12,
+ version = v1.37,
+ date = 2022/02/15,
authors = Qu Yi,
info = Customize superscript and subscript,
email = q1jx@foxmail.com,
@@ -30,7 +30,11 @@
\newcommand{#2}[2]
{\code{\textcolor{argument}{#3\textnormal{#1{##1}{##2}}#4}}}
}
-\newcommand{\kvsplit}[3]{\item\code{\option{#1}\cnltx@isvalue\splitmarg{#2}{#3}}}
+\newcommand{\kvsplit}[3]
+ {
+ \item\code{\option{#1}\cnltx@isvalue\splitmarg{#2}{#3}}
+ \cnltx@checkdefault{\hfill\newline}
+ }
\newsplitarg{\splitoarg}{[}{]}
\newsplitarg{\splitmarg}{\{}{\}}
\newsplitarg{\splitdarg}{(}{)}
@@ -112,7 +116,7 @@ The options common to \meta{kv list} of the three commands are as follows. They
\pkg*{spbmark} uses the \cs{spbset} command to control the global default format of superscript and subscript. These options also apply to \meta{kv list} of the above commands. The values ​​set by it will be overwritten by the optional parameters of the superscript and other commands.
\end{commands}
-The following list of keys control the format both of superscript or subscript.
+The following list of keys control the format both of superscript \textcolor{red}{or} subscript.
\begin{options}
\keyval{spvmove}{fixed length}\Default{0pt}
Extra vertical move of the superscript.
@@ -144,22 +148,22 @@ The following list of keys control the format both of superscript or subscript.
The distance between the subscript baseline and the next line.
\end{options}
-If \option{sphmove} is positive, the superscript or subscript moves to the right, conversely it moves to the left. However, for superscript, if \option{spvmove} is positive, the superscript moves up, conversely it moves down. For subscript, if \option{spvmove} is positive, the subscript moves down, conversely it moves up.
+If \option{sphmove} is positive, the superscript or subscript moves to the right, conversely it moves to the left. The positive direction of vertical offset of subscript and superscript is opposite. For superscript, if \option{spvmove} is positive, the superscript moves up, conversely it moves down. For subscript, if \option{spvmove} is positive, the subscript moves down, conversely it moves up.
-The following list of keys control the format of superscript and subscript.
+The following list of keys control the format of superscript \textcolor{red}{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} \newline
+ \kvsplit{spbcmd}{super cmds}{sub cmds}
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} \newline
+ \kvsplit{spbcmd+}{super cmds}{sub cmds}
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.
\keyval{spbdepth}{fixed length}
The distance between the subscript baseline and the next line.
- \keyval{vsep}{fixed length}\Default{0.6ex}
- The extra vertical distance between superscript and subscript.
+ \kvsplit{vsep}{super move}{sub move}\Default{0.6ex}\newtag[Changed]%
+ The extra vertical distance between superscript and subscript. The front part is the movement amount of the superscript, and the latter part is the movement amount of the subscript. If only the front part means that both are vertically shifted by one-half of the current value.
\keychoice{halign}{l,c,r}\Default{l}
The alignment of superscript and subscript, which contains \code{l}, \code{c}, and \code{r} parameters respectively for left, center, and right alignment.
\end{options}
diff --git a/Master/texmf-dist/tex/latex/spbmark/spbmark.sty b/Master/texmf-dist/tex/latex/spbmark/spbmark.sty
index 9b3b44c9177..f273b8a9782 100644
--- a/Master/texmf-dist/tex/latex/spbmark/spbmark.sty
+++ b/Master/texmf-dist/tex/latex/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/02/12}{1.36}
+\ProvidesExplPackage{spbmark}{2022/02/15}{1.37}
{Customize superscripts and subscripts}
\cs_generate_variant:Nn \box_set_ht:Nn { cv }
@@ -19,6 +19,7 @@
\cs_generate_variant:Nn \msg_warning:nnn { nnV }
\cs_generate_variant:Nn \str_case:nn { x }
\cs_generate_variant:Nn \tl_if_novalue:nF { V }
+\cs_generate_variant:Nn \tl_if_blank:nF { v }
\cs_new_protected:Npn \spb_define:n { \keys_define:nn { ctex/style } }
\cs_new_protected:Npn \spbset { \keys_set:nn { ctex/style } }
@@ -54,6 +55,21 @@
{ supersub } {#3}
}
}
+\NewDocumentCommand{\spb@both@vsep@assign}
+ {>{\SplitArgument{1}{,}}m}
+ {\spb_supersub_both_vsep:nn #1}
+\cs_new_protected:Npn \spb_supersub_both_vsep:nn #1#2
+ {
+ \tl_if_novalue:nTF {#2}
+ {
+ \tl_set:Nn \l__spb_super_vsep_ii_tl { #1/2 }
+ \tl_set:Nn \l__spb_sub_vsep_ii_tl { #1/2 }
+ }
+ {
+ \tl_set:Nn \l__spb_super_vsep_ii_tl {#1}
+ \tl_set:Nn \l__spb_sub_vsep_ii_tl {#2}
+ }
+ }
\cs_new_protected:Npn \defspbstyle #1#2
{
\spb_define:n
@@ -70,7 +86,7 @@
mode .initial:n = match,
style .choice:,
style .value_required:n = true,
- vsep .tl_set:N = \l__spb_supersub_vsep_tl,
+ vsep .code:n = \spb@both@vsep@assign{#1},
vsep .initial:n = 0.6ex,
halign .tl_set:N = \l__spb_supersub_halign_tl,
halign .initial:n = l,
@@ -89,7 +105,7 @@
\spb_local_case_init:nnn
{ \tl_set:Nn \l__spb_super_vmove_tl {#1} }
{ \tl_set:Nn \l__spb_sub_vmove_tl {#1} }
- { \tl_set:Nn \l__spb_supersub_vsep_tl {#1} }
+ { \spb@both@vsep@assign{#1} }
},
hmove .code:n =
{
@@ -119,17 +135,14 @@
}
\cs_generate_variant:Nn \spb_box_super_move_up_ii:n { V }
\cs_generate_variant:Nn \spb_box_sub_move_down_ii:n { V }
-\dim_new:N \l__spb_supersub_half_vsep_tl
\providecommand{\hbox_overlap_center:n}[1]
{ \hbox_to_zero:n { \hss #1\hss } }
\cs_new:Npn \spb_hbox_overlap_vmove_ii:n #1
{
- \tl_set:Nn \l__spb_supersub_half_vsep_tl
- { \l__spb_supersub_vsep_tl/2 }
\use:c { hbox_overlap_#1:n }
- { \spb_box_super_move_up_ii:V \l__spb_supersub_half_vsep_tl }
+ { \spb_box_super_move_up_ii:V \l__spb_super_vsep_ii_tl }
\use:c { hbox_overlap_#1:n }
- { \spb_box_sub_move_down_ii:V \l__spb_supersub_half_vsep_tl }
+ { \spb_box_sub_move_down_ii:V \l__spb_sub_vsep_ii_tl }
}
\tl_new:N \l__spb_super_cmd_ii_tl
@@ -203,9 +216,9 @@
}
\cs_new_protected:Npn \spb_ht_dp_assign:nnn #1#2#3
{
- \tl_if_empty:cF { l__#1_height_#3_tl }
+ \tl_if_blank:vF { l__#1_height_#3_tl }
{ \box_set_ht:cv { l__#1_#3_box } { l__#1_height_#3_tl } }
- \tl_if_empty:cF { l__#1_depth_i_tl }
+ \tl_if_blank:vF { l__#1_depth_i_tl }
{ \box_set_dp:cv { l__#2_#3_box } { l__#2_depth_#3_tl } }
}