summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/spbmark
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-10-30 03:00:57 +0000
committerNorbert Preining <norbert@preining.info>2021-10-30 03:00:57 +0000
commitf6b069c5441e2ba598b97c269ac8d00977606ef6 (patch)
tree36dd70aa94191ec75988c91a2e5c35db0fe61035 /macros/latex/contrib/spbmark
parent1f549499c63bd9e6345c4015f74a5475cb7fd2fa (diff)
CTAN sync 202110300300
Diffstat (limited to 'macros/latex/contrib/spbmark')
-rw-r--r--macros/latex/contrib/spbmark/spbmark.pdfbin66032 -> 67357 bytes
-rw-r--r--macros/latex/contrib/spbmark/spbmark.sty47
-rw-r--r--macros/latex/contrib/spbmark/spbmark.tex14
3 files changed, 39 insertions, 22 deletions
diff --git a/macros/latex/contrib/spbmark/spbmark.pdf b/macros/latex/contrib/spbmark/spbmark.pdf
index f42d42ea4a..6031d8553b 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 5a887c2f99..8ed460d1b8 100644
--- a/macros/latex/contrib/spbmark/spbmark.sty
+++ b/macros/latex/contrib/spbmark/spbmark.sty
@@ -9,21 +9,27 @@
% https://creativecommons.org/licenses/by/4.0/legalcode
\NeedsTeXFormat{LaTeX2e}[2018/12/31]
\RequirePackage{xparse,l3keys2e}
-\ProvidesExplPackage{spbmark}{2021/10/16}{1.1D}
+\ProvidesExplPackage{spbmark}{2021/10/29}{1.1F}
{Customize superscripts and subscripts}
\cs_new_protected:Npn \spb_define:n { \keys_define:nn { spbmark } }
\cs_new_protected:Npn \spbset { \keys_set:nn { spbmark } }
+\bool_new:N \l_spb_newsupb_text_bool
+\bool_new:N \l_spb_newsupb_math_bool
+\bool_new:N \l_spb_newsupb_foot_bool
+\bool_new:N \l_spb_newsupb_all_bool
+
\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
+ newsupb .multichoices:nn =
+ { text,math,foot,all }
+ { \bool_set_true:c { l_spb_newsupb_#1_bool } },
+ newsupb .default:n = all
}
\ProcessKeysOptions{spbmark/option}
@@ -254,21 +260,28 @@
The~l~parameter~will~be~used~by~default.
}
-\bool_if:NT \l__spb_new_supersub_bool
+\bool_if:NT \l_spb_newsupb_all_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
- }
+ \bool_set_true:N \l_spb_newsupb_text_bool
+ \bool_set_true:N \l_spb_newsupb_math_bool
+ \bool_set_true:N \l_spb_newsupb_foot_bool
+ }
+\bool_if:NT \l_spb_newsupb_text_bool
+ {
+ \cs_set_eq:NN \textsuperscript \super
+ \cs_set_eq:NN \textsubscript \sub
+ }
+\bool_if:NT \l_spb_newsupb_math_bool
+ {
+ \cs_set_eq:NN \sp \super
+ \cs_set_eq:NN \sb \sub
+ }
+\bool_if:NT \l_spb_newsupb_foot_bool
+ {
+ \cs_set:Npn \@makefnmark
+ { \hbox:n { \fnmarkfont\super{\@thefnmark} } }
}
\cs_set_eq:NN \spb \supersub
-\cs_set:Npn \@makefnmark
- { \hbox:n { \fnmarkfont\super{\@thefnmark}[0pt] } }
\tl_if_exist:NTF \ftntm@font
{ \tl_set_eq:NN \fnmarkfont \ftntm@font }
{ \tl_set_eq:NN \fnmarkfont \normalfont }
diff --git a/macros/latex/contrib/spbmark/spbmark.tex b/macros/latex/contrib/spbmark/spbmark.tex
index fc6071aedd..73019e147e 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.1D,
- date = 2021/10/16,
+ version = v1.1F,
+ date = 2021/10/29,
authors = Qu Yi,
info = Customize superscript and subscript,
email = q1jx@foxmail.com,
@@ -44,8 +44,12 @@
\begin{options}
\opt{ctex}\Default!
This option works with the C\TeX{} document class used by simplified Chinese users, there's actually no functional change. Adding path \module*{style} to \cs*{ctexset} command, which is equivalent to using \cs{spbset}.
- \keybool{newsupb}\Default{true}
- \option{newsupb} is a boolean option with a default value of true that redefines the \LaTeX{} kernel commands to cause \cs{sp} and \cs{textsuperscript} are equivalent to \cs{super} command, and \cs{sb} and \cs{textsubscript} are equivalent to \cs{sub} command.
+ \keychoice{newsupb}{text,math,foot,all}\Default
+ \option{newsupb} is a compound option that can select multiple values and will redefine the subscript commands of the \LaTeX{} kernel. \code{text} stands for \cs{textsuperscript} and \cs{textsubscript} are equivalent to the \cs{super} and \cs{sub} commands. \code{math} indicates that \cs{sp} and \cs{sb} are equivalent to the \cs{super} and \cs{sub} commands. \code{foot} will make the format of the footnote mark match the superscript offsets and format of the \cs{spbset} global setting. \code{all} will selects all previous three values at the same time.
+ \begin{example}[code-only]
+ \usepackage[newsupb = {text,math,foot}]{spbmark}
+ \usepackage[newsupb = all]{spbmark}
+ \end{example}
\end{options}
\section{User commands}
@@ -130,7 +134,7 @@ It can also be used with the \pkg*{siunitx} package to output superscript and su
\begin{example}
\unit[mode = math]{kg.m/s\super*[-1pt]{2}} \\
\qty[mode = text]{30}{A\supersub{b}{c}[1pt](\color{red})} \\
-\spbset{sub-hshift = 2pt}\unit[mode = text]{A_b}
+\spbset{sub-hshift = 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 shift does not work with footnote markers.