summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/easybook
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-06-15 03:01:03 +0000
committerNorbert Preining <norbert@preining.info>2021-06-15 03:01:03 +0000
commit2faf2507ca4d1d6d153f4c2b4c4c78479d459f06 (patch)
treee0f2305625e9b7254276aac23ed0253b6a6c0f60 /macros/latex/contrib/easybook
parent269940e8e52b921a855083542b9e1109af49af09 (diff)
CTAN sync 202106150301
Diffstat (limited to 'macros/latex/contrib/easybook')
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx248
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin326389 -> 328635 bytes
2 files changed, 100 insertions, 148 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index d370d08b56..c07e0d03c3 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/06/13\hskip\ccwd\relax v1.26a\thanks{\url{https://gitee.com/texl3/easybook}}}
+% \date{2021/06/14\hskip\ccwd\relax v1.26b\thanks{\url{https://gitee.com/texl3/easybook}}}
%
% \maketitle
% \begin{abstract}
@@ -197,13 +197,13 @@
% pagestyle = <标题页的页面格式>
% \end{syntax}
% \opt{multoc} 与 \opt{style/multoc} 选项具有相同的效果,但是具有优先性且可单独设置不同目录是否多栏排版,默认为双栏,可使用 \opt{columns} 更改。\opt{title} 选项用于更改目录的标题,标题之间用一个英文逗号分开,也可以只有一部分,表示中文目录的标题。当设置了英文目录标题时,英文目录标题将会自动加入主文档目录,与 \tn{tableofcontents+} 配合输出。
-%
-% 在书籍模式且 \opt{chapter} 选项开启或者文章模式的情况下,\opt{format} 用于设置目录标题的格式,\opt{aftertitle} 选项的代码将被插入到目录标题内容之后,\opt{pagestyle} 是目录标题所在页的页面格式,除此之外还支持 \opt{ctexset/chapter} 或 \opt{ctexset/section} 所有的章节标题样式选项。\opt{chapter} 选项使目录标题按照 chapter 级别输出,\opt{section} 选项使目录标题按照 section 级别输出,默认为 chapter 级别。
% \changes{v1.23}{2021/03/15}{为几个目录增加键值列表的选项,可设置标题输出级别以及是否加入主目录。}
% \changes{v1.24}{2021/04/04}{目录命令的可选参数增加标题键值。}
% \changes{v1.25}{2021/06/02}{目录可设置多栏,并在 article 模式仍然生效。}
% \end{function}
%
+% 在书籍模式且 \opt{chapter} 选项开启或者文章模式的情况下,\opt{format} 用于设置目录标题的格式,\opt{aftertitle} 选项的代码将被插入到目录标题内容之后,\opt{pagestyle} 是目录标题所在页的页面格式,除此之外还支持 \opt{ctexset/chapter} 或 \opt{ctexset/section} 所有的章节标题样式选项。\opt{chapter} 选项使目录标题按照 chapter 级别输出,\opt{section} 选项使目录标题按照 section 级别输出,默认为 chapter 级别。
+%
% \subsubsection{标题命令}
% \begin{function}[added = 2021-05-05,updated = 2021-06-13]{\bichapter,\bisection,\bisubsection}
% \begin{syntax}
@@ -212,11 +212,11 @@
% \tn{bisubsection*}\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}
% \end{syntax}
% 双语目录的标题命令目前设置了常用的三个级别,它们将中文标题正常输出,并使中英文标题加入双语目录。类似于标准文档类,这三个标题命令分别具有 bichapter、bisection 和 bisubsection 三个计数器,并对应 \tn{the}\meta{计数器} 的值,可以用于 \opt{binumber} 选项更改英文目录中的编号。这个功能是为国内一些高校的学位论文模板的要求设计,在一般情况和英文模式下 \textbf{不需要使用}。
-%
-% 它们的星号变体命令使文中标题不编号,但是仍然加入双语目录,若英文标题参数空置那么仅加入中文目录而不加入英文目录,这一特点与 \tn{chapter*} 等命令的行为不太一样,在一些情况下会用到。可选参数是目录中的中文标题,默认与中文标题一致,正文标题过长时可用它设置在目录中显示的标题。双语目录的格式默认是一致的,共享使用 \tn{tocset} 的设置,英文目录的章级别标题名及编号的修改方式如下
% \changes{v1.25}{2021/05/05}{增加与双语目录配合的标题命令。}
% \end{function}
%
+% 它们的星号变体命令使文中标题不编号,但是仍然加入双语目录,若英文标题参数空置那么仅加入中文目录而不加入英文目录,这一特点与 \tn{chapter*} 等命令的行为不太一样,在一些情况下会用到。可选参数是目录中的中文标题,默认与中文标题一致,正文标题过长时可用它设置在目录中显示的标题。双语目录的格式默认是一致的,共享使用 \tn{tocset} 的设置,英文目录的章级别标题名及编号的修改方式如下
+%
% \begin{function}{chapter/biname,chapter/binmuber}
% \begin{syntax}
% biname = \{<英文目录前名字|(Chapter\tn{space})>,<英文目录后名字>\}
@@ -231,9 +231,9 @@
% \tn{EBeforeAddBitoc*}\marg{加入目录英文标题前的代码}
% \end{syntax}
% \tn{appendix} 命令后的章节标题变为附录形式。英文目录中附录标题的格式用可选参数修改,英文附录目录前名字默认为 Appendix\tn{space},后名字默认为空,名字之间用一个半角逗号分开,也可以只有一部分,表示英文附录目录前名字。英文附录目录数字输出命令默认为 \tn{Alph}\{chapter\}。
+% \end{function}
%
% \tn{EBeforeAddBitoc} 是一个作用于局部范围的英文目录钩子,可以插入标题或目录设置的命令改变英文目录中标题的显示格式,也可以覆盖上述的目录前后名字和编号等设置,带有星号的命令会重置之前的代码,放置在导言区或 \tn{bichapter} 等命令前生效。
-% \end{function}
%
% \section{接口选项}
% \label{sec:interface options}
@@ -264,14 +264,14 @@
% multoc = <true|(false)>
% withpart = <true|(false)>
% footwith = <part|(chapter)|page>
-% rulewidth = <(0.75pt)>
+% rulewidth = <线宽|(0.75pt)>
% uppercase = <(true)|false>
-% figure-sep = <(.)>
-% table-sep = <(.)>
-% listing-sep = <(.)>
-% equation-sep = <(.)>
-% number-sep = <(.)>
-% figurepath = \{\{路径名1\}\{路径名2\}\}
+% figure-sep = <符号|(.)>
+% table-sep = <符号|(.)>
+% listing-sep = <符号|(.)>
+% equation-sep = <符号|(.)>
+% number-sep = <符号|(.)>
+% figurepath = \{\{<路径名1>\}\{<路径名2>\}\}
% \end{syntax}
% \ding{229} 以上选项路径为 \opt{style/...}
% \changes{v1.10}{2021/01/08}{更改颜色实现方式与选项名。}
@@ -514,7 +514,7 @@
% footruleskip = <页脚线间距>
% left = <页面左边距>
% top = <页面上边距>
-% hmargin = \marg{左边距,右边距}
+% hmargin = \{<左边距>,<右边距>\}
% textwidth = <页面文本区宽度>
% includehead = <true|(false)>
% \end{syntax}
@@ -537,7 +537,7 @@
%
% \subsection{页眉页脚}
% \label{subsec:header and footer}
-% \begin{function}[EXP,added = 2021-01-13,updated = 2021-05-31]{head-foot,chap-mark,sec-mark,subsec-mark,chap-label,sec-label,subsec-label,headrule,footrule,footnoterule}
+% \begin{function}[EXP,added = 2021-01-13,updated = 2021-06-14]{head-foot,chap-mark,sec-mark,subsec-mark,chap-label,sec-label,subsec-label,headrule,footrule,footnoterule}
% \begin{syntax}
% head-foot = <页眉页脚中的内容>
% chap-mark = <\tn{chaptermark} 标志命令的内容>
@@ -552,14 +552,6 @@
% \end{syntax}
% \ding{229} 以上选项路径为 \opt{hdrset/...} \\
% \opt{hdrset} 设置的命令由 \pkg{fancyhdr} 宏包提供支持。设置章节标志选项 \opt{chap-mark}、\opt{sec-mark} 和 \opt{subsec-mark} 时已做了情形考虑,不需要使用 \tn{markboth} 或 \tn{markright} 命令,其中参数 \#1 代表当前章、节或小节的标题。\opt{chap-mark} 和 \opt{sec-mark} 选项在 book 模式时有意义,\opt{sec-mark} 和 \opt{subsec-mark} 选项在 article 模式时有意义,这与标准文档类的行为一致。也可以直接重新定义这些标志命令,但此时 \opt{style/uppercase} 选项失效,这时可以用例如 \tn{MakeUppercase} 命令来设置标志内容的大小写。
-%
-% 标签选项 \opt{chap-label}、\opt{sec-label} 和 \opt{subsec-label} 用于设置标志命令中的标签,包括标题编号和与标题内容之间的距离,它们比标志命令内容的选项更常用,可选参数是编号,必选参数是距离命令
-%
-% \begin{ctexexam}
-% \hdrset{chap-label = [\thechapter]{\hspace{\ccwd}}}
-% \end{ctexexam}
-%
-% \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} 标志选项。}
@@ -567,14 +559,26 @@
% \changes{v1.24}{2021/04/09}{增加 \opt{subsec-mark} 标志选项,仅在 article 模式生效。}
% \end{function}
%
-% \begin{function}[added = 2021-01-13,updated = 2021-03-14]{\easyhead,\easyfoot}
+% 标签选项 \opt{chap-label}、\opt{sec-label} 和 \opt{subsec-label} 用于设置标志命令中的标签,包括标题编号和与标题内容之间的距离,它们比标志命令内容的选项更常用,可选参数是编号,必选参数是距离命令
+% \begin{ctexexam}
+% \hdrset
+% {
+% chap-label = [\thechapter]{\hspace{\ccwd}},
+% sec-mark = \CTEXifname{\CTEXthesection——}{}#1
+% }
+% \end{ctexexam}
+% \opt{headrule}、\opt{footrule} 和 \opt{footnoterule} 三个选项可以使用 \tn{hrule} width \meta{长度} height \meta{高度} 或下述 \tn{markrule} 命令来绘制横线,脚注线默认为空。当然,手动绘制横线时线条粗细选项 \opt{style/rulewidth} 会失效。
+%
+% \begin{function}[added = 2021-01-13,updated = 2021-06-14]{\easyhead,\easyfoot,\markrule}
% \begin{syntax}
% \tn{easyhead}\oarg{位置}\marg{内容}
% \tn{easyfoot}\oarg{位置}\marg{内容}
+% \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代表左、中、右部分。单面打印时,含有偶数的选项无效。下面举一个设置页眉的例子
+% 命令 \tn{easyhead} 和 \tn{easyfoot} 的使用方法与 \tn{fancyhead} 和 \tn{fancyfoot} 完全相同,它们需要在 \opt{head-foot} 选项中使用,设置的是一个名为 \opt{fancy} 的页面风格。\pkg{fancyhdr} 将页眉页脚分成了左中右和奇数页(odd)、偶数页(even)共12个部分,可选参数中E、O代表偶数、奇数,L、C、R代表左、中、右部分。单面打印时,含有偶数的选项无效。
% \end{function}
%
+% 命令 \tn{markrule} 用于绘制页眉页脚横线,长度默认为页面文本区的宽度,上下间距为横线与上下方部件的间距,带有长度单位,间距长度之间用+号分开,若只有一部分则表示上间距,这个命令也可以在正文中绘制横线。下面举一个设置页眉内容的例子
% \begin{ctexexam}
% \hdrset
% {
@@ -584,8 +588,7 @@
% \easyhead[OL]{\rightmark}
% \easyhead[EL,OR]{\textbf{\thepage}}
% },
-% sec-mark = \CTEXthesection\hspace{0.5\ccwd}#1,
-% headrule = \hrule width \textwidth height 1pt
+% headrule = \markrule(DarkViolet){0.5pt}[2pt+2pt]
% }
% \end{ctexexam}
%
@@ -603,11 +606,11 @@
% \end{syntax}
% \ding{229} 以上选项路径为 \opt{hdrset/...} \\
% 上面几个选项用于设置脚注格式,\opt{fnparskip} 和 \opt{fnparindent} 选项仅在 \opt{fnhang = true} 时有效。\opt{fnhang} 用于将脚注设置为悬挂缩进的格式,\opt{fnmark-pos} 选项设置脚注编号的位置,正常文本或是上标形式。\opt{fnmark-num} 选项设置脚注编号的格式,默认为原生样式 \opt{plain},还可以改为 \opt{pifont} 的各个版本,从左往右依次为普通版、阴文衬线版、阳文无衬线版和阴文无衬线版,缺点是它们的编号仅包括1-10。
-%
-% \opt{fnmark-form} 是脚注标记的格式,在此设置字体命令会覆盖 \opt{subfont/footnote} 的设置,最后一个格式命令可以带有一个参数,这个参数接受脚注编号,一般配合 \opt{fnmark-num = plain} 使用。\opt{afterfnmark} 是脚注标记后的代码,一般用于设置标记与文本间的距离。
% \changes{v1.25}{2021/05/12}{增加脚注样式设置选项。}
% \end{function}
%
+% \opt{fnmark-form} 是脚注标记的格式,在此设置字体命令会覆盖 \opt{subfont/footnote} 的设置,最后一个格式命令可以带有一个参数,这个参数接受脚注编号,一般配合 \opt{fnmark-num = plain} 使用。\opt{afterfnmark} 是脚注标记后的代码,一般用于设置标记与文本间的距离。
+%
% \subsection{目录样式}
% \label{subsec:catalog style}
% \begin{function}[EXP,added = 2021-01-13,updated = 2021-05-14]{format,format+,indent,rule,numsep}
@@ -620,22 +623,22 @@
% \end{syntax}
% \ding{229} 以上选项路径为 \opt{tocset/(level)/...} \\
% \opt{tocset} 将目录样式交给 \pkg{titletoc} 处理,\opt{(level)} 代表 part、chapter、section、subsection、figure、table 和 lstlisting 级别的目录,而使用 \opt{list} 级别可以统一设置图片、表格和代码目录的样式。
-%
-% \opt{format} 是目录中标题的格式,可以设置字体和加入垂直间距等,垂直间距最好使用无间距重合的 \tn{addvspace} 命令,带有加号的 \opt{format+} 选项用于在已有的格式命令后附加内容。\opt{indent} 是目录中标题在页面左侧的缩进距离,应该有长度单位。\opt{rule} 选项中一般应当使用 \tn{tocrule} 命令,将会在接下来介绍。\opt{numsep} 是有编号的标题在目录中编号与标题的间距。
% \changes{v1.21}{2021/01/13}{增加配置目录样式的选项。}
% \changes{v1.24}{2021/04/20}{增加目录中编号与标题的间距选项 \opt{numsep}。}
% \changes{v1.25}{2021/05/14}{可以分别设置图片、表格和代码目录的格式。}
% \end{function}
%
+% \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{syntax}
% \tn{tocrule}*\oarg{引导点间距|(0.7pc)}\parg{引导点大小|(1.2)}\marg{引导点}\oarg{页码格式}
% \tn{EBNumberLine}\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 代替一般不变。
-% \end{function}
%
% \begin{ctexexam}
% \tocset
@@ -1065,7 +1068,7 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2021/06/13}{1.26a}{beta}
+\ProvidesExplClass{easybook}{2021/06/14}{1.26b}{beta}
\bool_set_false:N \l__eb_compile_draft_bool
\bool_set_false:N \l__eb_title_newline_bool
@@ -1309,7 +1312,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{etoolbox}
-\ProvidesExplPackage{easybase}{2021/06/13}{1.26a}{beta}
+\ProvidesExplPackage{easybase}{2021/06/14}{1.26b}{beta}
\cs_generate_variant:Nn \eb_ctex_define:nn { nx }
\cs_generate_variant:Nn \int_to_arabic:n { v }
@@ -1572,6 +1575,17 @@
\cs_gset_eq:NN \easyhead \fancyhead
\cs_gset_eq:NN \easyfoot \fancyfoot
+\NewDocumentCommand{\markrule}
+ {O{\textwidth}D(){ctex@frame}m>{\SplitArgument{1}{+}}O{}}
+ {\eb_draw_markrule:nnnnn {#1} {#2} {#3} #4}
+\cs_new_protected:Npn \eb_draw_markrule:nnnnn #1#2#3#4#5
+ {
+ \group_begin:
+ \tl_if_empty:nF {#4} { \vspace*{#4} }
+ \color{#2}\hrule\@width #1\@height #3
+ \tl_if_novalue:nF {#5} { \vspace*{#5} }
+ \group_end:
+ }
\eb_ctex_define:nn { hdrset }
{
head-foot .tl_set:N = \l__eb_fancyhf_content_tl,
@@ -1589,36 +1603,15 @@
}
},
- chap-mark .cs_set:Np = \eb_fancyhf_chapter_mark:n #1,
- chap-mark .initial:n =
- {
- \int_compare:nNnT { \c@secnumdepth } > { -1 }
- {
- \ifbool{@mainmatter}
- {
- \int_if_odd:nT { \CTEX@chapter@numbering }
- { \eb@mark@chapter@label }
- }{}
- }#1
- },
- sec-mark .cs_set:Np = \eb_fancyhf_section_mark:n #1,
- sec-mark .initial:n =
- {
- \int_compare:nNnT { \c@secnumdepth } > { 0 }
- {
- \int_if_odd:nT { \CTEX@section@numbering }
- { \eb@mark@section@label }
- }#1
- },
+ chap-mark .cs_set:Np = \eb_fancyhf_chapter_mark:n #1,
+ chap-mark .initial:n =
+ { \CTEXifname{\eb@mark@chapter@label}{}#1 },
+ sec-mark .cs_set:Np = \eb_fancyhf_section_mark:n #1,
+ sec-mark .initial:n =
+ { \CTEXifname{\eb@mark@section@label}{}#1 },
subsec-mark .cs_set:Np = \eb_fancyhf_subsection_mark:n #1,
subsec-mark .initial:n =
- {
- \int_compare:nNnT { \c@secnumdepth } > { 1 }
- {
- \int_if_odd:nT { \CTEX@subsection@numbering }
- { \eb@mark@subsection@label }
- }#1
- },
+ { \CTEXifname{\eb@mark@subsection@label}{}#1 },
chap-label .code:n = \eb_mark_chapter_number_bool:n {#1},
chap-label .initial:n = \hspace{\ccwd},
sec-label .code:n = \eb_mark_section_number_bool:n {#1},
@@ -1626,25 +1619,13 @@
subsec-label .code:n = \eb_mark_subsection_number_bool:n {#1},
subsec-label .initial:n = \hspace{0.5\ccwd},
- headrule .tl_gset:N = \headrule,
- headrule .initial:n =
- {
- \group_begin:
- \color{ctex@frame}
- \hrule\@width\textwidth\@height\eb@rule@width@dim
- \group_end:
- },
- footrule .tl_gset:N = \footrule,
- footrule .initial:n = { },
+ headrule .tl_gset:N = \headrule,
+ headrule .initial:n = \markrule{\eb@rule@width@dim},
+ footrule .tl_gset:N = \footrule,
+ footrule .initial:n = { },
footnoterule .tl_gset:N = \footnoterule,
footnoterule .initial:n =
- {
- \group_begin:
- \color{ctex@frame}
- \hrule\@width 0.35\columnwidth\@height\eb@rule@width@dim
- \vspace*{2.6pt}
- \group_end:
- },
+ { \markrule[0.35\textwidth]{\eb@rule@width@dim}[+2.6pt] },
fnmargin .dim_set:N = \footnotemargin,
fnmargin .initial:n = 0.75\ccwd,
@@ -1672,32 +1653,34 @@
fnmark-num .value_required:n = true
}
-\cs_new:Npn \eb_upper_number_mark_bool:nn #1#2
+\cs_new:Npn \eb_mark_uppercase_bool:nn #1#2
{
- \bool_if:NT \l__eb_mark_uppercase_bool
- { \text_uppercase:n } {\use:c { eb_fancyhf_#1_mark:n } {#2}}
+ \bool_if:NTF \l__eb_mark_uppercase_bool
+ { \text_uppercase:n }
+ { \text_titlecase_first:n }
+ { \use:c { eb_fancyhf_#1_mark:n } {#2} }
}
-\cs_new:Npn \eb@number@markdouble #1#2
+\cs_new:Npn \eb@level@markdouble #1#2
{
\markboth
- {\eb_upper_number_mark_bool:nn {#1} {#2}}
+ {\eb_mark_uppercase_bool:nn {#1} {#2}}
{
\bool_if:NT \l__eb_page_twoside_bool
- { \eb_upper_number_mark_bool:nn {#1} {#2} }
+ { \eb_mark_uppercase_bool:nn {#1} {#2} }
}
}
-\cs_new:Npn \eb@number@markright #1#2
- { \markright{\eb_upper_number_mark_bool:nn {#1} {#2}} }
-\cs_new:Npn \eb@number@section@mark #1
+\cs_new:Npn \eb@level@markright #1#2
+ { \markright{\eb_mark_uppercase_bool:nn {#1} {#2}} }
+\cs_new:Npn \eb@level@section@mark #1
{
\bool_if:NTF \l__eb_class_book_bool
- { \eb@number@markright{section}{#1} }
- { \eb@number@markdouble{section}{#1} }
+ { \eb@level@markright{section}{#1} }
+ { \eb@level@markdouble{section}{#1} }
}
-\cs_new:Npn \eb@number@subsection@mark #1
+\cs_new:Npn \eb@level@subsection@mark #1
{
\bool_if:NF \l__eb_class_book_bool
- { \eb@number@markright{subsection}{#1} }
+ { \eb@level@markright{subsection}{#1} }
}
\ctex_at_end_preamble:n
{
@@ -1706,9 +1689,9 @@
\tl_use:N \l__eb_fancyhf_content_tl
\cs_gset_eq:NN \ps@plain \ps@empty
\pagestyle{fancy}
- \cs_gset:Npn \chaptermark #1 { \eb@number@markdouble{chapter}{#1} }
- \cs_gset_eq:NN \sectionmark \eb@number@section@mark
- \cs_gset_eq:NN \subsectionmark \eb@number@subsection@mark
+ \cs_gset:Npn \chaptermark #1 { \eb@level@markdouble{chapter}{#1} }
+ \cs_gset_eq:NN \sectionmark \eb@level@section@mark
+ \cs_gset_eq:NN \subsectionmark \eb@level@subsection@mark
\bool_if:NT \l__eb_compile_draft_bool
{
\easyfoot[C]{\color{SlateGray}\sffamily\today}
@@ -2103,11 +2086,11 @@
\tl_case:Nn \l__eb__bitoc_mark_title_level_tl
{
\c__eb_bitoc_mark_title_chapter_tl
- { \eb@nonumber@markdouble{##2} }
+ { \eb@level@markdouble{chapter}{##2} }
\c__eb_bitoc_mark_title_section_tl
- { \eb@nonumber@section@mark{##2} }
+ { \eb@level@section@mark{##2} }
\c__eb_bitoc_mark_title_subsection_tl
- { \eb@nonumber@subsection@mark{##2} }
+ { \eb@level@subsection@mark{##2} }
}
}{
\stepcounter{bi#1}
@@ -2170,45 +2153,16 @@
{ \tl_set:Nn \eb@bitoc@title {#2} }
}
-\cs_new:Npn \eb_upper_nonumber_mark_bool:n #1
- {
- \bool_if:NTF \l__eb_mark_uppercase_bool
- { \text_uppercase:n {#1} }
- { \text_titlecase_first:n {#1} }
- }
-\cs_new:Npn \eb@nonumber@markdouble #1
- {
- \markboth
- {\eb_upper_nonumber_mark_bool:n {#1}}
- {
- \bool_if:NT \l__eb_page_twoside_bool
- { \eb_upper_nonumber_mark_bool:n {#1} }
- }
- }
-\cs_new:Npn \eb@nonumber@markright #1
- { \markright{\eb_upper_nonumber_mark_bool:n {#1}} }
-\cs_new:Npn \eb@nonumber@section@mark #1
- {
- \bool_if:NTF \l__eb_class_book_bool
- { \eb@nonumber@markright{#1} }
- { \eb@nonumber@markdouble{#1} }
- }
-\cs_new:Npn \eb@nonumber@subsection@mark #1
- {
- \bool_if:NF \l__eb_class_book_bool
- { \eb@nonumber@markright{#1} }
- }
-
\cs_new_protected:Npn \eb_title_mark_intoc:n #1
{
\tl_if_eq:NnTF \l__eb_toc_type_tl { chapter }
{
\bichapter*{#1}{\eb@bitoc@title}
- \eb@nonumber@markdouble{#1}
+ \eb@level@markdouble{chapter}{#1}
}
{
\bisection*{#1}{\eb@bitoc@title}
- \eb@nonumber@section@mark{#1}
+ \eb@level@section@mark{#1}
}
}
\cs_new_protected:Npn \eb_title_mark_notoc:n #1
@@ -2216,11 +2170,11 @@
\tl_if_eq:NnTF \l__eb_toc_type_tl { chapter }
{
\chapter*{\phantomsection #1}
- \eb@nonumber@markdouble{#1}
+ \eb@level@markdouble{chapter}{#1}
}
{
\section*{\phantomsection #1}
- \eb@nonumber@section@mark{#1}
+ \eb@level@section@mark{#1}
}
}
\cs_new_protected:Npn \eb_title_number_intoc_bool:nn #1#2
@@ -2241,7 +2195,7 @@
\bool_if:NTF \l__eb_class_book_bool
{ \bichapter*{#1}{\l__eb_bib_bitoc_title} }
{ \bisection*{#1}{\l__eb_bib_bitoc_title} }
- \eb@nonumber@section@mark{#1}
+ \eb@level@section@mark{#1}
}
\cs_new_protected:Npn \eb_toc_start_multicol_bool:n #1
{
@@ -2313,7 +2267,7 @@
\group_begin:
\tl_set_eq:NN \eb@toc@title \indexname
\cs_set_eq:NN \imki@indexlevel \use_none:n
- \setkeys{imki}{intoc = false}
+ \setkeys{imkiindex}{noclearpage}
\IfValueT{#4}{\keys_set:nn { eb/listoc } {#4}}
\tl_set:Nn \imki@indexheaders
{
@@ -2630,24 +2584,22 @@
}
\tl_const:Nn \c__eb_thmtools_keyval_tl
{
- [
- spaceabove = \l__eb_thm_spaceabove_tl,
- spacebelow = \l__eb_thm_spacebelow_tl,
- headindent = \l__eb_thm_headindent_tl,
- headfont = \l__eb_thm_headfont_tl,
- notefont = \l__eb_thm_notefont_tl,
- notebraces = { }{ },
- bodyfont = \l__eb_thm_bodyfont_tl,
- headpunct = \l__eb_thm_headpunct_tl,
- postheadspace = \l__eb_thm_spacepost_tl,
- within = \l__eb_thm_numberwith_tl,
- headformat = \NAME\space\NUMBER\NOTE
- ]
+ spaceabove = \l__eb_thm_spaceabove_tl,
+ spacebelow = \l__eb_thm_spacebelow_tl,
+ headindent = \l__eb_thm_headindent_tl,
+ headfont = \l__eb_thm_headfont_tl,
+ notefont = \l__eb_thm_notefont_tl,
+ notebraces = { }{ },
+ bodyfont = \l__eb_thm_bodyfont_tl,
+ headpunct = \l__eb_thm_headpunct_tl,
+ postheadspace = \l__eb_thm_spacepost_tl,
+ within = \l__eb_thm_numberwith_tl,
+ headformat = \NAME\space\NUMBER\NOTE
}
\eb_at_end_preamble:n
{
- \exp_last_unbraced:NV
- \declaretheoremstyle \c__eb_thmtools_keyval_tl{easy-theorem}
+ \exp_last_unbraced:NNV
+ \declaretheoremstyle[\c__eb_thmtools_keyval_tl]{easy-theorem}
\eb_thmname_set:nnn { exercise } { Exercise } { 练习 }
\cs_undefine:N \proof
\clist_map_inline:nn
diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf
index ea9bd38c8e..bfa06382e0 100644
--- a/macros/latex/contrib/easybook/easybook.pdf
+++ b/macros/latex/contrib/easybook/easybook.pdf
Binary files differ