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.tex42
1 files changed, 32 insertions, 10 deletions
diff --git a/macros/latex/contrib/spbmark/spbmark.tex b/macros/latex/contrib/spbmark/spbmark.tex
index c1d428cd16..7cdd0b2bfd 100644
--- a/macros/latex/contrib/spbmark/spbmark.tex
+++ b/macros/latex/contrib/spbmark/spbmark.tex
@@ -1,13 +1,13 @@
\documentclass[load-preamble+]{cnltx-doc}
-\usepackage{spbmark,siunitx,pifont}
+\usepackage{spbmark,siunitx,pifont,hologo}
\usepackage[noto]{newtxmath}
\setcnltx
{
package = spbmark,
title = the spbmark package,
- version = v1.38,
- date = 2022/03/02,
+ version = v1.39,
+ date = 2022/03/04,
authors = Qu Yi,
info = Customize superscript and subscript,
email = q1jx@foxmail.com,
@@ -20,7 +20,9 @@
title-format = \huge\bfseries\scshape,
add-frame-options = {innerleftmargin = 2em},
listings-options = {numbers = none,gobble = 2},
- pre-output = {\parindent = 0em}
+ pre-output = {\parindent = 0em},
+ before-skip = \smallskipamount,
+ after-skip = \smallskipamount
}
\makeatletter
@@ -39,6 +41,7 @@
\newsplitarg{\splitmarg}{\{}{\}}
\newsplitarg{\splitdarg}{(}{)}
\newnote{\newtag}[1][New]{\textcolor{red}{\ding{73}\ #1}}
+\renewcommand{\emph}[1]{\textcolor{red}{#1}}
\makeatother
\begin{document}
@@ -76,6 +79,23 @@ There are currently three commands to set superscript and subscript. Their forma
Defines the style of the superscript or subscript used for the \option{style} option.
\command{spbifmath}[\marg{math code}\marg{text code}]
In some cases, \code{math} or \code{text} output modes require different code for format or move. This command can be used when using the \code{match} option or changing the output mode locally, whitch should be used in the move or format options. It can switch the corresponding code according to different output modes.
+
+ 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%
+ Save the width of the previous marker and provide left alignment.
+ \command{clastwd}\newtag%
+ Save the width of the previous marker and provide center alignment.
+ \command{rlastwd}\newtag%
+ Save the width of the previous marker and provide right alignment.
+ \begin{example}
+ A\super{bcd}\sub{e}B \\
+ A\super{bcd}\sub[hmove=-\llastwd]{e}B \\
+ A\sub{e}\super{bcd}[hmove=-\llastwd]B \\
+ A\super{bcd}\sub[hmove=-\clastwd]{e}B \\
+ A\super{bcd}\sub[hmove=-\rlastwd]{e}B \\
+ \end{example}
\command{spbshortkv}[\marg{short opt}\marg{key value}]\newtag%
Converts any existing key-value pair to a shorthand option. The value of key \code{\#1} indicates that the shorthand option needs to be assigned a value.
\begin{example}
@@ -87,20 +107,22 @@ There are currently three commands to set superscript and subscript. Their forma
\end{example}
\end{commands}
-Since the \cs{super} and \cs{sub} commands enclose the scripts in a horizontal box, the horizontal positions are staggered when using both superscript and subscript, which is different from the simultaneous use of \code{\^{}} and \code{\_} symbols in math mode. In this case, you need to adjust the horizontal offset of the latter command or use the \cs{supersub} command.
-
The options common to \meta{kv list} of the three commands are as follows. They can also be used in \meta {key-value list} of the \cs{spbset} command. In this situation, in addition to \option{style} and \option{mode}, they will be set according to the type of the previous most recent command.
\begin{options}
\keyval{vmove}{fixed length}\Default{0pt}
Vertical move of superscript or subscript. Represents the extra vertical distance \option{vsep} between superscript and subscript in the superscript and subscript commands.
\keyval{hmove}{fixed length}\Default{0pt}
- Horizontal move of superscript or subscript. Represents the common move in the superscript and subscript commands.
+ Horizontal move of superscript or subscript. Represents the common move in the superscript and subscript commands. Moved values can be expressed mathematically:
+ \begin{example}
+ A\super{b}[vmove=0.4ex+4pt/2,hmove=2pt*3-11.5pt] \\
+ A\supersub[vsep={3pt,6pt-2bp}]{examsuper}{sub}
+ \end{example}
\keyval{cmd}{format cmds}
The format commands of superscript or subscript. The last command can take a parameter, which accepts superscript or subscript. Represents the format of superscript and subscript in the superscript and subscript commands.
\keyval{cmd+}{format cmds}
Add code to the previous global superscript or subscript format commands.
\keyval{height}{fixed length}
- The distance between the superscript or subscript baseline and the previous line.
+ The distance between the superscript or subscript baseline and the previous line. It is recommended that the superscript adjusts the height and the subscript adjusts the depth.
\keyval{depth}{fixed length}
The distance between the superscript or subscript baseline and the next line.
\keyval{style}{style name}
@@ -116,7 +138,7 @@ The options common to \meta{kv list} of the three commands are as follows. They
\pkg*{spbmark} uses the \cs{spbset} command to control the global default format of superscript and subscript. These options also apply to \meta{kv list} of the above commands. The values ​​set by it will be overwritten by the optional parameters of the superscript and other commands.
\end{commands}
-The following list of keys control the format both of superscript \textcolor{red}{or} subscript.
+The following list of keys control the format both of superscript \emph{or} subscript.
\begin{options}
\keyval{spvmove}{fixed length}\Default{0pt}
Extra vertical move of the superscript.
@@ -150,7 +172,7 @@ The following list of keys control the format both of superscript \textcolor{red
If \option{sphmove} is positive, the superscript or subscript moves to the right, conversely it moves to the left. The positive direction of vertical offset of subscript and superscript is opposite. For superscript, if \option{spvmove} is positive, the superscript moves up, conversely it moves down. For subscript, if \option{spvmove} is positive, the subscript moves down, conversely it moves up.
-The following list of keys control the format of superscript \textcolor{red}{and} subscript.
+The following list of keys control the format of superscript \emph{and} subscript.
\begin{options}
\keyval{spbhmove}{fixed length}\Default{0pt}
Extra vertical move of the superscript and the subscript.