diff options
author | Karl Berry <karl@freefriends.org> | 2024-12-06 22:32:42 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-12-06 22:32:42 +0000 |
commit | 33b762e213c73d6c8a4f90c6bddc59943af81aea (patch) | |
tree | 954c756ed78840015772ee625dbd4347abc60b00 /Master/texmf-dist | |
parent | 6dde63a3e9d6bd1c815361d1611118c0f14f93eb (diff) |
spbmark (6dec24)
git-svn-id: svn://tug.org/texlive/trunk@73054 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/spbmark/README.md | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/spbmark/spbmark.pdf | bin | 95496 -> 96616 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/spbmark/spbmark.tex | 13 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/spbmark/spbmark.sty | 27 |
4 files changed, 27 insertions, 15 deletions
diff --git a/Master/texmf-dist/doc/latex/spbmark/README.md b/Master/texmf-dist/doc/latex/spbmark/README.md index ed53b50d7eb..d0e01db22a4 100644 --- a/Master/texmf-dist/doc/latex/spbmark/README.md +++ b/Master/texmf-dist/doc/latex/spbmark/README.md @@ -1,5 +1,5 @@ # The `spbmark` package -Customize superscripts and subscripts (v1.46t) +Customize superscripts and subscripts (v1.46u) ## 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. diff --git a/Master/texmf-dist/doc/latex/spbmark/spbmark.pdf b/Master/texmf-dist/doc/latex/spbmark/spbmark.pdf Binary files differindex e0b1d38ce18..56ea342fa5e 100644 --- a/Master/texmf-dist/doc/latex/spbmark/spbmark.pdf +++ b/Master/texmf-dist/doc/latex/spbmark/spbmark.pdf diff --git a/Master/texmf-dist/doc/latex/spbmark/spbmark.tex b/Master/texmf-dist/doc/latex/spbmark/spbmark.tex index 026e2b157c4..bc5ac8d437f 100644 --- a/Master/texmf-dist/doc/latex/spbmark/spbmark.tex +++ b/Master/texmf-dist/doc/latex/spbmark/spbmark.tex @@ -8,8 +8,8 @@ \setcnltx { package = spbmark, - version = v1.46t, - date = 2024/10/31, + version = v1.46u, + date = 2024/12/06, authors = Qu Yi, title = \spbmark{} package, info = Customize superscripts and subscripts, @@ -181,6 +181,12 @@ The options common to \meta{kv list} of the three commands are as follows. They \newcommand{\mysp}[2][]{\super[regex=\c{mysb},#1]{#2}} \newcommand{\mysb}[2][]{\sub[regex=\c{mysp},#1]{#2}} \end{codehigh} + \keychoice{nobox}{true,\fbox{false}}\newtag{New\\v1.46u}% + Causes the superscripts or subscripts not to be saved in the box, in which case the offset-related options are invalid. For example, there is a difference in nesting superscripts in math mode. +\begin{demohigh} +1A$\super{c\super{d}}$B \\ +2A$\super{c\super[nobox]{d}}$B +\end{demohigh} \end{options} \section{Global control interface} @@ -287,8 +293,7 @@ Here is a list of the three commands, please pay attention to the usage of optio 1A\super[vmove=0.2ex,hmove=0.2em,cmd=\textcolor{red}]{exam}B \\ 2$A\sub[style=fancy,cmd+=\mathsf,mode=math]{exam}B$ \\ 3A\supersub[vsep=0.6ex,halign=c]{examsuper}{sub}B \\ -4A\super{c}[vmove=5pt,hmove=-5.5pt]B\sub[vmove=5pt,hmove=-5pt]{d}AB \\ -5A\super{c\super{d}}B +4A\super{c}[vmove=5pt,hmove=-5.5pt]B\sub[vmove=5pt,hmove=-5pt]{d}AB \end{demohigh} \subsection{siunitx} diff --git a/Master/texmf-dist/tex/latex/spbmark/spbmark.sty b/Master/texmf-dist/tex/latex/spbmark/spbmark.sty index ada39cfc913..f83b05e3006 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} -\ProvidesExplPackage{spbmark}{2024/10/31}{1.46t} +\ProvidesExplPackage{spbmark}{2024/12/06}{1.46u} {Customize superscripts and subscripts} \cs_generate_variant:Nn \box_set_ht:Nn { cv } @@ -222,7 +222,7 @@ { \box_move_up:nn {#1} { \box_use:N \g__super_ii_box } } \cs_new:Npn \spb_box_sub_move_down_ii:n #1 { \box_move_down:nn {#1} { \box_use:N \g__sub_ii_box } } -\cs_new:Npn \spb_box_vmove_i:nn #1 +\cs_new:Npn \spb_inner_box_vmove_i:nn #1 { \str_case:nn {#1} { @@ -347,7 +347,9 @@ \NewHookWithArguments{cmd+/sub/after}{2} \cs_new:Npn \spb_math_print_store_i:nnnn #1#2#3#4 { - \hbox_gset:cn { g__#1_i_inner_box } + \bool_if:NTF \l__spb_nobox_mark_bool + { \tl_gset:cn { g__#1_i_nobox_mark_tl } } + { \hbox_gset:cn { g__#1_i_inner_box } } { #3{ \UseHookWithArguments{spb/#1/before}{2}{#1}{#2} @@ -448,7 +450,8 @@ spregex .tl_set:N = \l__spb_super_regex_next_tl, spregex .initial:n = \c{sub}|\c{textsubscript}|\c{sb}|\_, sbregex .tl_set:N = \l__spb_sub_regex_next_tl, - sbregex .initial:n = \c{super}|\c{textsuperscript}|\c{sp}|\^ + sbregex .initial:n = \c{super}|\c{textsuperscript}|\c{sp}|\^, + nobox .bool_set:N = \l__spb_nobox_mark_bool } \cs_new:Npn \spb_clear_thiswd:n #1 { @@ -492,9 +495,13 @@ \tl_gset:Nn \g__spb_mark_case_init_tl {#1} \spb_set:n { ##2,##3,##5 } \spb_mode_switch:nnn {#1} {##4} { i } - \spb_content_hbox_set:nn {#1} {##1} - \spb_ht_dp_assign:nnnn {#1} {#1} { i } { _outer } - \box_use:c { g__#1_i_outer_box } + \bool_if:NTF \l__spb_nobox_mark_bool + { \tl_use:c { g__#1_i_nobox_mark_tl } } + { + \spb_mark_box_set:nn {#1} {##1} + \spb_ht_dp_assign:nnnn {#1} {#1} { i } { _outer } + \box_use:c { g__#1_i_outer_box } + } \exp_last_unbraced:Nx \group_end: { @@ -505,7 +512,7 @@ } } } -\cs_new_protected:Npn \spb_content_hbox_set:nn #1#2 +\cs_new_protected:Npn \spb_mark_box_set:nn #1#2 { \dim_gset:Nn \clastwd { (\llastwd + \rlastwd)/2 } \tl_set:Nn \abs@hmove@i { \dim_abs:v { l__spb_#1_hmove_tl } } @@ -516,7 +523,7 @@ \hbox_overlap_left:n { \hbox_overlap_right:n - { \spb_box_vmove_i:nn {#1} { \tl_use:c { l__spb_#1_vmove_tl } } } + { \spb_inner_box_vmove_i:nn {#1} { \tl_use:c { l__spb_#1_vmove_tl } } } \skip_horizontal:n { \abs@hmove@i } } \IfBooleanT{#2} @@ -528,7 +535,7 @@ { \hbox_to_wd:nn { \tl_use:c { l__spb_box_#1_wd_i_tl } + \tl_use:c { l__spb_#1_hmove_tl } } - { \hss\spb_box_vmove_i:nn {#1} { \tl_use:c { l__spb_#1_vmove_tl } } } + { \hss\spb_inner_box_vmove_i:nn {#1} { \tl_use:c { l__spb_#1_vmove_tl } } } } } \dim_gset:Nv \llastwd { l__spb_box_#1_wd_i_tl } |