summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/easybook/easybook.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-04-10 03:01:32 +0000
committerNorbert Preining <norbert@preining.info>2021-04-10 03:01:32 +0000
commit5960076e4c9c15e2a052cf015dd697a65db3150d (patch)
treec146e929cbd0ac73adbdd2ca10c6fe02bbe0f7c0 /macros/latex/contrib/easybook/easybook.dtx
parent8ccafc1be8d24ff0c4126d40847afbedab7fc7fb (diff)
CTAN sync 202104100301
Diffstat (limited to 'macros/latex/contrib/easybook/easybook.dtx')
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx186
1 files changed, 121 insertions, 65 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index 5ca915335b..ff3a9f73fb 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/08\hskip\ccwd\relax v1.24h\thanks{\url{https://gitee.com/texl3/easybook}}}
+% \date{2021/04/09\hskip\ccwd\relax v1.24i\thanks{\url{https://gitee.com/texl3/easybook}}}
% \maketitle
% \begin{abstract}
% \cls{easybook} 是基于 \cls{ctexbook} 书籍文档类创建以极简为风格的模板,可以看作对 \cls{ctexbook} 的进一步包装。虽然\CTeX 文档类提供了较好的中文支持,但想实现个性化功能一般需要在其基础上载入更多宏包来定制。\cls{easybook} 考虑了一些细节并载入一些常用宏包实现一般的排版需求,它适用于排版中英文书籍或笔记,甚至可稍加调整成为学位论文模板。
@@ -171,7 +171,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.24h}{2021/04/04}{目录命令的可选参数增加标题键值。}
+% \changes{v1.24i}{2021/04/04}{目录命令的可选参数增加标题键值。}
% \end{function}
%
% \section{接口选项}
@@ -210,7 +210,7 @@ The latest version of this license is in
% multoc = <true|(false)>
% withpart = <true|(false)>
% footwith = <part|(chapter)|page>
-% notomath = <true|(false)>
+% notomath = <(true)|false>
% rulewidth = <(0.75pt)>
% uppercase = <(true)|false>
% figure-sep = <(.)>
@@ -238,7 +238,7 @@ The latest version of this license is in
% \item[multoc] 开启双栏目录,可与 \opt{onecolumn} 和 \opt{twocolumn} 选项配合出单栏正文、单栏目录,双栏正文、单栏目录,单栏正文、双栏目录和双栏正文、双栏目录四种方式。
% \item[withpart] 使章跟随每一部分编号,默认不跟随。
% \item[footwith] 使脚注跟随编号的计数器,默认跟随章,当开启新的一章时脚注编号从1开始。
-% \item[notomath] 使用 \opt{noto} 风格的数学字体,将会加载 \pkg{newtxmath} 宏包。此选项默认关闭,此时可以使用 \pkg{unicode-math} 等宏包自定义数学字体。
+% \item[notomath] 使用 \opt{noto} 风格的数学字体,将会加载 \pkg{newtxmath} 宏包。关闭此选项时可以使用 \pkg{unicode-math} 等宏包自定义数学字体。
% \item[rulewidth] 调整页眉、定理盒子以及代码框线条的粗细。
% \item[uppercase] 使用 \tn{rightmark} 及 \tn{leftmark} 获取标题内容设置页眉页脚时英文是否大小写。
% \item[figure-sep] 图片标题编号的连接符。
@@ -259,7 +259,7 @@ The latest version of this license is in
% \ding{229} 以上选项路径为 \opt{link/...} \\
% \opt{link} 将超链接选项(包括以上选项)交给 \pkg{hyperref} 处理,除了一些关于 pdf 书签的选项可能会失效,其它由键值选项命令 \tn{hypersetup} 支持的多数选项可用。
% \changes{v1.10}{2021/01/08}{修复了 \opt{linktopage} 选项关闭时目录中标题编号无超链接的问题。}
-% \changes{v1.24h}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。}
+% \changes{v1.24i}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。}
% \end{function}
%
% \begin{optdesc}
@@ -324,8 +324,9 @@ The latest version of this license is in
%
% \subsection{参考文献}
% \label{subsec:reference}
-% \begin{function}[EXP,added = 2021-01-11,updated = 2021-03-15]{backend,bib-style,cite-style,bibfile}
+% \begin{function}[EXP,added = 2021-01-11,updated = 2021-04-09]{bib-loadpkg,backend,bib-style,cite-style,bibfile}
% \begin{syntax}
+% bib-loadpkg = <(true)|false>
% backend = <(bibtex)|biblatex>
% bib-style = <(numerical)|authoryear|其它格式>
% cite-style = <标注风格>
@@ -334,29 +335,37 @@ 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.24i}{2021/04/09}{可以不载入参考文献包手动配置参考文献格式。}
% \end{function}
%
% \begin{optdesc}
+% \item[bib-loadpkg] 是否载入 \pkg{natbib} 或 \pkg{biblatex} 宏包,关闭此选项后需要在导言区手动载入参考文献宏包,之后可使用相关配置命令(见下文)或完全自行设置参考文献。
% \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[bibfile] 参考文献的数据文件,使用 \hologo{biber} 处理时要带有 \opt{bib} 后缀,默认为一个以 \opt{refs.bib} 命名的文件。
+% \item[bibfile] 参考文献数据库的文件名,使用 \hologo{biber} 处理时要带有 \opt{bib} 后缀,若不在当前文件夹名称需要包含路径,默认是一个在当前文件夹以 \opt{refs.bib} 命名的文件。
% \end{optdesc}
%
-% \begin{function}[added = 2021-01-11,updated = 2021-03-15]{\printbibliography}
+% \begin{function}[added = 2021-01-11,updated = 2021-04-09]{\printbibliography,\EbBibtexSet,\EbBiblatexPreset,\EbBiblatexPostset}
% \begin{syntax}
% \tn{printbibliography}\oarg{键值列表}
% \end{syntax}
-% 两种方式\textbf{均使用}此命令打印参考文献,不同处理后端此命令的键值列表不同。使用 \hologo{BibTeX} 处理时选项与小节 \ref{subsec:document command} 目录的选项相同,使用 \hologo{biber} 处理时常用的选项如下
+% 关闭 \opt{bib-loadpkg} 选项时 \opt{bibset} 中的选项会失效,但是后三个命令保存了 \opt{bibset} 模块预置的参考文献选项与配置,与对应宏包配合使用它们时 \opt{bibset} 中的选项仍然有效,也可以不使用它们完全自行设置参考文献方案。开启 \opt{bib-loadpkg} 选项对它们重新定义也可以达到重新设置参考文献的效果。
% \end{function}
%
-% \begin{function}{heading,title}
-% \begin{syntax}
-% heading = <bibliography|subbibliography|(bibintoc)|subbibintoc>
-% title = <参考文献标题名>
-% \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}
+% \begin{optdesc}
+% \item[\tn{printbibliography}] 两种方式\textbf{均使用}此命令打印参考文献,不同处理后端此命令的键值列表不同。使用 \hologo{BibTeX} 处理时选项与小节 \ref{subsec:document command} 目录的选项相同,使用 \hologo{biber} 处理时常用的选项如下
+% \begin{function}{heading,title}
+% \begin{syntax}
+% heading = <bibliography|subbibliography|(bibintoc)|subbibintoc>
+% title = <参考文献标题名>
+% \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{EbBibtexSet}] 这是 \pkg{natbib} 宏包的配置命令,需要与 \pkg{natbib} 配合并放在载入其之后使用,默认保存了参考文献风格和标题的设置。
+% \item[\tn{EbBiblatexPreset}] 这是 \pkg{biblatex} 宏包的前配置命令,需要与 \pkg{biblatex} 配合并放在载入其之前使用,默认保存了参考文献风格的设置。若重新定义可使用 \tn{PassOptionsToPackage} 命令向 \pkg{biblatex} 传递它支持的各种参考文献选项。
+% \item[\tn{EbBiblatexPostset}] 这是 \pkg{biblatex} 宏包的后配置命令,需要与 \pkg{biblatex} 配合并放在载入其之后使用,默认保存了参考文献标题的设置。
+% \end{optdesc}
%
% \subsection{定理样式}
% \label{subsec:theorem of style}
@@ -455,21 +464,25 @@ The latest version of this license is in
%
% \subsection{页眉页脚}
% \label{subsec:header and footer}
-% \begin{function}[EXP,added = 2021-01-13,updated = 2021-04-06]{head-foot,chap-mark,sec-mark,headrule,footrule,footnoterule}
+% \begin{function}[EXP,added = 2021-01-13,updated = 2021-04-09]{head-foot,chap-mark,sec-mark,subsec-mark,headrule,footrule,footnoterule}
% \begin{syntax}
% head-foot = <页眉页脚中的内容>
-% chap-mark = <\tn{chaptermark} 标志命令的定义>
-% sec-mark = <\tn{sectionmark} 标志命令的定义>
+% chap-mark = <\tn{chaptermark} 标志命令的内容>
+% sec-mark = <\tn{sectionmark} 标志命令的内容>
+% subsec-mark = <\tn{subsectionmark} 标志命令的内容>
% headrule = <页眉横线格式>
% footrule = <页脚横线格式>
% footnoterule = <脚注横线格式>
% \end{syntax}
% \ding{229} 以上选项路径为 \opt{hdrset/...} \\
-% \opt{hdrset} 设置的命令由 \pkg{fancyhdr} 宏包提供支持。章节标志选项 \opt{chap-mark} 和 \opt{sec-mark} 中参数\#1代表当前章或节的标题。\opt{headrule}、\opt{footrule} 和 \opt{footnoterule} 三个横线选项一般可以使用 \tn{hrule} width \meta{长度} height \meta{高度} 命令来绘制,脚注横线默认为空。当然,手动绘制横线时线条粗细选项 \opt{style/rulewidth} 会失效。
+% \opt{hdrset} 设置的命令由 \pkg{fancyhdr} 宏包提供支持。设置章节标志选项 \opt{chap-mark}、\opt{sec-mark} 和 \opt{subsec-mark} 时已做了情形考虑,不需要使用 \tn{markboth} 或 \tn{markright} 命令,其中参数\#1代表当前章、节或小节的标题。\opt{chap-mark} 和 \opt{sec-mark} 选项在 \opt{book} 模式时有意义,\opt{sec-mark} 和 \opt{subsec-mark} 选项在 \opt{article} 模式时有意义,这与标准文档类的行为一致。也可以直接重新定义这些标志命令,但此时 \opt{style/uppercase} 选项失效,这时可以用例如 \tn{MakeUppercase} 命令来设置标志内容的大小写。
+%
+% \opt{headrule}、\opt{footrule} 和 \opt{footnoterule} 三个横线选项一般可以使用 \tn{hrule} width \meta{长度} height \meta{高度} 命令来绘制,脚注横线默认为空。当然,手动绘制横线时线条粗细选项 \opt{style/rulewidth} 会失效。
% \changes{v1.21}{2021/01/11}{修复单面文档时页眉横线消失的问题。}
% \changes{v1.21}{2021/01/13}{增加配置页眉页脚的选项。}
-% \changes{v1.23}{2021/03/08}{优化页眉页脚设置,增加 \opt{chap-mark} 和 \opt{sec-mark} 选项。}
+% \changes{v1.23}{2021/03/08}{优化页眉页脚设置,增加 \opt{chap-mark} 和 \opt{sec-mark} 标志选项。}
% \changes{v1.23}{2021/03/14}{可以手动绘制页眉、页脚和脚注的横线。}
+% \changes{v1.24i}{2021/04/09}{增加 \opt{subsec-mark} 标志选项,仅在 \opt{article} 模式生效。}
% \end{function}
%
% \begin{function}[added = 2021-01-13,updated = 2021-03-14]{\easyhead,\easyfoot}
@@ -529,8 +542,8 @@ The latest version of this license is in
% \end{ctexexam}
%
% \opt{belowoffset} 选项为主目录标题 \tn{contentsname} 后的间距补偿,一般为负值,用于抵消 \opt{format} 中设置的垂直间距。\opt{lists} 中的 \opt{belowoffset} 与之意义类似,但是一般为正值,可以在 \opt{article} 模式中使用。建议 \opt{lists/lolskip(0.8pc) + lists/format/addvspace(0.2pc) + lists/belowoffset(0pc) = belowoffset(-1pc)}。\opt{line-align} 选项可以使目录引导线右边对齐并与页码保持一定间隙,否则会与页码连接。
-% \changes{v1.24h}{2021/04/05}{可以设置图、表和代码目录的标签。}
-% \changes{v1.24h}{2021/04/06}{增加目录引导线右边对齐方式。}
+% \changes{v1.24i}{2021/04/05}{可以设置图、表和代码目录的标签。}
+% \changes{v1.24i}{2021/04/06}{增加目录引导线右边对齐方式。}
% \end{function}
%
% \begin{function}[added = 2021-01-13,updated = 2021-04-06]{\tocrule}
@@ -576,7 +589,7 @@ The latest version of this license is in
% \begin{itemize}[label = \textbullet]
% \begin{description}[font = \sffamily\bfseries,style = nextline]
% \end{ctexexam}
-% \changes{v1.24h}{2021/04/08}{重新优化列表环境的配置。}
+% \changes{v1.24i}{2021/04/08}{重新优化列表环境的配置。}
% \end{function}
%
% \subsubsection{排序列表}
@@ -770,7 +783,7 @@ The latest version of this license is in
% \tn{bicaptionbox}\oarg{目录标题1}\marg{标题2}\oarg{目录标题1}\marg{标题2}
% \ \oarg{宽度}\oarg{内部位置}\marg{内容}
% \end{syntax}
-% 可以实现中英文双语标题,使用此功能需要在导言区载入 \pkg{bicaption} 宏包,具体用法见说明文档。
+% 可以实现图表浮动环境的中英文双语标题,使用此功能需要在导言区载入 \pkg{bicaption} 宏包,具体用法见说明文档。
% \end{function}
%
% \subsection{插入文档}
@@ -838,7 +851,7 @@ The latest version of this license is in
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2021/04/08}{1.24h}{beta}
+\ProvidesExplClass{easybook}{2021/04/09}{1.24i}{beta}
\cs_generate_variant:Nn \__ctex_define:nn {nx}
\cs_generate_variant:Nn \int_to_arabic:n {v}
@@ -852,6 +865,8 @@ The latest version of this license is in
{\ctex_patch_cmd_once:NnnnTF #1{}{#2}{#3}{}{\ctex_patch_failure:N #1}}
\cs_new_protected:Npn \__eb_appto_cmd:Nn #1#2
{\ctex_appto_cmd:NnnTF #1{}{#2}{}{\ctex_patch_failure:N #1}}
+\cs_new_protected:Npn \__eb_at_end_preamble:n
+ {\ctex_gadd_ltxhook:nn {env/document/before}}
\bool_set_false:N \l__eb_draft_bool
\bool_set_false:N \l__eb_newline_bool
@@ -957,7 +972,7 @@ The latest version of this license is in
withpart .initial:n = false,
notomath .bool_set:N = \l__eb_notomath_bool,
notomath .default:n = true,
- notomath .initial:n = false,
+ notomath .initial:n = true,
rulewidth .dim_set:N = \l__eb_rule_width_dim,
rulewidth .initial:n = 0.75pt,
uppercase .bool_set:N = \l__eb_uppercase_bool,
@@ -1110,7 +1125,8 @@ The latest version of this license is in
\cs_new_protected:Npn \kaishu{\__eb_switch_family:n {kaishu}}
\cs_new_protected:Npn \fangsong{\__eb_switch_family:n {fangsong}}
}
-\cs_if_exist:NF \kaishu{\cs_gset_eq:NN \kaishu\normalfont}
+\__eb_at_end_preamble:n
+ {\cs_if_exist:NF \kaishu{\cs_gset_eq:NN \kaishu\normalfont}}
\includepdfset{fitpaper = true}
\geometry
@@ -1178,6 +1194,7 @@ The latest version of this license is in
\easyhead[OC]{\color{ctex@frame}\kaishu\rightmark}
\easyhead[EL,OR]{\color{ctex@frame}\thepage}
},
+
chap-mark .cs_set:Np = \__eb_fancyhf_chap_mark:n #1,
chap-mark .initial:n =
{
@@ -1200,6 +1217,17 @@ The latest version of this license is in
\fi
}#1
},
+ subsec-mark .cs_set:Np = \__eb_fancyhf_subsec_mark:n #1,
+ subsec-mark .initial:n =
+ {
+ \int_compare:nT {\c@secnumdepth > 1}
+ {
+ \ifodd\CTEX@subsection@numbering
+ \CTEXthesubsection\hspace{0.5\ccwd}
+ \fi
+ }#1
+ },
+
headrule .tl_gset:N = \headrule,
headrule .initial:n =
{
@@ -1226,35 +1254,56 @@ The latest version of this license is in
{\text_uppercase:n {\__eb_fancyhf_chap_mark:n {#1}}}
{\text_titlecase_first:n {\__eb_fancyhf_chap_mark:n {#1}}}
}
+\cs_new_protected:Npn \__eb_ifupper_sectionmark_set:n #1
+ {
+ \bool_if:NTF \l__eb_uppercase_bool
+ {\text_uppercase:n {\__eb_fancyhf_sec_mark:n {#1}}}
+ {\text_titlecase_first:n {\__eb_fancyhf_sec_mark:n {#1}}}
+ }
+\cs_new_protected:Npn \__eb_ifupper_subsectionmark_set:n #1
+ {
+ \bool_if:NTF \l__eb_uppercase_bool
+ {\text_uppercase:n {\__eb_fancyhf_subsec_mark:n {#1}}}
+ {\text_titlecase_first:n {\__eb_fancyhf_subsec_mark:n {#1}}}
+ }
\ctex_at_end_preamble:n
{
\exp_args:NV \geometry\g__eb_geometry_clist
- \pagestyle{fancy}
\fancyhf{}
- \bool_if:NTF \l__eb_page_twoside_bool
+ \tl_use:N \l__eb_fancyhf_content_tl
+ \cs_gset_eq:NN \ps@plain\ps@empty
+ \pagestyle{fancy}
+ \bool_if:NTF \l__eb_class_book_bool
{
- \cs_gset:Npn \chaptermark#1
+ \bool_if:NTF \l__eb_page_twoside_bool
{
- \markboth
- {\__eb_ifupper_chaptermark_set:n {#1}}
- {\__eb_ifupper_chaptermark_set:n {#1}}
+ \cs_gset:Npn \chaptermark#1
+ {
+ \markboth
+ {\__eb_ifupper_chaptermark_set:n {#1}}
+ {\__eb_ifupper_chaptermark_set:n {#1}}
+ }
+ }{
+ \cs_gset:Npn \chaptermark#1
+ {\markboth{\__eb_ifupper_chaptermark_set:n {#1}}{}}
}
- \l__eb_fancyhf_content_tl
- \cs_gset_eq:NN \ps@plain\ps@empty
+ \cs_gset:Npn \sectionmark#1
+ {\markright{\__eb_ifupper_sectionmark_set:n {#1}}}
}{
- \cs_gset:Npn \chaptermark#1
- {\markboth{\__eb_ifupper_chaptermark_set:n {#1}}{}}
- \l__eb_fancyhf_content_tl
- \cs_gset_eq:NN \ps@plain\ps@empty
- }
- \cs_gset:Npn \sectionmark#1
- {
- \markright
+ \bool_if:NTF \l__eb_page_twoside_bool
{
- \bool_if:NTF \l__eb_uppercase_bool
- {\text_uppercase:n {\__eb_fancyhf_sec_mark:n {#1}}}
- {\text_titlecase_first:n {\__eb_fancyhf_sec_mark:n {#1}}}
+ \cs_gset:Npn \sectionmark#1
+ {
+ \markboth
+ {\__eb_ifupper_sectionmark_set:n {#1}}
+ {\__eb_ifupper_sectionmark_set:n {#1}}
+ }
+ }{
+ \cs_gset:Npn \sectionmark#1
+ {\markboth{\__eb_ifupper_sectionmark_set:n {#1}}{}}
}
+ \cs_gset:Npn \subsectionmark#1
+ {\markright{\__eb_ifupper_subsectionmark_set:n {#1}}}
}
\bool_if:NT \l__eb_draft_bool
{
@@ -1401,7 +1450,7 @@ The latest version of this license is in
{\text_uppercase:n {#1}}
{\text_titlecase_first:n {#1}}
}
-\cs_new_protected:Npn \eb@markboth#1
+\cs_new_protected:Npn \eb@markdouble#1
{
\bool_if:NTF \l__eb_page_twoside_bool
{
@@ -1432,14 +1481,14 @@ The latest version of this license is in
\section*{\phantomsection#1}
\CTEX@addtocline{section}{#1}
}
- \eb@markboth{#1}
+ \eb@markdouble{#1}
}
\cs_new_protected:Npn \__eb_title_mark_notoc:n #1
{
\tl_if_eq:NnTF \l__eb_toc_type_tl{book}
{\chapter*{\phantomsection#1}}
{\section*{\phantomsection#1}}
- \eb@markboth{#1}
+ \eb@markdouble{#1}
}
\cs_new_protected:Npn \__eb_ifmultoc_pre_set:
{
@@ -1540,7 +1589,7 @@ The latest version of this license is in
}
\ctex_patch_cmd:Nnn \imki@indexheaders
{\@mkboth{\MakeUppercase\indexname}{\MakeUppercase\indexname}}
- {\eb@markboth{\indexname}}
+ {\eb@markdouble{\indexname}}
}
\tl_new:N \l__eb_font_table_tl
@@ -1815,7 +1864,7 @@ The latest version of this license is in
name = \use:c {c__eb_name_#1_tl}
]{#1}
}
- \cs_gset_eq:NN \proof\relax
+ \cs_undefine:N \proof
\declaretheorem[
style = easy-thm-sty,
name = \c__eb_name_remark_tl,
@@ -2056,10 +2105,14 @@ The latest version of this license is in
cite-style .code:n =
{\tl_set:Nn \l__eb_bib_citestyle_tl{#1}},
bibfile .tl_set:N = \l__eb_bib_file_tl,
- bibfile .initial:n = refs.bib
+ bibfile .initial:n = refs.bib,
+
+ bib-loadpkg .bool_set:N = \l__eb_bib_loadpkg_bool,
+ bib-loadpkg .default:n = true,
+ bib-loadpkg .initial:n = true
}
-\cs_new_protected:Npn \__eb_bibtex_set:
+\cs_new_protected:Npn \EbBibtexSet
{
\tl_if_empty:NTF \l__eb_bib_otherstyle_tl
{
@@ -2089,7 +2142,7 @@ The latest version of this license is in
}
\cs_new_protected:Npn \__eb_put_biblatex:n #1
{\PassOptionsToPackage{#1}{biblatex}}
-\cs_new_protected:Npn \__eb_biblatex_pre_set:
+\cs_new_protected:Npn \EbBiblatexPreset
{
\tl_if_empty:NTF \l__eb_bib_otherstyle_tl
{
@@ -2102,23 +2155,26 @@ The latest version of this license is in
{\__eb_put_biblatex:n {citestyle = \l__eb_bib_citestyle_tl}}
\__eb_put_biblatex:n {backend = biber}
}
-\cs_new_protected:Npn \__eb_biblatex_post_set:
+\cs_new_protected:Npn \EbBiblatexPostset
{
\exp_args:NV \addbibresource\l__eb_bib_file_tl
\cs_gset:Npn \blx@default@theheading{bibintoc}
\defbibheading{bibintoc}[\bibname]{\__eb_title_mark_intoc:n {##1}}
\skip_set:Nn \bibitemsep{0ex}
}
-\ctex_at_end_preamble:n
+\__eb_at_end_preamble:n
{
- \bool_if:NTF \l__eb_backend_bibtex_bool
+ \bool_if:NT \l__eb_bib_loadpkg_bool
{
- \RequirePackage[sort&compress]{natbib}
- \__eb_bibtex_set:
- }{
- \__eb_biblatex_pre_set:
- \RequirePackage{biblatex}
- \__eb_biblatex_post_set:
+ \bool_if:NTF \l__eb_backend_bibtex_bool
+ {
+ \RequirePackage[sort&compress]{natbib}
+ \EbBibtexSet
+ }{
+ \EbBiblatexPreset
+ \RequirePackage{biblatex}
+ \EbBiblatexPostset
+ }
}
}
@@ -2354,7 +2410,7 @@ The latest version of this license is in
\keys_set_known:nn {ctex}
{
abstractname = Abstract,
- lstlistlistingname = List~of~Listings,
+ lstlistlistingname = List~of~Codes,
lstlistingname = Code
}
\crefformat{equation}{#2Equation~(#1)#3}