diff options
Diffstat (limited to 'macros/latex/contrib')
-rw-r--r-- | macros/latex/contrib/easybook/doc/chapter1.tex | 10 | ||||
-rw-r--r-- | macros/latex/contrib/easybook/doc/chapter2.tex | 8 | ||||
-rw-r--r-- | macros/latex/contrib/easybook/doc/chapter3.tex | 4 | ||||
-rw-r--r-- | macros/latex/contrib/easybook/doc/easybook-demo.pdf | bin | 262454 -> 262457 bytes | |||
-rw-r--r-- | macros/latex/contrib/easybook/doc/easybook-demo.tex | 4 | ||||
-rw-r--r-- | macros/latex/contrib/easybook/doc/easybook.pdf | bin | 443538 -> 449643 bytes | |||
-rw-r--r-- | macros/latex/contrib/easybook/easybook.dtx | 169 | ||||
-rw-r--r-- | macros/latex/contrib/ninecolors/README | 4 | ||||
-rw-r--r-- | macros/latex/contrib/ninecolors/ninecolors.pdf | bin | 0 -> 14750 bytes | |||
-rw-r--r-- | macros/latex/contrib/ninecolors/ninecolors.sty | 143 | ||||
-rw-r--r-- | macros/latex/contrib/ninecolors/ninecolors.tex | 89 |
11 files changed, 336 insertions, 95 deletions
diff --git a/macros/latex/contrib/easybook/doc/chapter1.tex b/macros/latex/contrib/easybook/doc/chapter1.tex index 15d8cbc899..2a64571f75 100644 --- a/macros/latex/contrib/easybook/doc/chapter1.tex +++ b/macros/latex/contrib/easybook/doc/chapter1.tex @@ -19,7 +19,7 @@ \end{matrix} \right] \end{equation} -可以通过添加标签在正文中引用公式,如带有中文括号的引用\cref{eq:matrix}。 +可以通过添加标签在正文中引用公式,如带有中文括号的引用\ref{eq:matrix}。 \zhlipsum*[56][name = aspirin] \begin{equation} @@ -44,7 +44,7 @@ \clearpage \section{插图} \index{c@插图} -当我们需要排列一组子图共享标题的图片时,可以使用依赖于 \lstinline{caption} 宏包的 \lstinline{subcaption} 宏包的功能,效果见\cref{fig:example}。 +当我们需要排列一组子图共享标题的图片时,可以使用依赖于 \lstinline{caption} 宏包的 \lstinline{subcaption} 宏包的功能,效果见\ref{fig:example}。 \begin{figure}[htbp] \centering \subcaptionbox{并排子图1} @@ -52,15 +52,15 @@ \hspace{1.2em} \subcaptionbox{并排子图2} {\includegraphics[width=0.4\textwidth]{example-image-4x3}} - \bicaption[使用subcaption排版子图]{使用subcaption宏包的subcaptionbox命令排版子图}[Use subcaption to typeset subgraphs]{Use the subcaptionbox command of the subcaption package to typeset sub-pictures}\label{fig:example} + \bicaption[使用 subcaption 排版子图]{使用 subcaption 宏包的 subcaptionbox 命令排版子图}[Use subcaption to typeset subgraphs]{Use the subcaptionbox command of the subcaption package to typeset sub-pictures}\label{fig:example} \end{figure} \section{表格} \index{b@表格} -合并表格列使用 \lstinline{\multicolumn} 命令,合并行可以使用 \lstinline{multirow} 宏包的 \lstinline{\multirow} 命令。当插入的表格内容过长以至于一行放不下的情况可以使用 \lstinline{tabularx} 环境,文档类设置了\textsf{L、C和R}三个列对齐选项,一个例子如\cref{tab:example} 所示。 +合并表格列使用 \lstinline{\multicolumn} 命令,合并行可以使用 \lstinline{multirow} 宏包的 \lstinline{\multirow} 命令。当插入的表格内容过长以至于一行放不下的情况可以使用 \lstinline{tabularx} 环境,文档类设置了\textsf{L、C和R}三个列对齐选项,一个例子如\ref{tab:example} 所示。 \begin{table}[htbp] \centering - \bicaption{使用tabularx创建内容过长表格}{Use tabularx to create a table with too long content}\label{tab:example}\small + \bicaption{使用 tabularx 创建内容过长表格}{Use tabularx to create a table with too long content}\label{tab:example}\small \begin{tabularx}{0.87\textwidth}{@{}llL@{}} \toprule Aliquam & Integer & Pellentesque tincidunt purus diff --git a/macros/latex/contrib/easybook/doc/chapter2.tex b/macros/latex/contrib/easybook/doc/chapter2.tex index cee689e4d4..d72ee6424a 100644 --- a/macros/latex/contrib/easybook/doc/chapter2.tex +++ b/macros/latex/contrib/easybook/doc/chapter2.tex @@ -19,7 +19,7 @@ \\ & =\oiint_\Sigma \left(P\cos\alpha + Q\cos\beta + R\cos\gamma\right)\mathrm{d}S \end{align} -这里$\Sigma$是整个边界曲面$\Omega$的外侧,$\cos\alpha,\cos\beta,\cos\gamma$是$\Sigma$在点$(x,y,z)$处的法向量的方向余弦。引用这个公式如\cref{theorem:gauss formula}。 +这里$\Sigma$是整个边界曲面$\Omega$的外侧,$\cos\alpha,\cos\beta,\cos\gamma$是$\Sigma$在点$(x,y,z)$处的法向量的方向余弦。引用这个公式如\ref{theorem:gauss formula}。 \end{theorem} \begin{definition}[(Stokes formula)] @@ -68,11 +68,11 @@ The Stokes formula is an extension of the basic calculus formula in the case of \zhlipsum*[3][name = aspirin] \begin{exercise}[LightYellow][1.](习题) \index{x@习题环境} - \item 设$w = f(x + y + z,xyz)$,$f$具有二阶连续偏导数,求$\dfrac{{\partial w}}{{\partial x}}$和$\dfrac{{{\partial ^2}w}}{{\partial x\partial z}}$。 + \item 设$w = f(x + y + z,xyz)$,$f$具有二阶连续偏导数,求$\dfrac{\partial w}{\partial x}$和$\dfrac{\partial ^2 w}{\partial x\partial z}$。 \item 已知$y = y(x)$在任意点$x$处的增量$\Delta y = \dfrac{y\Delta x}{1 + x^2} + \alpha$,其中$\alpha$是$\Delta x$的高阶无穷小($\Delta x\to 0$时),$y(0) = \pi$,则$y(1) = \uline{\mbox{\hspace{2em}}}$。 - \item 设函数$f(x)$在$( - \infty, + \infty)$上有定义,则下述命题中正确的是 \mbox{(\hspace{1.5em})} + \item 设函数$f(x)$在$(-\infty,+\infty)$上有定义,则下述命题中正确的是 \mbox{(\hspace{1.5em})} \begin{tasks} - \task 若$f(x)$在$( - \infty, + \infty)$上可导且单调增加,则对一切$x\in ( - \infty, + \infty)$,都有$f'(x) > 0$。 + \task 若$f(x)$在$(-\infty,+\infty)$上可导且单调增加,则对一切$x\in (-\infty,+\infty)$,都有$f'(x) > 0$。 \task 若$f(x)$在点$x_0$处取得极值,则$f'(x_0) = 0$。 \task 若$f''(x_0) = 0$,则$(x_0,f(x_0))$是曲线$y = f(x)$的拐点坐标。 \task 若$f'(x_0) = 0$, $f''(x_0) = 0$,$f'''(x_0)\ne 0$,则$x_0$一定不是$f(x)$的极值点。 diff --git a/macros/latex/contrib/easybook/doc/chapter3.tex b/macros/latex/contrib/easybook/doc/chapter3.tex index a9e19e03f4..252551e7dc 100644 --- a/macros/latex/contrib/easybook/doc/chapter3.tex +++ b/macros/latex/contrib/easybook/doc/chapter3.tex @@ -6,7 +6,7 @@ \section{代码} \index{d@代码} \zhlipsum[41][name = aspirin] -\begin{lstlisting}[language = Python,caption = {python程序练习题}] +\begin{lstlisting}[language = Python,caption = python 程序练习题] #!/usr/bin/python # -*- coding: UTF-8 -*- @@ -43,7 +43,7 @@ if __name__ == '__main__': \subsection{引用章节} \label{subsec:reference section} \index{y@引用!s@索引} -阿司匹林及其复方制剂都能有效治疗某几种头痛,但对另外几种则效果不明\cref{chap:other formats}。因其他疾病或创伤导致的继发性头痛需要及时在医疗机构接受治疗\cref{subsec:reference section}。 +阿司匹林及其复方制剂都能有效治疗某几种头痛,但对另外几种则效果不明\ref{chap:other formats}。因其他疾病或创伤导致的继发性头痛需要及时在医疗机构接受治疗\ref{subsec:reference section}。 \subsection{参考文献} \index{y@引用!c@参考文献} diff --git a/macros/latex/contrib/easybook/doc/easybook-demo.pdf b/macros/latex/contrib/easybook/doc/easybook-demo.pdf Binary files differindex 4b76732f4b..0bdc42f390 100644 --- a/macros/latex/contrib/easybook/doc/easybook-demo.pdf +++ b/macros/latex/contrib/easybook/doc/easybook-demo.pdf diff --git a/macros/latex/contrib/easybook/doc/easybook-demo.tex b/macros/latex/contrib/easybook/doc/easybook-demo.tex index e08d970008..c4d8542a18 100644 --- a/macros/latex/contrib/easybook/doc/easybook-demo.tex +++ b/macros/latex/contrib/easybook/doc/easybook-demo.tex @@ -12,6 +12,7 @@ style = { color = seaside, + % color-all = 009393, % multoc = true, % withpart = true, footwith = page, @@ -59,6 +60,7 @@ }, hdrset = { + % headrule = {}, head-foot = { \easyhead[EC]{\color{SeaGreen}\kaishu\leftmark} @@ -102,7 +104,7 @@ \url{https://latexstudio.net} \\ \url{https://gitee.com/texl3/easybook}\thanks{Gitee为项目的主要发布地址。} } -\date{2021/04/10\hskip\ccwd\relax v1.24j} +\date{2021/04/11\hskip\ccwd\relax v1.24k} \frontmatter[roman] \maketitle diff --git a/macros/latex/contrib/easybook/doc/easybook.pdf b/macros/latex/contrib/easybook/doc/easybook.pdf Binary files differindex 3de723b33c..439dc508f7 100644 --- a/macros/latex/contrib/easybook/doc/easybook.pdf +++ b/macros/latex/contrib/easybook/doc/easybook.pdf diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index 0eebece9c5..1b187b7a0d 100644 --- a/macros/latex/contrib/easybook/easybook.dtx +++ b/macros/latex/contrib/easybook/easybook.dtx @@ -55,7 +55,7 @@ The latest version of this license is in % % \title{\sffamily easybook 书籍文档类} % \author{瞿毅} -% \date{2021/04/10\hskip\ccwd\relax v1.24j\thanks{\url{https://gitee.com/texl3/easybook}}} +% \date{2021/04/11\hskip\ccwd\relax v1.24k\thanks{\url{https://gitee.com/texl3/easybook}}} % \maketitle % \begin{abstract} % \cls{easybook} 是基于 \cls{ctexbook} 书籍文档类创建以极简为风格的模板,可以看作对 \cls{ctexbook} 的进一步包装。虽然\CTeX 文档类提供了较好的中文支持,但想实现个性化功能一般需要在其基础上载入更多宏包来定制。\cls{easybook} 考虑了一些细节并载入一些常用宏包实现一般的排版需求,它适用于排版中英文书籍或笔记,甚至可稍加调整成为学位论文模板。 @@ -152,17 +152,18 @@ The latest version of this license is in % % \subsection{文档命令} % \label{subsec:document command} -% \begin{function}[added = 2021-02-20,updated = 2021-04-04]{\frontmatter,\mainmatter,\backmatter,\tableofcontents,\listoffigures,\listoftables,\listoflistings} +% \begin{function}[added = 2021-02-20,updated = 2021-04-11]{\frontmatter,\mainmatter,\backmatter,\cleardoublepage,\tableofcontents,\listoffigures,\listoftables,\listoflistings} % \begin{syntax} % \tn{frontmatter*}\oarg{编号格式|(Roman)} % \tn{mainmatter*} % \tn{backmatter} +% \tn{cleardoublepage}\oarg{页面风格|(empty)} % \tn{tableofcontents}\oarg{键值列表} % \tn{listoffigures*}\oarg{键值列表} % \tn{listoftables*}\oarg{键值列表} % \tn{listoflistings*}\oarg{键值列表} % \end{syntax} -% \tn{frontmatter} 为前言区命令,章标题不编号,页码可设置为例如 \opt{roman}、\opt{Alph} 等格式,带有星号的命令 \tn{frontmatter*} 不使用 \tn{cleardoublepage}。\tn{mainmatter} 为主文区命令,章标题正常编号且页码为从1开始计数的阿拉伯数字,\tn{mainmatter*} 命令不使用 \tn{cleardoublepage}。\tn{backmatter} 为后记区命令,页码格式与编号保持不变,章标题不编号。\tn{listoffigures} 命令输出图片目录,\tn{listoftables} 输出表格目录,\tn{listoflistings} 输出代码目录。带有星号的目录命令不会添加进主文档目录中,目录的键值列表选项如下 +% \tn{frontmatter} 为前言区命令,章标题不编号,页码可设置为例如 \opt{roman}、\opt{Alph} 等格式,带有星号的命令 \tn{frontmatter*} 不使用清双页命令 \tn{cleardoublepage}。\tn{mainmatter} 为主文区命令,章标题正常编号且页码为从1开始计数的阿拉伯数字,\tn{mainmatter*} 命令不使用 \tn{cleardoublepage}。\tn{backmatter} 为后记区命令,页码格式与编号保持不变,章标题不编号。在奇数页使用命令 \tn{cleardoublepage} 时可选参数为下一页多出的空白偶数页的页面风格,默认为 \opt{empty} 即空的页眉页脚。\tn{listoffigures} 命令输出图片目录,\tn{listoftables} 输出表格目录,\tn{listoflistings} 输出代码目录。带有星号的目录命令不会添加进主文档目录中,目录的键值列表选项如下 % \changes{v1.23}{2021/02/20}{重新定义文档结构划分命令。} % \end{function} % @@ -173,7 +174,7 @@ The latest version of this license is in % \end{syntax} % \opt{multoc} 与 \opt{style/multoc} 选项具有相同的效果,但是具有优先性且可单独设置不同目录是否双栏排版。已经预置了中英文的目录标题,可以使用 \opt{title} 选项更改目录标题的名称。\opt{book} 选项使目录标题按照 \opt{chapter} 级别输出,\opt{article} 选项使目录标题按照 \opt{article} 级别输出,默认为 \opt{chapter} 级别。 % \changes{v1.23}{2021/03/15}{为几个目录增加键值列表的选项,可设置标题输出级别以及是否加入主目录。} -% \changes{v1.24j}{2021/04/04}{目录命令的可选参数增加标题键值。} +% \changes{v1.24k}{2021/04/04}{目录命令的可选参数增加标题键值。} % \end{function} % % \section{接口选项} @@ -206,9 +207,10 @@ The latest version of this license is in % % \subsection{风格} % \label{subsec:style} -% \begin{function}[EXP,added = 2021-01-05,updated = 2021-03-18]{color,multoc,withpart,footwith,notomath,rulewidth,uppercase,figure-sep,table-sep,listing-sep,equation-sep,number-sep} +% \begin{function}[EXP,added = 2021-01-05,updated = 2021-04-11]{color,color-all,multoc,withpart,footwith,notomath,rulewidth,uppercase,figure-sep,table-sep,listing-sep,equation-sep,number-sep} % \begin{syntax} % color = <(none)|seaside|energy|cyberpunk> +% color-all = <HTML颜色代码> % multoc = <true|(false)> % withpart = <true|(false)> % footwith = <part|(chapter)|page> @@ -237,6 +239,7 @@ The latest version of this license is in % 主题颜色用到这三个颜色,可以使用 \tn{definecolor} 命令进行更改,类似地更改超链接颜色见小节 \ref{subsec:hyperlinks}。 % \changes{v1.10}{2021/01/08}{可以自定义主题颜色。} % \end{function} +% \item[color-all] 统一设置主题的各部分颜色,参数是6个十六进制数字组成的 HTML 颜色代码,任意颜色的代码可以在常见的图片处理工具拾色器中查看。 % \item[multoc] 开启双栏目录,可与 \opt{onecolumn} 和 \opt{twocolumn} 选项配合出单栏正文、单栏目录,双栏正文、单栏目录,单栏正文、双栏目录和双栏正文、双栏目录四种方式。 % \item[withpart] 使章跟随每一部分编号,默认不跟随。 % \item[footwith] 使脚注跟随编号的计数器,默认跟随章,当开启新的一章时脚注编号从1开始。 @@ -252,16 +255,17 @@ The latest version of this license is in % % \subsection{超链接} % \label{subsec:hyperlinks} -% \begin{function}[EXP,added = 2021-01-05,updated = 2021-04-05]{hyperlink,linkcolor,linktoc} +% \begin{function}[EXP,added = 2021-01-05,updated = 2021-04-11]{hyperlink,linkcolor,linkcol-all,linktoc} % \begin{syntax} % hyperlink = <(edge)|various|none> % linkcolor = <(fresh)|cutepink|skyblue|crimson> +% linkcol-all = <HTML颜色代码> % linktoc = <none|section|page|(all)> % \end{syntax} % \ding{229} 以上选项路径为 \opt{link/...} \\ % \opt{link} 将超链接选项(包括以上选项)交给 \pkg{hyperref} 处理,除了一些关于 pdf 书签的选项可能会失效,其它由键值选项命令 \tn{hypersetup} 支持的多数选项可用。 % \changes{v1.10}{2021/01/08}{修复了 \opt{linktopage} 选项关闭时目录中标题编号无超链接的问题。} -% \changes{v1.24j}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。} +% \changes{v1.24k}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。} % \end{function} % % \begin{optdesc} @@ -274,6 +278,7 @@ The latest version of this license is in % 超链接颜色用到这三个颜色,可以使用 \tn{definecolor} 命令进行更改。 % \changes{v1.10}{2021/01/08}{可以自定义超链接颜色。} % \end{function} +% \item[linkcol-all] 统一设置超链接的各部分颜色,参数是6个十六进制数字组成的 HTML 颜色代码,任意颜色的代码可以在常见的图片处理工具拾色器中查看。 % \item[linktoc] 将目录中的超链接取消、置于标题上、置于页码上或置于标题和页码上。 % \end{optdesc} % @@ -337,7 +342,7 @@ The latest version of this license is in % \ding{229} 以上选项路径为 \opt{bibset/...} % \changes{v1.21}{2021/01/11}{增加 \opt{bibset} 选项,可以使用 \hologo{BibTeX} 或 \hologo{biber} 编译参考文献。} % \changes{v1.23}{2021/02/23}{使用 \opt{bibset} 选项时可设置标注风格。} -% \changes{v1.24j}{2021/04/09}{可以不载入参考文献包手动配置参考文献格式。} +% \changes{v1.24k}{2021/04/09}{可以不载入参考文献包手动配置参考文献格式。} % \end{function} % % \begin{optdesc} @@ -485,7 +490,7 @@ The latest version of this license is in % \changes{v1.21}{2021/01/13}{增加配置页眉页脚的选项。} % \changes{v1.23}{2021/03/08}{优化页眉页脚设置,增加 \opt{chap-mark} 和 \opt{sec-mark} 标志选项。} % \changes{v1.23}{2021/03/14}{可以手动绘制页眉、页脚和脚注的横线。} -% \changes{v1.24j}{2021/04/09}{增加 \opt{subsec-mark} 标志选项,仅在 \opt{article} 模式生效。} +% \changes{v1.24k}{2021/04/09}{增加 \opt{subsec-mark} 标志选项,仅在 \opt{article} 模式生效。} % \end{function} % % \begin{function}[added = 2021-01-13,updated = 2021-03-14]{\easyhead,\easyfoot} @@ -555,8 +560,8 @@ The latest version of this license is in % line-align = <(true)|false> % \end{syntax} % \opt{lolskip} 是代码目录中章之间的代码标题的距离,与\CTeX 的表格目录和图片目录中章之间的标题距离选项 \opt{lotskip} 和 \opt{lofskip} 类似,它们的值均默认0.8 pc,在 \opt{article} 模式中此选项失效。目录标签整体使用 \opt{tocline} 设置,也可使用小节 \ref{subsec:page margins} 的 \opt{list-labelsep} 选项只设置编号与标题的间距。在图表标签的参数中,\#1与\#2分别代表编号和标题,代码标签的编号和标题则是 \tn{thelstlisting} 和 \tn{lstcaption},标签中还可包含标签名称,默认标签名称与图、表和代码环境的标题名称一致。下面举个设置标签的例子 -% \changes{v1.24j}{2021/04/05}{可以设置图、表和代码目录的标签。} -% \changes{v1.24j}{2021/04/06}{增加目录引导线右边对齐方式。} +% \changes{v1.24k}{2021/04/05}{可以设置图、表和代码目录的标签。} +% \changes{v1.24k}{2021/04/06}{增加目录引导线右边对齐方式。} % \end{function} % % \begin{ctexexam} @@ -589,7 +594,7 @@ The latest version of this license is in % \tn{end}\marg{环境名} % \end{syntax} % \pkg{enumitem} 宏包为系统预置的列表环境 \env{enumerate}、\env{itemize}和 \env{description} 提供了更灵活的标签以及间距的控制,可使用 \tn{setlist} 命令设置原有的三种列表格式。已为三种列表预置了三个级别的格式可相互嵌套,默认标签与 \cls{book} 文档类相同,若自定义标签可例如 -% \changes{v1.24j}{2021/04/08}{重新优化列表环境的配置。} +% \changes{v1.24k}{2021/04/08}{重新优化列表环境的配置。} % \end{function} % % \begin{ctexexam} @@ -749,11 +754,13 @@ The latest version of this license is in % \end{function} % % \subsection{引用} -% \begin{function}[added = 2021-01-05]{\cref} -% \begin{syntax} -% \tn{cref}\marg{标签} -% \end{syntax} -% 使用 \pkg{cleveref} 宏包的 \tn{cref} 命令进行引用,将会自动检测环境并添加相应的前缀。 +% \begin{function}[added = 2021-01-05,updated = 2021-04-11]{\ref,\labelformat} +% \begin{syntax} +% \tn{ref}\marg{标签} +% \tn{labelformat}\marg{计数器}\marg{标签引用格式} +% \end{syntax} +% 使用 \tn{ref} 命令进行引用将会自动检测环境并添加相应的前缀,\tn{labelformat} 可以设置标签引用格式,第二个参数中\#1代表 \tn{the}\meta{计数器},可以设置引用序号的前缀和后缀。 +% \changes{v1.24k}{2021/04/11}{取消载入 \pkg{cleveref} 宏包来交叉引用。} % \end{function} % % \subsubsection{索引} @@ -862,7 +869,7 @@ The latest version of this license is in %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/04/10}{1.24j}{beta} +\ProvidesExplClass{easybook}{2021/04/11}{1.24k}{beta} \cs_generate_variant:Nn \__ctex_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} @@ -1182,13 +1189,13 @@ The latest version of this license is in } } -\cs_gset:Npn \cleardoublepage +\RenewDocumentCommand{\cleardoublepage}{O{empty}} { \clearpage \bool_if:NT \l__eb_page_twoside_bool { - \int_if_odd:nF \c@page - {\hbox:n {}\thispagestyle{empty}\clearpage} + \int_if_odd:nF {\c@page} + {\hbox:n {}\thispagestyle{#1}\clearpage} } } \RenewDocumentCommand{\frontmatter}{sO{Roman}} @@ -1808,34 +1815,23 @@ The latest version of this license is in \setlist*[enumerate,3]{labelwidth = *} \setlist[description]{font = sf,labelwidth = *,leftmargin = 2\ccwd} -\cs_new_protected:Npn \__eb_thmname_set:nn #1#2 - {\tl_const:cn {c__eb_name_#1_tl}{#2}} -\tl_if_eq:NnTF \l__ctex_scheme_tl{chinese} +\cs_new_protected:Npn \__eb_thmname_set:nnn #1#2#3 { - \clist_map_inline:nn - { - {example}{例}, - {definition}{定义}, - {theorem}{定理}, - {proposition}{性质}, - {lemma}{引理}, - {corollary}{推论}, - {remark}{注}, - {exercise}{练习} - }{\__eb_thmname_set:nn #1} - }{ - \clist_map_inline:nn - { - {example}{Example}, - {definition}{Definition}, - {theorem}{Theorem}, - {proposition}{Proposition}, - {lemma}{Lemma}, - {corollary}{Corollary}, - {remark}{Remark}, - {exercise}{Exercise} - }{\__eb_thmname_set:nn #1} + \tl_if_eq:NnTF \l__ctex_scheme_tl{chinese} + {\tl_const:cn {c__eb_name_#1_tl}{#2}} + {\tl_const:cn {c__eb_name_#1_tl}{#3}} } +\clist_map_inline:nn + { + {example}{例}{Example}, + {definition}{定义}{Definition}, + {theorem}{定理}{Theorem}, + {proposition}{性质}{Proposition}, + {lemma}{引理}{Lemma}, + {corollary}{推论}{Corollary}, + {remark}{注}{Remark}, + {exercise}{练习}{Exercise} + }{\__eb_thmname_set:nnn #1} \bool_new:N \l__eb_thmbox_bool \tl_new:N \l__eb_thm_numberwith_tl @@ -1854,7 +1850,7 @@ The latest version of this license is in thmbox .default:n = true, thmbox .initial:n = false, within .tl_set:N = \l__eb_thm_numberwith_tl, - within .initial:n = chapter, + within .initial:n = \bool_if:NT \l__eb_class_book_bool{chapter}, bodyfont .tl_set:N = \l__eb_thm_bodyfont_tl, bodyfont .initial:n = {}, notefont .tl_set:N = \l__eb_thm_notefont_tl, @@ -2197,6 +2193,7 @@ The latest version of this license is in { \exp_args:NV \addbibresource\l__eb_bib_file_tl \cs_gset:Npn \blx@default@theheading{bibintoc} + \cs_gset:Npn \blx@warning@noline##1{} \defbibheading{bibintoc}[\bibname]{\__eb_class_title_bool:n {##1}} \skip_set:Nn \bibitemsep{0ex} } @@ -2216,7 +2213,7 @@ The latest version of this license is in } } -\ctex_at_end_preamble:n +\__eb_at_end_preamble:n { \group_begin: \footnotesize @@ -2319,6 +2316,10 @@ The latest version of this license is in {\definecolorset{HTML}{ctex@}{}{link,#1;url,#2;cite,#3}} \cs_new_protected:Npn \__eb_define_themecolor:nnn #1#2#3 {\definecolorset{HTML}{ctex@}{}{frame,#1;emph,#2;verb,#3}} +\cs_new_protected:Npn \__eb_define_linkcolor:n #1 + {\definecolorset{HTML}{ctex@}{}{link,#1;url,#1;cite,#1}} +\cs_new_protected:Npn \__eb_define_themecolor:n #1 + {\definecolorset{HTML}{ctex@}{}{frame,#1;emph,#1;verb,#1}} \cs_new:Npn \__eb_linkcolor_set:n #1 { linkcolor/\clist_item:nn {#1}{1} .code:n = @@ -2380,6 +2381,7 @@ The latest version of this license is in \__eb_linkcolor_set:n linkcolor .default:n = fresh, linkcolor .initial:n = fresh, + linkcol-all .code:n = \__eb_define_linkcolor:n {\exp_not:n {#1}}, linktoc .choice:, linktoc/unknown .code:n = @@ -2398,8 +2400,8 @@ The latest version of this license is in } \__ctex_define:nx {style} { - color .choice:, - color .value_required:n = true, + color .choice:, + color .value_required:n = true, \clist_map_function:nN { {none, 000000,000000,000000}, @@ -2408,16 +2410,19 @@ The latest version of this license is in {cyberpunk, 601986,eb6877,a4005b} } \__eb_themecolor_set:n - color .initial:n = none + color .initial:n = none, + color-all .code:n = \__eb_define_themecolor:n {\exp_not:n {#1}} } \ctex_at_end_preamble:n { - \RequirePackage{hyperref,cleveref} + \RequirePackage{hyperref} \urlstyle{same} \__eb_allow_urlbreak: \ctex_hypersetup:n {pdfstartview = FitH} \exp_args:NV \hypersetup\l__eb_hyperref_clist + \labelformat{part}{\CTEXthepart} + \labelformat{chapter}{\CTEXthechapter} \tl_if_eq:NnTF \l__ctex_scheme_tl{chinese} { \keys_set_known:nn {ctex} @@ -2430,21 +2435,20 @@ The latest version of this license is in lstlistlistingname = 代码索引, lstlistingname = 代码 } - \crefformat{equation}{#2式(#1)#3} - \crefformat{align}{#2式(#1)#3} - \crefformat{multline}{#2式(#1)#3} - \crefformat{gather}{#2式(#1)#3} - \crefformat{figure}{#2图#1#3} - \crefformat{table}{#2表#1#3} - \crefformat{chapter}{#2第#1章#3} - \crefformat{section}{#2节#1#3} - \crefformat{subsection}{#2小节#1#3} - \crefformat{theorem}{#2定理#1#3} - \crefformat{definition}{#2定义#1#3} - \crefformat{lemma}{#2引理#1#3} - \crefformat{corollary}{#2推论#1#3} - \crefformat{proposition}{#2性质#1#3} - \crefformat{example}{#2例#1#3} + \labelformat{equation}{式(#1)} + \labelformat{align}{式(#1)} + \labelformat{multline}{式(#1)} + \labelformat{gather}{式(#1)} + \labelformat{figure}{图#1} + \labelformat{table}{表#1} + \labelformat{section}{节#1} + \labelformat{subsection}{小节#1} + \labelformat{theorem}{定理#1} + \labelformat{definition}{定义#1} + \labelformat{lemma}{引理#1} + \labelformat{corollary}{推论#1} + \labelformat{proposition}{性质#1} + \labelformat{example}{例#1} }{ \keys_set_known:nn {ctex} { @@ -2452,21 +2456,20 @@ The latest version of this license is in lstlistlistingname = List~of~Codes, lstlistingname = Code } - \crefformat{equation}{#2Equation~(#1)#3} - \crefformat{align}{#2Equation~(#1)#3} - \crefformat{multline}{#2Equation~(#1)#3} - \crefformat{gather}{#2Equation~(#1)#3} - \crefformat{figure}{#2Figure~#1#3} - \crefformat{table}{#2Table~#1#3} - \crefformat{chapter}{#2Chapter~#1#3} - \crefformat{section}{#2Section~#1#3} - \crefformat{subsection}{#2Subsection~#1#3} - \crefformat{theorem}{#2Theorem~#1#3} - \crefformat{definition}{#2Definition~#1#3} - \crefformat{lemma}{#2Lemma~#1#3} - \crefformat{corollary}{#2Corollary~#1#3} - \crefformat{proposition}{#2Proposition~#1#3} - \crefformat{example}{#2Example~#1#3} + \labelformat{equation}{Equation~(#1)} + \labelformat{align}{Equation~(#1)} + \labelformat{multline}{Equation~(#1)} + \labelformat{gather}{Equation~(#1)} + \labelformat{figure}{Figure~#1} + \labelformat{table}{Table~#1} + \labelformat{section}{Section~#1} + \labelformat{subsection}{Subsection~#1} + \labelformat{theorem}{Theorem~#1} + \labelformat{definition}{Definition~#1} + \labelformat{lemma}{Lemma~#1} + \labelformat{corollary}{Corollary~#1} + \labelformat{proposition}{Proposition~#1} + \labelformat{example}{Example~#1} } } diff --git a/macros/latex/contrib/ninecolors/README b/macros/latex/contrib/ninecolors/README new file mode 100644 index 0000000000..94934f0087 --- /dev/null +++ b/macros/latex/contrib/ninecolors/README @@ -0,0 +1,4 @@ +Ninecolors: Select colors with proper WCAG color contrast +Author : Jianrui Lyu <tolvjr@163.com> +Repository: https://github.com/lvjr/ninecolors +License : The LaTeX Project Public License 1.3 diff --git a/macros/latex/contrib/ninecolors/ninecolors.pdf b/macros/latex/contrib/ninecolors/ninecolors.pdf Binary files differnew file mode 100644 index 0000000000..7876eaf2ac --- /dev/null +++ b/macros/latex/contrib/ninecolors/ninecolors.pdf diff --git a/macros/latex/contrib/ninecolors/ninecolors.sty b/macros/latex/contrib/ninecolors/ninecolors.sty new file mode 100644 index 0000000000..5331997477 --- /dev/null +++ b/macros/latex/contrib/ninecolors/ninecolors.sty @@ -0,0 +1,143 @@ +%%% -*- coding: utf-8 -*- +%%% ---------------------------------------------------------------------------- +%%% Ninecolors: Select colors with proper WCAG color contrast +%%% Author : Jianrui Lyu <tolvjr@163.com> +%%% Repository: https://github.com/lvjr/ninecolors +%%% License : The LaTeX Project Public License 1.3 +%%% ---------------------------------------------------------------------------- + +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{ninecolors}[2021/04/11 v2021A Select colors with proper color contrast] +\RequirePackage{xcolor} +\selectcolormodel{rgb} + +\definecolor{gray1}{gray}{0.14} +\definecolor{gray2}{gray}{0.23} +\definecolor{gray3}{gray}{0.30} +\definecolor{gray4}{gray}{0.38} +\definecolor{gray5}{gray}{0.46} +\definecolor{gray6}{gray}{0.55} +\definecolor{gray7}{gray}{0.64} +\definecolor{gray8}{gray}{0.75} +\definecolor{gray9}{gray}{0.87} + +\definecolor{red1}{Hsb}{0,0.67,0.26}%{0,0.95,0.31} +\definecolor{red2}{Hsb}{0,0.67,0.41} +\definecolor{red3}{Hsb}{0,0.67,0.54} +\definecolor{red4}{Hsb}{0,0.67,0.67} +\definecolor{red5}{Hsb}{0,0.60,0.77} +\definecolor{red6}{Hsb}{0,0.46,0.81} +\definecolor{red7}{Hsb}{0,0.34,0.86} +\definecolor{red8}{Hsb}{0,0.22,0.90} +\definecolor{red9}{Hsb}{0,0.11,0.95} + +\definecolor{brown1}{Hsb}{30,0.67,0.19} +\definecolor{brown2}{Hsb}{30,0.67,0.31} +\definecolor{brown3}{Hsb}{30,0.67,0.41} +\definecolor{brown4}{Hsb}{30,0.67,0.51} +\definecolor{brown5}{Hsb}{30,0.67,0.62} +\definecolor{brown6}{Hsb}{30,0.67,0.74} +\definecolor{brown7}{Hsb}{30,0.49,0.80} +\definecolor{brown8}{Hsb}{30,0.32,0.86} +\definecolor{brown9}{Hsb}{30,0.15,0.93} + +\definecolor{yellow1}{Hsb}{60,0.67,0.15} +\definecolor{yellow2}{Hsb}{60,0.67,0.23} +\definecolor{yellow3}{Hsb}{60,0.67,0.31} +\definecolor{yellow4}{Hsb}{60,0.67,0.39} +\definecolor{yellow5}{Hsb}{60,0.67,0.47} +\definecolor{yellow6}{Hsb}{60,0.67,0.56} +\definecolor{yellow7}{Hsb}{60,0.67,0.66} +\definecolor{yellow8}{Hsb}{60,0.59,0.77} +\definecolor{yellow9}{Hsb}{60,0.27,0.88} + +\definecolor{olive1}{Hsb}{90,0.67,0.16} +\definecolor{olive2}{Hsb}{90,0.67,0.25} +\definecolor{olive3}{Hsb}{90,0.67,0.33} +\definecolor{olive4}{Hsb}{90,0.67,0.42} +\definecolor{olive5}{Hsb}{90,0.67,0.51} +\definecolor{olive6}{Hsb}{90,0.67,0.60} +\definecolor{olive7}{Hsb}{90,0.67,0.71} +\definecolor{olive8}{Hsb}{90,0.48,0.81} +\definecolor{olive9}{Hsb}{90,0.22,0.90} + +\definecolor{green1}{Hsb}{120,0.67,0.16} +\definecolor{green2}{Hsb}{120,0.67,0.26} +\definecolor{green3}{Hsb}{120,0.67,0.35} +\definecolor{green4}{Hsb}{120,0.67,0.44} +\definecolor{green5}{Hsb}{120,0.67,0.53} +\definecolor{green6}{Hsb}{120,0.67,0.63} +\definecolor{green7}{Hsb}{120,0.67,0.74} +\definecolor{green8}{Hsb}{120,0.42,0.83} +\definecolor{green9}{Hsb}{120,0.19,0.91} + +\definecolor{teal1}{Hsb}{150,0.67,0.16} +\definecolor{teal2}{Hsb}{150,0.67,0.26} +\definecolor{teal3}{Hsb}{150,0.67,0.34} +\definecolor{teal4}{Hsb}{150,0.67,0.43} +\definecolor{teal5}{Hsb}{150,0.67,0.52} +\definecolor{teal6}{Hsb}{150,0.67,0.62} +\definecolor{teal7}{Hsb}{150,0.67,0.73} +\definecolor{teal8}{Hsb}{150,0.44,0.82} +\definecolor{teal9}{Hsb}{150,0.20,0.91} + +\definecolor{cyan1}{Hsb}{180,0.67,0.16} +\definecolor{cyan2}{Hsb}{180,0.67,0.25} +\definecolor{cyan3}{Hsb}{180,0.67,0.33} +\definecolor{cyan4}{Hsb}{180,0.67,0.42} +\definecolor{cyan5}{Hsb}{180,0.67,0.51} +\definecolor{cyan6}{Hsb}{180,0.67,0.60} +\definecolor{cyan7}{Hsb}{180,0.67,0.71} +\definecolor{cyan8}{Hsb}{180,0.47,0.81} +\definecolor{cyan9}{Hsb}{180,0.21,0.90} + +\definecolor{azure1}{Hsb}{210,0.67,0.22} +\definecolor{azure2}{Hsb}{210,0.67,0.35} +\definecolor{azure3}{Hsb}{210,0.67,0.47} +\definecolor{azure4}{Hsb}{210,0.67,0.59} +\definecolor{azure5}{Hsb}{210,0.67,0.71} +\definecolor{azure6}{Hsb}{210,0.56,0.78} +\definecolor{azure7}{Hsb}{210,0.41,0.83} +\definecolor{azure8}{Hsb}{210,0.27,0.88} +\definecolor{azure9}{Hsb}{210,0.13,0.94} + +\definecolor{blue1}{Hsb}{240,0.67,0.34} +\definecolor{blue2}{Hsb}{240,0.67,0.53} +\definecolor{blue3}{Hsb}{240,0.67,0.70} +\definecolor{blue4}{Hsb}{240,0.58,0.77} +\definecolor{blue5}{Hsb}{240,0.48,0.81} +\definecolor{blue6}{Hsb}{240,0.39,0.84} +\definecolor{blue7}{Hsb}{240,0.29,0.87} +\definecolor{blue8}{Hsb}{240,0.19,0.91} +\definecolor{blue9}{Hsb}{240,0.10,0.95} + +\definecolor{violet1}{Hsb}{270,0.67,0.29} +\definecolor{violet2}{Hsb}{270,0.67,0.45} +\definecolor{violet3}{Hsb}{270,0.67,0.60} +\definecolor{violet4}{Hsb}{270,0.67,0.75} +\definecolor{violet5}{Hsb}{270,0.54,0.79} +\definecolor{violet6}{Hsb}{270,0.43,0.82} +\definecolor{violet7}{Hsb}{270,0.32,0.86} +\definecolor{violet8}{Hsb}{270,0.21,0.90} +\definecolor{violet9}{Hsb}{270,0.11,0.95} + +\definecolor{magenta1}{Hsb}{300,0.67,0.23} +\definecolor{magenta2}{Hsb}{300,0.67,0.37} +\definecolor{magenta3}{Hsb}{300,0.67,0.49} +\definecolor{magenta4}{Hsb}{300,0.67,0.61} +\definecolor{magenta5}{Hsb}{300,0.67,0.74} +\definecolor{magenta6}{Hsb}{300,0.51,0.80} +\definecolor{magenta7}{Hsb}{300,0.37,0.84} +\definecolor{magenta8}{Hsb}{300,0.24,0.89} +\definecolor{magenta9}{Hsb}{300,0.12,0.94} + +\definecolor{purple1}{Hsb}{330,0.67,0.25} +\definecolor{purple2}{Hsb}{330,0.67,0.39} +\definecolor{purple3}{Hsb}{330,0.67,0.52} +\definecolor{purple4}{Hsb}{330,0.67,0.65} +\definecolor{purple5}{Hsb}{330,0.63,0.76} +\definecolor{purple6}{Hsb}{330,0.48,0.81} +\definecolor{purple7}{Hsb}{330,0.35,0.85} +\definecolor{purple8}{Hsb}{330,0.23,0.90} +\definecolor{purple9}{Hsb}{330,0.11,0.95} + diff --git a/macros/latex/contrib/ninecolors/ninecolors.tex b/macros/latex/contrib/ninecolors/ninecolors.tex new file mode 100644 index 0000000000..cdda3624bd --- /dev/null +++ b/macros/latex/contrib/ninecolors/ninecolors.tex @@ -0,0 +1,89 @@ +% -*- coding: utf-8 -*- +\documentclass{article} +\usepackage[a4paper,margin=1.5cm]{geometry} + +\usepackage{ninecolors} +\usepackage{arev} +\usepackage{pgffor} +\usepackage{hyperref} +\hypersetup{ + colorlinks=true, + urlcolor=blue3, +} + +\newcommand*{\myversion}{2021A} +\newcommand*{\mydate}{\the\year/\mylpad\month/\mylpad\day\ (v\myversion)} +\newcommand*{\mylpad}[1]{\ifnum#1<10 0\the#1\else\the#1\fi} + +\begin{document} + +\title{\href{https://github.com/lvjr/ninecolors}{Ninecolors: select colors with proper WCAG color contrast}} +\author{Jianrui Lyu (tolvjr@163.com)} +\date{\mydate} +\maketitle + +\textcolor{red4}{Ninecolors} package carefully selects and defines 9 colors for 13 hues each. +All colors with the same suffix number have equal luminance level. +Also color black is of level 0, and color white is of level 10. + +\bigskip + +\foreach \l in {1,...,9} +{ + \noindent + \foreach \n in {gray,red,brown,yellow,olive,green,teal,cyan,azure,blue,violet,magenta,purple} + {% + \xdef\mycolor{\ifnum \l < 5 white\else black\fi}% + \colorbox{\n\l}{\color{\mycolor}\texttt\strut\n\l}% + } + \par +} + +\bigskip + +\foreach \l in {1,...,9} +{ + \noindent + \foreach \n in {gray,red,brown,yellow,olive,green,teal,cyan,azure,blue,violet,magenta,purple} + {% + \xdef\mycolor{\ifnum \l < 5 gray9\else black\fi}% + \colorbox{\mycolor}{\color{\n\l}\texttt\strut\n\l}% + } + \par +} + +\bigskip +\hrule +\bigskip + +By simply choosing two colors in the above list, which differ in level by at least 5, +as foreground and background colors, you will get proper +\href{https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html}{WCAG Color Contrast}. + +\bigskip + +\colorbox{blue9}{% + \strut\color{green3}The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. +} +\par\nointerlineskip +\colorbox{green3}{% + \strut\color{blue9}The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. +} +\par\nointerlineskip +\colorbox{violet9}{% + \strut\color{brown3}The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. +} +\par\nointerlineskip +\colorbox{brown3}{% + \strut\color{violet9}The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. +} + +\bigskip +\hrule +\bigskip + +If you need to select more contrasting foreground and background colors, which may have other hues, +you could visit \href{https://lvjr.bitbucket.io/contrast.html}{WCAG Color Contrast Tool} +page which is designed by the author. + +\end{document} |