summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-06-30 21:18:14 +0000
committerKarl Berry <karl@freefriends.org>2021-06-30 21:18:14 +0000
commitd47a0f82a233c6e4347ed879fb1da009e06e8a73 (patch)
tree105ad80edcd2f8e264f34eff9f60ae5988172de9 /Master/texmf-dist/tex/latex
parente10d85cd43df7e227b19858f4ee94edbe836019d (diff)
spbmark (30jun21)
git-svn-id: svn://tug.org/texlive/trunk@59777 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/spbmark/spbmark.sty48
1 files changed, 33 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/latex/spbmark/spbmark.sty b/Master/texmf-dist/tex/latex/spbmark/spbmark.sty
index 2eb7406a8dc..f8a53902b79 100644
--- a/Master/texmf-dist/tex/latex/spbmark/spbmark.sty
+++ b/Master/texmf-dist/tex/latex/spbmark/spbmark.sty
@@ -11,19 +11,23 @@
%% conditions of the CC-BY 4.0 License.
%% The latest version of this license is in
%% https://creativecommons.org/licenses/by/4.0/legalcode
-\NeedsTeXFormat{LaTeX2e}[2020/10/01]
-\RequirePackage{l3keys2e}
-\ProvidesExplPackage{spbmark}{2021/06/28}{1.00a}{beta}
+\NeedsTeXFormat{LaTeX2e}[2018/12/31]
+\RequirePackage{xparse,l3keys2e}
+\ProvidesExplPackage{spbmark}{2021/06/30}{1.01}
+ {Customize superscripts and subscripts}
\cs_new_protected:Npn \spb_define:n { \keys_define:nn { spbmark } }
\cs_new_protected:Npn \spbset { \keys_set:nn { spbmark } }
\keys_define:nn { spbmark/option }
{
- ctex .code:n =
+ ctex .code:n =
{
\cs_set:Npn \spb_define:n { \keys_define:nn { ctex/style } }
\cs_set:Npn \spbset { \keys_set:nn { ctex/style } }
- }
+ },
+ newsupb .bool_set:N = \l__spb_new_supersub_bool,
+ newsupb .default:n = true,
+ newsupb .initial:n = true
}
\ProcessKeysOptions{spbmark/option}
@@ -69,15 +73,17 @@
}
\cs_set_eq:NN \spb@textsuperscript@save \textsuperscript
\cs_set_eq:NN \spb@textsubscript@save \textsubscript
+\cs_set_eq:NN \spb@sp@save \sp
+\cs_set_eq:NN \spb@sb@save \sb
\cs_new:Npn \spb_math:nn #1
{
\str_case:nn {#1}
{
- { super } { \sp }
- { sub } { \sb }
+ { super } { \spb@sp@save }
+ { sub } { \spb@sb@save }
}
}
-\cs_new_protected:Npn \spb_box_dp_ht_assign:nn #1#2
+\cs_new_protected:Npn \spb_box_ht_dp_assign:nn #1#2
{
\tl_if_empty:nF {#1} { \box_set_ht:Nn \l_tmpb_box {#1} }
\tl_if_novalue:nF {#2} { \box_set_dp:Nn \l_tmpb_box {#2} }
@@ -104,7 +110,7 @@
}
\hbox_set_to_wd:Nnn \l_tmpb_box { \l__spb_boxa_wd_tl + ##6 }
{ \hss\box_move_up:nn {##2} { \spb_tmp_boxa_use: } }
- \spb_box_dp_ht_assign:nn ##3
+ \spb_box_ht_dp_assign:nn ##3
\spb_tmp_boxb_use:
}
}
@@ -116,13 +122,13 @@
{
\IfBooleanTF{#1}
{
- \spb_tmp_hboxa_set:n { $#4{\sp{#5}}$ }
- \spb_tmp_hboxb_set:n { $#8{\sb{#6}}$ }
+ \spb_tmp_hboxa_set:n { $#4{\spb@sp@save{#5}}$ }
+ \spb_tmp_hboxb_set:n { $#8{\spb@sb@save{#6}}$ }
}{
\mode_if_math:TF
{
- \spb_tmp_hboxa_set:n { $#4{\sp{#5}}$ }
- \spb_tmp_hboxb_set:n { $#8{\sb{#6}}$ }
+ \spb_tmp_hboxa_set:n { $#4{\spb@sp@save{#5}}$ }
+ \spb_tmp_hboxb_set:n { $#8{\spb@sb@save{#6}}$ }
}
{
\spb_tmp_hboxa_set:n { #4{\spb@textsuperscript@save{#5}} }
@@ -164,8 +170,20 @@
Alignment~only~supports~l,~c,~and~r. \\
The~l~parameter~will~be~used~by~default.
}
-\cs_set_eq:NN \textsuperscript \super
-\cs_set_eq:NN \textsubscript \sub
+
+\bool_if:NT \l__spb_new_supersub_bool
+ {
+ \clist_map_inline:nn
+ {
+ { sp,sb },
+ { textsuperscript,textsubscript }
+ }
+ {
+ \cs_set_eq:cN { \clist_item:nn {#1} { 1 } } \super
+ \cs_set_eq:cN { \clist_item:nn {#1} { 2 } } \sub
+ }
+ }
+\cs_set_eq:NN \spb \supersub
\cs_set:Npn \@makefnmark
{ \hbox:n { \fnmarkfont\super{\@thefnmark}[0pt] } }
\cs_if_exist:NTF \ftntm@font