From 78682e50a10cf6f5b835a01ea798e1e67c604706 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 12 May 2024 19:13:22 +0000 Subject: easybook (12may24) git-svn-id: svn://tug.org/texlive/trunk@71242 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/easybook/easybook.pdf | Bin 631701 -> 632184 bytes Master/texmf-dist/doc/latex/easybook/easybook.tex | 52 ++++----- .../texmf-dist/source/latex/easybook/easybook.dtx | 127 ++++++++++++--------- Master/texmf-dist/tex/latex/easybook/easybase.sty | 121 +++++++++++--------- Master/texmf-dist/tex/latex/easybook/easybook.cls | 4 +- .../texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg | 2 +- 6 files changed, 170 insertions(+), 136 deletions(-) diff --git a/Master/texmf-dist/doc/latex/easybook/easybook.pdf b/Master/texmf-dist/doc/latex/easybook/easybook.pdf index 858e4066496..d39bbfb09f7 100644 Binary files a/Master/texmf-dist/doc/latex/easybook/easybook.pdf and b/Master/texmf-dist/doc/latex/easybook/easybook.pdf differ diff --git a/Master/texmf-dist/doc/latex/easybook/easybook.tex b/Master/texmf-dist/doc/latex/easybook/easybook.tex index 60dc80faccf..558f5dde4de 100644 --- a/Master/texmf-dist/doc/latex/easybook/easybook.tex +++ b/Master/texmf-dist/doc/latex/easybook/easybook.tex @@ -23,8 +23,8 @@ name = easybook, color-scheme = blue, title = EASYBOOK使用手册, - version = v2024bn, - date = 2024/05/10, + version = v2024bo, + date = 2024/05/12, authors = 瞿毅, info = 简便地排版中文学位论文或书籍, email = toquyi@163.com, @@ -136,10 +136,10 @@ \renewcommand{\cnltx@write@lastname}{} \renewcommand{\cmltx@list@setup} { - \setlength{\leftmargin}{0em} + \setlength{\leftmargin}{0pt} \setlength{\labelwidth}{2em} \setlength{\itemindent}{-1em} - \setlength{\labelsep}{0em} + \setlength{\labelsep}{0pt} \setlength{\listparindent}{2em} \setlength{\topsep}{\smallskipamount} \setlength{\itemsep}{\smallskipamount} @@ -190,8 +190,8 @@ 您在使用 \easybook{} 文档类编写文档前可能需要具备以下的条件: \begin{itemize} \item 使用 \hologo{XeLaTeX}(推荐)或 \hologo{LuaLaTeX} 两种编译方式之一。 - \item 由于文档类用到了一些 \LaTeX 和依赖宏包较新的功能,需要版本至少在\textbf{2021/11/15}以后的 \LaTeX 内核支持。建议您安装最新的 \TeX 发行版。 - \item 虽然手册对基本用法做了介绍,但这并不是入门教程,所涉及到宏包的用法与命令并未进行详细介绍,需要对它们有所了解。您应当具有一定的 \LaTeX 使用基础,可以在 \TeX 综合网站 \href{https://www.ctan.org/}{CTAN} 查看相关资源。 + \item 由于文档类用到了一些 \hologo{LaTeX} 和依赖宏包较新的功能,需要版本至少在\textbf{2021/11/15}以后的 \hologo{LaTeX} 内核支持。建议您安装最新的 \hologo{TeX} 发行版。 + \item 虽然手册对基本用法做了介绍,但这并不是入门教程,所涉及到宏包的用法与命令并未进行详细介绍,需要对它们有所了解。您应当具有一定的 \hologo{LaTeX} 使用基础,可以在 \hologo{TeX} 综合网站 \href{https://www.ctan.org/}{CTAN} 查看相关资源。 \end{itemize} \subsection{前言} @@ -199,7 +199,7 @@ \subsection{基本用法} \label{subsec:basic usage} -以下一份简单的 \TeX 文档演示了 \easybook{} 的最基本用法,在导言区进行宏包载入与文档设置,一些详细的使用样例会不定期上传在 \href{https://www.latexstudio.net/}{\LaTeX 工作室} 的网站。 +以下一份简单的 \TeX 文档演示了 \easybook{} 的最基本用法,在导言区进行宏包载入与文档设置,一些详细的使用样例会不定期上传在 \href{https://www.latexstudio.net/}{\hologo{LaTeX} 工作室} 的网站。 \begin{frameverb} \documentclass[文档类选项]{easybook} @@ -467,8 +467,8 @@ \label{subsec:spread} 行距因子用于设置各种行距倍数,\meta{数值} 是不带有长度单位的浮点数。各类行距既可以在导言区全局设置,也可以在正文中设置对后面生效。 \begin{options} - \keyval{line}{数值} - 正文行距因子。行距因子初始值为 \code{1.354}(相当于 \textsf{Word} 的1.25倍行距),如果设置了文类或 \pkg*{ctex} 宏包的全局行距选项 \option*{linespread} 则初始值设为它的值。 + \keyval{line}{数值}\Default{1.354} + 正文行距因子。中文主题下行距因子初始值为 \code{1.354}(相当于 \textsf{Word} 的1.25倍行距),如果设置了文类或 \pkg*{ctex} 宏包的全局行距选项 \option*{linespread} 则初始值设为它的值。 \keyval{table}{数值}\Default{1.354} 表格内容行距因子,对传统表格 \env{tabular} 和 \env{tabularx} 等环境生效。\pkg*{tabularray} 宏包的 \env{tblr} 环境自带 \option*{stretch} 和 \option*{rowsep} 等行间距选项,这里不做调整。 \keyval{math}{数值}\Default{1.2} @@ -573,15 +573,15 @@ \begin{options} \keyval{name}{定理名} 定理环境的标题名称,默认为英文首字母大写的环境名。 - \keychoice{numbered}{no,yes,unless unique} + \keychoice{numbered}{no,\fbox{yes},unless unique} 定理可以被编号、不被编号或者只有在文档中多次出现时才被编号。 - \keychoice{within}{chapter,section,\optpath*{empty},\optpath*{counter}} + \keychoice{within}{\fbox{chapter},section,\optpath*{empty},\optpath*{counter}} 定理编号跟随的计数器。当计数器值递增时定理编号会从零开始,通常这是一个章节计数器。 \keyval{numberlike}{计数器} 定理将使用此 \meta{计数器} 进行编号,通常这是另一个定理环境的名称。 \keyval{qed}{证毕符号} 证毕符号。位于定理段落末尾行的版心右边,可以设置成 \cs{qedsymbol} 默认是空心方块。 - \keyval{style}{定理样式} + \keyval{style}{定理样式}\Default{default} 选项的值为使用 \cs{declaretheoremstyle} 命令新定义的定理样式。 使用 \cs{declaretheorem} 命令以\ref{exam:new theorem sty} 中的定理样式 \code{fancy} 新建一个定理环境猜想,然后用一个基于 \pkg*{tcolorbox} 宏包的预置彩色盒子 \env{easyboxi} 增加背景: @@ -594,23 +594,23 @@ \command{declaretheoremstyle}[\oarg{键值列表1}\marg{定理样式}\oarg{键值列表2}] 定理样式声明命令,键值列表支持自身以及定理声明命令 \cs{declaretheorem} 的所有选项。可选参数的 \meta{键值列表1} 与 \meta{键值列表2} 等效,其中支持的选项如下: \begin{options} - \keyval{headfont}{字体命令} - 定理标题部分的字体,包括字体族、字体系列、字体尺寸和字体形状命令。 - \keyval{notefont}{字体命令} + \keyval{headfont}{字体命令}\Default{\cs*{sffamily}} + 定理标题部分(包括题注)的字体,包括字体族、字体系列、字体尺寸和字体形状命令。 + \keyval{notefont}{字体命令}\Default{\cs*{sffamily}} 定理题注部分的字体,包括字体族、字体系列、字体尺寸和字体形状命令。 - \keyval{bodyfont}{字体命令} + \keyval{bodyfont}{字体命令}\Default{\cs*{normalfont}} 定理内容部分的字体,包括字体族、字体系列、字体尺寸和字体形状命令。 \keyval{headpunct}{代码} 紧随定理标题末尾的标记代码,位于定理第一段内容的间距 \option{postheadspace} 之前,可以是字符或插入换行符 \cs*{newline} 等命令。 - \keyval{headindent}{刚性长度} + \keyval{headindent}{刚性长度}\Default{0pt} 定理标题的缩进。默认无缩进,可用 \cs*{parindent} 命令设置为段落缩进。 - \keyval{postheadspace}{刚性长度} + \keyval{postheadspace}{刚性长度}\Default{1em} 定理标题后与定理第一段内容的间距。 - \keyval{spaceabove}{弹性长度} + \keyval{spaceabove}{弹性长度}\Default{0ex plus .1ex} 定理环境前的间距,使用 \pkg*{tcolorbox} 的盒子环境包装后被覆盖。 - \keyval{spacebelow}{弹性长度} + \keyval{spacebelow}{弹性长度}\Default{0ex plus .1ex} 定理环境后的间距,使用 \pkg*{tcolorbox} 的盒子环境包装后被覆盖。 - \kvsplit-{notebraces}{\marg{左括号}\marg{右括号}} + \kvsplit-{notebraces}{\marg{左括号}\marg{右括号}}\Default{\Marg{(}\Marg{)}} 设置定理题注两边的括号,两个必选参数分别代表左括号和右括号。 \keyval{headformat}{标题排列} 定理标题各组成元素的位置排列和格式。定理标题由定理名、编号和题注组成,\meta{标题排列} 中命令 \cs*{NAME}、\cs*{NUMBER} 和 \cs*{NOTE} 分别代表定理名、编号和题注。 @@ -903,8 +903,8 @@ \end{options} \begin{commands} - \command{RegisterTocName}[\sarg\marg{条目名}]\newtagv[Changed]{2024as}% - 给条目类型名称为 \meta{条目名} 的标题注册用于设置目录样式的选项,即选项前有符号 \ding{73} 表示需要注册后使用。前面提到的条目类型均已注册,新类型的条目注册后默认格式与图表条目相同。这个命令可以重复使用,会重置目录条目为默认格式。带有星号参数的命令使注册目录的条目形成一个段落,此时多出下面三个选项可用: + \command{RegisterTocName}[\sarg\marg{条目名列表}]\newtagv[Changed]{2024bo}% + 给 \meta{条目名列表} 中的每个 \meta{条目名} 标题注册用于设置目录样式的选项,即选项前有符号 \ding{73} 表示需要注册后使用。前面提到的条目类型均已注册,新类型的条目注册后默认格式与图表条目相同。这个命令可以重复使用,会重置目录条目为默认格式。带有星号参数的命令使注册目录的条目形成一个段落,此时多出下面三个选项可用: \begin{options} \keyval{tocbegin}{开始代码}\dtag\newtagv{2024as}% 当前级别目录条目第一个标题前的代码,仅在存在更高级别的条目时有效。 @@ -983,7 +983,7 @@ \keyval{tocrule-every}{引导线命令} 统一设置所有类型的目录引导线样式。 \begin{commands} - \command{ExcludeEveryTocName}[\marg{条目名}]\newtagv{2024bn} + \command{ExcludeEveryTocName}[\marg{条目名列表}]\newtagv{2024bn} 用于指定带有 \option*{every} 后缀选项排除的条目类型。 \end{commands} \end{options} @@ -1212,7 +1212,7 @@ \environment{description}[\oarg{键值列表}] 已为三种列表各自预置了三个级别。同种列表或不同种列表间的不同级别可相互嵌套,可以使用短编号的形式,带有星号的环境为行内列表。默认列表标签与标准文档类一致,下面举几个更改列表标签以及其它格式的例子: \begin{ctexexam} - \setlist*{wide = 0em} % 取消所有列表的左边距 + \setlist*{wide = 0pt} % 取消所有列表的左边距 \begin{enumerate}[label = (\arabic*),leftmargin = 1cm,resume] \begin{enumerate*}[(1)] % 短编号形式 \begin{itemize}[label = \textbullet,labelsep = *] @@ -1319,7 +1319,7 @@ \section{扩展功能} \subsection{物理量} -使用 \pkg*{siunitx} 宏包提供国际单位制的物理量支持。\pkg*{siunitx} 宏包旨在为 \LaTeX 用户提供一种统一的方法,以便正确、轻松地排版数字和单位。\pkg*{siunitx} 的设计理念是默认遵循约定的规则,但允许通过选项设置进行更改。 +使用 \pkg*{siunitx} 宏包提供国际单位制的物理量支持。\pkg*{siunitx} 宏包旨在为 \hologo{LaTeX} 用户提供一种统一的方法,以便正确、轻松地排版数字和单位。\pkg*{siunitx} 的设计理念是默认遵循约定的规则,但允许通过选项设置进行更改。 \begin{commands} \command{num}[\oarg{键值列表}\marg{数字}] \cs{num} 命令可以输出以科学计数法表示的数值。 diff --git a/Master/texmf-dist/source/latex/easybook/easybook.dtx b/Master/texmf-dist/source/latex/easybook/easybook.dtx index 7beb93bdb9c..3ebd0799247 100644 --- a/Master/texmf-dist/source/latex/easybook/easybook.dtx +++ b/Master/texmf-dist/source/latex/easybook/easybook.dtx @@ -14,7 +14,7 @@ % This work has the LPPL maintenance status `maintained'. %<*class> \NeedsTeXFormat{LaTeX2e}[2021/11/15] -\ProvidesExplClass{easybook}{2024/05/10}{2024bn} +\ProvidesExplClass{easybook}{2024/05/12}{2024bo} {Easily typesetting Chinese theses or books} \bool_new:N \l__eb_compile_draft_bool @@ -85,7 +85,7 @@ { \eb_set_family:xnn { \CJKsfdefault } {#2} {#1} } \cs_new_protected:Npn \eb_setCJKmonofont:nn #1#2 { \eb_set_family:xnn { \CJKttdefault } {#2} {#1} } -\eb_seq_map_inline:nn +\clist_map_inline:nn { main,sans,mono,CJKmain,CJKsans,CJKmono } { \exp_args:Nc \RenewDocumentCommand { set#1font }{O{}mO{}} @@ -301,7 +301,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2021/11/15] \RequirePackage{etoolbox} -\ProvidesExplPackage{easybase}{2024/05/10}{2024bn} +\ProvidesExplPackage{easybase}{2024/05/12}{2024bo} {Easily typesetting Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -318,11 +318,6 @@ \cs_set_protected:Npn \ctex_define:nn #1 { \keys_define:nn { ctex/#1 } } -\cs_new_protected:Npn \eb_seq_map_inline:nn #1#2 - { - \seq_set_from_clist:Nn \l_tmpa_seq {#1} - \seq_map_inline:Nn \l_tmpa_seq {#2} - } \cs_new_protected:Npn \eb_patch_cmd:Nnn #1#2#3 { \ctex_patch_cmd_once:NnnnTF #1 { } {#2} {#3} @@ -334,7 +329,7 @@ { \AddToHook{cmd/#1/after}{#2} } \cs_new_protected:Npn \eb_at_begin_environment:nn #1#2 { - \eb_seq_map_inline:nn {#1} + \clist_map_inline:nn {#1} { \AtBeginEnvironment{##1}{#2} } } \cs_new_protected:Npn \eb_at_end_preamble:n @@ -360,7 +355,7 @@ \RenewDocumentCommand{\usepackage}{O{}mO{}} { \PassOptionsToPackage{#1}{#2} - \eb_seq_map_inline:nn {#2} + \clist_map_inline:nn {#2} { \eb_if_package_loaded:nnF {##1} {#1} { \eb@usepackage@save{##1}[#3] } @@ -383,7 +378,7 @@ \int_compare:nTF { \clist_count:n {#1} <= 1 } { \RequirePackage } { - \eb_seq_map_inline:nn {#1} + \clist_map_inline:nn {#1} { \eb_match_load_package:n {##1} } } } @@ -440,6 +435,10 @@ {\RequirePackage[heading]{ctex}} } } +\ctex_disable_package:n { nccfoots } +\ctex_disable_package:n { setspace } +\ctex_disable_package:n { tocloft } +\ctex_disable_package:n { titlesec } \seq_set_from_clist:Nn \l__eb_module_paths_seq { @@ -611,7 +610,7 @@ \booltrue{@mainmatter} \pagenumbering{arabic} } -\eb_seq_map_inline:nn +\clist_map_inline:nn { chapter,section,subsection } { \exp_args:Nc \NewDocumentCommand { eb@mark@#1@label@layout } @@ -826,7 +825,7 @@ \cs_new_protected:Npn \eb_fnmarktext_short_label_set:Nn #1#2 { \tl_set:Nn \l__eb_fnmarktext_short_tokens_tl {#2} - \eb_seq_map_inline:nn + \clist_map_inline:nn { A,a,1,I,i,c,s } { \regex_match:nnT {##1} {#2} @@ -1043,7 +1042,7 @@ \l__eb_fnpara_format_tl{#1} \tl_if_eq:NnT \l__eb_footnote_value_tl { hang } { \par } } -\eb_seq_map_inline:nn { \@footnotetext,\@mpfootnotetext } +\clist_map_inline:nn { \@footnotetext,\@mpfootnotetext } { \eb_patch_cmd:Nnn #1 { \reset@font } @@ -1291,7 +1290,7 @@ { \use:c { CTEX@#1@tocline }{#1}{#2} } \group_end: } -\cs_new_protected:Npn \RegisterBititle #1 +\cs_new_protected:Npn \eb@register@bititle #1 { \exp_args:Nc \NewDocumentCommand { bi#1 }{sO{##3}mm} { @@ -1308,9 +1307,12 @@ } } } -\clist_map_function:nN - { chapter,section,subsection } - \RegisterBititle +\cs_new_protected:Npn \RegisterBititle #1 + { + \clist_map_function:nN {#1} + \eb@register@bititle + } +\RegisterBititle{chapter,section,subsection} \eb_preto_cmd:nn { @chapter } { \skip_if_eq:nnF { \eb@toc@lol@skip } { \c_zero_skip } @@ -1379,7 +1381,7 @@ hyphen-every .initial:n = ., unknown .code:n = \eb_msg_deprecated_option:n { tools } } -\eb_seq_map_inline:nn +\clist_map_inline:nn { figure,table,listing,equation } { \cs_set:cpn { the#1 } @@ -1625,7 +1627,7 @@ \ctex_set:nn {#2} { tocformat = \IfBooleanT{#1}{\contentsmargin{0pt}}, - tocindent = 0em, + tocindent = 0pt, tocrule = \IfBooleanTF{#1}{,~\thecontentspage}{\tocrule{$\cdot$}}, toclabel = { @@ -1641,13 +1643,19 @@ } \seq_new:N \l__eb_toc_every_include_name_seq \cs_new_protected:Npn \ExcludeEveryTocName #1 - { \seq_remove_all:Nn \l__eb_toc_every_include_name_seq {#1} } + { + \clist_map_inline:nn {#1} + { \seq_remove_all:Nn \l__eb_toc_every_include_name_seq {##1} } + } \cs_new_protected:Npn \IncludeEveryTocName #1 { - \seq_put_right:Nn \l__eb_toc_every_include_name_seq {#1} - \seq_remove_duplicates:N \l__eb_toc_every_include_name_seq + \clist_map_inline:nn {#1} + { + \seq_put_right:Nn \l__eb_toc_every_include_name_seq {##1} + \seq_remove_duplicates:N \l__eb_toc_every_include_name_seq + } } -\NewDocumentCommand{\RegisterTocName}{sm} +\cs_new_protected:Npn \eb@register@toc@name #1#2 { \IfBooleanT{#1} { @@ -1665,10 +1673,16 @@ \tl_clear:N \l__eb_toc_tmpa_tl \tl_clear:N \l__eb_toc_tmpb_tl } -\seq_map_function:NN -\c__ctex_headings_seq \RegisterTocName +\NewDocumentCommand{\RegisterTocName}{sm} + { + \clist_map_inline:nn {#2} + { \eb@register@toc@name{#1}{##1} } + } +\clist_set_from_seq:NN +\c__ctex_headings_clist \c__ctex_headings_seq +\exp_args:NV \RegisterTocName \c__ctex_headings_clist \ctex_define:n { float/unknown .code:n = \eb_msg_deprecated_option:n { float } } -\cs_new_protected:Npn \RegisterEveryTocOption #1 +\cs_new_protected:Npn \eb@register@every@toc@option #1 { \ctex_define:nn { toc } { @@ -1679,9 +1693,12 @@ } } } -\clist_map_function:nN - { tocafter,tocindent,tocrule } - \RegisterEveryTocOption +\cs_new_protected:Npn \RegisterEveryTocOption #1 + { + \clist_map_function:nN {#1} + \eb@register@every@toc@option + } +\RegisterEveryTocOption{tocafter,tocindent,tocrule} \NewDocumentCommand{\tocrule}{st-O{0.7pc}d()mO{}} { \normalsize\normalfont @@ -1770,21 +1787,21 @@ part = { tocformat = \addvspace{1pc}\sffamily\large, - tocindent = 0em, + tocindent = 0pt, tocrule = \tocrule{}[\bfseries], tocline = \CTEXnumberline{#1}#2 }, chapter = { tocformat = \addvspace{1pc}\sffamily, - tocindent = 0em, + tocindent = 0pt, tocrule = \tocrule{$\cdot$}[\bfseries], tocline = \CTEXnumberline{#1}#2 }, section = { tocformat = \bool_if:NF \l__eb_class_mode_book_bool { \sffamily }, - tocindent = \bool_if:NTF \l__eb_class_mode_book_bool { 1.5em } { 0em }, + tocindent = \bool_if:NTF \l__eb_class_mode_book_bool { 1.5em } { 0pt }, tocrule = { \bool_if:NTF \l__eb_class_mode_book_bool @@ -1821,7 +1838,7 @@ binumber .initial:n = \arabic{chapter} } \cs_new_protected:Npn \eb_counter_zero:n #1 - { \eb_seq_map_inline:nn {#1} { \setcounter{##1}{0} } } + { \clist_map_inline:nn {#1} { \setcounter{##1}{0} } } \RenewDocumentCommand{\appendix} {O{Appendix\space}D(){\Alph{chapter}}} { @@ -1893,18 +1910,13 @@ } } \cs_set_eq:NN \addtosubfont \ebaddtofont + \ctex_define:nn { spread } { line .code:n = \setspread{#1}, - line .initial:n = - { - \fp_compare:nNnTF { \l__ctex_line_spread_fp } = { 1.3 } - { 1.354 } - { \fp_use:N \l__ctex_line_spread_fp } - }, table .fp_set:N = \l__eb_spread_table_fp, - table .initial:n = 1.354, - math .fp_set:N = \l__eb_spread_math_fp, + table .initial:n = 1.2, + math .tl_set:N = \eb@spread@math, math .initial:n = 1.2, footnote .code:n = { @@ -1944,10 +1956,15 @@ belowdisplayskip .initial:n = 0.5ex plus .1ex minus .1ex, unknown .code:n = \eb_msg_deprecated_option:n { spread } } -\AfterPreamble - {\skip_set:Nn \abovedisplayshortskip { 0ex plus .1ex }} +\tl_if_eq:NnT \l__ctex_scheme_tl { chinese } + { + \fp_compare:nNnTF { \l__ctex_line_spread_fp } = { 1.3 } + { \ctex_set:nn { spread } { line = 1.354,table = 1.354 } } + { \ctex_set:nn { spread } { line = \fp_use:N \l__ctex_line_spread_fp } } + } +\AfterPreamble{\skip_set:Nn \abovedisplayshortskip { 0ex plus .1ex }} -\eb_seq_map_inline:nn +\clist_map_inline:nn { table,figure,listing } { \DeclareCaptionFont{eb@#1@font} @@ -2022,7 +2039,7 @@ }{} \cs_new_protected:Npn \eb_enumitem_label_set:nn #1#2 { \SetEnumitemValue{label}{#1}{\color{ctex@emph}#2} } -\eb_seq_map_inline:nn +\clist_map_inline:nn { { bullet } { \textbullet }, { endash } { \normalfont\bfseries\textendash }, @@ -2045,7 +2062,7 @@ \setlist[enumerate,3]{label = roman,ref = enumiii} \setlist[description]{font = sf,style = standard} \newlist{eb@eqcomp@list}{description}{1} -\setlist[eb@eqcomp@list]{nosep,labelsep = 0em} +\setlist[eb@eqcomp@list]{nosep,labelsep = 0pt} \cs_new:Npn \seteqcomplist #1 { \setlist*[eb@eqcomp@list]{#1} } \keys_define:nn { eb/eqcomp } @@ -2053,7 +2070,7 @@ width .dim_set:N = \l__eb_eqsymb_width_dim, width .initial:n = 10pt, delim .tl_set:N = \l__eb_eqsymb_delim_tl, - delim .initial:n = ——, + delim .initial:n = \tl_if_eq:NnTF \l__ctex_scheme_tl { chinese } { —— } { --- }, space .dim_set:N = \l__eb_eqsymb_space_dim, space .initial:n = 0.25em, item-align .tl_set:N = \l__eb_eqsymb_item_align_tl, @@ -2143,7 +2160,7 @@ \declaretheoremstyle{default}[ spaceabove = 0ex plus .1ex, spacebelow = 0ex plus .1ex, - headindent = 0em, + headindent = 0pt, within = \bool_if:NT \l__eb_class_mode_book_bool { chapter }, headpunct = { }, headfont = \color{ctex@emph}\sffamily, @@ -2209,21 +2226,21 @@ cases,cases*,dcases,dcases*,rcases,rcases*,drcases,drcases*, aligned,alignedat,gathered,multlined,lgathered,rgathered } - { \setspread{\fp_use:N \l__eb_spread_math_fp} } -\eb_seq_map_inline:nn + { \setspread{\eb@spread@math} } +\clist_map_inline:nn { \start@gather,\start@align,\start@multline } { \eb_patch_cmd:Nnn #1 { \collect@body } { - \setspread{\fp_use:N \l__eb_spread_math_fp} + \setspread{\eb@spread@math} \collect@body } } \eb_patch_cmd:Nnn \gather@split { \spread@equation } { - \setspread{\fp_use:N \l__eb_spread_math_fp} + \setspread{\eb@spread@math} \spread@equation } \ctex_at_end_package:nn { unicode-math } @@ -2389,7 +2406,7 @@ }, } } -\eb_seq_map_inline:nn +\clist_map_inline:nn { { linkcolor } { link }, { color } { theme } @@ -2536,7 +2553,7 @@ } % %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2024/05/10}{2024bn} +\ProvidesExplFile{eb-tcolorbox.cfg}{2024/05/12}{2024bo} {Customization of tcolorbox for easybook} \cs_set_protected:Npn \addtotcbstyle #1#2 diff --git a/Master/texmf-dist/tex/latex/easybook/easybase.sty b/Master/texmf-dist/tex/latex/easybook/easybase.sty index 2dae33aa53b..78dd12dd720 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybase.sty +++ b/Master/texmf-dist/tex/latex/easybook/easybase.sty @@ -20,7 +20,7 @@ %% This work has the LPPL maintenance status `maintained'. \NeedsTeXFormat{LaTeX2e}[2021/11/15] \RequirePackage{etoolbox} -\ProvidesExplPackage{easybase}{2024/05/10}{2024bn} +\ProvidesExplPackage{easybase}{2024/05/12}{2024bo} {Easily typesetting Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -37,11 +37,6 @@ \cs_set_protected:Npn \ctex_define:nn #1 { \keys_define:nn { ctex/#1 } } -\cs_new_protected:Npn \eb_seq_map_inline:nn #1#2 - { - \seq_set_from_clist:Nn \l_tmpa_seq {#1} - \seq_map_inline:Nn \l_tmpa_seq {#2} - } \cs_new_protected:Npn \eb_patch_cmd:Nnn #1#2#3 { \ctex_patch_cmd_once:NnnnTF #1 { } {#2} {#3} @@ -53,7 +48,7 @@ { \AddToHook{cmd/#1/after}{#2} } \cs_new_protected:Npn \eb_at_begin_environment:nn #1#2 { - \eb_seq_map_inline:nn {#1} + \clist_map_inline:nn {#1} { \AtBeginEnvironment{##1}{#2} } } \cs_new_protected:Npn \eb_at_end_preamble:n @@ -79,7 +74,7 @@ \RenewDocumentCommand{\usepackage}{O{}mO{}} { \PassOptionsToPackage{#1}{#2} - \eb_seq_map_inline:nn {#2} + \clist_map_inline:nn {#2} { \eb_if_package_loaded:nnF {##1} {#1} { \eb@usepackage@save{##1}[#3] } @@ -102,7 +97,7 @@ \int_compare:nTF { \clist_count:n {#1} <= 1 } { \RequirePackage } { - \eb_seq_map_inline:nn {#1} + \clist_map_inline:nn {#1} { \eb_match_load_package:n {##1} } } } @@ -159,6 +154,10 @@ {\RequirePackage[heading]{ctex}} } } +\ctex_disable_package:n { nccfoots } +\ctex_disable_package:n { setspace } +\ctex_disable_package:n { tocloft } +\ctex_disable_package:n { titlesec } \seq_set_from_clist:Nn \l__eb_module_paths_seq { @@ -330,7 +329,7 @@ \booltrue{@mainmatter} \pagenumbering{arabic} } -\eb_seq_map_inline:nn +\clist_map_inline:nn { chapter,section,subsection } { \exp_args:Nc \NewDocumentCommand { eb@mark@#1@label@layout } @@ -545,7 +544,7 @@ \cs_new_protected:Npn \eb_fnmarktext_short_label_set:Nn #1#2 { \tl_set:Nn \l__eb_fnmarktext_short_tokens_tl {#2} - \eb_seq_map_inline:nn + \clist_map_inline:nn { A,a,1,I,i,c,s } { \regex_match:nnT {##1} {#2} @@ -762,7 +761,7 @@ \l__eb_fnpara_format_tl{#1} \tl_if_eq:NnT \l__eb_footnote_value_tl { hang } { \par } } -\eb_seq_map_inline:nn { \@footnotetext,\@mpfootnotetext } +\clist_map_inline:nn { \@footnotetext,\@mpfootnotetext } { \eb_patch_cmd:Nnn #1 { \reset@font } @@ -1010,7 +1009,7 @@ { \use:c { CTEX@#1@tocline }{#1}{#2} } \group_end: } -\cs_new_protected:Npn \RegisterBititle #1 +\cs_new_protected:Npn \eb@register@bititle #1 { \exp_args:Nc \NewDocumentCommand { bi#1 }{sO{##3}mm} { @@ -1027,9 +1026,12 @@ } } } -\clist_map_function:nN - { chapter,section,subsection } - \RegisterBititle +\cs_new_protected:Npn \RegisterBititle #1 + { + \clist_map_function:nN {#1} + \eb@register@bititle + } +\RegisterBititle{chapter,section,subsection} \eb_preto_cmd:nn { @chapter } { \skip_if_eq:nnF { \eb@toc@lol@skip } { \c_zero_skip } @@ -1098,7 +1100,7 @@ hyphen-every .initial:n = ., unknown .code:n = \eb_msg_deprecated_option:n { tools } } -\eb_seq_map_inline:nn +\clist_map_inline:nn { figure,table,listing,equation } { \cs_set:cpn { the#1 } @@ -1344,7 +1346,7 @@ \ctex_set:nn {#2} { tocformat = \IfBooleanT{#1}{\contentsmargin{0pt}}, - tocindent = 0em, + tocindent = 0pt, tocrule = \IfBooleanTF{#1}{,~\thecontentspage}{\tocrule{$\cdot$}}, toclabel = { @@ -1360,13 +1362,19 @@ } \seq_new:N \l__eb_toc_every_include_name_seq \cs_new_protected:Npn \ExcludeEveryTocName #1 - { \seq_remove_all:Nn \l__eb_toc_every_include_name_seq {#1} } + { + \clist_map_inline:nn {#1} + { \seq_remove_all:Nn \l__eb_toc_every_include_name_seq {##1} } + } \cs_new_protected:Npn \IncludeEveryTocName #1 { - \seq_put_right:Nn \l__eb_toc_every_include_name_seq {#1} - \seq_remove_duplicates:N \l__eb_toc_every_include_name_seq + \clist_map_inline:nn {#1} + { + \seq_put_right:Nn \l__eb_toc_every_include_name_seq {##1} + \seq_remove_duplicates:N \l__eb_toc_every_include_name_seq + } } -\NewDocumentCommand{\RegisterTocName}{sm} +\cs_new_protected:Npn \eb@register@toc@name #1#2 { \IfBooleanT{#1} { @@ -1384,10 +1392,16 @@ \tl_clear:N \l__eb_toc_tmpa_tl \tl_clear:N \l__eb_toc_tmpb_tl } -\seq_map_function:NN -\c__ctex_headings_seq \RegisterTocName +\NewDocumentCommand{\RegisterTocName}{sm} + { + \clist_map_inline:nn {#2} + { \eb@register@toc@name{#1}{##1} } + } +\clist_set_from_seq:NN +\c__ctex_headings_clist \c__ctex_headings_seq +\exp_args:NV \RegisterTocName \c__ctex_headings_clist \ctex_define:n { float/unknown .code:n = \eb_msg_deprecated_option:n { float } } -\cs_new_protected:Npn \RegisterEveryTocOption #1 +\cs_new_protected:Npn \eb@register@every@toc@option #1 { \ctex_define:nn { toc } { @@ -1398,9 +1412,12 @@ } } } -\clist_map_function:nN - { tocafter,tocindent,tocrule } - \RegisterEveryTocOption +\cs_new_protected:Npn \RegisterEveryTocOption #1 + { + \clist_map_function:nN {#1} + \eb@register@every@toc@option + } +\RegisterEveryTocOption{tocafter,tocindent,tocrule} \NewDocumentCommand{\tocrule}{st-O{0.7pc}d()mO{}} { \normalsize\normalfont @@ -1489,21 +1506,21 @@ part = { tocformat = \addvspace{1pc}\sffamily\large, - tocindent = 0em, + tocindent = 0pt, tocrule = \tocrule{}[\bfseries], tocline = \CTEXnumberline{#1}#2 }, chapter = { tocformat = \addvspace{1pc}\sffamily, - tocindent = 0em, + tocindent = 0pt, tocrule = \tocrule{$\cdot$}[\bfseries], tocline = \CTEXnumberline{#1}#2 }, section = { tocformat = \bool_if:NF \l__eb_class_mode_book_bool { \sffamily }, - tocindent = \bool_if:NTF \l__eb_class_mode_book_bool { 1.5em } { 0em }, + tocindent = \bool_if:NTF \l__eb_class_mode_book_bool { 1.5em } { 0pt }, tocrule = { \bool_if:NTF \l__eb_class_mode_book_bool @@ -1540,7 +1557,7 @@ binumber .initial:n = \arabic{chapter} } \cs_new_protected:Npn \eb_counter_zero:n #1 - { \eb_seq_map_inline:nn {#1} { \setcounter{##1}{0} } } + { \clist_map_inline:nn {#1} { \setcounter{##1}{0} } } \RenewDocumentCommand{\appendix} {O{Appendix\space}D(){\Alph{chapter}}} { @@ -1612,18 +1629,13 @@ } } \cs_set_eq:NN \addtosubfont \ebaddtofont + \ctex_define:nn { spread } { line .code:n = \setspread{#1}, - line .initial:n = - { - \fp_compare:nNnTF { \l__ctex_line_spread_fp } = { 1.3 } - { 1.354 } - { \fp_use:N \l__ctex_line_spread_fp } - }, table .fp_set:N = \l__eb_spread_table_fp, - table .initial:n = 1.354, - math .fp_set:N = \l__eb_spread_math_fp, + table .initial:n = 1.2, + math .tl_set:N = \eb@spread@math, math .initial:n = 1.2, footnote .code:n = { @@ -1663,10 +1675,15 @@ belowdisplayskip .initial:n = 0.5ex plus .1ex minus .1ex, unknown .code:n = \eb_msg_deprecated_option:n { spread } } -\AfterPreamble - {\skip_set:Nn \abovedisplayshortskip { 0ex plus .1ex }} +\tl_if_eq:NnT \l__ctex_scheme_tl { chinese } + { + \fp_compare:nNnTF { \l__ctex_line_spread_fp } = { 1.3 } + { \ctex_set:nn { spread } { line = 1.354,table = 1.354 } } + { \ctex_set:nn { spread } { line = \fp_use:N \l__ctex_line_spread_fp } } + } +\AfterPreamble{\skip_set:Nn \abovedisplayshortskip { 0ex plus .1ex }} -\eb_seq_map_inline:nn +\clist_map_inline:nn { table,figure,listing } { \DeclareCaptionFont{eb@#1@font} @@ -1741,7 +1758,7 @@ }{} \cs_new_protected:Npn \eb_enumitem_label_set:nn #1#2 { \SetEnumitemValue{label}{#1}{\color{ctex@emph}#2} } -\eb_seq_map_inline:nn +\clist_map_inline:nn { { bullet } { \textbullet }, { endash } { \normalfont\bfseries\textendash }, @@ -1764,7 +1781,7 @@ \setlist[enumerate,3]{label = roman,ref = enumiii} \setlist[description]{font = sf,style = standard} \newlist{eb@eqcomp@list}{description}{1} -\setlist[eb@eqcomp@list]{nosep,labelsep = 0em} +\setlist[eb@eqcomp@list]{nosep,labelsep = 0pt} \cs_new:Npn \seteqcomplist #1 { \setlist*[eb@eqcomp@list]{#1} } \keys_define:nn { eb/eqcomp } @@ -1772,7 +1789,7 @@ width .dim_set:N = \l__eb_eqsymb_width_dim, width .initial:n = 10pt, delim .tl_set:N = \l__eb_eqsymb_delim_tl, - delim .initial:n = ——, + delim .initial:n = \tl_if_eq:NnTF \l__ctex_scheme_tl { chinese } { —— } { --- }, space .dim_set:N = \l__eb_eqsymb_space_dim, space .initial:n = 0.25em, item-align .tl_set:N = \l__eb_eqsymb_item_align_tl, @@ -1862,7 +1879,7 @@ \declaretheoremstyle{default}[ spaceabove = 0ex plus .1ex, spacebelow = 0ex plus .1ex, - headindent = 0em, + headindent = 0pt, within = \bool_if:NT \l__eb_class_mode_book_bool { chapter }, headpunct = { }, headfont = \color{ctex@emph}\sffamily, @@ -1928,21 +1945,21 @@ cases,cases*,dcases,dcases*,rcases,rcases*,drcases,drcases*, aligned,alignedat,gathered,multlined,lgathered,rgathered } - { \setspread{\fp_use:N \l__eb_spread_math_fp} } -\eb_seq_map_inline:nn + { \setspread{\eb@spread@math} } +\clist_map_inline:nn { \start@gather,\start@align,\start@multline } { \eb_patch_cmd:Nnn #1 { \collect@body } { - \setspread{\fp_use:N \l__eb_spread_math_fp} + \setspread{\eb@spread@math} \collect@body } } \eb_patch_cmd:Nnn \gather@split { \spread@equation } { - \setspread{\fp_use:N \l__eb_spread_math_fp} + \setspread{\eb@spread@math} \spread@equation } \ctex_at_end_package:nn { unicode-math } @@ -2108,7 +2125,7 @@ }, } } -\eb_seq_map_inline:nn +\clist_map_inline:nn { { linkcolor } { link }, { color } { theme } diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index d19d6926cc9..220a6b5eec8 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybook.cls +++ b/Master/texmf-dist/tex/latex/easybook/easybook.cls @@ -19,7 +19,7 @@ %% %% This work has the LPPL maintenance status `maintained'. \NeedsTeXFormat{LaTeX2e}[2021/11/15] -\ProvidesExplClass{easybook}{2024/05/10}{2024bn} +\ProvidesExplClass{easybook}{2024/05/12}{2024bo} {Easily typesetting Chinese theses or books} \bool_new:N \l__eb_compile_draft_bool @@ -90,7 +90,7 @@ { \eb_set_family:xnn { \CJKsfdefault } {#2} {#1} } \cs_new_protected:Npn \eb_setCJKmonofont:nn #1#2 { \eb_set_family:xnn { \CJKttdefault } {#2} {#1} } -\eb_seq_map_inline:nn +\clist_map_inline:nn { main,sans,mono,CJKmain,CJKsans,CJKmono } { \exp_args:Nc \RenewDocumentCommand { set#1font }{O{}mO{}} diff --git a/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg index f324dad2a02..fea29c72b1e 100644 --- a/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg +++ b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg @@ -18,7 +18,7 @@ %% LaTeX version 2005/12/01 or later. %% %% This work has the LPPL maintenance status `maintained'. -\ProvidesExplFile{eb-tcolorbox.cfg}{2024/05/10}{2024bn} +\ProvidesExplFile{eb-tcolorbox.cfg}{2024/05/12}{2024bo} {Customization of tcolorbox for easybook} \cs_set_protected:Npn \addtotcbstyle #1#2 -- cgit v1.2.3