diff options
author | Karl Berry <karl@freefriends.org> | 2022-01-28 22:24:34 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-01-28 22:24:34 +0000 |
commit | f9e1c78d9b1cfc64e25599d031f4a6b05c27d37a (patch) | |
tree | ec9e0ad680f5040566f6420b0dd3ef6b9aca559a /Master/texmf-dist/doc/latex/spbmark/spbmark.tex | |
parent | 586094916a20b006ef35e394b3a957a22057123d (diff) |
spbmark (28jan22)
git-svn-id: svn://tug.org/texlive/trunk@61777 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/spbmark/spbmark.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/spbmark/spbmark.tex | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/Master/texmf-dist/doc/latex/spbmark/spbmark.tex b/Master/texmf-dist/doc/latex/spbmark/spbmark.tex index b68e0bb1694..fd163192233 100644 --- a/Master/texmf-dist/doc/latex/spbmark/spbmark.tex +++ b/Master/texmf-dist/doc/latex/spbmark/spbmark.tex @@ -6,8 +6,8 @@ { package = spbmark, title = the spbmark package, - version = v1.32, - date = 2022/01/25, + version = v1.33, + date = 2022/01/28, authors = Qu Yi, info = Customize superscript and subscript, email = q1jx@foxmail.com, @@ -19,7 +19,7 @@ color-scheme = blue, title-format = \huge\bfseries\scshape, add-frame-options = {innerleftmargin = 2em}, - listings-options = {numbers = none}, + listings-options = {numbers = none,gobble = 2}, pre-output = {\parindent = 0em} } @@ -40,7 +40,7 @@ \section{Macro package options} \label{sec:macro package options} -The following macro package options will redefine the scripts commands of the \LaTeX{} kernel. If you do not specify the values of boolean options, they default to \code{true}. +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}. \begin{options} \keybool{text}\Default{false} \cs{textsuperscript} and \cs{textsubscript} are equivalent to the \cs{super} and \cs{sub} commands. @@ -54,7 +54,7 @@ The following macro package options will redefine the scripts commands of the \L The values of \option{text}, \option{math} and \option{foot} three options are \code{true} at the same time. \begin{example}[code-only] \usepackage[both]{spbmark} - \usepackage[text,foot = true]{spbmark} + \usepackage[text,foot=true]{spbmark} \end{example} \end{options} @@ -71,8 +71,19 @@ 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. + \command{spbshortkv}[\marg{short opt}\marg{key value}] + 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} + \spbshortkv{x}{sphmove=#1} + \defspbstyle{fancy}{sbcmd=\color{blue},mode=math} + \spbshortkv{mysb}{style=fancy} + A\super[x=2pt]{b} \\ + A\sub{b}[mysb] + \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 be used in \meta{key-value list} for the \cs{spbset} command. When the following options are used in the \cs{spbset} command, in addition to \option{style} and \option{mode}, they are set according to the type of the previous most recent command. \begin{options} \keyval{vmove}{fixed length}\Default{0pt} @@ -138,9 +149,9 @@ The following list of keys control the format of superscript and subscript. \begin{options} \keyval{spbhmove}{fixed length}\Default{0pt} Extra vertical move of the superscript and the subscript. - \kvsplit{spbcmd}{super cmds}{sub cmds} + \kvsplit{spbcmd}{super cmds}{sub cmds} \newline The format commands of superscript and subscript. The first part is in superscript format, and the latter part is in subscript format. They are separated by commas, or only the first part exists. - \kvsplit{spbcmd+}{super cmds}{sub cmds} + \kvsplit{spbcmd+}{super cmds}{sub cmds} \newline Add code to the previous global superscript and subscript format commands. \keyval{spbheight}{fixed length} The distance between the superscript baseline and the previous line. @@ -155,19 +166,19 @@ The following list of keys control the format of superscript and subscript. \section{Examples of use} Here is a list of the three commands, please pay attention to the usage of optional parameters. Note when the horizontal move is negative, the starting point is at the right end of the mark. \begin{example} -\defspbstyle{fancy}{cmd=\color{purple}} -\spbset{spbcmd={\spbifmath{\mathtt}{\ttfamily},\color{blue}}} -A\super[vmove=0.2ex,hmove=0.2em,cmd=\textcolor{red}]{exam}B \\ -$A\sub[style=fancy,cmd+=\mathsf,mode=math]{exam}B$ \\ -A\supersub[vsep=0.6ex,halign=c]{examsuper}{sub}B \\ -A\super{c}[vmove=5pt,hmove=-5.5pt]B\sub[vmove=5pt,hmove=-5pt]{d}AB + \defspbstyle{fancy}{cmd=\color{purple}} + \spbset{spbcmd={\spbifmath{\mathtt}{\ttfamily},\color{blue}}} + A\super[vmove=0.2ex,hmove=0.2em,cmd=\textcolor{red}]{exam}B \\ + $A\sub[style=fancy,cmd+=\mathsf,mode=math]{exam}B$ \\ + A\supersub[vsep=0.6ex,halign=c]{examsuper}{sub}B \\ + A\super{c}[vmove=5pt,hmove=-5.5pt]B\sub[vmove=5pt,hmove=-5pt]{d}AB \end{example} 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}} + \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}} \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 move does not work with footnote markers. |