summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/spbmark/spbmark.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/spbmark/spbmark.tex')
-rw-r--r--macros/latex/contrib/spbmark/spbmark.tex44
1 files changed, 25 insertions, 19 deletions
diff --git a/macros/latex/contrib/spbmark/spbmark.tex b/macros/latex/contrib/spbmark/spbmark.tex
index 3235237822..9d04ea07f9 100644
--- a/macros/latex/contrib/spbmark/spbmark.tex
+++ b/macros/latex/contrib/spbmark/spbmark.tex
@@ -2,13 +2,14 @@
\usepackage{siunitx,setspace,pifont,hologo}
\usepackage[spbmark]{altsubsup}
+\usepackage[margin = 1in,marginparwidth = 0.6in,footskip = 0.5in]{geometry}
\usepackage[noto]{newtxmath}
\setcnltx
{
package = spbmark,
title = the spbmark package,
- version = v1.46e,
- date = 2024/02/16,
+ version = v1.46j,
+ date = 2024/05/19,
authors = Qu Yi,
info = Customize superscript and subscript,
email = toquyi@163.com,
@@ -39,21 +40,23 @@
\newsplitarg{\splitoarg}{[}{]}
\newsplitarg{\splitmarg}{\{}{\}}
\newsplitarg{\splitdarg}{(}{)}
-\newnote{\newtag}[1][New]{\textcolor{red}{\ding{73}\ #1}}
+\newnote{\newtag}[1]{\textcolor{red}{#1}}
\renewcommand{\emph}[1]{\textcolor{red}{#1}}
\renewcommand{\cnltx@write@lastname}{}
\makeatother
\begin{document}
\section{Macro package options}
-The following macro package options will redefine the script commands of the \LaTeX{} kernel. If you do not specify the values of boolean options, they default to \code{true}. These options can also be changed in the preamble area and main body using the global control command \cs{sbpset}.
+The following macro package options will redefine the script commands of the \LaTeX{} kernel. If you do not specify the values of boolean options, they default to \code{true}. These options can also be changed in the preamble area and main body using the global control command \cs{spbset}.
\begin{options}
- \keychoice{text}{true,\fbox{false}}\newtag[Changed]%
- \cs{textsuperscript} and \cs{textsubscript} are equivalent to the \cs{super} and \cs{sub} commands. At this point, you can use the \cs{defspbstyle} command to define the style \code{textsp} and \code{textsb} to change the format of the text superscript and subscript.
- \keychoice{math}{true,\fbox{false}}\newtag[Changed]%
- \cs{sp} and \cs{sb} are equivalent to the \cs{super} and \cs{sub} commands. At this point, you can use the \cs{defspbstyle} command to define the style \code{mathsp} and \code{mathsb} to change the format of the math superscript and subscript.
- \keychoice{foot}{true,\fbox{false}}\newtag[Changed]%
- The format of the footnote mark match the superscript global move and format settings. At this point, you can use the \cs{defspbstyle} command to define the superscript style \code{fnmark} to change the format of the footnote mark.
+ \keychoice{text}{true,\fbox{false}}
+ \cs{textsuperscript} and \cs{textsubscript} are equivalent to the \cs{super} and \cs{sub} commands. The command \cs{defspbstyle} can be used to define the style \code{textsp} and \code{textsb} to change the format of the text superscript and subscript.
+ \keychoice{math}{true,\fbox{false}}
+ \cs{sp} and \cs{sb} are equivalent to the \cs{super} and \cs{sub} commands. The command \cs{defspbstyle} can be used to define the style \code{mathsp} and \code{mathsb} to change the format of the math superscript and subscript.
+ \keychoice{math*}{true,\fbox{false}}\newtag{Exp\\v1.46j}%
+ The \code{\^{}} and \code{\_{}} tokens in the math mode are equivalent to the \cs{super} and \cs{sub} commands. The command \cs{defspbstyle} can be used to define the style \code{mathsp*} and \code{mathsb*} to change the format of the math superscript and subscript.
+ \keychoice{foot}{true,\fbox{false}}
+ The format of the footnote mark match the superscript global move and format settings. \cs{defspbstyle} can be used to define the superscript style \code{fnmark} to change the format of the footnote mark.
\begin{example}[code-only]
\defspbstyle{textsp}{vmove=-1pt,cmd=\bfseries}
\defspbstyle{mathsb}{hmove=0.5em}
@@ -151,7 +154,7 @@ The options common to \meta{kv list} of the three commands are as follows. They
Use the \meta{style name} defined by the \cs{defspbstyle} command to make it work global or local.
\keychoice{mode}{text,math,\fbox{match}}
The mode of superscript or subscript output can be \code{text} or \code{math} mode. The \code{match} option automatically matches output modes according to the current mode.
- \keychoice{thiswd}{auto,\fbox{keep}}\newtag%
+ \keychoice{thiswd}{auto,\fbox{keep}}
Sets how the length of the this marker is handled after this command is used. If it is \code{keep}, the width of the previous marker remains the same. If it is \code{auto}, if the next token is a marker command and the upper or lower position is the \textcolor{red}{opposite} of the this command, the width of the this marker is maintained, otherwise the width automatically returns to \textcolor{red}{zero}.
\begin{example}
\spbset{sbhmove=-\llastwd,sbthiswd=auto,sbcmd=\color{red}}
@@ -160,7 +163,7 @@ The options common to \meta{kv list} of the three commands are as follows. They
3A\sub{bcd}[thiswd=keep]\sub{e}Some texts\sub{e} \\
4A\sub{bcd}\sub{e}Some texts\sub{e}
\end{example}
- \keyval{regex}{regular expression}\newtag%
+ \keyval{regex}{regular expression}
After using the superscript or subscript command, this option is used to determine whether the \textcolor{red}{following} tokens match the \meta{regular expression}. If it does \textcolor{red}{not}, the width of the this marker returns to zero.
\begin{example}[code-only]
\newcommand{\mysp}[2][]{\super[regex=\c{mysb},#1]{#2}}
@@ -205,13 +208,13 @@ The following list of keys control the format both of superscript \emph{or} subs
The distance between the subscript baseline and the previous line.
\keyval{sbdepth}{fixed length}
The distance between the subscript baseline and the next line.
- \keychoice{spthiswd}{auto,\fbox{keep}}\newtag%
+ \keychoice{spthiswd}{auto,\fbox{keep}}
Width processing mode after using this superscript. See Section \ref{sec:user commands} for the meaning of this option.
- \keychoice{sbthiswd}{auto,\fbox{keep}}\newtag%
+ \keychoice{sbthiswd}{auto,\fbox{keep}}
Width processing mode after using this subscript. See Section \ref{sec:user commands} for the meaning of this option.
- \keyval{spregex}{regular expression}\newtag%
+ \keyval{spregex}{regular expression}
After the superscript command is used, the regular expression rules of the following tokens are matched. See Section \ref{sec:user commands} for the meaning of this option.
- \keyval{sbregex}{regular expression}\newtag%
+ \keyval{sbregex}{regular expression}
After the subscript command is used, the regular expression rules of the following tokens are matched. See Section \ref{sec:user commands} for the meaning of this option.
\end{options}
@@ -250,9 +253,12 @@ Here is a list of the three commands, please pay attention to the usage of optio
\subsection{siunitx}
It can also be used with the \pkg*{siunitx} package to output superscript and subscript in the unit:
\begin{example}
- \unit[mode=math]{kg.m/s\super[vmove=-1pt]{2}} \\
- \qty[mode=text]{30}{A\supersub[hmove=1pt,cmd=\color{red}]{b}{c}} \\
- \spbset{sbhmove=2pt}\unit[mode=text]{A\sub{b}}
+ \spbset{spcmd=\spbifmath{}{\color{purple}}}
+ \sisetup{text-superscript-command=\super}
+ 1-\qty[mode=text]{10}{A^2} \\
+ 2-\unit[mode=math]{kg.m/s\super[vmove=-1pt]{2}} \\
+ 3-\qty[mode=text]{30}{A\supersub[hmove=1pt,cmd=\color{blue}]{b}{c}} \\
+ 4-\spbset{sbhmove=2pt}\unit[mode=text]{A\sub{b}}
\end{example}
\subsection{realscripts}