summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/spbmark
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-02-07 03:01:02 +0000
committerNorbert Preining <norbert@preining.info>2024-02-07 03:01:02 +0000
commit50fcb5024d3243d7e1601abf72b5f4444dd618b6 (patch)
treef53a7b130aa3e1ab8afb00c716a31c33e888f625 /macros/latex/contrib/spbmark
parent25b83ac051a8ec3bf79f47e3c3c66b3567a3216a (diff)
CTAN sync 202402070301
Diffstat (limited to 'macros/latex/contrib/spbmark')
-rw-r--r--macros/latex/contrib/spbmark/spbmark.pdfbin86873 -> 89117 bytes
-rw-r--r--macros/latex/contrib/spbmark/spbmark.sty17
-rw-r--r--macros/latex/contrib/spbmark/spbmark.tex24
3 files changed, 34 insertions, 7 deletions
diff --git a/macros/latex/contrib/spbmark/spbmark.pdf b/macros/latex/contrib/spbmark/spbmark.pdf
index bd7701a44a..90e46b31bf 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 4b7a7f981b..e846f52fde 100644
--- a/macros/latex/contrib/spbmark/spbmark.sty
+++ b/macros/latex/contrib/spbmark/spbmark.sty
@@ -9,7 +9,7 @@
% https://creativecommons.org/licenses/by/4.0/legalcode
\NeedsTeXFormat{LaTeX2e}[2018/12/31]
\RequirePackage{xparse,l3keys2e}
-\ProvidesExplPackage{spbmark}{2024/02/05}{1.46}
+\ProvidesExplPackage{spbmark}{2024/02/06}{1.46b}
{Customize superscripts and subscripts}
\cs_generate_variant:Nn \box_set_ht:Nn { cv }
@@ -479,10 +479,21 @@
Alignment~only~supports~l,~c,~and~r. \\
The~l~parameter~will~be~used~by~default.
}
-\@ifpackageloaded{easybase}
- {\ctex_gadd_package_hook:nnn { after } { easybase }}
+\providecommand{\IfPackageLoadedTF}{\@ifpackageloaded}
+\providecommand{\IfFormatAtLeastTF}{\@ifl@t@r\fmtversion}
+\IfPackageLoadedTF{easybase}
+ {\AddToHook{package/easybase/after}}
{\use:n}
{ \keys_define:nn { } { ctex/style .inherit:n = spbmark/option } }
+\IfFormatAtLeastTF{2021/11/15}
+ {
+ \AddToHook{package/altsubsup/after}
+ {
+ \ifaltsbsp@spbmark
+ \SetAltSubSupCommands{\relax}
+ \else\fi
+ }
+ }{}
\cs_set_eq:NN \spb \supersub
\endinput
%
diff --git a/macros/latex/contrib/spbmark/spbmark.tex b/macros/latex/contrib/spbmark/spbmark.tex
index 727ee086a7..2c9319118c 100644
--- a/macros/latex/contrib/spbmark/spbmark.tex
+++ b/macros/latex/contrib/spbmark/spbmark.tex
@@ -1,13 +1,14 @@
\documentclass[load-preamble+]{cnltx-doc}
-\usepackage{spbmark,siunitx,setspace,pifont,hologo}
+\usepackage{siunitx,setspace,pifont,hologo}
+\usepackage[spbmark]{altsubsup}
\usepackage[noto]{newtxmath}
\setcnltx
{
package = spbmark,
title = the spbmark package,
- version = v1.46,
- date = 2024/02/05,
+ version = v1.46b,
+ date = 2024/02/06,
authors = Qu Yi,
info = Customize superscript and subscript,
email = toquyi@163.com,
@@ -78,7 +79,7 @@ There are currently three commands to set superscript and subscript. Their forma
\command{sub}[\sarg\oarg{kv list}\marg{content}\oarg{kv list}]
This is a subscript output command. The two \meta{kv list} are equivalent.
- When the horizontal movement distance of the marker is \emph{non-negative}, since the \cs{super} and \cs{sub} commands put the marker in a horizontal box, the horizontal position is staggered when using superscript and subscript \emph{consecutively}, which is a different mechanism than the sequential use of \code{\^{}} and \code{\_} symbols in math mode. The following three commands save the width of the previous marker, use it for negative move of the \option{hmove} option of the next marker, and provide the corresponding alignment.
+ When the horizontal movement distance of the marker is \emph{non-negative}, since the \cs{super} and \cs{sub} commands put the marker in a horizontal box, the horizontal position is staggered when using superscript and subscript \emph{consecutively}, which is a different mechanism than the sequential use of \code{\^{}} and \code{\_{}} symbols in math mode. The following three commands save the width of the previous marker, use it for negative move of the \option{hmove} option of the next marker, and provide the corresponding alignment.
It should be noted that the following commands should save the longer width of the marker, that is, the longer width of the marker in the front, the shorter width of the marker in the back. This is due to the fact that horizontal movement uses a negative distance to leave the marker in a zero-width box state.
\command{llastwd}\newtag%
@@ -222,6 +223,7 @@ Here is a list of the three commands, please pay attention to the usage of optio
4A\super{c}[vmove=5pt,hmove=-5.5pt]B\sub[vmove=5pt,hmove=-5pt]{d}AB
\end{example}
+\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}} \\
@@ -229,6 +231,20 @@ It can also be used with the \pkg*{siunitx} package to output superscript and su
\spbset{sbhmove=2pt}\unit[mode=text]{A\sub{b}}
\end{example}
+\subsection{realscripts}
+If the OpenType text font you are using does not have optical sizes, the superscript and subscript may not appear correctly. Loading the \pkg*{realscripts} macro package before the \pkg*{spbmark} macro package fixes this behavior.
+\begin{example}[code-only]
+ \usepackage{realscripts,spbmark}
+\end{example}
+
+\subsection{altsubsup}
+The \pkg*{altsubsup} package allows to write alternate superscript and subscript in math mode with \code{\^{}}\oarg{mark} and \code{\_{}}\oarg{mark} dimensions. When the macro package is loaded using the \code{spbmark} option, the superscript and subscript mechanism of \pkg*{spbmark} is used, you can use \cs{defspbstyle} to define its superscript style \code{altsup} and subscript style \code{altsub}.
+\begin{example}
+ \defspbstyle{altsup}{sphmove=-\llastwd,spvmove=1pt}
+ $A_[bcd]^[e]B$
+\end{example}
+
+\subsection{footnote}
\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 move does not work with footnote markers.
\section{Developer commands}