summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/easybook/easybook.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-07-16 03:01:07 +0000
committerNorbert Preining <norbert@preining.info>2021-07-16 03:01:07 +0000
commit01b14a20f8942ab0c52aeb8abffa85b811c7a95a (patch)
tree2db57d63324f0141577f40d9e8a8a035b131e176 /macros/latex/contrib/easybook/easybook.dtx
parent55ae461252a599d6bc951065a37c16a8971fc560 (diff)
CTAN sync 202107160301
Diffstat (limited to 'macros/latex/contrib/easybook/easybook.dtx')
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx287
1 files changed, 193 insertions, 94 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index f7c4e25dfe..0a212bbb5b 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/14\hskip\ccwd\relax v1.27e\thanks{\url{https://gitee.com/texl3/easybook}}}
+% \date{2021/07/15\hskip\ccwd\relax v1.27f\thanks{\url{https://gitee.com/texl3/easybook}}}
%
% \maketitle
% \begin{abstract}
@@ -42,7 +42,7 @@
% \begin{itemize}
% \item 使用 \hologo{XeLaTeX}(推荐)或 \hologo{LuaLaTeX} 两种编译方式。
% \item 由于用到了一些 \LaTeX 和宏包较新的功能,建议安装最新的 \TeX 发行版,例如 \TeX~Live 2021 或 \hologo{MiKTeX} 21.2 之后的版本。
-% \item 虽然手册对基本用法做了介绍,但这并不是入门教程,您应当具有一定的 \LaTeX 使用基础。
+% \item 虽然手册对基本用法做了介绍,但这并不是入门教程,所涉及到宏包的用法与命令也需要有了解。您应当具有一定的 \LaTeX 使用基础,可以在 \TeX 综合网站 \href{https://www.ctan.org/}{CTAN} 查看相关资源。
% \end{itemize}
%
% \subsection{基本用法}
@@ -148,7 +148,7 @@
% cjkfont = <adobe|fandol|founder|mac|macnew|macold|ubuntu|windows|none>
% \end{syntax}
% 中文字体采用 \CTeX 宏集包含的字库并与其一致,具体配置方案可以查看 \CTeX 使用手册。它与 \opt{fontset} 选项是等效的,如果没有指定 \opt{cjkfont} 的值,将会自动检测用户的操作系统并选择相应的字体。
-% \changes{v1.27e}{2021/07/12}{新增 \opt{cjkfont} 选项设置中文字体,原 \opt{font} 选项设置英文字体,中文字体使用 \CTeX 的字库。}
+% \changes{v1.27f}{2021/07/12}{新增 \opt{cjkfont} 选项设置中文字体,原 \opt{font} 选项设置英文字体,中文字体使用 \CTeX 的字库。}
% \end{function}
%
% 如果需要使用其它中文字体,可以在启用选项 \opt{cjkfont = none} 后,再使用 \pkg{xeCJK} 宏包的相关命令设置字体以及声明字体族:
@@ -247,7 +247,6 @@
% \end{function}
%
% 它们的星号变体命令使文中标题不编号,但是仍然加入双语目录,若英文标题参数空置那么仅加入中文目录而不加入英文目录,这一特点与 \tn{chapter*} 等命令的行为不太一样,在一些情况下会用到。可选参数是目录中的中文标题,默认与中文标题一致,正文标题过长时可用它设置在目录中显示的标题。双语目录的格式默认是一致的,共享使用 \tn{tocset} 的设置,英文目录的章级别标题名及编号的修改方式如下:
-%
% \begin{function}{chapter/biname,chapter/binmuber}
% \begin{syntax}
% biname = \{<英文目录前名字|(Chapter\tn{space})>,<英文目录后名字>\}
@@ -288,7 +287,7 @@
% \begin{syntax}
% \tn{ctexset}\marg{键值列表}
% \end{syntax}
-% \cls{easybook} 扩展了 \CTeX 宏集 \LaTeX 3风格键值的通用控制命令 \tn{ctexset},接口选项同样可用它设置, 原有的 \meta{键值列表} 仍然可用。本文档类目前有九个模块用于实现常规的排版功能,如下表所示,它们既是统一接口 \tn{ctexset} 的路径,也是相关模块的接口命令名:
+% \cls{easybook} 扩展了 \CTeX 宏集 \hologo{LaTeX3} 风格键值的通用控制命令 \tn{ctexset},接口选项同样可用它设置, 原有的 \meta{键值列表} 仍然可用。本文档类目前有九个模块用于实现常规的排版功能,如下表所示,它们既是统一接口 \tn{ctexset} 的路径,也是相关模块的接口命令名:
% \begin{center}
% \begin{tabular}{*{5}{c}}
% \toprule
@@ -406,8 +405,8 @@
% line = <数值|(1.3)>
% table = <数值|(1.05)>
% math = <数值|(1.05)>
-% caption = <数值|(1)>
-% footnote = <数值|(1)>
+% caption = <数值|(1.1)>
+% footnote = <数值|(1.1)>
% spread-all = <数值|(empty)>
% \end{syntax}
% \ding{229} 以上选项路径为 \opt{spread/...} \\
@@ -421,7 +420,11 @@
% \item[table] 表格行距,对传统表格环境 \env{tabular}、\env{tabularx} 以及 \pkg{tabularray} 宏包的 \env{tblr} 环境生效,同时 \env{tblr} 也自带有 \opt{stretch} 选项设置行距。
% \item[math] 数学环境行距,包括 \pkg{amsmath} 和 \pkg{mathtools} 宏包附带的环境,但并未加载 \pkg{mathtools} 宏包。
% \item[caption] 图表代码标题行距。
-% \item[footnote] 脚注行距。
+% \item[footnote] 脚注整体内容的行距,可以使用 \opt{fntext-form} 的代码覆盖每个脚注单独的行距,从而与不同脚注的段落间距不同。
+% \begin{ctexexam}
+% \spread{footnote = 1.3}
+% \hdrset{fntext-form = \linespread{1.2}\selectfont}
+% \end{ctexexam}
% \item[spread-all] 统一设置上述各种行距。
% \end{optdesc}
%
@@ -470,10 +473,11 @@
% \begin{optdesc}
% \item[backend] 参考文献处理后端,默认用传统的 \hologo{BibTeX} 处理参考文献。
% \item[bib-style] 参考文献格式为中国的参考文献推荐标准 GB/T 7714-2015,有顺序编码制和著者-出版年制两种风格,理工科类一般使用顺序编码制,文科类一般使用著者-出版年制。若使用其它格式,使用 \hologo{BibTeX} 处理时需确保正确的 \opt{bst} 文件,使用 \hologo{biber} 处理可使用 \pkg{biblatex} 宏包支持的参考文献风格名称。
-% \item[cite-style] 标注参考文献的风格,\opt{backend = bibtex} 选项下可使用 \opt{super}(数字上标标注,默认)或 \opt{numbers}(数字标注)等 \pkg{natbib} 宏包带有的标注风格,\opt{backend = biblatex} 选项下可使用 \pkg{biblatex} 宏包支持的标注风格名称。
+% \item[cite-style] 标注参考文献的风格,选项 \opt{backend = bibtex} 下可使用 \opt{super}(数字上标标注,默认)或 \opt{numbers}(数字标注)等 \pkg{natbib} 宏包带有的标注风格,选项 \opt{backend = biblatex} 下可使用 \pkg{biblatex} 宏包支持的标注风格名称。
% \item[datafile] 参考文献数据库的文件名,可以是单个文件也可以是以括号包裹并以英文逗号分隔的文件列表,使用 \hologo{biber} 处理时要带有 \opt{bib} 后缀,若不在当前文件夹名称需要包含路径。只有设置数据库的文件名才会载入 \pkg{natbib} 或 \pkg{biblatex} 宏包,之后才可使用相关配置命令,否则需要手动载入相关宏包配置参考文献。
% \end{optdesc}
%
+% \subsubsection{配置参考文献}
% \begin{function}[added = 2021-01-11,updated = 2021-04-09]{\printbibliography,\BibtexPreSet,\BibtexPostSet,\BiblatexPreSet,\BiblatexPostSet}
% \begin{syntax}
% \tn{printbibliography}\oarg{键值列表}
@@ -496,6 +500,20 @@
% \item[\tn{BiblatexPostSet}] 这是 \pkg{biblatex} 宏包的后配置命令,需要与 \pkg{biblatex} 配合并放在载入其之后使用,默认保存了参考文献标题的设置。
% \end{optdesc}
%
+% 可能一些情况下您希望更加灵活地设置参考文献或由更多需求,下面举一个在导言区手动载入 \pkg{biblatex} 宏包的例子:
+% \begin{ctexexam}
+% \bibset
+% {
+% bib-style = alphabetic,
+% cite-style = numeric-comp
+% }
+% \BiblatexPreSet % 传递 biblatex 宏包的选项
+% \usepackage{biblatex}
+% \addbibresource{myrefs.bib}
+% \defbibheading{bibliography}[参考文献] % 定义参考文献标题
+% {\chapter*{#1}\markboth{#1}{#1}}
+% \end{ctexexam}
+%
% \subsection{定理样式}
% \label{subsec:theorem of style}
% \begin{function}[EXP,added = 2021-01-12,updated = 2021-07-01]{thmbox,within,headpunct,bodyfont,notefont,headfont,headindent,spaceabove,spacebelow,spacepost,headformat,brackets}
@@ -526,9 +544,9 @@
% \item[notefont] 定理题注部分的字体,包括字体族、字体系列、字体尺寸和字体形状命令。
% \item[headfont] 定理标题部分的字体,包括字体族、字体系列、字体尺寸和字体形状命令。
% \item[headindent] 定理标题的缩进,默认无缩进,可用 \tn{parindent} 命令设置为段落缩进。
-% \item[spaceabove] 定理环境前的间距。
-% \item[spacebelow] 定理环境后的间距。
-% \item[spacepost] 定理标题后与第一段内容的间隔。
+% \item[spaceabove] 定理环境前的间距,使用 \pkg{tcolorbox} 的环境包装后被覆盖。
+% \item[spacebelow] 定理环境后的间距,使用 \pkg{tcolorbox} 的环境包装后被覆盖。
+% \item[spacepost] 定理标题后与第一段内容的间距。
% \item[headformat] 定理开头部分各组成元素的排列和格式,这个选项一般不需要使用,其中 \tn{NAME}、\tn{NUMBER} 和 \tn{NOTE} 分别代表标题、编号和题注。
% \item[brackets] 设置行间公式编号标签的括号,以英文逗号分隔,分别为左右括号。
% \end{optdesc}
@@ -680,11 +698,11 @@
% \end{syntax}
% \ding{229} 以上选项路径为 \opt{hdrset/...} \\
% \changes{v1.25}{2021/05/12}{增加脚注样式设置选项。}
-% \changes{v1.27e}{2021/07/14}{增加脚注内容格式选项 \opt{fntext-form} 和脚注类型选项 \opt{footnotetype}。}
+% \changes{v1.27f}{2021/07/14}{增加脚注内容格式选项 \opt{fntext-form} 和脚注类型选项 \opt{footnotetype}。}
% \end{function}
%
% \begin{optdesc}
-% \item[fnmargin] 脚注首段缩进距离,等于长度 \tn{footnotemargin} 的值。
+% \item[fnmargin] 脚注首段缩进距离,等于长度 \tn{footnoteindent} 的值。
% \item[fnparskip] 脚注段落间距,等于长度 \tn{footparskip} 的值。
% \item[fnparindent] 脚注段落缩进,等于长度 \tn{footparindent} 的值。
% \item[footnotetype] 脚注的类型,悬挂缩进 \opt{hang} 是默认值,\opt{default} 是原始的类型,在一些浮动体排版的情况下,脚注可能位于页面中间,\opt{bottom} 使脚注始终位于页面底端。这是个复合选项,\opt{bottom} 可以与前两种类型重复或复合使用:
@@ -727,7 +745,6 @@
% \end{function}
%
% \tn{CTEXnumberline} 命令用于在 \CTeX 文档类的 \opt{tocline} 选项中设置目录标签的编号,它已经被重新定义,使得目录编号后间距选项 \opt{numsep} 仍然有效。\meta{编号级别} 为 \opt{chapter} 和 \opt{section} 等,也可用参数 \#1 代替当前级别类型,标题名用参数 \#2 代替一般不变。
-%
% \begin{ctexexam}
% \tocset
% {
@@ -789,7 +806,7 @@
% \ <行间公式>
% \tn{end}\marg{环境名}
% \end{syntax}
-% \pkg{amsmath} 宏包提供了一系列数学环境,它们可以排布各种对齐或不对齐的公式组。\env{multline} 环境用于一行无法放下的长公式,\env{gather} 环境用于每行居中的公式组,\env{align} 环境用于多列对齐的公式组。
+% \pkg{amsmath} 宏包提供了一系列行间数学环境,它们可以排布各种对齐或不对齐的公式组。\env{multline} 环境用于一行无法放下的长公式,\env{gather} 环境用于每行居中的公式组,\env{align} 环境用于多列对齐的公式组。
% \end{function}
%
% \subsection{表格}
@@ -799,10 +816,28 @@
% \ <表格内容>
% \tn{end}\marg{环境名}
% \end{syntax}
-% \pkg{tabularray} 是一个较新的宏包,不仅提供了 \pkg{tabularx}、\pkg{multirow}、和 \pkg{booktabs} 宏包的功能,并且不依赖其它宏包与它们同时使用不会产生冲突,还实现了用简便的键值列表方式设置表格样式。目前除了表头斜线以及跨页功能存在不足,其它方面已满足对表格绝大多数格式的需求,具体用法可见宏包的说明文档。
+% \pkg{tabularray} 是一个较新的宏包,不仅提供了 \pkg{tabularx}、\pkg{multirow}、和 \pkg{booktabs} 宏包的功能,并且不依赖其它宏包与它们同时使用不会产生冲突,还实现了用简便的键值列表方式设置表格样式。具体用法可见宏包的说明文档。下面演示一个 \env{tblr} 表格的用法:
% \changes{v1.25}{2021/05/17}{使用功能更便捷齐全的 \pkg{tabularray} 宏包设置表格样式。}
% \end{function}
%
+% \begin{ctexexam}
+% \begin{tblr}
+% {
+% colspec = {X[2,l]XX[LimeGreen]X},
+% rowspec = {Q[t]Q[m]Q[b,Magenta]Q[t]Q[m]Q[b]},
+% hline{1,6} = {1pt,solid},
+% hline{3-5} = {LightBlue,dashed},
+% vline{1,5} = {3-4}{dotted},
+% rows = {1cm,abovesep = 2pt}
+% }
+% Alpha & Beta & Gamma & Delta \\
+% Epsilon & Zeta & Eta & Theta \\
+% Iota & Kappa & \SetCell[r=2]{h,c,Cyan}Lambda & Mu \\
+% Nu & Xi & Omicron & Pi \\
+% Rho & Sigma & Tau & Upsilon
+% \end{tblr}
+% \end{ctexexam}
+%
% \subsection{列表}
% \begin{function}[added = 2021-01-05,updated = 2021-04-08]{enumerate,enumerate*,itemize,itemize*,description,description*}
% \begin{syntax}
@@ -831,7 +866,7 @@
% \ <定理内容>
% \tn{end}\marg{环境名}
% \end{syntax}
-% 这些是已预置的定理环境,它们的盒子边框可使用 \opt{thmset/thmbox = false} 关闭,其中注与证明环境不编号,证明末尾会自动添加证明结束符,声明新的定理环境见小节 \ref{subsec:theorem of style}。环境名对应的定理标题名如下:
+% 这些是预置的定理环境,可使用选项 \opt{thmset/thmbox} 为它们添加盒子边框,其中注与证明环境不编号,证明末尾会自动添加证明结束符,声明新的定理环境或更改边框样式见小节 \ref{subsec:theorem of style}。环境名对应的定理标题名如下:
% \begin{center}
% \begin{tabular}{*{8}{c}}
% \toprule
@@ -851,7 +886,7 @@
% \tn{end}\{hangparas\}
% \end{syntax}
% \tn{hangpara} 命令使其后的一个段落保持悬挂缩进,\env{hangparas} 环境使其中的段落均保持悬挂缩进。缩进将以 \meta{缩进长度} 从每个段落的 \meta{缩进开始行数} 开始。
-% \changes{v1.27e}{2021/07/11}{增加悬挂缩进段落命令 \tn{hangpara} 和环境 \env{hangparas}。}
+% \changes{v1.27f}{2021/07/11}{增加悬挂缩进段落命令 \tn{hangpara} 和环境 \env{hangparas}。}
% \end{function}
%
% \subsection{代码}
@@ -873,7 +908,7 @@
% \ \tn{item} <习题内容>
% \tn{end}\{exercise\}
% \end{syntax}
-% 习题环境 \env{exercise} 的标题紧接上一节编号并加入目录与页眉,当使用星号参数时不进行编号,使用 + 号参数独立编号并启用 \pkg{tcolorbox} 支持生成标题,并使 \opt{color} 生效,此时计数器使用的值为 \tn{thetcbcounter}。第三个 \meta{键值列表} 的选项与小节 \ref{subsec:sort list} 排序列表相同,\opt{number} 的编号格式也是如此。第一个 \meta{键值列表} 中包含的选项如下:
+% 习题环境 \env{exercise} 的标题紧接上一节编号并加入目录与页眉,当使用星号参数时不进行编号,使用 + 号参数独立编号并启用 \pkg{tcolorbox} 支持生成标题,并使 \opt{color} 生效,此时计数器使用的值为 \tn{thetcbcounter}。第三个 \meta{键值列表} 的选项与 \pkg{enumitem} 的排序列表相同,第一个 \meta{键值列表} 中包含的选项如下:
% \changes{v1.23}{2021/02/08}{增加准确的习题盒子标题目录锚点。}
% \end{function}
%
@@ -885,20 +920,20 @@
% numsep = <编号与标题的间距|(0.5\tn{ccwd})>
% label = <标签内容>
% \end{syntax}
-% 第二个 \meta{键值列表} 在是否使用 + 号参数时用法不同,使用 + 号参数时为 \pkg{tcolorbox} 的盒子选项,例如 \opt{boxrule} 和 \opt{fontupper}。不使用 + 号参数时相当于设置 \tn{ctexset}\{section = {\#1}\} 键值选项列表,例如 \opt{format} 和 \opt{beforeskip}。\opt{label} 选项用于设置习题环境的引用标签,它与标签格式命令 \tn{labelformat} 对应的计数器是 eb@exercise。
+% 第二个 \meta{键值列表} 在是否使用 + 号参数时用法不同,使用 + 号参数时为 \pkg{tcolorbox} 的盒子选项,例如 \opt{boxrule} 和 \opt{fontupper}。不使用 + 号参数时相当于设置 \tn{ctexset}\{section = {\#1}\} 键值选项列表,例如 \opt{format} 和 \opt{beforeskip}。\opt{number} 为短编号形式,应当包含 A、a、I、i、或 1 其中一个符号。\opt{label} 选项用于设置习题环境的引用标签,它与标签格式命令 \tn{labelformat} 对应的计数器是 eb@exercise。
% \end{function}
%
-% \begin{function}{\setexercise,\exerprologue,\tcphanifname}
+% \begin{function}{\setexercise,\exerprologue,\tcphantomifname}
% \begin{syntax}
% \tn{setexercise}\marg{键值列表}
% \tn{exerprologue}\marg{序言内容}
-% \tn{tcphanifname}\marg{编号代码}\marg{不编号代码}
+% \tn{tcphantomifname}\marg{编号代码}\marg{不编号代码}
% \end{syntax}
-% 可以通过 \tn{setexercise} 命令使用键值列表设置上述习题选项的默认值。\tn{exerprologue} 命令在习题环境开始前插入一段内容,可以是文本或者代码,需要在每一个习题环境前使用。\tn{tcphanifname} 命令根据使用 \pkg{tcolorbox} 生成的习题标题是否编号,在超链接锚点的位置加入代码。
+% 可以通过 \tn{setexercise} 命令使用键值列表设置上述习题选项的默认值。\tn{exerprologue} 命令在习题环境开始前插入一段内容,可以是文本或者代码,需要在每一个习题环境前使用。\tn{tcphantomifname} 命令根据使用 \pkg{tcolorbox} 生成的习题标题是否编号,在超链接锚点的位置加入代码,比如使用 \tn{addcontentsline} 命令将习题标题加入目录。
% \end{function}
%
% \begin{ctexexam}
-% \tcphanifname{\markright{\UseCounter{tcbcounter}{\quad 习题}}}{}
+% \tcphantomifname{\markright{\UseCounter{tcbcounter}{\quad 习题}}}{}
% \exerprologue{习题前的一段文本}
% \begin{exercise}+[color = LightSkyBlue](after skip = 3.75ex)[itemsep = 1ex]
% \item 第一题
@@ -1016,12 +1051,13 @@
% \end{function}
%
% \subsection{引用}
-% \begin{function}[added = 2021-01-05,updated = 2021-04-11]{\ref,\labelformat}
+% \begin{function}[added = 2021-01-05,updated = 2021-07-15]{\ref,\footref,\labelformat}
% \begin{syntax}
% \tn{ref}\marg{标签}
+% \tn{footref}\marg{脚注标签}
% \tn{labelformat}\marg{计数器}\marg{标签引用格式}
% \end{syntax}
-% 使用 \tn{ref} 命令引用 \tn{label} 设置的标签,将会检测临近计数器并添加相应的前缀,比如图表、章节标题和定理等。\tn{labelformat} 可以设置标签引用格式,第二个参数中 \#1 代表 \tn{the}\meta{计数器},可以设置引用序号的前缀和后缀。
+% 使用 \tn{ref} 命令引用 \tn{label} 设置的标签,将会检测临近计数器并添加相应的前缀,比如图表、章节标题和定理等。\tn{footref} 对自动编号的脚注进行引用,为上标形式与脚注标记一致。\tn{labelformat} 可以设置标签引用格式,第二个参数中 \#1 代表 \tn{the}\meta{计数器},可以设置引用序号的前缀和后缀。
% \changes{v1.24}{2021/04/11}{取消载入 \pkg{cleveref} 宏包来交叉引用。}
% \end{function}
%
@@ -1096,8 +1132,8 @@
% \pkg{ulem} 宏包提供了多种下划线命令,下划线的粗细由命令 \tn{ULthickness} 控制,重新定义它需要使用 \tn{renewcommand} 命令。下划线的深度由 \tn{ULdepth} 控制,默认值 \tn{maxdimen} 是一个允许深度根据当前字体变化的特殊标志,当然也可以使用 \tn{setlength} 设定特定深度。
% \end{function}
%
-% \section{载入的宏包}
-% 以下为 \cls{easybook} 直接调用的关键宏包,带有 \ding{75} 符号的宏包并未载入它们,仅做了预配置和兼容性处理,可根据需要在导言区手动载入以实现相关的功能。
+% \section{依赖的宏包}
+% 以下为 \pkg{easybase} 直接调用的关键宏包,带有 \ding{75} 符号的宏包并未载入它们,仅做了预配置和兼容性处理,可根据需要在导言区手动载入以实现相关的功能。
% \begin{description}[font = \normalfont\sffamily]
% \item[ctex] 提供中文排版的通用框架。
% \item[xcolor] 提供任意颜色的设定与混合,已载入了 \opt{svgnames} 颜色库。
@@ -1140,20 +1176,26 @@
%
% \bibitem{fduthesis}
% 曾祥东.
-% \newblock \textit{\pkg{fduthesis}:复旦大学论文模板} [EB/OL].
+% \newblock \textit{\pkg{fduthesis}: 复旦大学论文模板} [EB/OL].
% \newblock version 0.7e,
% \newblock (2020-08-30)
% \urlprefix\url{https://github.com/stone-zeng/fduthesis}
%
% \bibitem{source3}
-% \textsc{The \LaTeX3 Project}.
-% \newblock \textit{The \LaTeX3 Interfaces} [CP/OL].
+% \textsc{The \LaTeX~Project Team}.
+% \newblock \textit{The \hologo{LaTeX3} Interfaces} [CP/OL].
% \newblock (2020-10-27)
% \urlprefix\url{https://ctan.org/pkg/l3kernel}
%
+% \bibitem{source2e}
+% \textsc{The \LaTeX~Project Team}.
+% \newblock \textit{The \hologo{LaTeX2e} Sources} [CP/OL].
+% \newblock (2020-10-01)
+% \urlprefix\url{https://www.ctan.org/pkg/source2e}
+%
% \bibitem{胡伟2017latex2e}
% 胡伟.
-% \newblock \textit{\LaTeXe 文类和宏包学习手册} [M].
+% \newblock \textit{\hologo{LaTeX2e} 文类和宏包学习手册} [M].
% \newblock 北京: 清华大学出版社, 2017
%
% \bibitem{刘海洋2013latex入门}
@@ -1161,16 +1203,58 @@
% \newblock \textit{\LaTeX 入门} [M].
% \newblock 北京: 电子工业出版社, 2013
%
+% \bibitem{footmisc}
+% Robin Fairbairns.
+% \newblock \textit{The \pkg{footmisc} package} [EB/OL].
+% \newblock version 5.5b,
+% \newblock (2011-06-06)
+% \urlprefix\url{https://www.ctan.org/pkg/footmisc}
+%
+% \bibitem{thmtools}
+% Dr. Ulrich M. Schwarz, Yukai Chou.
+% \newblock \textit{The \pkg{thmtools} package} [EB/OL].
+% \newblock version 0.72,
+% \newblock (2020-08-01)
+% \urlprefix\url{https://www.ctan.org/pkg/thmtools}
+%
+% \bibitem{fancyhdr}
+% Pieter van Oostrum.
+% \newblock \textit{The \pkg{fancyhdr} package} [EB/OL].
+% \newblock version 4.0.1,
+% \newblock (2020-01-28)
+% \urlprefix\url{https://www.ctan.org/pkg/fancyhdr}
+%
+% \bibitem{caption}
+% Axel Sommerfeldt.
+% \newblock \textit{The \pkg{caption} package} [EB/OL].
+% \newblock version 3.5,
+% \newblock (2020-08-30)
+% \urlprefix\url{https://www.ctan.org/pkg/caption}
+%
+% \bibitem{titletoc}
+% Javier Bezos.
+% \newblock \textit{The \pkg{titletoc} package} [EB/OL].
+% \newblock version 2.13,
+% \newblock (2019-10-16)
+% \urlprefix\url{https://www.ctan.org/pkg/titletoc}
+%
+% \bibitem{tcolorbox}
+% Thomas F. Sturm.
+% \newblock \textit{The \pkg{tcolorbox} package} [EB/OL].
+% \newblock version 4.51,
+% \newblock (2021-06-14)
+% \urlprefix\url{https://www.ctan.org/pkg/tcolorbox}
+%
% \bibitem{xmuthesis}
% Camuse Cao.
-% \newblock \textit{\pkg{xmuthesis}:厦门大学论文模板} [EB/OL].
+% \newblock \textit{\pkg{xmuthesis}: 厦门大学论文模板} [EB/OL].
% \newblock version 0.4.1,
% \newblock (2020-10-09)
% \urlprefix\url{https://github.com/CamuseCao/XMU-thesis}
%
% \bibitem{whuthesis}
% WHUTUG.
-% \newblock \textit{\pkg{whuthesis}:武汉大学论文模板} [EB/OL].
+% \newblock \textit{\pkg{whuthesis}: 武汉大学论文模板} [EB/OL].
% \newblock version 0.6d,
% \newblock (2021-05-20)
% \urlprefix\url{https://github.com/whutug/whu-thesis}
@@ -1180,12 +1264,11 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2021/07/14}{1.27e}
+\ProvidesExplClass{easybook}{2021/07/15}{1.27f}
{Typeset Chinese theses or books}
\bool_set_false:N \l__eb_compile_draft_bool
\bool_set_false:N \l__eb_title_newline_bool
-\bool_set_false:N \l__eb_font_noto_bool
\bool_set_true:N \l__eb_page_twoside_bool
\bool_set_true:N \l__eb_class_book_bool
\tl_new:N \g__eb_config_tl
@@ -1235,10 +1318,10 @@
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 }
}
@@ -1475,7 +1558,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2021/07/14}{1.27e}
+\ProvidesExplPackage{easybase}{2021/07/15}{1.27f}
{Typeset Chinese theses or books}
\cs_generate_variant:Nn \int_to_arabic:n { v }
@@ -1501,15 +1584,20 @@
\seq_set_from_clist:Nn \l_tmpb_seq {#1}
\seq_map_function:NN \l_tmpb_seq #2
}
-\cs_new_protected:Npn \eb_patch_cmd:Nnn #1#2#3
+\cs_new_protected:Npn \eb_char_patch_cmd:nnn #1#2#3
{
- \ctex_patch_cmd_once:NnnnTF #1 { } {#2} {#3}
- { } { \ctex_patch_failure:N #1 }
+ \ExplSyntaxOn\makeatletter
+ \eb_clist_map_inline:nn {#1}
+ {
+ \ctex_patch_cmd_once:NnnnTF ##1 { } {#2} {#3}
+ { } { \ctex_patch_failure:N ##1 }
+ }
+ \ExplSyntaxOff\makeatother
}
-\cs_new_protected:Npn \eb_patch_cmd:nnn #1#2#3
+\cs_new_protected:Npn \eb_at_end_patch_cmd:nnn #1#2#3
{
- \eb_clist_map_inline:nn {#1}
- { \eb_patch_cmd:Nnn ##1 {#2} {#3} }
+ \eb_at_end_preamble:n
+ { \eb_char_patch_cmd:nnn {#1} {#2} {#3} }
}
\cs_new_protected:Npn \eb_preto_cmd:Nn #1#2
{
@@ -1626,6 +1714,20 @@
\keys_define:nn { } { ctex/link .inherit:n = ctex/refset }
\ctex_define:n { link .meta:nn = { ctex/link } {#1} }
\cs_set_eq:NN \link \refset
+\eb_clist_map_inline:nn
+ { style,subfont,spread,bibset,thmset,hdrset,tocset }
+ {
+ \msg_new:nnn { easybase } { ignore-#1 }
+ {
+ ##1~is~an~unknown~option~of~#1. \\
+ Please~check~the~user~manual~for~the~supported~options.
+ }
+ }
+\cs_new:Npn \eb_msg_unknown_option:n #1
+ {
+ \msg_warning:nnx
+ { easybase } { ignore-#1 } { \l_keys_key_str }
+ }
\cs_if_exist:NF \chapter
{
\newcounter{chapter}
@@ -1881,7 +1983,7 @@
}
\ctex_define:nn { hdrset }
{
- fnmargin .dim_set:N = \footnotemargin,
+ fnmargin .dim_set:N = \footnoteindent,
fnmargin .initial:n = 0.75\ccwd,
fnparskip .skip_set:N = \footparskip,
fnparskip .initial:n = 0ex,
@@ -1911,16 +2013,7 @@
{ \tl_set:Nn \l__eb_fnmark_number_choice_tl {#1} },
fnmark-num .value_required:n = true,
- unknown .code:n =
- {
- \msg_warning:nnx
- { easybase } { ignore-hdrset } { \l_keys_key_str }
- }
- }
-\msg_new:nnn { easybase } { ignore-hdrset }
- {
- #1~is~an~unknown~hdrset~option. \\
- Please~check~the~user~manual~for~the~supported~options.
+ unknown .code:n = \eb_msg_unknown_option:n { hdrset }
}
\eb_at_end_preamble:n
@@ -1985,8 +2078,8 @@
{
\hbox_set:Nn \l_tmpa_box
{
- \dim_compare:nNnTF { \footnotemargin } > { 0pt }
- { \hbox_to_wd:nn { \footnotemargin } { \eb@makefnmark\hss } }
+ \dim_compare:nNnTF { \footnoteindent } > { 0pt }
+ { \hbox_to_wd:nn { \footnoteindent } { \eb@makefnmark\hss } }
{ \eb@makefnmark }
}
\dim_set:Nn \leftmargin { \box_wd:N \l_tmpa_box }
@@ -2000,16 +2093,16 @@
}
{
\noindent
- \dim_compare:nNnTF { \footnotemargin } > { 0pt }
- { \hbox_to_wd:nn { \footnotemargin } { \hss\eb@makefnmark } }
+ \dim_compare:nNnTF { \footnoteindent } > { 0pt }
+ { \hbox_to_wd:nn { \footnoteindent } { \hss\eb@makefnmark } }
{
- \dim_compare:nNnTF { \footnotemargin } = { 0pt }
+ \dim_compare:nNnTF { \footnoteindent } = { 0pt }
{ \hbox_overlap_left:n { \eb@makefnmark } }
{
\hbox_overlap_left:n
{
\hbox_to_wd:nn
- { -\footnotemargin }
+ { -\footnoteindent }
{ \eb@makefnmark\hss }
}
}
@@ -2021,7 +2114,10 @@
\tl_if_eq:NnT \l__eb_footnotetype_choice_tl { hang } { \par }
\group_end:
}
-\eb_patch_cmd:nnn { \@footnotetext,\@mpfootnotetext }
+\cs_set_eq:NN \eb@makefntext \@makefntext
+\ctex_at_end_package:nn { footmisc }
+ { \cs_set_eq:NN \@makefntext \eb@makefntext }
+\eb_at_end_patch_cmd:nnn { \@footnotetext,\@mpfootnotetext }
{ \reset@font }
{
\linespread{\fp_use:N \l__eb_spread_footnote_fp}
@@ -2030,6 +2126,13 @@
}
\ProvideDocumentCommand{\super}{mo}{\textsuperscript{#1}}
\providecommand{\spb@textsuperscript@save}{\textsuperscript}
+\providecommand{\footref}[1]
+ {
+ \group_begin:
+ \unrestored@protected@xdef\@thefnmark{\ref{#1}}
+ \group_end:
+ \@footnotemark
+ }
\cs_set:Npn \@makefnmark
{
\hbox:n
@@ -2062,6 +2165,9 @@
\group_end:
}
}
+\cs_new:Npn \Footnote #1 { \Footnotemark{#1}\@footnotetext }
+\cs_new:Npn \Footnotemark #1 { \eb@@makefnmark{#1}\@footnotemark }
+\cs_new:Npn \Footnotetext #1 { \eb@@makefnmark{#1}\@footnotetext }
\cs_new:Npn \eb_fnmark_counter_pifont:N #1
{ \ding{\int_eval:n { 171 + #1 }} }
\cs_new:Npn \eb_fnmark_counter_pifont_neg:N #1
@@ -2082,9 +2188,6 @@
}
{ \int_use:N #1 }
}
-\cs_new:Npn \Footnote #1 { \Footnotemark{#1}\@footnotetext }
-\cs_new:Npn \Footnotemark #1 { \eb@@makefnmark{#1}\@footnotemark }
-\cs_new:Npn \Footnotetext #1 { \eb@@makefnmark{#1}\@footnotetext }
\cs_new:Npn \eb_alph:n #1 { \int_to_alph:v { c@#1 } }
\cs_set:Npn \thefootnote { \eb_footnote_counter:N \c@footnote }
\cs_set:Npn \thempfootnote { \eb_alph:n { mpfootnote } }
@@ -2108,7 +2211,8 @@
{ \tl_put_right:cn { l__eb_toc_#1_format_tl } {##1} },
#1/indent .dim_set:c = l__eb_toc_#1_indent_dim,
#1/rule .tl_set:c = l__eb_toc_#1_rule_tl,
- #1/numsep .dim_set:c = eb@toc@#1@numsep
+ #1/numsep .dim_set:c = eb@toc@#1@numsep,
+ #1/unknown .code:n = \eb_msg_unknown_option:n { tocset }
}
\seq_if_in:NnF \c__ctex_headings_seq { subparagraph }
{
@@ -2150,6 +2254,7 @@
}
}
+\cs_set_eq:NN \ctexnumberline \CTEXnumberline
\cs_set:Npn \CTEXnumberline #1
{
\CTEXifname
@@ -2409,16 +2514,7 @@
equation-con = #1
},
number-con .initial:n = { . },
- unknown .code:n =
- {
- \msg_warning:nnx
- { easybase } { ignore-style } { \l_keys_key_str }
- }
- }
-\msg_new:nnn { easybase } { ignore-style }
- {
- #1~is~an~unknown~style~option. \\
- Please~check~the~user~manual~for~the~supported~options.
+ unknown .code:n = \eb_msg_unknown_option:n { style }
}
\eb_clist_map_inline:nn
{ figure,table,lstlisting,equation }
@@ -2600,8 +2696,7 @@
\ctex_assign_heading_name:nn { biappendix } {#1}
\int_compare:nNnTF { \c@chapter } > { 0 }
{
- \ExplSyntaxOn\char_set_catcode_letter:N \@
- \eb_patch_cmd:Nnn \CTEX@addbitocline
+ \eb_char_patch_cmd:nnn \CTEX@addbitocline
{
\def\CTEX@prechapter{\CTEX@prebichapter}
\def\CTEX@thechapter{\CTEX@bichapter@number}
@@ -2612,7 +2707,6 @@
\def\CTEX@thechapter{#2}
\def\CTEX@postchapter{\CTEX@postbiappendix}
}
- \ExplSyntaxOff\char_set_catcode_other:N \@
\gdef\thechapter{\@Alph\c@chapter}
\gdef\thebichapter{\@Alph\c@bichapter}
\gdef\CTEX@prechapter{\CTEX@preappendix}
@@ -2658,7 +2752,8 @@
}
{ \tl_set:Nn \l__eb_subfont_math_choice_tl {#1} },
math .value_required:n = true,
- math .initial:n = times
+ math .initial:n = times,
+ unknown .code:n = \eb_msg_unknown_option:n { subfont }
}
\cs_new_protected:Npn \eb_put_newtxmath:n #1
@@ -2694,9 +2789,9 @@
math .fp_set:N = \l__eb_spread_math_fp,
math .initial:n = 1.05,
caption .fp_set:N = \l__eb_spread_caption_fp,
- caption .initial:n = 1,
+ caption .initial:n = 1.1,
footnote .fp_set:N = \l__eb_spread_footnote_fp,
- footnote .initial:n = 1,
+ footnote .initial:n = 1.1,
spread-all .meta:n =
{
line = #1,
@@ -2704,7 +2799,8 @@
math = #1,
caption = #1,
footnote = #1
- }
+ },
+ unknown .code:n = \eb_msg_unknown_option:n { spread }
}
\DeclareCaptionLabelSeparator{ccwd}{\hspace{\ccwd}}
@@ -2902,7 +2998,8 @@
thmbox .default:n = true,
thmbox .initial:n = false,
brackets .code:n = \eb_assign_tag_brackets:n {#1},
- brackets .initial:n = { (,) }
+ brackets .initial:n = { (,) },
+ unknown .code:n = \eb_msg_unknown_option:n { thmset }
}
\ctex_set:nn { thmset }
{
@@ -2967,13 +3064,14 @@
\linespread{\fp_use:N \l__eb_spread_math_fp}
\selectfont\ignorespaces
}
-\eb_patch_cmd:nnn { \start@gather,\start@align,\start@multline }
+\eb_at_end_patch_cmd:nnn
+ { \start@gather,\start@align,\start@multline }
{ \collect@body }
{
\linespread{\fp_use:N \l__eb_spread_math_fp}
\selectfont\collect@body
}
-\eb_patch_cmd:Nnn \gather@split
+\eb_at_end_patch_cmd:nnn \gather@split
{ \spread@equation }
{
\linespread{\fp_use:N \l__eb_spread_math_fp}
@@ -3031,7 +3129,8 @@
{ \tl_set:Nn \l__eb_bib_cite_style_tl {#1} },
datafile .clist_set:N = \l__eb_bib_datafile_clist,
bitoc-title .tl_set:N = \l__eb_bib_en_bitoc_title_tl,
- bitoc-title .initial:n = Reference
+ bitoc-title .initial:n = Reference,
+ unknown .code:n = \eb_msg_unknown_option:n { bibset }
}
\cs_new_protected:Npn \BibtexPreSet
@@ -3332,7 +3431,7 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2021/07/14}{1.27e}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2021/07/15}{1.27f}
{Customization of tcolorbox for easybook}
\cs_new_protected:Npn \eb_tcb_theorem_set:n #1
@@ -3386,12 +3485,12 @@
\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} }
-\cs_new:Npn \tcphanifname #1#2
+\cs_new:Npn \tcphantomifname #1#2
{
\tl_gset:Nn \eb@tc@exercise@ifnametrue {#1}
\tl_gset:Nn \eb@tc@exercise@ifnamefalse {#2}
}
-\tcphanifname
+\tcphantomifname
{
\markright
{