texlive[60076] Master/texmf-dist: spbmark (26jul21)

commits+karl at tug.org commits+karl at tug.org
Mon Jul 26 22:29:23 CEST 2021


Revision: 60076
          http://tug.org/svn/texlive?view=revision&revision=60076
Author:   karl
Date:     2021-07-26 22:29:23 +0200 (Mon, 26 Jul 2021)
Log Message:
-----------
spbmark (26jul21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.pdf
    trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.tex

Removed Paths:
-------------
    trunk/Master/texmf-dist/source/latex/spbmark/

Modified: trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.pdf
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.tex	2021-07-26 20:29:23 UTC (rev 60076)
@@ -0,0 +1,136 @@
+\documentclass[load-preamble]{cnltx-doc}
+
+\usepackage{spbmark,siunitx}
+\usepackage[noto]{newtxmath}
+\setcnltx
+  {
+    package   = spbmark,
+    title     = the spbmark package,
+    version   = v1.05,
+    date      = 2021/07/26,
+    authors   = Qu Yi,
+    info      = Customize superscript and subscript,
+    email     = quee123 at foxmail.com,
+    url       = https://github.com/texl3/spbmark,
+    abstract  =
+      {
+        \pkg{spbmark} provides three commands \cs{super}, \cs{sub} and \cs{supersub} to improve the layout of superscript and subscript which can be adjusted the relative position and format, and can be used in text and math mode.
+      },
+    color-scheme      = blue,
+    title-format      = \huge\bfseries\scshape,
+    add-frame-options = {innerleftmargin = 2em},
+    listings-options  = {numbers = none},
+    pre-output        = {\parindent = 0em}
+  }
+
+\begin{document}
+
+\section{Macro package options}
+\label{sec:macro package options}
+\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 \option{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.
+\end{options}
+
+\section{User commands}
+There are currently three commands to set superscript and subscript. Their format can be set temporarily using the optional parameters of the command, or set globally using a key-value list, see section \ref{sec:global control interface}.
+\begin{commands}
+  \command{super}[\sarg\oarg{option}\oarg{height,depth}\darg{code}\marg{content}\oarg{hshift}]
+  This is a superscript output command.
+  \command{sub}[\sarg\oarg{option}\oarg{height,depth}\darg{code}\marg{content}\oarg{hshift}]
+  This is a subscript output command.
+  \command{supersub}[\sarg\oarg{vsep}\oarg{align}\darg{sup code}\marg{sup cont}\marg{sub cont}\oarg{hshift}\darg{sub code}]
+  This is a command that outputs both superscript and subscript at the same time.
+\end{commands}
+
+These commands can match the corresponding pattern depending on whether they are currently in text mode or mathematical mode, or they can use an asterisk variant to force the mathematical pattern. 
+
+The \meta{vshift} and \meta{hshift} represent respectively vertical and horizontal offsets of superscript or subscript, their default value is \code{0pt}, and the parameters of \meta{script align} are the same as the \option{supersubalign}.
+
+The second optional parameter generally does not need to be used. The \meta{height} and \meta{depth} are separated by commas. Only the front part indicates the height of the superscript or subscript, and only the back part indicates the depth.
+
+The \meta{code} is used to format superscript and subscript, and can insert commands such as fonts or colors. The last command in the code can take an argument, which is either a superscript or a subscript.
+
+If you need to use the original definitions of \cs{textsuperscript}, \cs{textsubscript}, \cs{sp} and \cs{sb} after using the \option{newsupb} option, then you can use the following commands:
+\begin{commands}
+  \command{spb at textsuperscript@save}[\marg{content}]
+  Save the original definition of the \cs{textsuperscript} command, output superscript in the text.
+  \command{spb at textsubscript@save}[\marg{content}]
+  Save the original definition of the \cs{textsubscript} command, output subscript in the text.
+  \command{spb at sp@save}[\marg{content}]
+  Save the original definition of the \cs{sp} command, output superscript in the math mode.
+  \command{spb at sbt@save}[\marg{content}]
+  Save the original definition of the \cs{sb} command, output subscript in the math mode.
+\end{commands}
+
+\section{Global control interface}
+\label{sec:global control interface}
+\begin{commands}
+  \command{spbset}[\marg{key-value list}]
+  \pkg{spbmark} uses the \cs{spbset} command to control the global default format of superscript and subscript. 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 or subscript. They are equivalent to the optional parameters of the \cs{super} or \cs{sub} commands.
+\begin{options}
+  \keyval{super-vshift}{fixed length}\Default{0pt}
+  Extra vertical shift of the superscript.
+  \keyval{super-hshift}{fixed length}\Default{0pt}
+  Extra horizontal shift of the superscript.
+  \keyval{sub-vshift}{fixed length}\Default{0pt}
+  Extra vertical shift of the subscript.
+  \keyval{sub-hshift}{fixed length}\Default{0pt}
+  Extra horizontal shift of the subscript.
+  \keyval{super-format}{format code}\Default
+  Control the format of superscript, the last command in the code can take an argument, which is a superscript.
+  \keyval{sub-format}{format code}\Default
+  Control the format of subscript, the last command in the code can take an argument, which is a subscript.
+\end{options}
+
+The following list of keys control the format of superscript and subscript. They are equivalent to the optional parameters of the \cs{supersub} command.
+\begin{options}
+  \keyval{supersub-hshift}{fixed length}\Default{0pt}
+  Extra vertical shift of the superscript and the subscript.
+  \keyval{supersub-format}{super code,sub code}\Default{0pt}
+  Control the format of superscript or subscript. The first part is in superscript format, and the latter part is in subscript format. The two are separated by commas, or only the first part exists.
+  \keyval{supersubsep}{fixed length}\Default{0pt}
+  The distance between superscript and subscript, its default value is \code{0.3ex}.
+  \keychoice{supersubalign}{l,c,r}\Default{l}
+  The alignment of superscript and subscript, which contains \option{l}, \option{c}, and \option{r} parameters respectively for left, center, and right alignment.
+\end{options}
+
+\section{Examples of use}
+Here is a list of the three commands, please pay attention to the delimiter and usage of optional parameters:
+\begin{example}
+\spbset{supersub-format = {\ttfamily,\color{blue}}}
+A\super[0.2ex](\textcolor{red}){exam}[0.2em]B \\
+$A\sub(\mathsf){exam}B$ \\
+A\supersub[0.3ex][c]{examsuper}{sub}B
+\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*[-1pt]{2}} \\
+\qty[mode = text]{30}{A\supersub(\color{red}){b}{c}[1pt]} \\
+\spbset{sub-hshift = 2pt}\unit[mode = text]{A_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.
+
+\section{Known issues}
+At present, the vertical and horizontal offsets are effective for the unit commands in the \pkg{siunitx} macro package. However, due to the special mechanism that the decimal point is not recognized correctly because it is converted to a space in the \cs{unit} command, it is recommended to use \code{pt} as the unit of offset.
+
+\newcommand\urlprefix{\newline\hspace*{\fill}}
+\let\OldUrl\url
+\renewcommand\url[2][]{{\small\textit{#1}~\OldUrl{#2}}}
+\begin{thebibliography}{99}
+\bibitem{realscripts}
+\textsc{Will Robertson}.
+\newblock \textit{The \pkg{realscripts} package} [CP/OL].
+\newblock version 0.3d,
+\newblock (2016-02-13)
+\urlprefix\url{https://ctan.org/pkg/realscripts}
+\end{thebibliography}
+
+\end{document} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/spbmark/spbmark.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty	2021-07-26 11:35:35 UTC (rev 60075)
+++ trunk/Master/texmf-dist/tex/latex/spbmark/spbmark.sty	2021-07-26 20:29:23 UTC (rev 60076)
@@ -1,19 +1,15 @@
-%%
-%% This is file `spbmark.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% spbmark.dtx  (with options: `package')
-%% Copyright (C) 2021 by Qu Yi <quee123 at foxmail.com>
-%% 
-%% This work may be distributed and/or modified under the
-%% conditions of the CC-BY 4.0 License.
-%% The latest version of this license is in
-%%   https://creativecommons.org/licenses/by/4.0/legalcode
+%
+% ***************** THE SPBMARK PACKAGE *****************
+%
+% Copyright (C) 2021 by Qu Yi <quee123 at foxmail.com>
+%
+% This work may be distributed and/or modified under the
+% conditions of the CC-BY 4.0 License.
+% The latest version of this license is in
+%   https://creativecommons.org/licenses/by/4.0/legalcode
 \NeedsTeXFormat{LaTeX2e}[2018/12/31]
 \RequirePackage{xparse,l3keys2e}
-\ProvidesExplPackage{spbmark}{2021/07/23}{1.04}
+\ProvidesExplPackage{spbmark}{2021/07/26}{1.05}
   {Customize superscripts and subscripts}
 
 \cs_new_protected:Npn \spb_define:n { \keys_define:nn { spbmark } }



More information about the tex-live-commits mailing list.