summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-07-27 03:01:57 +0000
committerNorbert Preining <norbert@preining.info>2021-07-27 03:01:57 +0000
commitcef58753eba8ad7e2071195dbd92454febe82d32 (patch)
treedf909696e42fb25ce108e30258c7f935ded86079 /macros/latex
parent84465d50d746dfed1bfbe7bb5065279665fa87de (diff)
CTAN sync 202107270301
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx117
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin593817 -> 595237 bytes
-rw-r--r--macros/latex/contrib/macrolist/README.md2
-rw-r--r--macros/latex/contrib/macrolist/macrolist.dtx31
-rw-r--r--macros/latex/contrib/macrolist/macrolist.pdfbin192607 -> 192674 bytes
-rw-r--r--macros/latex/contrib/palette/README.md17
-rw-r--r--macros/latex/contrib/palette/palette.dtx403
-rw-r--r--macros/latex/contrib/palette/palette.pdfbin0 -> 180945 bytes
-rw-r--r--macros/latex/contrib/spbmark/spbmark.dtx364
-rw-r--r--macros/latex/contrib/spbmark/spbmark.ins37
-rw-r--r--macros/latex/contrib/spbmark/spbmark.pdfbin70916 -> 64321 bytes
-rw-r--r--macros/latex/contrib/spbmark/spbmark.sty219
-rw-r--r--macros/latex/contrib/spbmark/spbmark.tex136
13 files changed, 868 insertions, 458 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index e2de071e35..82c1980c7b 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -29,7 +29,7 @@
%
% \title{\sffamily easybook 文档类手册}
% \author{瞿毅}
-% \date{2021/07/25\hskip 1em\relax v1.27p\thanks{\url{https://gitee.com/texl3/easybook}}}
+% \date{2021/07/25\hskip 1em\relax v1.27q\thanks{\url{https://gitee.com/texl3/easybook}}}
%
% \maketitle
% \begin{abstract}
@@ -61,7 +61,7 @@
% \end{document}
% \end{frameverb}
%
-% 或者直接使用 \pkg{easybase} 宏包,目前适用于 \cls{ctexbook}、\cls{ctexrep}、\cls{ctexart} 以及标准文档类。它的宏包选项有 \opt{class}、\opt{draft}、\opt{paper} 和 \opt{floatpage},包含了节 \ref{sec:interface options} 所示各个模块接口命令的功能。当在 \textbf{标准文档类} 后载入时还可以使用 \pkg{ctex} 宏包的选项,将会传递给 \pkg{ctex} 宏包。
+% 或者直接使用 \pkg{easybase} 宏包,目前适用于 \cls{ctexbook}、\cls{ctexrep}、\cls{ctexart} 以及标准文档类。它的宏包选项有 \opt{class}、\opt{draft}、\opt{paper} 和 \opt{floatpage},包含了节 \ref{sec:interface options} 所示各个模块接口命令的功能。当在\textbf{标准文档类}后载入时还可以使用 \pkg{ctex} 宏包的选项,将会传递给 \pkg{ctex} 宏包。
% \begin{frameverb}
% \documentclass{ctexbook}
%
@@ -87,7 +87,7 @@
% xelatex -shell-escape easybook
% \end{frameverb}
% 当然也可以使用 \opt{latexmk} 及一些软件自带的编译工具,这里就不做介绍。 \\
-% \ding{72} 需要注意正确 \textbf{编译索引} 要增加 \opt{-shell-escape} 命令行选项。
+% \ding{72} 需要注意正确\textbf{编译索引}要增加 \opt{-shell-escape} 命令行选项。
%
% \section{文档类选项}
% \label{sec:document class options}
@@ -113,7 +113,7 @@
% \begin{syntax}
% scheme = <(chinese)|plain>
% \end{syntax}
-% \opt{scheme} 代表文档的主题,扩展了此选项在 \CTeX 文档类中原有的作用范围,\opt{plain} 选项可使各类标题变为英文形式。包括章节标题、图表标题和定理标题等。如 \textbf{第一章} 变为 \textbf{Chapter 1},\textbf{图1.1} 变为 \textbf{Table 1.1}。
+% \opt{scheme} 代表文档的主题,扩展了此选项在 \CTeX 文档类中原有的作用范围,\opt{plain} 选项可使各类标题变为英文形式。包括章节标题、图表标题和定理标题等。如\textbf{第一章}变为\textbf{Chapter 1},\textbf{图1.1}变为\textbf{Table 1.1}。
% \end{function}
%
% \begin{function}[rEXP,added = 2021-01-05,updated = 2021-04-29]{enmode}
@@ -149,7 +149,7 @@
% cjkfont = <adobe|fandol|founder|mac|macnew|macold|ubuntu|windows|none>
% \end{syntax}
% 中文字体采用 \CTeX 宏集包含的字库并与其一致,具体配置方案可以查看 \CTeX 使用手册。它与 \opt{fontset} 选项是等效的,如果没有指定 \opt{cjkfont} 的值,将会自动检测用户的操作系统并选择相应的字体。
-% \changes{v1.27p}{2021/07/12}{新增 \opt{cjkfont} 选项设置中文字体,原 \opt{font} 选项设置英文字体,中文字体使用 \CTeX 的字库。}
+% \changes{v1.27q}{2021/07/12}{新增 \opt{cjkfont} 选项设置中文字体,原 \opt{font} 选项设置英文字体,中文字体使用 \CTeX 的字库。}
% \end{function}
%
% 如果需要使用其它中文字体,可以在启用选项 \opt{cjkfont = none} 后,再使用 \pkg{xeCJK} 宏包的相关命令设置字体以及声明字体族:
@@ -246,7 +246,7 @@
% \tn{bisection*}\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}
% \tn{bisubsection*}\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}
% \end{syntax}
-% 双语目录的标题命令目前设置了常用的三个级别,它们将中文标题正常输出,并使中英文标题加入双语目录。类似于标准文档类,这三个标题命令分别具有 bichapter、bisection 和 bisubsection 三个计数器,并对应 \tn{the}\meta{计数器} 的值,可以用于 \opt{binumber} 选项更改英文目录中的编号。这个功能是为国内一些高校的学位论文模板的要求设计,在一般情况和英文模式下 \textbf{不需要使用}。
+% 双语目录的标题命令目前设置了常用的三个级别,它们将中文标题正常输出,并使中英文标题加入双语目录。类似于标准文档类,这三个标题命令分别具有 bichapter、bisection 和 bisubsection 三个计数器,并对应 \tn{the}\meta{计数器} 的值,可以用于 \opt{binumber} 选项更改英文目录中的编号。这个功能是为国内一些高校的学位论文模板的要求设计,在一般情况和英文模式下\textbf{不需要使用}。
% \changes{v1.25}{2021/05/05}{增加与双语目录配合的标题命令。}
% \end{function}
%
@@ -497,7 +497,7 @@
% \begin{syntax}
% \tn{printbibliography}\oarg{键值列表}
% \end{syntax}
-% 两种方式 \textbf{均使用} 此命令打印参考文献,不同处理后端此命令的 \meta{键值列表} 不同。使用 \hologo{BibTeX} 处理时选项与节 \ref{sec:document command} 目录的选项相同,使用 \hologo{biber} 处理时常用的选项如下:
+% 两种方式\textbf{均使用}此命令打印参考文献,不同处理后端此命令的 \meta{键值列表} 不同。使用 \hologo{BibTeX} 处理时选项与节 \ref{sec:document command} 目录的选项相同,使用 \hologo{biber} 处理时常用的选项如下:
% \end{function}
%
% \begin{function}{heading,title,prenote,section,type,filter}
@@ -597,7 +597,7 @@
% \begin{itemize}
% \item 中英文模式下标题不同,英文标题为可选项,默认为首字母大写的环境名。
% \item 自动定义交叉引用的格式,引用标签前缀为定理名称。
-% \item 定理盒子选项 \opt{thmbox} 仍然生效,盒子样式选项是用于设置定理盒子样式的名称,它需要 \pkg{tcolorbox} 的 \tn{tcbset} 接口命令设定,默认为 \opt{tc-theorem}。
+% \item 定理盒子选项 \opt{thmbox} 仍然生效,盒子样式选项是用于设置定理盒子样式的名称,它需要 \pkg{tcolorbox} 的 \tn{tcbset} 接口命令或 \tn{tcbappstyle} 设定,默认为 \opt{tc-theorem}。
% \item 默认使用 \opt{easy-theorem} 定理样式,可在最后一个选项使用 \opt{style} 更改样式。
% \end{itemize}
% \item[\tn{declaretheoremstyle}] 定义新的定理样式,\meta{键值列表} 中包括上述定理样式以及 \tn{declaretheorem} 的所有选项。
@@ -614,6 +614,11 @@
% \tcolorboxenvironment{定理环境名}{tc-theorem}
% \end{ctexexam}
%
+% 使用 \tn{tcbappstyle} 命令调整开启定理盒子时默认的样式,第一个参数为 \opt{theorem},关于命令的介绍在小节 \ref{subsec:exercise}。
+% \begin{ctexexam}
+% \tcbappstyle{theorem}{colback = GreenYellow}
+% \end{ctexexam}
+%
% 定义一个新的定理样式可用于 \tn{declaretheorem} 的 \opt{style} 选项:
% \begin{ctexexam}
% \declaretheoremstyle[bodyfont = \rmfamily,spacepost = 0.5em]{定理样式名}
@@ -726,7 +731,7 @@
% \end{syntax}
% \ding{229} 以上选项路径为 \opt{hdrset/...} \\
% \changes{v1.25}{2021/05/12}{增加脚注样式设置选项。}
-% \changes{v1.27p}{2021/07/14}{增加脚注内容格式选项 \opt{fntext-form} 和脚注类型选项 \opt{footnotetype}。}
+% \changes{v1.27q}{2021/07/14}{增加脚注内容格式选项 \opt{fntext-form} 和脚注类型选项 \opt{footnotetype}。}
% \end{function}
%
% \begin{optdesc}
@@ -914,7 +919,7 @@
% \tn{end}\{hangparas\}
% \end{syntax}
% \tn{hangpara} 命令使其后的一个段落保持悬挂缩进,\env{hangparas} 环境使其中的段落均保持悬挂缩进。缩进将以 \meta{缩进长度} 从每个段落的 \meta{缩进开始行数} 开始。
-% \changes{v1.27p}{2021/07/11}{增加悬挂缩进段落命令 \tn{hangpara} 和环境 \env{hangparas}。}
+% \changes{v1.27q}{2021/07/11}{增加悬挂缩进段落命令 \tn{hangpara} 和环境 \env{hangparas}。}
% \end{function}
%
% \subsection{代码}
@@ -940,29 +945,41 @@
% \changes{v1.23}{2021/02/08}{增加准确的习题盒子标题目录锚点。}
% \end{function}
%
-% \meta{键值列表2} 为 \pkg{tcolorbox} 的盒子样式选项,例如 \opt{boxsep} 和 \opt{fontupper}等。\meta{键值列表3} 的选项与 \pkg{enumitem} 的排序列表相同,不过第一个选项无法是短编号形式,这被 \opt{number} 选项代替。\meta{键值列表1} 也用于设置标题样式,包含的选项如下:
-% \begin{function}{color,title,number,numsep,label}
+% \meta{键值列表2} 为 \pkg{tcolorbox} 的盒子样式选项,例如 \opt{boxsep} 和 \opt{fontupper} 等,也可以使用下述 \opt{tcolorbox} 选项。\meta{键值列表3} 的选项与 \pkg{enumitem} 的排序列表相同,也可以使用下述 \opt{enumitem} 选项,不过第一个选项无法是短编号形式,这被 \opt{number} 选项代替。\meta{键值列表1} 也用于设置标题样式,包含的选项如下:
+% \begin{function}{color,title,number,numsep,tcolorbox,enumitem,label}
% \begin{syntax}
% color = <标题背景颜色名|(DeepSkyBlue)>
% title = <环境标题>
% number = <习题编号格式|(1.)>
% numsep = <编号与标题的间距|(0.5em)>
+% tcolorbox = \{<键值列表2>\}
+% enumitem = \{<键值列表3>\}
% label = <标签内容>
% \end{syntax}
% \opt{number} 为短编号形式,应当包含 A、a、I、i、或 1 其中一个符号。\opt{label} 选项用于设置习题环境的引用标签,它与标签格式命令 \tn{labelformat} 对应的计数器是 eb@exercise。
% \end{function}
%
-% \begin{function}{\setexercise,\exerprologue,\tcphantomifname}
+% \begin{function}{\setexercise,\tcbappstyle,\setexerlist,\exerprologue,\tcphantomifname}
% \begin{syntax}
-% \tn{setexercise}\marg{键值列表}
+% \tn{setexercise}\marg{键值列表1}
+% \tn{tcbappstyle*}\marg{风格名称}\marg{键值列表2}
+% \tn{setexerlist}\marg{键值列表3}
% \tn{exerprologue}\marg{序言内容}
% \tn{tcphantomifname}\marg{编号代码}\marg{不编号代码}
% \end{syntax}
-% 可以通过 \tn{setexercise} 命令使用键值列表设置上述习题选项的默认值。\tn{exerprologue} 命令在习题环境开始前插入一段内容,可以是文本或者代码,需要在每一个习题环境前使用。\tn{tcphantomifname} 命令根据使用 \pkg{tcolorbox} 生成的习题标题是否编号,在超链接锚点的位置加入代码,比如使用 \tn{addcontentsline} 命令将习题标题加入目录。
% \end{function}
%
+% \begin{optdesc}
+% \item[\tn{setexercise}] 这个命令可以全局设置上述习题综合选项 \meta{键值列表1} 的默认值。
+% \item[\tn{tcbappstyle*}] 这是 \pkg{tcolorbox} 宏包盒子风格定义命令,带有星号的命令可以\textbf{新建或重置}一个名为 \opt{tc-}\meta{风格名称} 的盒子风格,否则是修改\textbf{已存在}的风格。在这里可以设置标题选项 \meta{键值列表2} 的值,第一个参数为 \opt{exercise},也可以修改小节 \ref{subsec:box} 本文档类支持的其它盒子环境风格。
+% \item[\tn{setexerlist}] 这个命令用于设置习题条目选项 \meta{键值列表3} 的值。
+% \item[\tn{exerprologue}] 在习题环境开始前插入一段内容,可以是文本或者代码,需要在每一个习题环境前使用。
+% \item[\tn{tcphantomifname}] 根据使用 \pkg{tcolorbox} 生成的习题标题是否编号,在超链接锚点的位置加入代码,比如使用 \tn{addcontentsline} 命令将习题标题加入目录。
+% \end{optdesc}
+%
% \begin{ctexexam}
% \tcphantomifname{\markright{\UseCounter{tcbcounter}{\quad 习题}}}{}
+% \tcbappstyle{exercise}{boxsep = 5pt}
% \exerprologue{习题前的一段文本}
% \begin{exercise}+[color = LightSkyBlue](after skip = 2pc)[itemsep = 1ex]
% \item 第一题
@@ -972,19 +989,21 @@
%
% \subsection{盒子}
% \label{subsec:box}
-% 使用盒子以及小节 \ref{subsec:exercise} 中的 \env{exercise} 环境需要在导言区 \textbf{手动载入} \pkg{tcolorbox} 宏包,它们 \meta{配置选项} 的键值列表同样由 \pkg{tcolorbox} 提供支持,具体选项可见宏包文档的 Option Keys 一节,可以进行边距、字体及背景颜色等各种个性化设置,一些配置会覆盖预设。
+% 使用盒子以及小节 \ref{subsec:exercise} 中的 \env{exercise} 环境需要在导言区\textbf{手动载入} \pkg{tcolorbox} 宏包,它们 \meta{配置选项} 的键值列表同样由 \pkg{tcolorbox} 提供支持,具体选项可见宏包文档的 Option Keys 一节,可以进行边距、字体及背景颜色等各种个性化设置,一些配置会覆盖预设。
%
% \subsubsection{摘要盒子}
-% \begin{function}[added = 2021-01-05,updated = 2021-05-02]{outline}
+% \begin{function}[added = 2021-01-05,updated = 2021-05-02]{\setoutlinelist,outline}
% \begin{syntax}
-% \tn{begin}\{outline\}\oarg{列表配置选项}\parg{标题名称}\oarg{盒子配置选项}
+% \tn{setoutlinelist}\marg{键值列表1}
+% \tn{begin}\{outline\}\oarg{键值列表1}\parg{标题名称}\oarg{键值列表2}
% \ \tn{item} <摘要内容>
% \tn{end}\{outline\}
% \end{syntax}
-% 摘要盒子可用于章前摘要,它的标题是可选参数,默认标题是摘要。列表配置选项与 \pkg{enumitem} 宏包中列表的选项相同,可以设置摘要条目的各种距离。
+% 摘要盒子 \env{outline} 可用于章前摘要,它的标题是可选参数,默认标题是摘要。\meta{键值列表1} 与 \pkg{enumitem} 宏包中列表配置选项相同,可以设置摘要条目的各种距离,使用 \tn{setoutlinelist} 命令对它进行全局设置。\meta{键值列表2} 是摘要盒子样式选项,可以使用 \tn{tcbappstyle} 命令对它进行全局设置,命令第一个参数为 \opt{outline}。
% \end{function}
%
% \begin{ctexexam}
+% \tcbappstyle{outline}{arc = 6pt}
% \begin{outline}[leftmargin = *](标题名称)
% \item 摘要内容
% \item 摘要内容
@@ -998,7 +1017,7 @@
% \ <盒子内容>
% \tn{end}\{easybox\}
% \end{syntax}
-% 环境 \env{easybox} 创建一个带有三个可选参数的扁平盒子。使用星号参数时给盒子添加边框,\meta{颜色名} 选项设置背景颜色,\meta{段落标题} 选项可以设置标题,默认无标题。
+% 环境 \env{easybox} 创建一个带有三个可选参数的扁平盒子。使用星号参数时给盒子添加边框,\meta{颜色名} 选项设置背景颜色,\meta{段落标题} 选项可以设置标题,默认无标题。如果 \meta{配置选项} 较长且希望在原有基础上更改为全局固定的样式,可以使用 \tn{tcbappstyle} 命令设置,命令第一个参数为 \opt{easybox}。
% \end{function}
%
% \begin{ctexexam}
@@ -1015,7 +1034,7 @@
% \ <盒子内容>
% \tn{end}\{ebparbox\}
% \end{syntax}
-% 环境 \env{ebparbox} 与 \env{easybox} 类似,同样带有三个可选参数。当使用星号参数时盒子左边带有一条竖线,\meta{颜色名} 选项可以自定义竖线颜色,使用带有星号的环境则盒子带有竖线颜色的浅色背景。\meta{段落标题} 选项可以设置标题,默认无标题。
+% 环境 \env{ebparbox} 用法与 \env{easybox} 类似,同样带有三个可选参数。当使用星号参数时盒子左边带有一条竖线,\meta{颜色名} 选项可以自定义竖线颜色,使用带有星号的环境则盒子带有竖线颜色的浅色背景。\meta{段落标题} 选项可以设置标题,默认无标题。
% \changes{v1.24}{2021/04/19}{优化盒子环境的选项,增加可带有标题的扁平盒子 \env{ebparbox}。}
% \end{function}
%
@@ -1060,7 +1079,7 @@
% \changes{v1.26}{2021/06/30}{增加计数器使用命令 \tn{UseCounter}。}
% \end{function}
%
-% 需要注意的是 \tn{UseCounter} 仅具有 \textbf{输出功能},并不会改变计数器原有的绑定关系。默认每使用一次命令 \meta{计数器} 的值增加 1,带有星号的命令使 \meta{计数器} 保持当前值,\meta{编号} 为 arabic 和 alpha 等格式,\meta{数值} 可以手动将 \meta{计数器} 设为指定值。
+% 需要注意的是 \tn{UseCounter} 仅具有\textbf{输出功能},并不会改变计数器原有的绑定关系。默认每使用一次命令 \meta{计数器} 的值增加 1,带有星号的命令使 \meta{计数器} 保持当前值,\meta{编号} 为 arabic 和 alpha 等格式,\meta{数值} 可以手动将 \meta{计数器} 设为指定值。
%
% 在一定的场合下可能用到 \tn{UseCounter} 命令,比如通过新建快捷命令在一些位置使用定理环境的计数器,使用 \tn{labelformat} 设置计数器的引用标签需添加 eb@:
% \begin{ctexexam}
@@ -1090,25 +1109,27 @@
% \end{function}
%
% \subsection{公式符号对照}
-% \begin{function}[added = 2021-07-22]{\seteqcomp,\symb,eqcomp}
+% \begin{function}[added = 2021-07-22]{\seteqcomp,\seteqcomplist,\symb,eqcomp}
% \begin{syntax}
% \tn{seteqcomp}\marg{键值列表}
+% \tn{seteqcomplist}\marg{键值列表2}
% \tn{symb*}\marg{符号}\oarg{引导符}
% \tn{begin}\{eqcomp\}\oarg{键值列表1}\parg{键值列表2}
% \ \tn{symb}\marg{符号}\oarg{引导符}<说明文字>
% \tn{end}\{eqcomp\}
% \end{syntax}
% 一些公式之后可以使用基于列表环境的 \env{eqcomp} 进行符号对照。\tn{symb} 需要在环境内使用,带有星号的命令可单独在文本段落使用。对照列表的 \meta{键值列表2} 与 \pkg{enumitem} 的选项相同,一般较少用到,可以用于设置垂直间距等。\meta{键值列表1} 也可以使用 \tn{seteqcomp} 全局设置,它的选项如下:
-% \changes{v1.27p}{2021/07/22}{增加公式符号对照环境 \env{eqcomp} 和命令 \tn{symb}。}
+% \changes{v1.27q}{2021/07/22}{增加公式符号对照环境 \env{eqcomp} 和命令 \tn{symb}。}
% \end{function}
%
-% \begin{function}{width,delim,space,item-align,delim-align,intro,font,mode}
+% \begin{function}{width,delim,space,item-align,delim-align,enumitem,intro,font,mode}
% \begin{syntax}
% width = <符号宽度|(2em)>
% delim = <引导符|(——)>
% space = <符号间隙|(0.25em)>
% item-align = <l|c|(r)>
% delim-align = <l|(c)|r>
+% enumitem = \{<键值列表2>\}
% intro = <首行文字>
% font = <符号字体>
% mode = <(math)|text>
@@ -1121,6 +1142,7 @@
% \item[space] 符号间隙为引导符两侧与符号和说明文字间的距离。
% \item[item-align] 符号的对齐方式,分为左(\opt{l})、中(\opt{c})和右(\opt{r})三种对齐方式。
% \item[delim-align] 引导符的对齐方式,分为左(\opt{l})、中(\opt{c})和右(\opt{r})三种对齐方式。
+% \item[enumitem] 可以使用选项 \opt{enumitem} 或命令 \tn{seteqcomplist} 调整对照列表的水平垂直间距。
% \item[intro] 符号对照的说明文字,应当为简短的几个字,只显示在第一行,其后为悬挂缩进的对照列表。
% \item[font] 符号的字体,数学和文本符号模式应采用不同的字体命令,最后一个命令可以接受一个参数,这个参数为符号。
% \item[mode] 符号字体模式,可以为数学字体或者文本字体。
@@ -1318,7 +1340,7 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2021/07/25}{1.27p}
+\ProvidesExplClass{easybook}{2021/07/25}{1.27q}
{Typeset Chinese theses or books}
\bool_set_false:N \l__eb_compile_draft_bool
@@ -1602,7 +1624,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2021/07/25}{1.27p}
+\ProvidesExplPackage{easybase}{2021/07/25}{1.27q}
{Typeset Chinese theses or books}
\cs_generate_variant:Nn \int_to_arabic:n { v }
@@ -2992,6 +3014,9 @@
\setlist[enumerate,2]{label = alph,ref = enumii,labelwidth = *}
\setlist[enumerate,3]{label = roman,ref = enumiii,labelwidth = *}
\setlist[description]{font = sf,labelwidth = *,leftmargin = 2em}
+\cs_new:Npn \setexerlist #1 { \setlist*[eb@exercise@list]{#1} }
+\cs_new:Npn \seteqcomplist #1 { \setlist*[eb@eqcomp@list]{#1} }
+\cs_new:Npn \setoutlinelist #1 { \setlist*[eb@outline@list]{#1} }
\keys_define:nn { eb/eqcomp }
{
@@ -3005,6 +3030,7 @@
item-align .initial:n = r,
delim-align .tl_set:N = \l__eb_eqsymb_delim_align_tl,
delim-align .initial:n = c,
+ enumitem .code:n = \seteqcomplist{#1},
intro .tl_set:N = \l__eb_eqsymb_intro_tl,
font .tl_set:N = \l__eb_eqsymb_font_tl,
mode .tl_set:N = \l__eb_eqsymb_mode_tl,
@@ -3232,10 +3258,18 @@
title .initial:n = \c__eb_name_exercise_tl,
numsep .dim_set:N = \eb@toc@exercise@numsep,
numsep .initial:n = 0.5em,
- label .tl_set:N = \eb@tc@exercise@label
+ label .tl_set:N = \eb@tc@exercise@label,
+ enumitem .code:n = \setexerlist{#1},
+ tcolorbox .code:n = \tcbappstyle{exercise}{#1}
}
\cs_new_protected:Npn \setexercise #1
{ \keys_set:nn { eb/exercise } {#1} }
+\NewDocumentCommand{\tcbappstyle}{smm}
+ {
+ \IfBooleanTF{#1}
+ {\tcbset{tc-#2/.style = {#3}}}
+ {\tcbset{tc-#2/.append~style = {#3}}}
+ }
\ctex_at_end_package:nn { tcolorbox }
{
\eb_package_date_check:nn { tcolorbox } { 2020/10/09 }
@@ -3554,17 +3588,11 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2021/07/25}{1.27p}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2021/07/25}{1.27q}
{Customization of tcolorbox for easybook}
-\cs_new_protected:Npn \eb_tcb_theorem_set:n #1
- { \tcbset{tc-theorem/.style = {#1}} }
-\cs_new_protected:Npn \eb_tcb_outline_set:n #1
- { \tcbset{tc-outline/.style = {#1}} }
-\cs_new_protected:Npn \eb_tcb_exercise_set:n #1
- { \tcbset{tc-exercise/.style = {#1}} }
\tl_gset:Nn \eb@tc@line@skip { 0.5\baselineskip }
-\eb_tcb_theorem_set:n
+\tcbappstyle*{theorem}
{
enhanced~jigsaw,pad~at~break* = 3pt,
opacityback = 0,
@@ -3575,7 +3603,7 @@
top = \eb@tc@line@skip,bottom = \eb@tc@line@skip,
middle = \eb@tc@line@skip
}
-\eb_tcb_outline_set:n
+\tcbappstyle*{outline}
{
enhanced,nofloat,
tikznode~boxed~title,
@@ -3588,13 +3616,15 @@
arc = 3pt,
left = 2pc,right = 2pc,top = 1.5pc,bottom = 1pc
}
-\eb_tcb_exercise_set:n
+\tcbappstyle*{exercise}
{
blank,on~line,center,
sharpish~corners,
fontupper = \Large\sffamily,
beforeafter~skip = 3.75ex plus .2ex minus .1ex
}
+\tcbappstyle*{easybox}{}
+\tcbappstyle*{ebparbox}{}
\tcbset
{
breakable,
@@ -3603,7 +3633,6 @@
boxrule = \l__eb_rule_width_dim
}
-\newtcbox[auto~counter]{\eb@tc@exercise@box}[1]{tc-exercise,#1}
\tl_new:N \p@eb@exercise
\tl_new:N \eb@tc@list@prologue
\cs_new:Npn \exerprologue #1 { \tl_gset:Nn \eb@tc@list@prologue {#1} }
@@ -3637,13 +3666,15 @@
\hspace{\use:c { eb@toc@#1@numsep }}
}
+\newtcbox[auto~counter]{\eb@tc@exercise@box}[1]{tc-exercise,#1}
+\newtcolorbox{eb@tc@outline@box}[2]{title = #1,tc-outline,#2}
\NewDocumentEnvironment{outline}{O{}D(){\abstractname}o+b}
{
- \begin{tcolorbox}[tc-outline,title = #2,IfValueT = {#3}{#3}]
+ \begin{eb@tc@outline@box}{#2}{IfValueT = {#3}{#3}}
\begin{eb@outline@list}[#1]
#4
\end{eb@outline@list}
- \end{tcolorbox}
+ \end{eb@tc@outline@box}
}{}
\NewDocumentEnvironment{exercise}{st+od()O{}+b}
{
@@ -3693,7 +3724,7 @@
bottomtitle = \eb@tc@line@skip,
beforeafter~skip = 1.75ex plus .2ex minus .1ex,
halign~upper = left,halign~lower = left,
- center~title,#4
+ center~title,tc-easybox,#4
}
\DeclareTColorBox{ebparbox}{sO{DarkSlateBlue}d()O{}}
{
@@ -3717,7 +3748,7 @@
left = 8pt,
middle = \eb@tc@line@skip,bottomtitle = \eb@tc@line@skip,
beforeafter~skip = 1.75ex plus .2ex minus .1ex,
- colframe = #2,coltitle = #2,#4
+ colframe = #2,coltitle = #2,tc-ebparbox,#4
}
\DeclareTotalTCBox{\ebemph}{O{DarkSeaGreen}vO{}}
{on~line,blank,fuzzy~halo = 2pt~with~#1,#3}{#2}
diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf
index 000f2a5a9d..89cccdd884 100644
--- a/macros/latex/contrib/easybook/easybook.pdf
+++ b/macros/latex/contrib/easybook/easybook.pdf
Binary files differ
diff --git a/macros/latex/contrib/macrolist/README.md b/macros/latex/contrib/macrolist/README.md
index ea16d986ea..01a19cad01 100644
--- a/macros/latex/contrib/macrolist/README.md
+++ b/macros/latex/contrib/macrolist/README.md
@@ -1,4 +1,4 @@
-# The LaTeX package macrolist - version 1.2.0 (2021/07/23)
+# The LaTeX package macrolist - version 1.2.1 (2021/07/25)
> Copyright (C) 2021 Dennis Chen <proofprogram@gmail.com>
>
diff --git a/macros/latex/contrib/macrolist/macrolist.dtx b/macros/latex/contrib/macrolist/macrolist.dtx
index 382faf2930..59d3041f3f 100644
--- a/macros/latex/contrib/macrolist/macrolist.dtx
+++ b/macros/latex/contrib/macrolist/macrolist.dtx
@@ -16,7 +16,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{macrolist}[2021/07/23 v1.2.0 Create lists of macros and perform operations on them]
+\ProvidesPackage{macrolist}[2021/07/25 v1.2.1 Create lists of macros and perform operations on them]
\RequirePackage{pgffor}
%</package>
@@ -94,6 +94,7 @@
\csname macrolist@list@#1\the\numexpr #2\relax\endcsname%
}
% \fi
+% \changes{v1.2.1}{2021/07/25}{Fix behavior of listindexof and listcontains for empty lists}
% \changes{v1.2.0}{2021/07/23}{Add listindexof and listcontains}
% \DescribeMacro{\listindexof}
%
@@ -106,12 +107,14 @@
\newcommand{\listindexof}[2]{%
\def\macrolist@listindex{0}%
\macrolist@exists{#1}%
- \def\macrolist@el{#2}%
- \listforeach{#1}{\macrolist@listindexel}[\listsize{#1}][1]{%
- \ifx\macrolist@el\macrolist@listindexel
- \xdef\macrolist@listindex{\macrolist@index}%
- \fi
- }%
+ \ifnum\listsize{#1}>0\relax
+ \def\macrolist@el{#2}%
+ \listforeach{#1}{\macrolist@listindexel}[\listsize{#1}][1]{%
+ \ifx\macrolist@el\macrolist@listindexel
+ \xdef\macrolist@listindex{\macrolist@index}%
+ \fi
+ }%
+ \fi
\macrolist@listindex%
\let\macrolist@listindex\relax%
}
@@ -125,12 +128,14 @@
\newcommand{\listcontains}[4]{%
\def\macrolist@listindex{0}%
\macrolist@exists{#1}%
- \def\macrolist@el{#2}%
- \listforeach{#1}{\macrolist@listindexel}[\listsize{#1}][1]{%
- \ifx\macrolist@el\macrolist@listindexel
- \xdef\macrolist@listindex{\macrolist@index}%
- \fi
- }%
+ \ifnum\listsize{#1}>0\relax
+ \def\macrolist@el{#2}%
+ \listforeach{#1}{\macrolist@listindexel}[\listsize{#1}][1]{%
+ \ifx\macrolist@el\macrolist@listindexel
+ \xdef\macrolist@listindex{\macrolist@index}%
+ \fi
+ }%
+ \fi
\ifnum\macrolist@listindex>0\relax
#3%
\else
diff --git a/macros/latex/contrib/macrolist/macrolist.pdf b/macros/latex/contrib/macrolist/macrolist.pdf
index 2ee450e2bc..204fa35c1c 100644
--- a/macros/latex/contrib/macrolist/macrolist.pdf
+++ b/macros/latex/contrib/macrolist/macrolist.pdf
Binary files differ
diff --git a/macros/latex/contrib/palette/README.md b/macros/latex/contrib/palette/README.md
new file mode 100644
index 0000000000..9e74362159
--- /dev/null
+++ b/macros/latex/contrib/palette/README.md
@@ -0,0 +1,17 @@
+# The LaTeX package palette - version 1.0.0 (2021/07/26)
+
+**palette** provides the ability to create custom color palettes and symbol palettes ("symbol suites"), and swap one palette in for another easily. It also allows the user to create a variable that represents the selected palette, and provides checks in case the variable represents a palette that does not exist.
+
+The package is split into `colorpalette` and `symbolsuite`.
+
+## Installation instructions
+
+A working TeX installation is required.
+
+This is a self-extracting dtx file, so run
+
+ pdflatex palette.dtx
+
+to generate the README, documentation, and packages.
+
+
diff --git a/macros/latex/contrib/palette/palette.dtx b/macros/latex/contrib/palette/palette.dtx
new file mode 100644
index 0000000000..7697b75f6c
--- /dev/null
+++ b/macros/latex/contrib/palette/palette.dtx
@@ -0,0 +1,403 @@
+% \iffalse meta-comment
+% This package was written for pdfLaTeX.
+% In particular, there is no guarantee that this works for other tex engines.
+%
+% Copyright (C) 2021 Dennis Chen <proofprogram@gmail.com>
+%
+% This work may be distributed and/or modified under
+% the conditions the LaTeX Project Public License (LPPL),
+% either version 1.3 of this license or (at your option)
+% any later version. The latest version of this license
+% can be found in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+%<*internal>
+\iffalse
+%</internal>
+%<*readme>
+# The LaTeX package palette - version 1.0.0 (2021/07/26)
+
+**palette** provides the ability to create custom color palettes and symbol palettes ("symbol suites"), and swap one palette in for another easily. It also allows the user to create a variable that represents the selected palette, and provides checks in case the variable represents a palette that does not exist.
+
+The package is split into `colorpalette` and `symbolsuite`.
+
+## Installation instructions
+
+A working TeX installation is required.
+
+This is a self-extracting dtx file, so run
+
+ pdflatex palette.dtx
+
+to generate the README, documentation, and packages.
+%</readme>
+% \fi
+
+% \iffalse
+
+%<*internal>
+\fi
+\def\nameofplainTeX{plain}
+\ifx\fmtname\nameofplainTeX\else
+ \expandafter\begingroup
+\fi
+%</internal>
+%<*install>
+
+\input docstrip.tex
+\keepsilent
+\askforoverwritefalse
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2021 Dennis Chen <proofprogram@gmail.com>
+
+This work may be distributed and/or modified under
+the conditions the LaTeX Project Public License (LPPL),
+either version 1.3 of this license or (at your option)
+any later version. The latest version of this license
+can be found in
+
+ http://www.latex-project.org/lppl.txt
+
+and version 1.3 or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+To produce the documentation, run palette.dtx through pdflatex.
+
+\endpreamble
+\postamble
+
+This package consists of the file palette.dtx,
+ and the generated files colorpalette.sty,
+ symbolsuite.sty,
+ palette.pdf.
+\endpostamble
+
+\usedir{tex/latex/palette}
+\generate{
+ \file{colorpalette.sty}{\from{\jobname.dtx}{color}}
+ \file{symbolsuite.sty}{\from{\jobname.dtx}{symbol}}
+}
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* files into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* colorpalette.sty *}
+\Msg{* symbolsuite.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation, run the file *}
+\Msg{* palette.dtx through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{*************************************************************}
+
+%</install>
+%<install>\endbatchfile
+%<*internal>
+
+\usedir{source/latex/palette}
+\generate{
+ \file{\jobname.ins}{\from{\jobname.dtx}{install}}
+}
+\nopreamble\nopostamble
+
+\usedir{doc/latex/palette}
+\generate{
+ \file{README.md}{\from{\jobname.dtx}{readme}}
+}
+
+\ifx\fmtname\nameofplainTeX
+ \expandafter\endbatchfile
+\else
+ \expandafter\endgroup
+\fi
+%</internal>
+%
+%<color|symbol>\NeedsTeXFormat{LaTeX2e}
+%<color>\ProvidesPackage{colorpalette}
+%<symbol>\ProvidesPackage{symbolsuite}
+%<color|symbol>[2021/07/26 v1.0.0 Create palettes for colors and symbols]
+%<color>\RequirePackage{xcolor}
+%<*color|symbol>
+\RequirePackage{ifallfalse}
+\RequirePackage{macrolist}
+%</color|symbol>
+%<*driver>
+\ProvidesFile{\jobname.dtx}[2021/07/26 v1.0.0 Create palettes for colors and symbols]
+\documentclass{ltxdoc}
+
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+
+\begin{document}
+ \DocInput{\jobname.dtx}
+ \PrintIndex
+ \PrintChanges
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{\jobname.dtx}
+%
+% \changes{v1.0.0}{2021/07/26}{Initial version}
+%
+% \title{\textsf{palette} -- Create palettes for colors and symbols}
+% \author{Dennis Chen \\ proofprogram@gmail.com}
+% \date{\fileversion{} (\filedate)}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The \textsf{palette} package provides \textsf{colorpalette.sty} and \textsf{symbolsuite.sty}, which can be used to create and manage palettes of colors and symbols, respectively.
+% \end{abstract}
+%
+% \section{Overview}
+% We will go over the basic structure of the user interface in broad terms first (i.e. no macros or environments yet). We will use \textsf{colorpalette} as our example here, but \textsf{symbolsuite} behaves virtually identically.
+%
+% First, the user can create palette \emph{themes}, which are independent from each other. Then, you can add colors to themes. Finally, you can make a palette associated with a theme and set its colors.
+%
+% \section{colorpalette.sty}
+%
+% \subsection{Usage}
+%
+% \DescribeMacro{\newpalettetheme}
+% To create a new palette theme called \textsf{theme}, write |\newpalettetheme{theme}|.
+%
+% \iffalse
+%<*color>
+\newcommand\newpalettetheme[1]{
+ \newlist{colorpalette@theme@#1@palettes}
+ \newlist{colorpalette@theme@#1@colors}
+}
+%</color>
+% \fi
+% \DescribeMacro{\addcolortotheme}
+% To add a color \textsf{color} to theme \textsf{theme}, write |\addcolortotheme{theme}{color}|.
+%
+% \iffalse
+%<*color>
+\newcommand\addcolortotheme[2]{
+ \colorpalette@themecheck{#1}
+ \listadd{colorpalette@theme@#1@colors}{#2}
+}
+%</color>
+% \fi
+%
+% \DescribeMacro{\newpalette}
+% To create a new palette \textsf{palette} based on theme \textsf{theme}, write |\newpalette{theme}{palette}|.
+%
+% Palette names only need to be unique across the same theme. This means that you can have two palettes with the same name if they are associated with different themes.
+%
+% \iffalse
+%<*color>
+\newcommand\newpalette[2]{
+ % Check that the theme exists
+ \colorpalette@themecheck{#1}
+ \listadd{colorpalette@theme@#1@palettes}{#2}
+}
+%</color>
+% \fi
+%
+% \DescribeMacro{\setpalettecolor}
+% To set the color \textsf{color} (which was defined with respect to the theme of the palette) as the color value \textsf{value} in the format \textsf{encoding} (which by default is HTML) of palette \textsf{palette} in theme \textsf{theme}, write \begin{verbatim}\setpalettecolor{theme}{palette}{color}[encoding]{value}\end{verbatim}
+%
+% \iffalse
+%<*color>
+\newcommand\setpalettecolor[3]{
+ \colorpalette@themecheck{#1}
+ \colorpalette@palettecheck{#1}{#2}
+ \colorpalette@colorcheck{#1}{#3}
+ \def\colorpalette@temp@themename{#1}
+ \def\colorpalette@temp@palettename{#2}
+ \def\colorpalette@temp@colorname{#3}
+ \colorpalette@setpalettecolor
+}
+\newcommand\colorpalette@setpalettecolor[2][HTML]{
+ \definecolor{colorpalette@\colorpalette@temp@themename @\colorpalette@temp@palettename @\colorpalette@temp@colorname}{#1}{#2}
+}
+%</color>
+% \fi
+%
+% \DescribeMacro{\activepalette}
+% This sets the active palette of a theme. (This is how palettes are ``swapped in'' with respect to a theme.) To set the active palette of theme \textsf{theme} as \textsf{palette}, write |\activepalette{theme}{palette}|.
+%
+% \iffalse
+%<*color>
+\newcommand\activepalette[2]{%
+ \colorpalette@themecheck{#1}
+ \colorpalette@palettecheck{#1}{#2}
+ \expandafter\def\csname colorpalette@#1@active\endcsname{#2}%
+}
+%</color>
+% \fi
+%
+% \DescribeMacro{\getcolor}
+% To use, write |\getcolor{theme}{color}|. This gets the \emph{internal} color name from the \emph{active} palette of \textsf{theme}. No errors will be thrown even if you pass in an undefined theme or color (with respect to the theme). This limitation is because we must be able to parse |\getcolor|.
+%
+% \iffalse
+%<*color>
+\newcommand\getcolor[2]{colorpalette@#1@\csname colorpalette@#1@active\endcsname @#2}
+%</color>
+% \fi
+%
+% \DescribeMacro{\applycolor}
+% To use, write |\applycolor{theme}{color}|. This applies color \textsf{color} from the \emph{active} palette of theme \textsf{theme}. (This means that the newly defined color is passed into |\color|.) If \textsf{theme} has no active palette, an error will be thrown.
+%
+% To make it clearer what |\applycolor| does, we will just show the macro definition directly (since it is quite simple). (The macros |\colorpalette@themecheck| and |\colorpalette@colorcheck| are just for error handling.)
+%
+% \begin{macrocode}
+%<*color>
+\newcommand\applycolor[2]{%
+ \colorpalette@themecheck{#1}%
+ \colorpalette@colorcheck{#1}{#2}%
+ \color{\getcolor{#1}{#2}}%
+}
+%</color>
+% \end{macrocode}
+%
+% \subsection{Error Messages}
+% \iffalse
+%<*color>
+\newcommand\colorpalette@themecheck[1]{\listexists{colorpalette@theme@#1@palettes}{}{\colorpalette@error@theme{#1}}}
+\newcommand\colorpalette@palettecheck[2]{\listcontains{colorpalette@theme@#1@palettes}{#2}{}{\colorpalette@error@palette{#1}{#2}}}
+\newcommand\colorpalette@colorcheck[2]{\listcontains{colorpalette@theme@#1@colors}{#2}{}{\colorpalette@error@color{#1}{#2}}}
+%</color>
+% \fi
+%
+% If a nonexistent theme is passed in, the following error will be thrown:
+% \begin{verbatim}The palette passed in is not a defined palette of theme `#1'\end{verbatim}
+% where |#1| is the name of the theme.
+% \iffalse
+%<color>\newcommand\colorpalette@error@theme[1]{\PackageError{colorpalette}{The theme `#1' passed in is not defined}{}}
+% \fi
+%
+% If a palette that does not belong to a theme is passed in, the following error will be thrown:
+% \begin{verbatim}The palette `#2' passed in is not a defined palette of theme `#1'\end{verbatim}
+% where |#1| is the name of the theme and |#2| is the name of the palette.
+% \iffalse
+%<color>\newcommand\colorpalette@error@palette[2]{\PackageError{colorpalette}{The palette `#2' passed in is not a defined palette of theme `#1'}{}}
+% \fi
+%
+% If a color that does not belong to a theme is passed in, the following error will be thrown:
+% \begin{verbatim}The color `#2' passed in is not a defined color of theme `#1'\end{verbatim}
+% where |#1| is the name of the theme and |#2| is the name of the color.
+% \iffalse
+%<color>\newcommand\colorpalette@error@color[2]{\PackageError{colorpalette}{The color `#2' passed in is not a defined color of theme `#1'}{}}
+% \fi
+%
+% \section{symbolsuite.sty}
+%
+% This package is nearly analogous to \textsf{colorpalette}. A \emph{suite} is analogous to a \emph{palette}, and a \emph{symbol} is analogous to a \emph{color}. \emph{Themes} are used in both packages.
+%
+% \subsection{Usage}
+%
+% \DescribeMacro{\newsuitetheme}
+% To create a new suite theme called \textsf{theme}, write |\newsuitetheme{theme}|.
+%
+% \iffalse
+%<*symbol>
+\newcommand\newsuitetheme[1]{
+ \newlist{symbolsuite@theme@#1@suites}
+ \newlist{symbolsuite@theme@#1@symbols}
+}
+%</symbol>
+% \fi
+% \DescribeMacro{\addsymboltotheme}
+% To add a symbol \textsf{symbol} to theme \textsf{theme}, write |\addsymboltotheme{theme}{symbol}|.
+%
+% \iffalse
+%<*symbol>
+\newcommand\addsymboltotheme[2]{
+ \symbolsuite@themecheck{#1}
+ \listadd{symbolsuite@theme@#1@symbols}{#2}
+}
+%</symbol>
+% \fi
+%
+% \DescribeMacro{\newsuite}
+% To create a new suite \textsf{suite} based on theme \textsf{theme}, write |\newsuite{theme}{suite}|.
+%
+% Suite names only need to be unique across the same theme. This means that you can have two suites with the same name if they are associated with different themes.
+%
+% \iffalse
+%<*symbol>
+\newcommand\newsuite[2]{
+ \symbolsuite@themecheck{#1}
+ \listadd{symbolsuite@theme@#1@suites}{#2}
+}
+%</symbol>
+% \fi
+%
+% \DescribeMacro{\setsuitesymbol}
+% To set the symbol \textsf{symbol} (which was defined with respect to the theme of the suite) as the icon \textsf{icon} of suite \textsf{suite} in theme \textsf{theme}, write \begin{verbatim}\setsuitesymbol{theme}{suite}{symbol}{icon}\end{verbatim}
+%
+% \iffalse
+%<symbol>\newcommand\setsuitesymbol[4]{\expandafter\def\csname symbolsuite@#1@#2@#3\endcsname{#4}}
+% \fi
+%
+% \DescribeMacro{\activesuite}
+% This sets the active suite of a theme. (This is how suites are ``swapped in'' with respect to a theme.) To set the active suite of theme \textsf{theme} as \textsf{suite}, write |\activesuite{theme}{suite}|.
+%
+% \iffalse
+%<*symbol>
+\newcommand\activesuite[2]{
+ \symbolsuite@themecheck{#1}
+ \symbolsuite@suitecheck{#1}{#2}
+ \expandafter\def\csname symbolsuite@#1@active\endcsname{#2}
+}
+%</symbol>
+% \fi
+%
+% \DescribeMacro{\printsymbol}
+% To use, write |\printsymbol{theme}{symbol}|. This is similar to \textsf{colorpalette.sty}'s |\applycolor|.
+% \iffalse
+%<*symbol>
+\newcommand\printsymbol[2]{%
+ \symbolsuite@themecheck{#1}%
+ \symbolsuite@symbolcheck{#1}{#2}%
+ \csname symbolsuite@#1@\csname symbolsuite@#1@active\endcsname @#2\endcsname%
+}
+%</symbol>
+% \fi
+%
+% \subsection{Error Messages}
+% \iffalse
+%<*symbol>
+\newcommand\symbolsuite@themecheck[1]{\listexists{symbolsuite@theme@#1@suites}{}{\symbolsuite@error@theme{#1}}}
+\newcommand\symbolsuite@suitecheck[2]{\listcontains{symbolsuite@theme@#1@suites}{#2}{}{\symbolsuite@error@suite{#1}{#2}}}
+\newcommand\symbolsuite@symbolcheck[2]{\listcontains{symbolsuite@theme@#1@symbols}{#2}{}{\symbolsuite@error@symbol{#1}{#2}}}
+%</symbol>
+% \fi
+%
+% If a nonexistent theme is passed in, the following error will be thrown:
+% \begin{verbatim}The palette passed in is not a defined palette of theme `#1'\end{verbatim}
+% where |#1| is the name of the theme.
+% \iffalse
+%<symbol>\newcommand\symbolsuite@error@theme[1]{\PackageError{symbolsuite}{The theme `#1' passed in is not defined}{}}
+% \fi
+%
+% If a suite that does not belong to a theme is passed in, the following error will be thrown:
+% \begin{verbatim}The suite `#2' passed in is not a defined suite of theme `#1'\end{verbatim}
+% where |#1| is the name of the theme and |#2| is the name of the suite.
+% \iffalse
+%<symbol>\newcommand\symbolsuite@error@suite[2]{\PackageError{symbolsuite}{The suite `#2' passed in is not a defined suite of theme `#1'}{}}
+% \fi
+%
+% If a symbol that does not belong to a theme is passed in, the following error will be thrown:
+% \begin{verbatim}The symbol `#2' passed in is not a defined symbol of theme `#1'\end{verbatim}
+% where |#1| is the name of the theme and |#2| is the name of the symbol.
+% \iffalse
+%<symbol>\newcommand\symbolsuite@error@symbol[2]{\PackageError{symbolsuite}{The symbol `#2' passed in is not a defined color of theme `#1'}{}}
+% \fi
+% \Finale
+%
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/palette/palette.pdf b/macros/latex/contrib/palette/palette.pdf
new file mode 100644
index 0000000000..31227e386e
--- /dev/null
+++ b/macros/latex/contrib/palette/palette.pdf
Binary files differ
diff --git a/macros/latex/contrib/spbmark/spbmark.dtx b/macros/latex/contrib/spbmark/spbmark.dtx
deleted file mode 100644
index b2666aab80..0000000000
--- a/macros/latex/contrib/spbmark/spbmark.dtx
+++ /dev/null
@@ -1,364 +0,0 @@
-% \iffalse meta-comment
-%
-% Copyright (C) 2021 by Qu Yi <quee123@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
-% \fi
-%
-% \iffalse
-%<*driver>
-\documentclass{l3doc}
-\usepackage{spbmark,siunitx}
-\usepackage[noto]{newtxmath}
-\OnlyDescription
-\begin{document}
- \DocInput{\jobname.dtx}
- \PrintIndex
-\end{document}
-%</driver>
-% \fi
-%
-% \title{\pkg{spbmark} -- Customize superscripts and subscripts}
-% \author{Qu Yi}
-% \date{2021/07/23\hskip 1em\relax v1.04\thanks{\url{https://github.com/texl3/spbmark}}}
-%
-% \maketitle
-% \begin{abstract}
-% \pkg{spbmark} provides three commands \tn{super}, \tn{sub} and \tn{supersub} to improve the layout of superscripts and subscripts which can be adjusted the relative position and format, and can be used in text and math mode.
-% \end{abstract}
-% \tableofcontents
-%
-% \section{Macro package options}
-% \label{sec:macro package options}
-% \begin{function}[added = 2021-06-26]{ctex}
-% This option works with the C\TeX{} document class used by simplified Chinese users, there's actually no functional change. Adding path \texttt{style} to \tn{ctexset} command, which is equivalent to using \tn{spbset}.
-% \end{function}
-%
-% \begin{function}[added = 2021-06-30]{newsupb}
-% \texttt{newsupb} is a boolean option with a default value of true that redefines the \LaTeX{} kernel commands to cause \tn{sp} and \tn{textsuperscript} are equivalent to \tn{super} command, and \tn{sb} and \tn{textsubscript} are equivalent to \tn{sub} command.
-% \end{function}
-%
-% \section{User commands}
-% \begin{function}[added = 2021-06-26,updated = 2021-06-28]{\super,\sub,\supersub}
-% \begin{syntax}
-% \tn{super*}\oarg{vshift}[<height>,<depth>]\parg{code}\marg{content}\oarg{hshift}
-% \tn{sub*}\oarg{vshift}[<height>,<depth>]\parg{code}\marg{content}\oarg{hshift}
-% \tn{supersub*}\oarg{script sep}\oarg{script align}\parg{super format code}
-% \ \marg{super content}\marg{sub content}
-% \ \oarg{horizontal shift}\parg{sub format code}
-% \end{syntax}
-% \tn{super} command is used to output superscripts, \tn{sub} command is used to output subscripts, \tn{supersub} command is used to output both superscripts and subscripts.
-% \end{function}
-%
-% They 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 \texttt{0pt}, and the parameters of \meta{script align} are the same as the \texttt{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 superscripts and subscripts, 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.
-%
-% \begin{function}[added = 2021-06-30]{\sp,\sb,\spb,\textsuperscript,\textsubscript}
-% Except for the \tn{spb} command which is equivalent to \tn{supersub}, the others are \LaTeX{} kernel commands. If you use the \texttt{newsupb} package option then they will be redefined to make the command shorter, see section \ref{sec:macro package options}.
-%
-% If you need to use the original definitions of \tn{textsuperscript} and \tn{textsubscript}, then \tn{spb@textsuperscript@save} and \tn{spb@textsubscript@save} will be available. If you need to use the original definitions of \tn{sp} and \tn{sb}, then \tn{spb@sp@save} and \tn{spb@sb@save} will be available.
-% \end{function}
-%
-% \section{Global control interface}
-% \begin{function}[added = 2021-06-26,updated = 2021-07-23]{\spbset}
-% \begin{syntax}
-% \tn{spbset}\marg{key-value list}
-% \end{syntax}
-% \pkg{spbmark} uses the \tn{spbset} command to control the global default format of superscripts and subscripts. The values ​​set by it will be overwritten by the optional parameters of the superscript and other commands.
-% \end{function}
-%
-% \begin{function}{super-vshift,super-hshift,sub-vshift,sub-hshift,super-format,sub-format}
-% \begin{syntax}
-% super-vshift = <fixed length>
-% super-hshift = <fixed length>
-% sub-vshift = <fixed length>
-% sub-hshift = <fixed length>
-% super-format = <format code>
-% sub-format = <format code>
-% \end{syntax}
-% These list of keys control the format of superscript or subscript. They are equivalent to the optional parameters of the \tn{super} or \tn{sub} commands.
-% \end{function}
-%
-% \noindent
-% \DescribeOption{super-vshift} Extra vertical shift of the superscripts. \\
-% \DescribeOption{super-hshift} Extra horizontal shift of the superscripts. \\
-% \DescribeOption{sub-vshift} Extra vertical shift of the subscripts. \\
-% \DescribeOption{sub-hshift} Extra horizontal shift of the subscripts. \\
-% \DescribeOption{super-format} Control the format of superscripts, the last command in the code can take an argument, which is a superscript. \\
-% \DescribeOption{sub-format} Control the format of subscripts, the last command in the code can take an argument, which is a subscript.
-%
-% \begin{function}{supersub-hshift,supersub-format,supersubsep,supersubalign}
-% \begin{syntax}
-% supersub-hshift = <fixed length>
-% supersub-format = \{<super code>,<sub code>\}
-% supersubsep = <fixed length>
-% supersubalign = <horizontal alignment>
-% \end{syntax}
-% These list of keys control the format of superscripts and subscripts. They are equivalent to the optional parameters of the \tn{supersub} command.
-% \end{function}
-%
-% \noindent
-% \DescribeOption{supersub-hshift} Extra vertical shift of the superscripts and the subscripts. \\
-% \DescribeOption{supersub-format} Control the format of superscripts or subscripts. 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. \\
-% \DescribeOption{supersubsep} The distance between superscripts and subscripts, its default value is \texttt{0.3ex}. \\
-% \DescribeOption{supersubalign} The alignment of superscripts and subscripts, which contains \texttt{l}, \texttt{c}, and \texttt{r} parameters respectively for left, center, and right alignment.
-%
-% \section{Examples of use}
-% Here is a list of the three commands, please pay attention to the delimiter and usage of optional parameters:
-% \begin{quotation}
-% \noindent
-% |\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| \\
-% \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{quotation}
-%
-% It can also be used with the \pkg{siunitx} package to output superscripts and subscripts in the unit:
-% \begin{quotation}
-% \noindent
-% |\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}| \\
-% \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{quotation}
-%
-% \pkg{spbmark} also patches the footer markers for standard document class and \cls{KOMA-Script}. You can format the footer markers by redefining the \tn{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 \tn{unit} command, it is recommended to use \texttt{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 realscripts package} [CP/OL].
-% \newblock version 0.3d,
-% \newblock (2016-02-13)
-% \urlprefix\url{https://ctan.org/pkg/realscripts}
-% \end{thebibliography}
-%
-% \StopEventually{}
-%<*package>
-\NeedsTeXFormat{LaTeX2e}[2018/12/31]
-\RequirePackage{xparse,l3keys2e}
-\ProvidesExplPackage{spbmark}{2021/07/23}{1.04}
- {Customize superscripts and subscripts}
-
-\cs_new_protected:Npn \spb_define:n { \keys_define:nn { spbmark } }
-\cs_new_protected:Npn \spbset { \keys_set:nn { spbmark } }
-\keys_define:nn { spbmark/option }
- {
- ctex .code:n =
- {
- \cs_set:Npn \spb_define:n { \keys_define:nn { ctex/style } }
- \cs_set:Npn \spbset { \keys_set:nn { ctex/style } }
- },
- newsupb .bool_set:N = \l__spb_new_supersub_bool,
- newsupb .default:n = true,
- newsupb .initial:n = true
- }
-
-\ProcessKeysOptions{spbmark/option}
-
-\tl_new:N \l__spb_super_script_formatii_tl
-\tl_new:N \l__spb_sub_script_formatii_tl
-\spb_define:n
- {
- super-vshift .dim_set:N = \l__spb_super_script_vshift_dim,
- super-vshift .initial:n = 0pt,
- super-hshift .dim_set:N = \l__spb_super_script_hshift_dim,
- super-hshift .initial:n = 0pt,
- sub-vshift .dim_set:N = \l__spb_sub_script_vshift_dim,
- sub-vshift .initial:n = 0pt,
- sub-hshift .dim_set:N = \l__spb_sub_script_hshift_dim,
- sub-hshift .initial:n = 0pt,
- supersub-hshift .dim_set:N = \l__spb_supersub_script_hshift_dim,
- supersub-hshift .initial:n = 0pt,
- super-format .tl_set:N = \l__spb_super_script_formati_tl,
- sub-format .tl_set:N = \l__spb_sub_script_formati_tl,
- supersub-format .code:n = \spb_both_format_assign:n {#1},
- supersubsep .dim_set:N = \l__spb_supersub_script_sep_dim,
- supersubsep .initial:n = 0.3ex,
- supersubalign .tl_set:N = \l__spb_supersub_script_align_tl,
- supersubalign .initial:n = l
- }
-
-\tl_set:Nn \l__spb_boxa_wd_tl { \box_wd:N \l_tmpa_box }
-\tl_set:Nn \l__spb_boxb_wd_tl { \box_wd:N \l_tmpb_box }
-\cs_new:Npn \spb_tmp_boxa_use: { \box_use:N \l_tmpa_box }
-\cs_new:Npn \spb_tmp_boxb_use: { \box_use:N \l_tmpb_box }
-\cs_new:Npn \spb_box_max_dim_horizontal:
- {
- \skip_horizontal:n
- { \dim_max:nn { \l__spb_boxa_wd_tl } { \l__spb_boxb_wd_tl } }
- }
-\cs_new:Npn \spb_boxwd_subtract:nnnn #1#2#3#4
- {
- \skip_horizontal:n
- { #1\tl_use:c { l__spb_#3_wd_tl } - #2\tl_use:c { l__spb_#4_wd_tl } }
- }
-\cs_new:Npn \spb_boxwd_script_align:nn #1#2
- {
- \spb_boxwd_subtract:nnnn { 0.5 } { 0.5 } {#1} {#2}
- \use:c { spb_tmp_#2_use: }
- \spb_boxwd_subtract:nnnn { -0.5 } { 0.5 } {#1} {#2}
- \use:c { spb_tmp_#1_use: }
- }
-\cs_new:Npn \spb_math_print_store:nnn #1#2#3
- {
- \hbox_set:Nn \l_tmpa_box
- { \ensuremath{#1{\spb_math:nn {#2} {#3}}} }
- }
-\cs_new:Npn \spb_text_print_store:nnn #1#2#3
- {
- \hbox_set:Nn \l_tmpa_box
- { #1{\use:c { spb@text#2script@save }{#3}} }
- }
-\cs_new:Npn \spb_math_print_store:nnnn #1#2#3#4
- {
- \hbox_set:Nn \l_tmpa_box { \ensuremath{#1{\spb@sp@save{#2}}} }
- \hbox_set:Nn \l_tmpb_box { \ensuremath{#3{\spb@sb@save{#4}}} }
- }
-\cs_new:Npn \spb_text_print_store:nnnn #1#2#3#4
- {
- \hbox_set:Nn \l_tmpa_box { #1{\spb@textsuperscript@save{#2}} }
- \hbox_set:Nn \l_tmpb_box { #3{\spb@textsubscript@save{#4}} }
- }
-\cs_set_eq:NN \spb@textsuperscript@save \textsuperscript
-\cs_set_eq:NN \spb@textsubscript@save \textsubscript
-\cs_set_eq:NN \spb@sp@save \sp
-\cs_set_eq:NN \spb@sb@save \sb
-\cs_new:Npn \spb_math:nn #1
- {
- \str_case:nn {#1}
- {
- { super } { \spb@sp@save }
- { sub } { \spb@sb@save }
- }
- }
-\cs_new_protected:Npn \spb_box_ht_dp_assign:nn #1#2
- {
- \tl_if_empty:nF {#1} { \box_set_ht:Nn \l_tmpb_box {#1} }
- \tl_if_novalue:nF {#2} { \box_set_dp:Nn \l_tmpb_box {#2} }
- }
-\NewDocumentCommand{\spb_both_format_assign:n}
- {>{\SplitArgument{1}{,}}m}
- {\spb_supersub_script_both_format:nn #1}
-\cs_new_protected:Npn \spb_supersub_script_both_format:nn #1#2
- {
- \tl_set:Nn \l__spb_super_script_formatii_tl {#1}
- \tl_if_novalue:nTF {#2}
- { \tl_clear:N \l__spb_sub_script_formatii_tl }
- { \tl_set:Nn \l__spb_sub_script_formatii_tl {#2} }
- }
-
-\clist_map_inline:nn
- { super,sub }
- {
- \exp_args:Nc \NewDocumentCommand {#1}
- {
- sO{\dim_use:c { l__spb_#1_script_vshift_dim }}
- >{\SplitArgument{1}{,}}O{}
- D(){\tl_use:c { l__spb_#1_script_formati_tl }}
- mO{\dim_use:c { l__spb_#1_script_hshift_dim }}
- }
- {
- \IfBooleanTF{##1}
- {\spb_math_print_store:nnn {##4} {#1} {##5}}
- {
- \mode_if_math:TF
- { \spb_math_print_store:nnn {##4} {#1} {##5} }
- { \spb_text_print_store:nnn {##4} {#1} {##5} }
- }
- \hbox_set_to_wd:Nnn \l_tmpb_box { \l__spb_boxa_wd_tl + ##6 }
- { \hss\box_move_up:nn {##2} { \spb_tmp_boxa_use: } }
- \spb_box_ht_dp_assign:nn ##3
- \spb_tmp_boxb_use:
- }
- }
-\NewDocumentCommand{\supersub}
- {
- sO{\l__spb_supersub_script_sep_dim}
- O{\l__spb_supersub_script_align_tl}
- D(){\l__spb_super_script_formatii_tl}mm
- O{\l__spb_supersub_script_hshift_dim}
- D(){\l__spb_sub_script_formatii_tl}
- }
- {
- \IfBooleanTF{#1}
- {\spb_math_print_store:nnnn {#4} {#5} {#8} {#6}}
- {
- \mode_if_math:TF
- { \spb_math_print_store:nnnn {#4} {#5} {#8} {#6} }
- { \spb_text_print_store:nnnn {#4} {#5} {#8} {#6} }
- }
- \hbox_set_to_wd:Nnn \l_tmpa_box { \l__spb_boxa_wd_tl + #7 }
- { \hss\box_move_up:nn {#2} { \spb_tmp_boxa_use: } }
- \hbox_set_to_wd:Nnn \l_tmpb_box { \l__spb_boxb_wd_tl + #7 }
- { \hss\box_move_down:nn {#2} { \spb_tmp_boxb_use: } }
- \str_case:onF {#3}
- {
- { l } { \use_i:nnn }
- { c } { \use_ii:nnn }
- { r } { \use_iii:nnn }
- }
- {
- \msg_warning:nn { spbmark } { unsupported-align }
- \use_i:nnn
- }
- {
- \hbox_overlap_right:n { \spb_tmp_boxa_use: }
- \hbox_overlap_right:n { \spb_tmp_boxb_use: }
- \spb_box_max_dim_horizontal:
- }
- {
- \dim_compare:nNnTF { \l__spb_boxa_wd_tl } > { \l__spb_boxb_wd_tl }
- { \spb_boxwd_script_align:nn { boxa } { boxb } }
- { \spb_boxwd_script_align:nn { boxb } { boxa } }
- }
- {
- \spb_box_max_dim_horizontal:
- \hbox_overlap_left:n { \spb_tmp_boxa_use: }
- \hbox_overlap_left:n { \spb_tmp_boxb_use: }
- }
- }
-\msg_new:nnn { spbmark } { unsupported-align }
- {
- Alignment~only~supports~l,~c,~and~r. \\
- The~l~parameter~will~be~used~by~default.
- }
-
-\bool_if:NT \l__spb_new_supersub_bool
- {
- \clist_map_inline:nn
- {
- { sp,sb },
- { textsuperscript,textsubscript }
- }
- {
- \cs_set_eq:cN { \clist_item:nn {#1} { 1 } } \super
- \cs_set_eq:cN { \clist_item:nn {#1} { 2 } } \sub
- }
- }
-\cs_set_eq:NN \spb \supersub
-\cs_set:Npn \@makefnmark
- { \hbox:n { \fnmarkfont\super{\@thefnmark}[0pt] } }
-\cs_if_exist:NTF \ftntm@font
- { \cs_new:Npn \fnmarkfont { \ftntm@font } }
- { \cs_new:Npn \fnmarkfont { \normalfont } }
-%</package>
-\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/spbmark/spbmark.ins b/macros/latex/contrib/spbmark/spbmark.ins
deleted file mode 100644
index 43d605dab2..0000000000
--- a/macros/latex/contrib/spbmark/spbmark.ins
+++ /dev/null
@@ -1,37 +0,0 @@
-%
-% Copyright (C) 2021 by Qu Yi <quee123@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
-\input l3docstrip
-\keepsilent
-\askforoverwritefalse
-
-\usedir{tex/latex/spbmark}
-
-\preamble
-Copyright (C) 2021 by Qu Yi <quee123@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
-\endpreamble
-
-\generate{\file{spbmark.sty}{\from{\jobname.dtx}{package}}}
-
-\obeyspaces
-\Msg{*************************************************************}
-\Msg{* *}
-\Msg{* To finish the installation you have to move the following *}
-\Msg{* files into a directory searched by TeX: *}
-\Msg{* *}
-\Msg{* spbmark.sty *}
-\Msg{* *}
-\Msg{* Happy TeXing! *}
-\Msg{* *}
-\Msg{*************************************************************}
-
-\endbatchfile \ No newline at end of file
diff --git a/macros/latex/contrib/spbmark/spbmark.pdf b/macros/latex/contrib/spbmark/spbmark.pdf
index c7c7689c8d..d19d0c9fa9 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
new file mode 100644
index 0000000000..f5e40f2b7f
--- /dev/null
+++ b/macros/latex/contrib/spbmark/spbmark.sty
@@ -0,0 +1,219 @@
+%
+% ***************** THE SPBMARK PACKAGE *****************
+%
+% Copyright (C) 2021 by Qu Yi <quee123@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/26}{1.05}
+ {Customize superscripts and subscripts}
+
+\cs_new_protected:Npn \spb_define:n { \keys_define:nn { spbmark } }
+\cs_new_protected:Npn \spbset { \keys_set:nn { spbmark } }
+\keys_define:nn { spbmark/option }
+ {
+ ctex .code:n =
+ {
+ \cs_set:Npn \spb_define:n { \keys_define:nn { ctex/style } }
+ \cs_set:Npn \spbset { \keys_set:nn { ctex/style } }
+ },
+ newsupb .bool_set:N = \l__spb_new_supersub_bool,
+ newsupb .default:n = true,
+ newsupb .initial:n = true
+ }
+
+\ProcessKeysOptions{spbmark/option}
+
+\tl_new:N \l__spb_super_script_formatii_tl
+\tl_new:N \l__spb_sub_script_formatii_tl
+\spb_define:n
+ {
+ super-vshift .dim_set:N = \l__spb_super_script_vshift_dim,
+ super-vshift .initial:n = 0pt,
+ super-hshift .dim_set:N = \l__spb_super_script_hshift_dim,
+ super-hshift .initial:n = 0pt,
+ sub-vshift .dim_set:N = \l__spb_sub_script_vshift_dim,
+ sub-vshift .initial:n = 0pt,
+ sub-hshift .dim_set:N = \l__spb_sub_script_hshift_dim,
+ sub-hshift .initial:n = 0pt,
+ supersub-hshift .dim_set:N = \l__spb_supersub_script_hshift_dim,
+ supersub-hshift .initial:n = 0pt,
+ super-format .tl_set:N = \l__spb_super_script_formati_tl,
+ sub-format .tl_set:N = \l__spb_sub_script_formati_tl,
+ supersub-format .code:n = \spb_both_format_assign:n {#1},
+ supersubsep .dim_set:N = \l__spb_supersub_script_sep_dim,
+ supersubsep .initial:n = 0.3ex,
+ supersubalign .tl_set:N = \l__spb_supersub_script_align_tl,
+ supersubalign .initial:n = l
+ }
+
+\tl_set:Nn \l__spb_boxa_wd_tl { \box_wd:N \l_tmpa_box }
+\tl_set:Nn \l__spb_boxb_wd_tl { \box_wd:N \l_tmpb_box }
+\cs_new:Npn \spb_tmp_boxa_use: { \box_use:N \l_tmpa_box }
+\cs_new:Npn \spb_tmp_boxb_use: { \box_use:N \l_tmpb_box }
+\cs_new:Npn \spb_box_max_dim_horizontal:
+ {
+ \skip_horizontal:n
+ { \dim_max:nn { \l__spb_boxa_wd_tl } { \l__spb_boxb_wd_tl } }
+ }
+\cs_new:Npn \spb_boxwd_subtract:nnnn #1#2#3#4
+ {
+ \skip_horizontal:n
+ { #1\tl_use:c { l__spb_#3_wd_tl } - #2\tl_use:c { l__spb_#4_wd_tl } }
+ }
+\cs_new:Npn \spb_boxwd_script_align:nn #1#2
+ {
+ \spb_boxwd_subtract:nnnn { 0.5 } { 0.5 } {#1} {#2}
+ \use:c { spb_tmp_#2_use: }
+ \spb_boxwd_subtract:nnnn { -0.5 } { 0.5 } {#1} {#2}
+ \use:c { spb_tmp_#1_use: }
+ }
+\cs_new:Npn \spb_math_print_store:nnn #1#2#3
+ {
+ \hbox_set:Nn \l_tmpa_box
+ { \ensuremath{#1{\spb_math:nn {#2} {#3}}} }
+ }
+\cs_new:Npn \spb_text_print_store:nnn #1#2#3
+ {
+ \hbox_set:Nn \l_tmpa_box
+ { #1{\use:c { spb@text#2script@save }{#3}} }
+ }
+\cs_new:Npn \spb_math_print_store:nnnn #1#2#3#4
+ {
+ \hbox_set:Nn \l_tmpa_box { \ensuremath{#1{\spb@sp@save{#2}}} }
+ \hbox_set:Nn \l_tmpb_box { \ensuremath{#3{\spb@sb@save{#4}}} }
+ }
+\cs_new:Npn \spb_text_print_store:nnnn #1#2#3#4
+ {
+ \hbox_set:Nn \l_tmpa_box { #1{\spb@textsuperscript@save{#2}} }
+ \hbox_set:Nn \l_tmpb_box { #3{\spb@textsubscript@save{#4}} }
+ }
+\cs_set_eq:NN \spb@textsuperscript@save \textsuperscript
+\cs_set_eq:NN \spb@textsubscript@save \textsubscript
+\cs_set_eq:NN \spb@sp@save \sp
+\cs_set_eq:NN \spb@sb@save \sb
+\cs_new:Npn \spb_math:nn #1
+ {
+ \str_case:nn {#1}
+ {
+ { super } { \spb@sp@save }
+ { sub } { \spb@sb@save }
+ }
+ }
+\cs_new_protected:Npn \spb_box_ht_dp_assign:nn #1#2
+ {
+ \tl_if_empty:nF {#1} { \box_set_ht:Nn \l_tmpb_box {#1} }
+ \tl_if_novalue:nF {#2} { \box_set_dp:Nn \l_tmpb_box {#2} }
+ }
+\NewDocumentCommand{\spb_both_format_assign:n}
+ {>{\SplitArgument{1}{,}}m}
+ {\spb_supersub_script_both_format:nn #1}
+\cs_new_protected:Npn \spb_supersub_script_both_format:nn #1#2
+ {
+ \tl_set:Nn \l__spb_super_script_formatii_tl {#1}
+ \tl_if_novalue:nTF {#2}
+ { \tl_clear:N \l__spb_sub_script_formatii_tl }
+ { \tl_set:Nn \l__spb_sub_script_formatii_tl {#2} }
+ }
+
+\clist_map_inline:nn
+ { super,sub }
+ {
+ \exp_args:Nc \NewDocumentCommand {#1}
+ {
+ sO{\dim_use:c { l__spb_#1_script_vshift_dim }}
+ >{\SplitArgument{1}{,}}O{}
+ D(){\tl_use:c { l__spb_#1_script_formati_tl }}
+ mO{\dim_use:c { l__spb_#1_script_hshift_dim }}
+ }
+ {
+ \IfBooleanTF{##1}
+ {\spb_math_print_store:nnn {##4} {#1} {##5}}
+ {
+ \mode_if_math:TF
+ { \spb_math_print_store:nnn {##4} {#1} {##5} }
+ { \spb_text_print_store:nnn {##4} {#1} {##5} }
+ }
+ \hbox_set_to_wd:Nnn \l_tmpb_box { \l__spb_boxa_wd_tl + ##6 }
+ { \hss\box_move_up:nn {##2} { \spb_tmp_boxa_use: } }
+ \spb_box_ht_dp_assign:nn ##3
+ \spb_tmp_boxb_use:
+ }
+ }
+\NewDocumentCommand{\supersub}
+ {
+ sO{\l__spb_supersub_script_sep_dim}
+ O{\l__spb_supersub_script_align_tl}
+ D(){\l__spb_super_script_formatii_tl}mm
+ O{\l__spb_supersub_script_hshift_dim}
+ D(){\l__spb_sub_script_formatii_tl}
+ }
+ {
+ \IfBooleanTF{#1}
+ {\spb_math_print_store:nnnn {#4} {#5} {#8} {#6}}
+ {
+ \mode_if_math:TF
+ { \spb_math_print_store:nnnn {#4} {#5} {#8} {#6} }
+ { \spb_text_print_store:nnnn {#4} {#5} {#8} {#6} }
+ }
+ \hbox_set_to_wd:Nnn \l_tmpa_box { \l__spb_boxa_wd_tl + #7 }
+ { \hss\box_move_up:nn {#2} { \spb_tmp_boxa_use: } }
+ \hbox_set_to_wd:Nnn \l_tmpb_box { \l__spb_boxb_wd_tl + #7 }
+ { \hss\box_move_down:nn {#2} { \spb_tmp_boxb_use: } }
+ \str_case:onF {#3}
+ {
+ { l } { \use_i:nnn }
+ { c } { \use_ii:nnn }
+ { r } { \use_iii:nnn }
+ }
+ {
+ \msg_warning:nn { spbmark } { unsupported-align }
+ \use_i:nnn
+ }
+ {
+ \hbox_overlap_right:n { \spb_tmp_boxa_use: }
+ \hbox_overlap_right:n { \spb_tmp_boxb_use: }
+ \spb_box_max_dim_horizontal:
+ }
+ {
+ \dim_compare:nNnTF { \l__spb_boxa_wd_tl } > { \l__spb_boxb_wd_tl }
+ { \spb_boxwd_script_align:nn { boxa } { boxb } }
+ { \spb_boxwd_script_align:nn { boxb } { boxa } }
+ }
+ {
+ \spb_box_max_dim_horizontal:
+ \hbox_overlap_left:n { \spb_tmp_boxa_use: }
+ \hbox_overlap_left:n { \spb_tmp_boxb_use: }
+ }
+ }
+\msg_new:nnn { spbmark } { unsupported-align }
+ {
+ Alignment~only~supports~l,~c,~and~r. \\
+ The~l~parameter~will~be~used~by~default.
+ }
+
+\bool_if:NT \l__spb_new_supersub_bool
+ {
+ \clist_map_inline:nn
+ {
+ { sp,sb },
+ { textsuperscript,textsubscript }
+ }
+ {
+ \cs_set_eq:cN { \clist_item:nn {#1} { 1 } } \super
+ \cs_set_eq:cN { \clist_item:nn {#1} { 2 } } \sub
+ }
+ }
+\cs_set_eq:NN \spb \supersub
+\cs_set:Npn \@makefnmark
+ { \hbox:n { \fnmarkfont\super{\@thefnmark}[0pt] } }
+\cs_if_exist:NTF \ftntm@font
+ { \cs_new:Npn \fnmarkfont { \ftntm@font } }
+ { \cs_new:Npn \fnmarkfont { \normalfont } }
+\endinput
+%%
+%% End of file `spbmark.sty'.
diff --git a/macros/latex/contrib/spbmark/spbmark.tex b/macros/latex/contrib/spbmark/spbmark.tex
new file mode 100644
index 0000000000..0391f84d74
--- /dev/null
+++ b/macros/latex/contrib/spbmark/spbmark.tex
@@ -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@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@textsuperscript@save}[\marg{content}]
+ Save the original definition of the \cs{textsuperscript} command, output superscript in the text.
+ \command{spb@textsubscript@save}[\marg{content}]
+ Save the original definition of the \cs{textsubscript} command, output subscript in the text.
+ \command{spb@sp@save}[\marg{content}]
+ Save the original definition of the \cs{sp} command, output superscript in the math mode.
+ \command{spb@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