texlive[72710] Master/texmf-dist: spbmark (30oct24)
commits+karl at tug.org
commits+karl at tug.org
Wed Oct 30 21:02:39 CET 2024
Revision: 72710
https://tug.org/svn/texlive?view=revision&revision=72710
Author: karl
Date: 2024-10-30 21:02:39 +0100 (Wed, 30 Oct 2024)
Log Message:
-----------
spbmark (30oct24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/spbmark/README.md
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/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spbmark/README.md 2024-10-30 20:02:30 UTC (rev 72709)
+++ trunk/Master/texmf-dist/doc/latex/spbmark/README.md 2024-10-30 20:02:39 UTC (rev 72710)
@@ -1,5 +1,5 @@
# The `spbmark` package
-Customize superscripts and subscripts (v1.46q)
+Customize superscripts and subscripts (v1.46r)
## Abstract
`spbmark` provides three commands `\super`, `\sub` and `\supersub` to improve the layout of superscripts and subscripts which can be adjusted the relative position and format, and can be used in text and math mode.
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 2024-10-30 20:02:30 UTC (rev 72709)
+++ trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.tex 2024-10-30 20:02:39 UTC (rev 72710)
@@ -8,8 +8,8 @@
\setcnltx
{
package = spbmark,
- version = v1.46q,
- date = 2024/10/22,
+ version = v1.46r,
+ date = 2024/10/29,
authors = Qu Yi,
title = \spbmark{} package,
info = Customize superscripts and subscripts,
@@ -253,6 +253,20 @@
The alignment of superscripts and subscripts, which contains \code{l}, \code{c}, and \code{r} parameter respectively for left, center, and right alignment.
\end{options}
+\section{Marker hooks}
+\begin{commands}\setlength{\itemsep}{0pt}
+ \command{AddToHookWithArguments}[\Marg{spb/super/before}\oarg{label}\marg{code}]\nonl
+ \command{AddToHookWithArguments}[\Marg{spb/super/after}\oarg{label}\marg{code}]\nonl
+ \command{AddToHookWithArguments}[\Marg{spb/sub/before}\oarg{label}\marg{code}]\nonl
+ \command{AddToHookWithArguments}[\Marg{spb/sub/after}\oarg{label}\marg{code}]\newtag{New\\v1.46r}%
+ \pkg*{spbmark} gives hooks to markers with arguments in front and back positions, this feature requires support in the \hologo{LaTeX} kernel after \textbf{2023/06/01}. Argument \code{\#1} in the \meta{code} represents \code{super} or \code{sub}, and argument \code{\#2} represents the marker content itself.
+\begin{demohigh}
+\AddToHookWithArguments{spb/super/before}{\spbifmath{(#1-#2)}{[#1-#2]}}
+$\super{a}$\super{b}
+\RemoveFromHook{spb/super/before}
+\end{demohigh}
+\end{commands}
+
\section{Examples of use}
Here is a list of the three commands, please pay attention to the usage of optional parameter. Note when the horizontal move is negative, the starting point is at the right end of the mark.
\begin{demohigh}
@@ -316,6 +330,7 @@
\begin{version}[v = 1.46k,date = 2024/06/21]
\item Add options \option{spcore} and \option{sbcore}: Set kernel commands for superscripts and subscripts of text and math modes.
\end{version}
+ \shortversion{v = 1.46r,date = 2024/10/29,changes = Give hooks to markers with parameters at the front and back positions.}
\end{changelog}
\nocite{*}
Modified: trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty 2024-10-30 20:02:30 UTC (rev 72709)
+++ trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty 2024-10-30 20:02:39 UTC (rev 72710)
@@ -9,7 +9,7 @@
% https://creativecommons.org/licenses/by/4.0/legalcode
\NeedsTeXFormat{LaTeX2e}[2018/12/31]
\RequirePackage{xparse}
-\ProvidesExplPackage{spbmark}{2024/10/22}{1.46q}
+\ProvidesExplPackage{spbmark}{2024/10/29}{1.46r}
{Customize superscripts and subscripts}
\cs_generate_variant:Nn \box_set_ht:Nn { cv }
@@ -233,7 +233,7 @@
\cs_generate_variant:Nn \spb_box_super_move_up_ii:n { V }
\cs_generate_variant:Nn \spb_box_sub_move_down_ii:n { V }
\providecommand{\hbox_overlap_center:n}[1]
- { \hbox_to_zero:n { \hss #1\hss } }
+ {\hbox_to_zero:n { \hss #1\hss }}
\cs_new:Npn \spb_hbox_overlap_vmove_ii:n #1
{
\use:c { hbox_overlap_#1:n }
@@ -333,6 +333,12 @@
\tl_set:Nn \maxwd { \dim_max:VV \superwd \subwd }
\tl_set:Nn \l__spb_box_super_wd_i_tl { \box_wd:N \g__super_i_inner_box }
\tl_set:Nn \l__spb_box_sub_wd_i_tl { \box_wd:N \g__sub_i_inner_box }
+\providecommand{\NewHookWithArguments}[2]{}
+\providecommand{\UseHookWithArguments}[4]{}
+\NewHookWithArguments{spb/super/before}{2}
+\NewHookWithArguments{spb/super/after}{2}
+\NewHookWithArguments{spb/sub/before}{2}
+\NewHookWithArguments{spb/sub/after}{2}
\cs_new:Npn \spb_math_print_store_i:nn #1#2
{
\hbox_gset:cn { g__#1_i_inner_box }
@@ -339,8 +345,10 @@
{
\ensuremath
{
+ \UseHookWithArguments{spb/#1/before}{2}{#1}{#2}
\use:c { spb at math@#1 at core }
{ \tl_use:c { l__spb_#1_cmd_i_tl }{#2} }
+ \UseHookWithArguments{spb/#1/after}{2}{#1}{#2}
}
}
\dim_gset:Nv \rlastwd { l__spb_box_#1_wd_i_tl }
@@ -349,8 +357,10 @@
{
\hbox_gset:cn { g__#1_i_inner_box }
{
+ \UseHookWithArguments{spb/#1/before}{2}{#1}{#2}
\use:c { spb at text#1script at core }
{ \tl_use:c { l__spb_#1_cmd_i_tl }{#2} }
+ \UseHookWithArguments{spb/#1/after}{2}{#1}{#2}
}
\dim_gset:Nv \rlastwd { l__spb_box_#1_wd_i_tl }
}
@@ -357,9 +367,23 @@
\cs_new:Npn \spb_math_print_store_ii:nn #1#2
{
\hbox_gset:Nn \g__super_ii_box
- { \ensuremath{\spb at math@super at core{\l__spb_super_cmd_ii_tl{#1}}} }
+ {
+ \ensuremath
+ {
+ \UseHookWithArguments{spb/super/before}{2}{super}{#1}
+ \spb at math@super at core{\l__spb_super_cmd_ii_tl{#1}}
+ \UseHookWithArguments{spb/super/after}{2}{super}{#1}
+ }
+ }
\hbox_gset:Nn \g__sub_ii_box
- { \ensuremath{\spb at math@sub at core{\l__spb_sub_cmd_ii_tl{#2}}} }
+ {
+ \ensuremath
+ {
+ \UseHookWithArguments{spb/sub/before}{2}{sub}{#2}
+ \spb at math@sub at core{\l__spb_sub_cmd_ii_tl{#2}}
+ \UseHookWithArguments{spb/sub/after}{2}{sub}{#2}
+ }
+ }
}
\cs_new:Npn \spb_text_print_store_ii:nn #1#2
{
More information about the tex-live-commits
mailing list.