summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/easybook
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-07-09 03:00:47 +0000
committerNorbert Preining <norbert@preining.info>2021-07-09 03:00:47 +0000
commit86f3f0ba5c374ad17aaefc15e92e4ab47edf821e (patch)
tree33349ffb1bce3a2285ac5daadb1e010c36b3d5ab /macros/latex/contrib/easybook
parentf008fc632f906448b4bdbc5cd96ab7d98e68b0b9 (diff)
CTAN sync 202107090300
Diffstat (limited to 'macros/latex/contrib/easybook')
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx333
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin558693 -> 559755 bytes
2 files changed, 173 insertions, 160 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index 1b04478f14..c6d443516f 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -28,7 +28,7 @@
%
% \title{\sffamily easybook 文档类手册}
% \author{瞿毅}
-% \date{2021/07/06\hskip\ccwd\relax v1.26u\thanks{\url{https://gitee.com/texl3/easybook}}}
+% \date{2021/07/06\hskip\ccwd\relax v1.26x\thanks{\url{https://gitee.com/texl3/easybook}}}
%
% \maketitle
% \begin{abstract}
@@ -158,7 +158,7 @@
% floatpage = <true|(false)>
% \end{syntax}
% 开启这个选项后浮动环境 \env{table} 和 \env{figure} 的比例参数会使用默认值,关闭它则尽可能避免出现浮动页,使图表环境与正文段落更加紧凑,减少多余的空白版面。
-% \changes{v1.26u}{2021/06/15}{增加浮动环境比例参数选项 \opt{floatpage}。}
+% \changes{v1.26x}{2021/06/15}{增加浮动环境比例参数选项 \opt{floatpage}。}
% \end{function}
%
% \subsection{article 模式}
@@ -166,7 +166,7 @@
% \begin{syntax}
% class = <(book)|article>
% \end{syntax}
-% 设置文类风格,默认为 \cls{book} 文档类。选用 \opt{article} 会变为 \opt{oneside} 单面排版,同时使文档编号、结构等与标准 \cls{article} 文档类的特性相似,可用于短篇幅的文章,不需要再使用 \tn{chapter} 命令,此时设置双栏目录的 \opt{style/multoc} 选项、节 \ref{sec:document command} 中打印目录命令的 \opt{chapter} 选项会失效,将以 \opt{section} 标题级别输出目录。如果使用 \cls{ctexart} 配合 \pkg{easybase} 宏包,则 \opt{book} 宏包选项会失效。
+% 使用 \cls{easybook} 文档类可以有两种模式,默认为 \cls{book} 模式。选用 \opt{article} 会变为 \opt{oneside} 单面排版,同时使文档编号、结构等与标准 \cls{article} 文档类的特性相似,可用于短篇幅的文章,不需要再使用 \tn{chapter} 命令,此时节 \ref{sec:document command} 中目录命令的 \opt{chapter} 选项会失效,将以 \opt{section} 标题级别输出目录。也可以使用 \opt{book} 或 \opt{article} 选项指定文档类型。如果使用 \cls{ctexart} 配合 \pkg{easybase} 宏包,则 \opt{book} 宏包选项会失效。
% \changes{v1.23}{2021/03/16}{增加 article 文章模式,可用于短篇幅的文章。}
% \end{function}
%
@@ -234,16 +234,16 @@
% 类似 \CTeX 的 \opt{name} 和 \opt{nmuber} 选项,它们用于设置主文区 \tn{bichapter} 等标题命令在英文目录中的前后名字与编号,目前只支持通常改变名字与编号的 chapter 级别。
% \end{function}
%
-% \begin{function}[added = 2021-05-05,updated = 2021-06-13]{\appendix,\EBeforeAddBitoc}
+% \begin{function}[added = 2021-05-05,updated = 2021-06-13]{\appendix,\BeforeAddBitoc}
% \begin{syntax}
% \tn{appendix}[<英文附录目录前名字>,<英文附录目录后名字>]\parg{英文附录目录数字输出命令}
-% \tn{EBeforeAddBitoc*}\marg{加入目录英文标题前的代码}
+% \tn{BeforeAddBitoc*}\marg{加入目录英文标题前的代码}
% \end{syntax}
% \tn{appendix} 命令后的章节标题变为附录形式。英文目录中附录标题的格式用可选参数修改,英文附录目录前名字默认为 Appendix\tn{space},后名字默认为空,名字之间用一个半角逗号分开,也可以只有一部分,表示英文附录目录前名字。英文附录目录数字输出命令默认为 \tn{Alph}\{chapter\}。
-% \changes{v1.26u}{2021/06/13}{增加调整英文目录格式的钩子 \tn{EBeforeAddBitoc}。}
+% \changes{v1.26x}{2021/06/13}{增加调整英文目录格式的钩子 \tn{BeforeAddBitoc}。}
% \end{function}
%
-% \tn{EBeforeAddBitoc} 是一个作用于局部范围的英文目录钩子,可以插入标题或目录设置的命令改变英文目录中标题的显示格式,也可以覆盖上述的目录前后名字和编号等设置,带有星号的命令会重置之前的代码,放置在导言区或 \tn{bichapter} 等命令前生效。
+% \tn{BeforeAddBitoc} 是一个作用于局部范围的英文目录钩子,可以插入标题或目录设置的命令改变英文目录中标题的显示格式,也可以覆盖上述的目录前后名字和编号等设置,带有星号的命令会重置之前的代码,放置在导言区或 \tn{bichapter} 等命令前生效。
%
% \subsection{上标和下标}
% \begin{function}[added = 2021-06-26]{\super,\sub,\supersub,\textsuperscript,\textsubscript}
@@ -255,7 +255,7 @@
% \ \oarg{水平偏移|(0pt)}\parg{下标代码}
% \end{syntax}
% 上标和下标的功能来自 \pkg{spbmark} 宏包,\tn{super}、\tn{sub} 和 \tn{supersub} 三个命令可以用于输出上标和下标。它们根据当前处于文本模式还是数学模式来匹配相应的模式,或者可以使用它们的星号变体命令来强制使用数学模式。也可以使用键值列表对偏移量进行全局设置,详情见小节 \ref{subsubsec:super-sub-script}。
-% \changes{v1.26u}{2021/06/28}{增加可以调整相对位置和格式的上标和下标命令 \tn{super}、\tn{sub} 和 \tn{supersub}。}
+% \changes{v1.26x}{2021/06/28}{增加可以调整相对位置和格式的上标和下标命令 \tn{super}、\tn{sub} 和 \tn{supersub}。}
% \end{function}
%
% 垂直和水平偏移默认值都是 0 pt,\meta{对齐方式} 的参数与 \opt{supersubalign} 相同。\meta{格式代码} 用于格式化上标和下标,可以插入字体或颜色等命令。代码中的最后一个命令可以接受一个为上标或下标的参数。上标和下标命令还分别具有更简短的等价命令 \tn{sp}、\tn{sb} 和 \tn{spb}。
@@ -306,7 +306,7 @@
% \tn{DeclareThemeColor}\{<风格名称>,<ctex@frame>,<ctex@emph>,<ctex@verb>\}
% \end{syntax}
% 可以使用 \tn{DeclareThemeColor} 命令声明新的主题颜色,它的参数以英文逗号分隔,第一部分为颜色风格名称,后面三部分为 HTML 颜色代码,构成主题颜色。类似地更改超链接颜色见小节 \ref{subsec:hyperlinks}。
-% \changes{v1.26u}{2021/07/03}{使用 \tn{DeclareThemeColor} 命令声明新的颜色风格。}
+% \changes{v1.26x}{2021/07/03}{使用 \tn{DeclareThemeColor} 命令声明新的颜色风格。}
% \end{function}
% \item[color-all] 统一设置主题的各部分颜色,参数是 6 个十六进制数字组成的 HTML 颜色代码,任意颜色的代码可以在常见的图片处理工具拾色器中查看。
% \item[multoc] 开启多栏目录,与节 \ref{sec:document command} 中目录命令的同名选项有相同效果。
@@ -371,7 +371,7 @@
% \tn{DeclareLinkColor}\{<风格名称>,<ctex@link>,<ctex@url>,<ctex@cite>\}
% \end{syntax}
% 可以使用 \tn{DeclareLinkColor} 命令声明新的超链接颜色样式,它的参数以英文逗号分隔,第一部分为颜色风格名称,后面三部分为 HTML 颜色代码,构成超链接颜色。
-% \changes{v1.26u}{2021/07/03}{使用 \tn{DeclareLinkColor} 命令声明新的超链接颜色。}
+% \changes{v1.26x}{2021/07/03}{使用 \tn{DeclareLinkColor} 命令声明新的超链接颜色。}
% \end{function}
% \item[linkcol-all] 统一设置超链接的各部分颜色,参数是 6 个十六进制数字组成的 HTML 颜色代码,任意颜色的代码可以在常见的图片处理工具拾色器中查看。
% \item[linktoc] 将目录中的超链接取消、置于标题上、置于页码上或置于标题和页码上。
@@ -452,7 +452,7 @@
% \item[datafile] 参考文献数据库的文件名,可以是单个文件也可以是以括号包裹并以英文逗号分隔的文件列表,使用 \hologo{biber} 处理时要带有 \opt{bib} 后缀,若不在当前文件夹名称需要包含路径。只有设置数据库的文件名才会载入 \pkg{natbib} 或 \pkg{biblatex} 宏包,之后才可使用相关配置命令,否则需要手动载入相关宏包配置参考文献。
% \end{optdesc}
%
-% \begin{function}[added = 2021-01-11,updated = 2021-04-09]{\printbibliography,\EBibtexSet,\EBiblatexPreset,\EBiblatexPostset}
+% \begin{function}[added = 2021-01-11,updated = 2021-04-09]{\printbibliography,\BibtexPostset,\BiblatexPreset,\BiblatexPostset}
% \begin{syntax}
% \tn{printbibliography}\oarg{键值列表}
% \end{syntax}
@@ -468,9 +468,9 @@
% \end{syntax}
% \opt{heading} 为参考文献标题的处理方式,\opt{bibliography} 选项以 \opt{chapter} 级别输出参考文献,不加进目录,\opt{subbibliography} 选项以 \opt{section} 级别输出参考文献,不加进目录,\opt{bibintoc} 选项以 \opt{chapter} 级别输出参考文献,加进目录,\opt{subbibintoc} 选项以 \opt{section} 级别输出参考文献,加进目录。\opt{title} 选项覆盖由 \opt{heading} 选项提供的缺省标题名。除此之外其他支持选项可见 \pkg{biblatex} 宏包说明文档。
% \end{function}
-% \item[\tn{EBibtexSet}] 这是 \pkg{natbib} 宏包的配置命令,需要与 \pkg{natbib} 配合并放在载入其之后使用,默认保存了参考文献风格和标题的设置。
-% \item[\tn{EBiblatexPreset}] 这是 \pkg{biblatex} 宏包的前配置命令,需要与 \pkg{biblatex} 配合并放在载入其之前使用,默认保存了参考文献风格的设置。若重新定义可使用 \tn{PassOptionsToPackage} 命令向 \pkg{biblatex} 传递它支持的各种参考文献选项。
-% \item[\tn{EBiblatexPostset}] 这是 \pkg{biblatex} 宏包的后配置命令,需要与 \pkg{biblatex} 配合并放在载入其之后使用,默认保存了参考文献标题的设置。
+% \item[\tn{BibtexPostset}] 这是 \pkg{natbib} 宏包的配置命令,需要与 \pkg{natbib} 配合并放在载入其之后使用,默认保存了参考文献风格和标题的设置。
+% \item[\tn{BiblatexPreset}] 这是 \pkg{biblatex} 宏包的前配置命令,需要与 \pkg{biblatex} 配合并放在载入其之前使用,默认保存了参考文献风格的设置。若重新定义可使用 \tn{PassOptionsToPackage} 命令向 \pkg{biblatex} 传递它支持的各种参考文献选项。
+% \item[\tn{BiblatexPostset}] 这是 \pkg{biblatex} 宏包的后配置命令,需要与 \pkg{biblatex} 配合并放在载入其之后使用,默认保存了参考文献标题的设置。
% \end{optdesc}
%
% \subsection{定理样式}
@@ -492,7 +492,7 @@
% \end{syntax}
% \ding{229} 以上选项路径为 \opt{thmset/...}
% \changes{v1.21}{2021/01/12}{增加配置定理环境样式的选项。}
-% \changes{v1.26u}{2021/07/01}{增加配置公式标签括号选项 \opt{brackets}。}
+% \changes{v1.26x}{2021/07/01}{增加配置公式标签括号选项 \opt{brackets}。}
% \end{function}
%
% \begin{optdesc}
@@ -510,16 +510,16 @@
% \item[brackets] 设置行间公式编号标签的括号,以英文逗号分隔,分别为左右括号。
% \end{optdesc}
%
-% \begin{function}[added = 2021-01-12,updated = 2021-06-15]{\declaretheorem,\EBNewTheorem,\declaretheoremstyle}
+% \begin{function}[added = 2021-01-12,updated = 2021-06-15]{\declaretheorem,\DeclareTheorem,\declaretheoremstyle}
% \begin{syntax}
% \tn{declaretheorem}\oarg{键值列表}\marg{定理环境名}
-% \tn{EBNewTheorem}\marg{定理环境名}\oarg{英文标题}\marg{中文标题}\parg{盒子样式|(tc-theorem)}\oarg{键值列表}
+% \tn{DeclareTheorem}\marg{定理环境名}\oarg{英文标题}\marg{中文标题}\parg{盒子样式|(tc-theorem)}\oarg{键值列表}
% \tn{declaretheoremstyle}\oarg{键值列表}\marg{定理样式名}
% \end{syntax}
% 文档类已预置 8 个定理环境,环境名及对应的定理标题名见小节 \ref{subsec:theorem},如果需要新的定理标题名或定理样式可使用这两个命令,由 \pkg{thmtools} 提供支持,用法与它的同名命令一致。
% \changes{v1.23}{2021/03/12}{重新定义了新定理环境命令 \tn{newtheorem}。}
-% \changes{v1.24}{2021/04/25}{增加定义定理环境命令 \tn{EBNewTheorem}。}
-% \changes{v1.26u}{2021/06/15}{定义新定理环境的命令调整为 \tn{declaretheorem}。}
+% \changes{v1.24}{2021/04/25}{增加定义定理环境命令 \tn{DeclareTheorem}。}
+% \changes{v1.26x}{2021/06/15}{定义新定理环境的命令调整为 \tn{declaretheorem}。}
% \end{function}
%
% \begin{optdesc}
@@ -530,7 +530,7 @@
% \item[numberlike] 定理将使用此计数器进行编号,通常这是另一个定理环境的名称。
% \item[style] 用 \tn{declaretheoremstyle} 定义的定理样式的名称,定理将使用这种样式的设置。
% \end{description}
-% \item[\tn{EBNewTheorem}] \tn{EBNewTheorem} 是更便捷的定理命令,它定义一个新的定理环境,\meta{键值列表} 支持的选项与 \tn{declaretheorem} 相同,但它们的区别有:
+% \item[\tn{DeclareTheorem}] \tn{DeclareTheorem} 是更便捷的定理命令,它定义一个新的定理环境,\meta{键值列表} 支持的选项与 \tn{declaretheorem} 相同,但它们的区别有:
% \begin{itemize}
% \item 中英文模式下标题不同,英文标题为可选项,默认为首字母大写的环境名。
% \item 自动定义交叉引用的格式,引用标签前缀为定理名称。
@@ -543,7 +543,7 @@
% \subsubsection{新的定理样式}
% 预置定理的样式为 \opt{easy-theorem},上述定理样式选项将对这个定理样式生效。如果使用这个样式而只是增加新的定理名称,可以这样:
% \begin{ctexexam}
-% \EBNewTheorem{定理环境名}{中文标题}[style = other theorem]
+% \DeclareTheorem{定理环境名}{中文标题}[style = other theorem]
% \declaretheorem[style = easy-theorem,name = 定理名]{定理环境名}
% \end{ctexexam}
% \tn{declaretheorem} 定义的定理环境需要手动增加盒子边框,可以如下进行设置:
@@ -625,7 +625,7 @@
% \tn{markrule}\oarg{长度|(\tn{textwidth})}\parg{颜色名}\marg{线宽|(0.75pt)}[<上间距>+<下间距>]
% \end{syntax}
% 命令 \tn{easyhead} 和 \tn{easyfoot} 的使用方法与 \tn{fancyhead} 和 \tn{fancyfoot} 完全相同,它们需要在 \opt{head-foot} 选项中使用,设置的是一个名为 \opt{fancy} 的页面风格。\pkg{fancyhdr} 将页眉页脚分成了左中右和奇数页(odd)、偶数页(even)共12个部分,可选参数中E、O代表偶数、奇数,L、C、R代表左、中、右部分。单面打印时,含有偶数的选项无效。
-% \changes{v1.26u}{2021/06/14}{增加页眉页脚的横线绘制命令 \tn{markrule}。}
+% \changes{v1.26x}{2021/06/14}{增加页眉页脚的横线绘制命令 \tn{markrule}。}
% \end{function}
%
% 命令 \tn{markrule} 用于绘制页眉页脚横线,长度默认为页面文本区的宽度,上下间距为横线与上下方部件的间距,带有长度单位,间距长度之间用 + 号分开,若只有一部分则表示上间距,这个命令也可以在正文中绘制横线。下面举一个设置页眉内容的例子:
@@ -680,15 +680,15 @@
%
% \opt{format} 是目录中标题的格式,可以设置字体和加入垂直间距等,垂直间距最好使用无间距重合的 \tn{addvspace} 命令,带有加号的 \opt{format+} 选项用于在已有的格式命令后附加内容。\opt{indent} 是目录中标题在页面左侧的缩进距离,应该有长度单位。\opt{rule} 选项中一般应当使用 \tn{tocrule} 命令,将会在接下来介绍。\opt{numsep} 是有编号的标题在目录中编号与标题的间距。
%
-% \begin{function}[added = 2021-01-13,updated = 2021-06-11]{\tocrule,\EBNumberLine}
+% \begin{function}[added = 2021-01-13,updated = 2021-06-11]{\tocrule,\CTEXnumberline}
% \begin{syntax}
% \tn{tocrule}*\oarg{引导点间距|(0.7pc)}\parg{引导点大小|(1.2)}\marg{引导点}\oarg{页码格式}
-% \tn{EBNumberLine}\marg{编号类型}
+% \tn{CTEXnumberline}\marg{编号级别}
% \end{syntax}
% \tn{tocrule} 命令生成目录引导线,需要在 \opt{rule} 选项中使用。带有星号的命令会使当前级别的目录引导线右边与页码连接而不是对齐。引导点间距需带有长度单位,引导点大小不带单位,为引导点符号正常大小的倍数,引导点一般为英文句号或 \tn{cdot} 中心点符号。页码格式的内容位于页码前面,可以设置页码字体和距离等,最后一个格式命令可以带有一个参数,这个参数接受页码编号。
% \end{function}
%
-% \tn{EBNumberLine} 命令类似 \CTeX 的 \tn{CTEXnumberline} 命令,用于 \opt{tocline} 选项中设置目录标签的编号。区别是它需要在 \opt{tocset/hang = false} 时使用,否则目录中无法显示标题编号,使用它的时候 \opt{numsep} 选项仍然有效。\meta{编号类型} 为 \opt{chapter} 和 \opt{section} 等,也可用参数 \#1 代替当前级别类型,标题名用参数 \#2 代替一般不变。
+% \tn{CTEXnumberline} 命令用于在 \CTeX 文档类的 \opt{tocline} 选项中设置目录标签的编号,它已经被重新定义,使得目录编号后间距选项 \opt{numsep} 仍然有效。\meta{编号级别} 为 \opt{chapter} 和 \opt{section} 等,也可用参数 \#1 代替当前级别类型,标题名用参数 \#2 代替一般不变。
%
% \begin{ctexexam}
% \tocset
@@ -858,7 +858,7 @@
% \end{function}
%
% \begin{ctexexam}
-% \tcphanifname{\markright{\EBUseCounter{tcbcounter}{\quad 习题}}}{}
+% \tcphanifname{\markright{\UseCounter{tcbcounter}{\quad 习题}}}{}
% \exerprologue{习题前的一段文本}
% \begin{exercise}+[color = LightSkyBlue](after skip = 3.75ex)[itemsep = 1ex]
% \item 习题内容
@@ -957,22 +957,22 @@
% \end{ctexexam}
%
% \subsection{计数器}
-% \begin{function}[added = 2021-06-30]{\newcounter,\EBUseCounter}
+% \begin{function}[added = 2021-06-30]{\newcounter,\UseCounter}
% \begin{syntax}
% \tn{newcounter}\marg{计数器}\oarg{父计数器}
-% \tn{EBUseCounter*}\oarg{父计数器}\parg{编号|(arabic)}\marg{计数器}\marg{内容}\oarg{分隔符|(.)}\parg{数值}
+% \tn{UseCounter*}\oarg{父计数器}\parg{编号|(arabic)}\marg{计数器}\marg{内容}\oarg{分隔符|(.)}\parg{数值}
% \end{syntax}
-% \tn{newcounter} 是 \LaTeX 自带的创建计数器命令,\tn{EBUseCounter} 将会以一定的格式使用由它创建的计数器,将会以 \tn{the}\meta{父计数器}\meta{分隔符}\tn{the}\meta{计数器}\meta{内容} 输出当前内容。
-% \changes{v1.26u}{2021/06/30}{增加计数器使用命令 \tn{EBUseCounter}。}
+% \tn{newcounter} 是 \LaTeX 自带的创建计数器命令,\tn{UseCounter} 将会以一定的格式使用由它创建的计数器,将会以 \tn{the}\meta{父计数器}\meta{分隔符}\tn{the}\meta{计数器}\meta{内容} 输出当前内容。
+% \changes{v1.26x}{2021/06/30}{增加计数器使用命令 \tn{UseCounter}。}
% \end{function}
%
-% 需要注意的是 \tn{EBUseCounter} 仅具有 \textbf{输出功能},并不会改变计数器原有的绑定关系。默认每使用一次命令 \meta{计数器} 的值增加 1,带有星号的命令使 \meta{计数器} 保持当前值,\meta{编号} 为 arabic 和 alpha 等格式,\meta{数值} 可以手动将 \meta{计数器} 设为指定值。
+% 需要注意的是 \tn{UseCounter} 仅具有 \textbf{输出功能},并不会改变计数器原有的绑定关系。默认每使用一次命令 \meta{计数器} 的值增加 1,带有星号的命令使 \meta{计数器} 保持当前值,\meta{编号} 为 arabic 和 alpha 等格式,\meta{数值} 可以手动将 \meta{计数器} 设为指定值。
%
-% 在一定的场合下可能用到 \tn{EBUseCounter} 命令,比如通过新建快捷命令在一些位置使用定理环境的计数器,使用 \tn{labelformat} 设置计数器的引用标签需添加 eb@:
+% 在一定的场合下可能用到 \tn{UseCounter} 命令,比如通过新建快捷命令在一些位置使用定理环境的计数器,使用 \tn{labelformat} 设置计数器的引用标签需添加 eb@:
% \begin{ctexexam}
% \labelformat{eb@theorem}{定理 #1}
% \newcommand{\theoremhead}[1]
-% {定理 \EBUseCounter[chapter]{theorem}{\hspace{\ccwd}#1}}
+% {定理 \UseCounter[chapter]{theorem}{\hspace{\ccwd}#1}}
% \theoremhead{定理标题}\label{thm:theorem}
% \end{ctexexam}
%
@@ -1150,8 +1150,8 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2021/07/06}{1.26u}
- {Typeset Chinese books or notes}
+\ProvidesExplClass{easybook}{2021/07/06}{1.26x}
+ {Typeset Chinese theses or books}
\bool_set_false:N \l__eb_compile_draft_bool
\bool_set_false:N \l__eb_title_newline_bool
@@ -1165,7 +1165,6 @@
\keys_define:nn { easybook }
{
- draft .code:n = \bool_set_true:N \l__eb_compile_draft_bool,
newline .code:n = \bool_set_true:N \l__eb_title_newline_bool,
scheme .code:n = \eb_put_ctexbook:n { scheme = #1 },
enmode .meta:n = { newline,scheme = plain },
@@ -1208,11 +1207,13 @@
\bool_set_false:N \l__eb_class_book_bool
\keys_set:nn { easybook } { oneside }
},
+ book .meta:n = { class = book },
+ article .meta:n = { class = article },
- config .tl_set:N = \g__eb_config_tl,
- floatpage .bool_set:N = \l__eb_float_page_bool,
- floatpage .default:n = true,
- unknown .code:n =
+ config .tl_set:N = \g__eb_config_tl,
+ floatpage .bool_set:N = \l__eb_float_page_bool,
+ floatpage .default:n = true,
+ unknown .code:n =
{ \clist_gput_right:NV \g__eb_options_clist \CurrentOption }
}
@@ -1331,7 +1332,6 @@
part =
{
pagestyle = empty,
- tocline = \EBNumberLine{#1}#2,
format = \color{ctex@frame}\sffamily\Huge,
aftername =
{
@@ -1397,8 +1397,8 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{etoolbox}
-\ProvidesExplPackage{easybase}{2021/07/06}{1.26u}
- {Typeset Chinese books or notes}
+\ProvidesExplPackage{easybase}{2021/07/06}{1.26x}
+ {Typeset Chinese theses or books}
\cs_generate_variant:Nn \eb_ctex_define:nn { nx }
\cs_generate_variant:Nn \int_to_arabic:n { v }
@@ -1446,28 +1446,28 @@
\eb_clist_map_inline:nn {#1}
{ \AtBeginEnvironment{##1}{#2} }
}
-\cs_new_protected:Npn \eb_match_package_name:n #1
+\cs_new_protected:Npn \eb_match_load_package:n #1
{
\tl_if_in:nnTF {#1} { [ }
{
- \regex_split:nnNT { \[ } {#1} \l_tmpa_seq
- { \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl }
- \@ifpackageloaded{\l_tmpa_tl}{}
+ \seq_set_split:Nnn \l_tmpa_seq { [ } {#1}
+ \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl
+ \IfFileExists{\l_tmpa_tl.sty}
{
\exp_last_unbraced:Nx \RequirePackage
{ [\seq_use:Nn \l_tmpa_seq { , } }{\l_tmpa_tl}
- }
+ }{}
}
- { \@ifpackageloaded{#1}{}{\RequirePackage{#1}} }
+ { \IfFileExists{#1.sty}{\RequirePackage{#1}}{} }
}
-\NewDocumentCommand{\eb@package@load}{O{}m}
+\NewDocumentCommand{\LoadPackage}{O{}m}
{
- \seq_set_split:Nnn \l__eb_package_name_seq { + } {#2}
+ \seq_set_split:Nnn \l__eb_package_names_seq { + } {#2}
\int_compare:oNnT
- { \seq_count:N \l__eb_package_name_seq } = { 1 }
+ { \seq_count:N \l__eb_package_names_seq } = { 1 }
{ \PassOptionsToPackage{#1}{#2} }
\seq_map_function:NN
- \l__eb_package_name_seq \eb_match_package_name:n
+ \l__eb_package_names_seq \eb_match_load_package:n
}
\cs_new_protected:Npn \eb_at_end_preamble:n
{ \BeforeBeginEnvironment{document} }
@@ -1482,11 +1482,10 @@
\keys_define:nn { easybase }
{
- draft .code:n =
- { \bool_set_true:N \l__eb_compile_draft_bool },
- floatpage .bool_set:N = \l__eb_float_page_bool,
- floatpage .default:n = true,
- floatpage .initial:n = false,
+ draft .code:n = \bool_set_true:N \l__eb_compile_draft_bool,
+ floatpage .bool_set:N = \l__eb_float_page_bool,
+ floatpage .default:n = true,
+ floatpage .initial:n = false,
paper .choice:,
paper .value_required:n = true,
@@ -1501,7 +1500,9 @@
\bool_set_false:N \l__eb_class_book_bool
\bool_set_false:N \l__eb_page_twoside_bool
},
- class .initial:n = book
+ class .initial:n = book,
+ book .meta:n = { class = #1 },
+ article .meta:n = { class = #1 }
}
\clist_map_inline:nn
@@ -1571,32 +1572,10 @@
uppercase .bool_set:N = \l__eb_mark_uppercase_bool,
uppercase .default:n = true,
uppercase .initial:n = true,
- figurepath .tl_set:N = \l_eb_graphics_path_tl,
-
- footwith .choices:nn =
- { part,page,chapter }
- {
- \tl_set_eq:NN
- \l__eb_foot_counter_parent_choice_tl \l_keys_choice_tl
- },
- footwith .value_required:n = true,
- footwith .initial:n = chapter,
-
- figure-con .tl_set:N = \l__eb_figure_connector_tl,
- table-con .tl_set:N = \l__eb_table_connector_tl,
- listing-con .tl_set:N = \l__eb_lstlisting_connector_tl,
- equation-con .tl_set:N = \l__eb_equation_connector_tl,
- number-con .meta:n =
- {
- figure-con = #1,
- table-con = #1,
- listing-con = #1,
- equation-con = #1
- },
- number-con .initial:n = { . }
+ figurepath .tl_set:N = \l_eb_graphics_path_tl
}
-\eb@package@load
+\LoadPackage
{
footmisc[stable,bottom]+
spbmark[ctex]+
@@ -1611,9 +1590,9 @@
setspace+
listings
}
-\cs_new_protected:Npn \eb_package_later_bool:nn #1#2
+\cs_new_protected:Npn \eb_package_date_check:nn #1#2
{
- \@ifpackagelater{#1}{#2}
+ \IfPackageAtLeastTF{#1}{#2}
{}{\msg_warning:nnn { easybase } { package-old } {#1}}
}
\msg_new:nnn { easybase } { package-old }
@@ -1631,9 +1610,10 @@
{ thmtools } { 2020/08/01 },
{ caption } { 2020/08/24 },
{ fancyhdr } { 2021/01/28 },
- { siunitx } { 2021/06/22 }
+ { siunitx } { 2021/06/22 },
+ { tabularray } { 2021/07/01 }
}
- { \eb_package_later_bool:nn #1 }
+ { \eb_package_date_check:nn #1 }
\includepdfset{fitpaper = true}
\geometry
@@ -1806,7 +1786,7 @@
{
\bool_if:NTF \l__eb_mark_uppercase_bool
{ \eb_mark_uppercase:n }
- { \eb_mark_nouppercase:n }{\use:c { eb_fancyhf_#1_mark:n } {#2}}
+ { \eb_mark_nouppercase:n } { \use:c { eb_fancyhf_#1_mark:n } {#2} }
}
\cs_new:Npn \eb@level@markdouble #1#2
{
@@ -1850,6 +1830,17 @@
\cs_if_exist:NF \kaishu { \cs_gset_eq:NN \kaishu \itshape }
}
+\eb_ctex_define:nn { style }
+ {
+ footwith .choices:nn =
+ { part,page,chapter }
+ {
+ \tl_set_eq:NN
+ \l__eb_foot_counter_parent_choice_tl \l_keys_choice_tl
+ },
+ footwith .value_required:n = true,
+ footwith .initial:n = chapter
+ }
\eb_at_end_preamble:n
{
\group_begin:
@@ -1876,6 +1867,8 @@
\selectfont\ignorespaces
\l__eb_subfont_footnote_tl
}
+\providecommand{\super}{\textsuperscript}
+\providecommand{\spb@textsuperscript@save}{\textsuperscript}
\ctex_after_end_preamble:n
{
\ExplSyntaxOn\char_set_catcode_letter:N \@
@@ -1965,14 +1958,19 @@
}
}
-\cs_new:Npn \EBNumberLine #1
+\cs_set:Npn \CTEXnumberline #1
{
\CTEXifname
{
- \use:c { CTEXthe#1 }
- \hspace{\use:c { eb@toc@#1@numsep }}
+ \ifbool{eb@titletoc@hang@fix}
+ { \protect\numberline{\use:c { CTEXthe#1 }} }
+ {
+ \use:c { CTEXthe#1 }
+ \hspace{\use:c { eb@toc@#1@numsep }}
+ }
}{}
}
+\cs_set_eq:NN \EBNumberLine \CTEXnumberline
\newbool{eb@titletoc@hang@fix}
\eb_ctex_define:nn { tocset }
{
@@ -2008,25 +2006,8 @@
},
hang .choice:,
- hang/true .code:n =
- {
- \booltrue{eb@titletoc@hang@fix}
- \ctex_set:n
- {
- chapter/tocline = \CTEXnumberline{##1}##2,
- section/tocline = \CTEXnumberline{##1}##2,
- subsection/tocline = \CTEXnumberline{##1}##2
- }
- },
- hang/false .code:n =
- {
- \ctex_set:n
- {
- chapter/tocline = \EBNumberLine{##1}##2,
- section/tocline = \EBNumberLine{##1}##2,
- subsection/tocline = \EBNumberLine{##1}##2
- }
- },
+ hang/true .code:n = \booltrue{eb@titletoc@hang@fix},
+ hang/false .code:n = { },
hang .default:n = true,
hang .initial:n = false,
@@ -2056,6 +2037,13 @@
list/rule = #1
}
}
+\ctex_set:n
+ {
+ part/tocline = \CTEXnumberline{#1}#2,
+ chapter/tocline = \CTEXnumberline{#1}#2,
+ section/tocline = \CTEXnumberline{#1}#2,
+ subsection/tocline = \CTEXnumberline{#1}#2
+ }
\NewDocumentCommand{\tocrule}{sO{0.7pc}D(){1.2}mO{}}
{
@@ -2136,7 +2124,7 @@
\tl_use:c { the#1 }
}
}
-\NewDocumentCommand{\EBUseCounter}{soD(){arabic}mmO{.}d()}
+\NewDocumentCommand{\UseCounter}{soD(){arabic}mmO{.}d()}
{
\IfBooleanF{#1}{\stepcounter{#4}}
\IfValueT{#7}{\setcounter{#4}{#7}}
@@ -2159,22 +2147,10 @@
\cs_set:Npn \thebisection { \eb_section_counter_prefix:n { bi } }
\cs_set:Npn \thebisubsection { \thebisection.\eb_arabic:n { bisubsection } }
\cs_set:Npn \thesection { \eb_section_counter_prefix:n { } }
-\eb_clist_map_inline:nn
- { figure,table,lstlisting,equation }
- {
- \cs_set:cpn { the#1 }
- {
- \int_compare:nNnT { \c@chapter } > { 0 }
- {
- \thechapter
- \tl_use:c { l__eb_#1_connector_tl }
- }
- \eb_arabic:n {#1}
- }
- }
+
\contentsuse{}{tec}
\tl_new:N \eb@before@addbitoc@hook
-\NewDocumentCommand{\EBeforeAddBitoc}{sm}
+\NewDocumentCommand{\BeforeAddBitoc}{sm}
{
\IfBooleanTF{#1}
{\tl_gset:Nn \eb@before@addbitoc@hook {#2}}
@@ -2226,6 +2202,35 @@
}
}
+\eb_ctex_define:nn { style }
+ {
+ figure-con .tl_set:N = \l__eb_figure_connector_tl,
+ table-con .tl_set:N = \l__eb_table_connector_tl,
+ listing-con .tl_set:N = \l__eb_lstlisting_connector_tl,
+ equation-con .tl_set:N = \l__eb_equation_connector_tl,
+ number-con .meta:n =
+ {
+ figure-con = #1,
+ table-con = #1,
+ listing-con = #1,
+ equation-con = #1
+ },
+ number-con .initial:n = { . }
+ }
+\eb_clist_map_inline:nn
+ { figure,table,lstlisting,equation }
+ {
+ \cs_set:cpn { the#1 }
+ {
+ \int_compare:nNnT { \c@chapter } > { 0 }
+ {
+ \thechapter
+ \tl_use:c { l__eb_#1_connector_tl }
+ }
+ \eb_arabic:n {#1}
+ }
+ }
+
\tl_set:Nx \l__eb_toc_type_tl
{ \bool_if:NTF \l__eb_class_book_bool { chapter } { section } }
\tl_new:N \eb@bitoc@title
@@ -2477,7 +2482,7 @@
{ scholax } { \eb_put_newtxmath:n { nc,noOT1 } }
{ charter } { \eb_put_newtxmath:n { charter,noOT1 } }
}
- { \eb@package@load{newtxmath+bm} }
+ { \LoadPackage{newtxmath+bm} }
}
\fp_new:N \l__eb_spread_line_fp
@@ -2538,14 +2543,17 @@
\captionsetup[figure][bi-second]{name = Figure}
\captionsetup[table][bi-second]{name = Table}
}
-\SetTblrDefault
+\IfPackageAtLeastTF{tabularray}{2021/07/01}
{
- rows = {abovesep = 4pt,belowsep = 2pt},
- stretch = \fp_use:N \l__eb_spread_table_fp
- }
-\NewTableCommand{\toprule}[1][1pt]{\hline[#1]}
-\NewTableCommand{\midrule}[1][0.5pt]{\hline[#1]}
-\NewTableCommand{\bottomrule}[1][1pt]{\hline[#1]}
+ \SetTblrInner
+ {
+ rows = {abovesep = 4pt,belowsep = 2pt},
+ stretch = \fp_use:N \l__eb_spread_table_fp
+ }
+ \NewTableCommand{\toprule}[1][1pt]{\hline[#1]}
+ \NewTableCommand{\midrule}[1][0.5pt]{\hline[#1]}
+ \NewTableCommand{\bottomrule}[1][1pt]{\hline[#1]}
+ }{}
\eb_at_begin_environment:nn { tabular,tabularx }
{
\exp_args:Nx \linespread { \fp_use:N \l__eb_spread_table_fp }
@@ -2624,7 +2632,7 @@
{ \tl_const:cn { c__eb_name_#1_tl } {#3} }
{ \tl_const:cn { c__eb_name_#1_tl } {#2} }
}
-\NewDocumentCommand{\EBNewTheorem}
+\NewDocumentCommand{\DeclareTheorem}
{mO{\text_titlecase_first:n {#1}}mD(){tc-theorem}O{}}
{
\ctex_at_end_preamble:n
@@ -2643,6 +2651,7 @@
\labelformat{#1}{\tl_use:c { c__eb_name_#1_tl }~##1}
}
}
+\cs_set_eq:NN \EBNewTheorem \DeclareTheorem
\cs_set_eq:NN \eb@declare@theorem@save \declaretheorem
\RenewDocumentCommand{\declaretheorem}{O{}m}
{\AfterPreamble{\eb@declare@theorem@save[#1]{#2}}}
@@ -2719,7 +2728,7 @@
{ remark } { 注 } [ numbered = no ],
{ { proof } { 证明 } [ numbered = no,qed = \qedsymbol ] }
}
- { \EBNewTheorem #1 }
+ { \DeclareTheorem #1 }
}
\setchemformula
@@ -2728,19 +2737,22 @@
charge-hshift = 0.25\ccwd,
subscript-vshift = -0.2ex
}
-\sisetup
+\IfPackageAtLeastTF{siunitx}{2021/06/22}
{
- mode = match,
- table-parse-only,
- text-family-to-math,
- text-series-to-math,
- reset-text-family = false,
- reset-text-series = false,
- reset-text-shape = false,
- range-phrase = \ensuremath{\sim},
- range-units = single,
- group-digits = none
- }
+ \sisetup
+ {
+ mode = match,
+ table-parse-only,
+ text-family-to-math,
+ text-series-to-math,
+ reset-text-family = false,
+ reset-text-series = false,
+ reset-text-shape = false,
+ range-phrase = \ensuremath{\sim},
+ range-units = single,
+ group-digits = none
+ }
+ }{}
\eb_at_begin_environment:nn
{
array,matrix,pmatrix,bmatrix,Bmatrix,vmatrix,Vmatrix,
@@ -2790,7 +2802,7 @@
{ \keys_set:nn { eb/exercise } {#1} }
\ctex_at_end_package:nn { tcolorbox }
{
- \eb_package_later_bool:nn { tcolorbox } { 2020/10/09 }
+ \eb_package_date_check:nn { tcolorbox } { 2020/10/09 }
\file_if_exist_input:n { eb-tcolorbox.cfg }
}
@@ -2831,7 +2843,7 @@
bitoc-title .initial:n = Reference
}
-\cs_new_protected:Npn \EBibtexSet
+\cs_new_protected:Npn \BibtexPostset
{
\tl_if_empty:NTF \l__eb_bib_otherstyle_tl
{
@@ -2867,7 +2879,7 @@
}
\cs_new_protected:Npn \eb_put_biblatex:n #1
{ \PassOptionsToPackage{#1}{biblatex} }
-\cs_new_protected:Npn \EBiblatexPreset
+\cs_new_protected:Npn \BiblatexPreset
{
\tl_if_empty:NTF \l__eb_bib_otherstyle_tl
{
@@ -2881,7 +2893,7 @@
{ \eb_put_biblatex:n { citestyle = \l__eb_bib_citestyle_tl } }
\eb_put_biblatex:n { backend = biber }
}
-\cs_new_protected:Npn \EBiblatexPostset
+\cs_new_protected:Npn \BiblatexPostset
{
\clist_map_function:NN \l__eb_bib_datafile_clist \addbibresource
\tl_gset:Nn \blx@default@theheading { bibintoc }
@@ -2895,13 +2907,13 @@
{
\bool_if:NTF \l__eb_backend_bibtex_bool
{
- \eb@package@load[sort&compress]{natbib}
- \EBibtexSet
+ \LoadPackage[sort&compress]{natbib}
+ \BibtexPostset
}
{
- \EBiblatexPreset
- \eb@package@load{biblatex}
- \EBiblatexPostset
+ \BiblatexPreset
+ \LoadPackage{biblatex}
+ \BiblatexPostset
}
}
}
@@ -3091,7 +3103,7 @@
}
\ctex_at_end_preamble:n
{
- \eb@package@load{hyperref}
+ \LoadPackage{hyperref}
\urlstyle{same}
\eb_allow_urlbreak:
\ctex_hypersetup:n { pdfstartview = FitH }
@@ -3132,7 +3144,7 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2021/07/06}{1.26u}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2021/07/06}{1.26x}
{Customization of tcolorbox for easybook}
\cs_new_protected:Npn \eb_tcb_theorem_set:n #1
@@ -3165,8 +3177,9 @@
{
blank,on~line,center,
sharpish~corners,
- fontupper = \Large\sffamily,
- before~skip = 3.75ex,after~skip = 3ex
+ fontupper = \Large\sffamily,
+ before~skip = 3.75ex,
+ after~skip = 3ex\tl_if_empty:NF \eb@tc@list@prologue { + 0.75ex }
}
\tcbset
{
diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf
index 8dcf4520b0..69091e6cb5 100644
--- a/macros/latex/contrib/easybook/easybook.pdf
+++ b/macros/latex/contrib/easybook/easybook.pdf
Binary files differ