texlive[71046] Master/texmf-dist: easybook (23apr24)

commits+karl at tug.org commits+karl at tug.org
Tue Apr 23 21:30:03 CEST 2024


Revision: 71046
          https://tug.org/svn/texlive?view=revision&revision=71046
Author:   karl
Date:     2024-04-23 21:30:03 +0200 (Tue, 23 Apr 2024)
Log Message:
-----------
easybook (23apr24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/easybook/easybook.pdf
    trunk/Master/texmf-dist/doc/latex/easybook/easybook.tex
    trunk/Master/texmf-dist/source/latex/easybook/easybook.dtx
    trunk/Master/texmf-dist/tex/latex/easybook/easybase.sty
    trunk/Master/texmf-dist/tex/latex/easybook/easybook.cls
    trunk/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg

Modified: trunk/Master/texmf-dist/doc/latex/easybook/easybook.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/easybook/easybook.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/easybook/easybook.tex	2024-04-23 19:29:54 UTC (rev 71045)
+++ trunk/Master/texmf-dist/doc/latex/easybook/easybook.tex	2024-04-23 19:30:03 UTC (rev 71046)
@@ -23,8 +23,8 @@
     name            = easybook,
     color-scheme    = blue,
     title           = EASYBOOK使用手册,
-    version         = v2024as,
-    date            = 2024/04/19,
+    version         = v2024aw,
+    date            = 2024/04/22,
     authors         = 瞿毅,
     info            = 简便地排版中文学位论文或书籍,
     email           = toquyi at 163.com,
@@ -60,15 +60,16 @@
 
 \ExplSyntaxOn\makeatletter
 % * Do not add entries to the index
+% + Canceling the \item command in the list environment
 % - Leave the option value blank
-\let\isvalue\cnltx at isvalue
-\NewDocumentCommand{\kvsplit}{st-mm}
+\NewDocumentCommand{\kvsplit}{st+t-mm}
   {
-    \item\code
+    \IfBooleanF{#2}{\item}
+    \code
       {
-        \IfBooleanTF{#1}{\option*{#3}}{\option{#3}}
+        \IfBooleanTF{#1}{\option*{#4}}{\option{#4}}
         \cnltx at isvalue
-        \IfBooleanTF{#2}{#4}{\splitmarg{#4}}
+        \IfBooleanTF{#3}{#5}{\splitmarg{#5}}
       }
     \cnltx at checkdefault{\hfill\newline}
   }
@@ -177,6 +178,20 @@
         \refstepcounter{ctexexam}\ctexexamlabelref
       }
   }
+\newcommand{\cancelitem}
+  {
+    \renewcommand*{\@cnltx at option@one}[2]
+      {
+        ##1{##2}
+        \cnltx at checkdefault{\hfill\newline}
+      }
+    \renewcommand*{\@cnltx at option@two}[3]
+      {
+        ##1{##2}{##3}
+        \cnltx at checkdefault{\hfill\newline}
+      }
+  }
+\newcommand{\optpath}[1]{\item\code{\textcolor{SlateGray}{#1}}}
 \makeatother\ExplSyntaxOff
 \labelformat{section}{节#1}
 \labelformat{subsection}{小节#1}
@@ -449,7 +464,7 @@
   \keychoice{linktype}{\fbox{edge},colors,none}
   超链接类型。\code{edge} 使超链接形式为边框,\code{colors} 使超链接字体为彩色,\code{none} 关闭超链接边框与颜色,此时 \option{linkcolor} 选项无效。
   \keychoice{linkcolor}{fresh,cutepink,\fbox{navyblue},crimson}
-  超链接颜色样式。预置了四种超链接颜色风格。为使相关颜色能够正确显示,选项 \option{linkcolor} 应当在 \option{linktype} 前使用。
+  当超链接类型为 \code{colors} 时文本的颜色样式。预置了四种超链接颜色风格,默认为海军蓝 \code{navyblue}。
   \begin{commands}
   \command{DeclareLinkColor}[\splitmarg{风格名称,颜色1,颜色2,颜色3}]
   声明新的超链接颜色样式命令。它的参数以英文逗号分隔,第一部分为颜色风格名称,后面三部分为 \code{HTML} 颜色代码,构成超链接颜色列表。其中 \meta{颜色1} 为普通链接,\meta{颜色2} 为网址,\meta{颜色3} 为参考文献引用。
@@ -821,11 +836,11 @@
 模块 \module*{tocset} 将使用 \pkg*{titletoc} 宏包处理目录样式。默认包括 \module*{part}、\module*{chapter}、\module*{section}、\module*{subsection}、\module*{figure}、\module*{table} 和 \module*{lstlisting} 条目名的键路径,而使用 \module*{float} 路径可以统一设置图片、表格和代码目录的样式。选项前带有 \ding{73} 符号表示支持所有相应\textbf{条目名}的路径,其它选项则处于 \module*{tocset} 键路径下。目前支持多数学术论文目录样式,更复杂的样式可以查看 \pkg*{titletoc} 的相关用法。
 \begin{options}
   \keyval{tocformat}{条目格式}\dtag
-  目录中各类型条目的格式。可以设置条目字体和加入垂直间距等,垂直间距最好使用防止垂直间距重合的 \cs*{addvspace} 命令。
+  目录中各类型条目的格式。可以设置条目字体和加入垂直间距等,垂直间距最好使用防止垂直间距重合的 \cs*{addvspace} 命令。如果是段落型目录,格式代码仅在段落中当前级别条目前执行一次。
   \keyval{tocformat+}{条目格式}\dtag
   与选项 \option{tocformat} 用法一样,只是在已有的格式命令后附加代码。
   \keyval{tocindent}{刚性长度}\dtag
-  目录条目左边的缩进距离,通常标题级别越低缩进越大。
+  目录条目左边的缩进距离,通常标题级别越低缩进越大。如果是段落型目录,仅在当前条目级别为段落中最高时有效。
   \keyval{tocrule}{引导线命令}\dtag
   引导线选项 \option{tocrule} 中一般可以使用基于 \cs*{xleaders} 命令的 \cs{tocrule} 绘制引导线。
   \begin{commands}
@@ -832,23 +847,27 @@
   \command{tocrule}[\sarg\harg\oarg{引导点间距}\darg{放大因子}\marg{引导点}\oarg{页码格式}]
   生成目录引导线的命令,需要在引导线选项 \option{tocrule} 中使用。带有星号的命令与 \keyis{dotalign}{false} 效果相同。命令带 \harg{} 号参数不添加目录页码,此时无格式的页码被保存在 \cs{thecontentspage} 命令中,可以配合盒子命令设置不同的页码左右间距和对齐方式。\meta{引导点间距} 需带有长度单位,\meta{放大因子} 为 \meta{引导点} 的放大倍数。\meta{页码格式} 中最后一个命令可以带有一个参数为页码编号。
   \end{commands}
-  \keyval{toclabel}{标题标签格式}\dtag\newtagv{2024as}%
-  目录中各类型条目标题标签的格式,可与 \option{tocline} 选项联用设置标题。其中参数 \code{\#1} 代表标签的编号 \cs{thecontentslabel},参数 \code{\#2} 代表 \meta{条目名}。
+  \keyval{toclabel}{标题标签定义}\dtag\newtagv{2024as}%
+  目录中各类型条目标题标签的定义,可与 \option{tocline} 选项联用设置标题。其中参数 \code{\#1} 代表标签的编号 \cs{thecontentslabel},参数 \code{\#2} 代表 \meta{条目名}。定义最后的命令可带有一个参数,用于接受标题内容,一些特殊情况例如需要将标题内容放在标签后,可以通过定义命令实现:
+  \begin{ctexexam}
+  \newcommand{\seqentry}[2]{#2-#1} % #2为标题内容
+  \ctexset{chapter/toclabel = \seqentry{#1}}
+  \end{ctexexam}
   \keyval{tocafter}{距离命令}\dtag\Default{\cs*{hspace}\Marg{1em}}
   目录条目标签与标题间的代码,默认为插入 \code{1em} 横向距离。
   \keyval{tocbelow}{距离命令}\dtag
   在目录条目下方执行的代码,可以插入垂直距离等命令。
-  \keyval{tocline}{条目定义}\dtag[\textcolor{red}{\ding{73}}]
+  \keyval{tocline}{标题定义}\dtag[\textcolor{red}{\ding{73}}]
   这个选项在章节标题基础上扩展了浮动环境的题注标题在目录文件中的定义。章节和题注标题选项中参数 \code{\#1} 代表标题编号 \cs*{the}\meta{计数器} 对应的计数器名称,参数 \code{\#2} 则代表相应标题内容。
   \begin{ctexexam}
   \ctexset
     {
-      chapter         =
+      chapter           =
         {
-          tocformat   = \addvspace{8pt}\large,
-          tocindent   = 1.5em,
-          tocrule     = \tocrule[0.6pc](1.1){.}[\zihao{5}],
-          tocline     = \CTEXnumberline{#1}#2
+          tocformat     = \addvspace{8pt}\large,
+          tocindent     = 1.5em,
+          tocrule       = \tocrule[0.6pc](1.1){.}[\zihao{5}],
+          tocline       = \CTEXnumberline{#1}#2
         },
       section/toclabel  = \contentspush{#1\hspace{0.5em}},
       section/tocrule   = \tocrule-{}\makebox[1cm]{\rlap{\thecontentspage}}
@@ -857,7 +876,7 @@
 \end{options}
 
 \begin{commands}
-  \command{RegisterTocName}[\sarg\marg{条目名}]
+  \command{RegisterTocName}[\sarg\marg{条目名}]\newtagv[Changed]{2024as}%
   给条目类型名称为 \meta{条目名} 的标题注册用于设置目录样式的选项,即选项前有符号 \ding{73} 表示需要注册后使用。前面提到的条目类型均已注册,新类型的条目注册后选项初始值与图表条目相同。带有星号参数的命令使注册目录的条目形成一个段落,此时多出下面三个选项可用:
   \begin{options}
   \keyval{tocbegin}{开始代码}\dtag\newtagv{2024as}%
@@ -1013,7 +1032,7 @@
   \end{options}
 \end{commands}
 
-\subsection[双语标题]{双语标题\smodule{chapter}}
+\subsection{双语章节标题与新建标题}
 双语目录标题命令目前设置了常用的三个级别,它们将中文标题正常输出,并使中英文标题加入双语目录。类似于标准文档类,这三个标题命令分别具有独立的计数器\footnote{默认情况下与普通标题命令共享使用计数器。},并对应 \cs*{the}\meta{计数器} 的值,可以用于 \option{number} 选项更改英文目录中标题的编号格式。这个功能是为国内一些高校的学位论文模板的要求设计,在一般情况和英文模式下\textbf{不需要使用}。
 \begin{commands}
   \command{bichapter}[\sarg\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}]
@@ -1024,10 +1043,10 @@
   \code{subsection} 小节级别的双语目录标题命令,具有独立的 \code{bisubsection} 计数器。
 
   它们的星号变体命令使文中标题不编号,但是仍然加入双语目录,若英文标题参数空置那么仅加入中文目录而不加入英文目录,这一特点与 \cs*{chapter}\sarg{} 等命令的行为不太一样,在一些情况下会用到。可选参数是目录中的中文条目,默认与中文标题一致,正文标题过长时可用它设置在目录中显示的标题。默认情况下双语目录条目的格式是一致的,共享使用 \module*{tocset} 模块的设置。提供了两个选项 \option{biname} 和 \option{binumber} 修改英文目录章标题条目的名字及编号:
-  \begin{options}
-  \kvsplit{biname}{英文目录前名字,英文目录后名字}\Default{Chapter\cs*{space}}
+  \begin{options}\cancelitem
+  \optpath{chapter/}\kvsplit+{biname}{英文目录前名字,英文目录后名字}\Default{Chapter\cs*{space}}
   更改英文目录 \code{chapter} 级别的标题条目编号前后名字,类似于 \CTeX 的 \option*{name} 选项。
-  \keyval{binumber}{英文目录编号输出命令}\Default{\cs*{arabic}\Marg{chapter}}
+  \optpath{chapter/}\keyval{binumber}{英文目录编号输出命令}\Default{\cs*{arabic}\Marg{chapter}}
   更改英文目录 \code{chapter} 级别的标题条目编号输出格式,类似于 \CTeX 的 \option*{number} 选项。下面两种设置英文目录中章标题编号的方式等效:
   \end{options}
   \begin{ctexexam}
@@ -1047,6 +1066,22 @@
   \end{ctexexam}
 \end{commands}
 
+\begin{commands}
+  \command{NewTitleCommand}[\marg{条目名}\marg{章节层次}]\newtagv{2024aw}%
+  创建一个命令名为 \meta{条目名} 新章节标题,并且支持 \CTeX 中的标题样式选项机制,默认的标题格式为空。同时创建一个名为 \meta{条目名} 的计数器和标记命令 \code{\textbackslash}\meta{条目名}\code{\textcolor{cs}{mark}}。同时还需指定标题的 \meta{章节层次},例如标准文档类中 \code{chapter} 级别为 \code{0}。
+  \command{NewTitleEntryCommand}[\oarg{扩展名}\marg{条目名}]\newtagv{2024aw}%
+  创建一个命令 \code{\textbackslash}\meta{条目名}\code{\textcolor{cs}{entry}}\marg{标题},仅将 \meta{标题} 加入文件扩展名为 \meta{扩展名} 的目录中,而不在正文中输出标题,默认扩展名为 \code{toc}。
+  \begin{ctexexam}
+  \NewTitleCommand{lchapter}{0}
+  \NewTitleEntryCommand{lchapter}
+  \contentsuse{lchapter}{toc}
+  \RegisterTocName{lchapter}
+  \ctexset{lchapter/number = \thechapter}
+  \lchapter{正常标题}
+  \lchapterentry{加入目录的标题}
+  \end{ctexexam}
+\end{commands}
+
 \subsection[上标和下标]{上标和下标\smodule{style}}
 上标和下标的功能来自 \pkg*{spbmark} 宏包,下面有三个命令可以用于输出上标和下标。可以使用键值列表的形式对上下标格式进行局部或全局设置,下面命令中两个可选参数的键值列表是等效的。全局设置的详情见\ref{subsubsec:super-sub-script},更多命令和详细用法见 \pkg*{spbmark} 宏包说明文档。
 \begin{commands}
@@ -1437,9 +1472,10 @@
   \changed
   \item 目录条目样式注册命令 \cs{RegisterTocName} 增加星号参数,支持设置段落型目录。
   \added
-  \item 新增目录条目标题标签设置的选项 \option{toclabel}。
+  \item 新增目录条目标题标签定义的选项 \option{toclabel}。
   \item 新增段落型目录条目附加代码的选项 \option{tocbegin}、\option{tocsep} 和 \option{tocend}。
   \end{version}
+  \shortversion{v = 2024aw,date = 2022/04/22,changes = 新增新建章节标题命令 \cs{NewTitleCommand} 和 \cs{NewTitleEntryCommand}。}
 \end{changelog}
 \nocite{*}
 

Modified: trunk/Master/texmf-dist/source/latex/easybook/easybook.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/easybook/easybook.dtx	2024-04-23 19:29:54 UTC (rev 71045)
+++ trunk/Master/texmf-dist/source/latex/easybook/easybook.dtx	2024-04-23 19:30:03 UTC (rev 71046)
@@ -15,7 +15,7 @@
 %<*class>
 \NeedsTeXFormat{LaTeX2e}[2021/11/15]
 \RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2024/04/19}{2024as}
+\ProvidesExplClass{easybook}{2024/04/22}{2024aw}
   {Easily typesetting Chinese theses or books}
 
 \bool_new:N \l__eb_compile_draft_bool
@@ -297,7 +297,7 @@
 %<*package>
 \NeedsTeXFormat{LaTeX2e}[2021/11/15]
 \RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2024/04/19}{2024as}
+\ProvidesExplPackage{easybase}{2024/04/22}{2024aw}
   {Easily typesetting Chinese theses or books}
 
 \cs_generate_variant:Nn \dim_set:Nn { NV }
@@ -308,7 +308,7 @@
 \cs_generate_variant:Nn \skip_set:Nn { NV }
 \cs_generate_variant:Nn \seq_set_from_clist:Nn { No }
 \cs_generate_variant:Nn \ctex_define:nn { nx }
-\cs_generate_variant:Nn \eb_put_hyperref:n { x }
+\cs_generate_variant:Nn \eb_set_hyperref:n { x }
 \cs_generate_variant:Nn \eb_at_begin_environment:nn { on }
 
 \cs_set_protected:Npn \ctex_define:nn #1
@@ -564,8 +564,8 @@
       {
         \exp_args:Nx \geometry
           {
-            \l_keys_key_str
-            \tl_if_empty:NF \l_keys_value_tl { = {#1} }
+            \str_use:N \l_keys_key_str
+            \tl_if_empty:NF \l_keys_value_tl { = \exp_not:n { {#1} } }
           }
       }
   }
@@ -1176,7 +1176,7 @@
     \tl_use:N \l__eb_fntext_after_tl
   }
 
-\tl_clear:N \@thefnmark
+\tl_clear_new:N \@thefnmark
 \tl_new:N \@the at up@fnmark
 \cs_new:Npn \eb@@makefnmark #1#2
   {
@@ -1275,8 +1275,7 @@
       { \use:c { CTEX@#1 at tocline }{#1}{#2} }
     \group_end:
   }
-\eb_seq_map_inline:nn
-  { chapter,section,subsection }
+\cs_new_protected:Npn \RegisterBititle #1
   {
     \exp_args:Nc \NewDocumentCommand { bi#1 }{sO{##3}mm}
       {
@@ -1294,11 +1293,44 @@
           }
       }
   }
+\clist_map_function:nN
+  { chapter,section,subsection }
+  \RegisterBititle
 \eb_preto_cmd:nn { @chapter }
   {
     \skip_if_eq:nnF { \eb at toc@lol at skip } { \c_zero_skip }
       { \addtocontents{lol}{\protect\addvspace{\skip_use:N \eb at toc@lol at skip}} }
   }
+\cs_new_protected:Npn \NewTitleCommand #1#2
+  {
+    \newcounter{#1}
+    \cs_set_eq:cN { #1mark } \use_none:n
+    \tl_clear:N \l__ctex_tmp_tl
+    \__ctex_initial_heading:n {#1}
+    \__ctex_def_heading_keys:n {#1}
+    \exp_args:No \ctex_define:n { \l__ctex_tmp_tl }
+    \cs_gset_protected:cpx {#1}
+      {
+        \exp_not:N \@startsection{#1}{#2}
+          {\exp_not:c { CTEX@#1 at indent }}
+          {\exp_not:c { CTEX@#1 at beforeskip }}
+          {\exp_not:c { CTEX@#1 at afterskip }}
+          {\exp_not:N \normalfont\exp_not:c { CTEX@#1 at format }}
+      }
+    \cs_new:cpn { CTEX@#1 at tocline } ##1##2
+      { \CTEXnumberline{##1}##2 }
+    \exp_args:Nc \providecommand { toclevel@#1 }{#2}
+  }
+\NewDocumentCommand{\NewTitleEntryCommand}{O{toc}m}
+  {
+    \cs_new_protected:cpn { #2entry } ##1
+      {
+        \bool_if:cTF { CTEX@#2 at numbering }
+          { \CTEX at ifnametrue }
+          { \CTEX at ifnamefalse }
+        \addcontentsline{#1}{#2}{\use:c { CTEX@#2 at tocline }{#2}{##1}}
+      }
+  }
 
 \ctex_define:nn { style }
   {
@@ -1537,8 +1569,8 @@
         #1/tocend .tl_set:c     = l__eb_toc_#1_end_tl
       }
   }
-\tl_new:N \l_eb_tmpa_tl
-\tl_new:N \l_eb_tmpb_tl
+\tl_new:N \l__eb_toc_tmpa_tl
+\tl_new:N \l__eb_toc_tmpb_tl
 \cs_new_protected:Npn \eb_toc_format_initial:nn #1#2
   {
     \exp_last_unbraced:Nx
@@ -1546,7 +1578,7 @@
       {
         \exp_not:N
         \titlecontents
-        \tl_use:N \l_eb_tmpa_tl
+        \tl_use:N \l__eb_toc_tmpa_tl
         \exp_not:n
           {
             {#2}
@@ -1556,10 +1588,11 @@
             {\tl_use:c { l__eb_toc_#2_rule_tl }}
             [\tl_use:c { l__eb_toc_#2_below_tl }]
           }
-        \exp_not:o { \l_eb_tmpb_tl }
+        \exp_not:o { \l__eb_toc_tmpb_tl }
       }
     \ctex_set:nn {#2}
       {
+        tocformat = \IfBooleanT{#1}{\contentsmargin{0pt}},
         tocindent = 0em,
         tocrule   = \IfBooleanTF{#1}{,~\thecontentspage}{\tocrule{$\cdot$}},
         toclabel  =
@@ -1567,13 +1600,7 @@
             \bool_if:NTF \l__eb_toc_entry_hang_bool
               { \IfBooleanTF{##3}{\use:n}{\contentspush} }
               { \use:n }
-              {
-                \bool_if:NTF \l__eb_toc_number_color_bool
-                  { \textcolor{ctex at toc@number} }
-                  { \use:n }
-                  { ##1 }
-                \tl_use:c { l__eb_toc_##2_after_tl }
-              }
+              { ##1\tl_use:c { l__eb_toc_##2_after_tl } }
           },
         tocafter  = \hspace{1em},
         tocsep    = .—,
@@ -1584,8 +1611,9 @@
   {
     \IfBooleanT{#1}
       {
-        \tl_set:Nn \l_eb_tmpa_tl {*}
-        \tl_set:Nn \l_eb_tmpb_tl
+        \ctex_set:nn { tocset } { between = { },bibetween = { } }
+        \tl_set:Nn \l__eb_toc_tmpa_tl {*}
+        \tl_set:Nn \l__eb_toc_tmpb_tl
           {
             [\tl_use:c { l__eb_toc_#2_sep_tl }]
             [\tl_use:c { l__eb_toc_#2_end_tl }]
@@ -1593,6 +1621,8 @@
       }
     \eb_toc_format_define:n {#2}
     \eb_toc_format_initial:nn {#1} {#2}
+    \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
@@ -2226,6 +2256,12 @@
 \lstloadlanguages{C,C++,Java,Python,Matlab}
 
 \clist_new:N \l__eb_hyperref_clist
+\cs_new_protected:Npn \eb_set_hyperref:n #1
+  {
+    \IfPackageLoadedTF{hyperref}
+      {\hypersetup}
+      {\eb_put_hyperref:n}{#1}
+  }
 \cs_new_protected:Npn \eb_put_hyperref:n #1
   { \clist_put_right:Nn \l__eb_hyperref_clist {#1} }
 \cs_new_protected:Npn \eb_define_link_color:nnn #1#2#3
@@ -2290,10 +2326,8 @@
     color-every .code:n     = \eb_define_theme_color:n { \exp_not:n {#1} }
   }
 
-\bool_new:N \l__eb_toc_number_color_bool
 \cs_new_protected:Npn \eb_link_border_set:n #1
   {
-    \bool_set_false:N \l__eb_toc_number_color_bool
     \ctex_at_end_package:nn { hyperref }
       {
         \def\@pdfborder{#1}
@@ -2300,26 +2334,12 @@
         \def\Hy at colorlink ##1 {\begingroup}
         \def\Hy at endcolorlink{\endgroup}
       }
-    \eb_put_hyperref:n { colorlinks = false }
+    \eb_set_hyperref:n { colorlinks = false }
   }
 \cs_new_protected:Npn \eb_link_colors_set:
-  {
-    \bool_set_true:N \l__eb_toc_number_color_bool
-    \colorlet{ctex at toc@number}{ctex at link}
-    \eb_put_hyperref:n { colorlinks }
-  }
+  { \eb_set_hyperref:n { colorlinks } }
 \cs_new_protected:Npn \eb_link_toc_put:n #1
-  {
-    \eb_put_hyperref:n { linktoc = #1 }
-    \eb_seq_map_inline:nn { page,none }
-      {
-        \tl_if_eq:NnT \l_keys_value_tl {##1}
-          {
-            \colorlet{ctex at toc@number}{black}
-            \seq_map_break:
-          }
-      }
-  }
+  { \eb_set_hyperref:n { linktoc = #1 } }
 \ctex_define:nn { refset }
   {
     linktype .choice:,
@@ -2330,15 +2350,15 @@
     linktype/various .meta:n    = linktype/colors,
     linktype .initial:n         = edge,
     linktoc .choice:,
+    linktoc .value_required:n   = true,
     linktoc/unknown .code:n     = \eb_link_toc_put:n {#1},
-    linktoc .default:n          = all,
     linktoc .initial:n          = all,
     unknown .code:n             =
       {
-        \eb_put_hyperref:x
+        \eb_set_hyperref:x
           {
-            \l_keys_key_str
-            \tl_if_empty:NF \l_keys_value_tl { = {#1} }
+            \str_use:N \l_keys_key_str
+            \tl_if_empty:NF \l_keys_value_tl { = \exp_not:n { {#1} } }
           }
       }
   }
@@ -2420,7 +2440,7 @@
   }
 %</package>
 %<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2024/04/19}{2024as}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2024/04/22}{2024aw}
   {Customization of tcolorbox for easybook}
 
 \cs_set_protected:Npn \addtotcbstyle #1#2

Modified: trunk/Master/texmf-dist/tex/latex/easybook/easybase.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/easybook/easybase.sty	2024-04-23 19:29:54 UTC (rev 71045)
+++ trunk/Master/texmf-dist/tex/latex/easybook/easybase.sty	2024-04-23 19:30:03 UTC (rev 71046)
@@ -20,7 +20,7 @@
 %% This work has the LPPL maintenance status `maintained'.
 \NeedsTeXFormat{LaTeX2e}[2021/11/15]
 \RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2024/04/19}{2024as}
+\ProvidesExplPackage{easybase}{2024/04/22}{2024aw}
   {Easily typesetting Chinese theses or books}
 
 \cs_generate_variant:Nn \dim_set:Nn { NV }
@@ -31,7 +31,7 @@
 \cs_generate_variant:Nn \skip_set:Nn { NV }
 \cs_generate_variant:Nn \seq_set_from_clist:Nn { No }
 \cs_generate_variant:Nn \ctex_define:nn { nx }
-\cs_generate_variant:Nn \eb_put_hyperref:n { x }
+\cs_generate_variant:Nn \eb_set_hyperref:n { x }
 \cs_generate_variant:Nn \eb_at_begin_environment:nn { on }
 
 \cs_set_protected:Npn \ctex_define:nn #1
@@ -287,8 +287,8 @@
       {
         \exp_args:Nx \geometry
           {
-            \l_keys_key_str
-            \tl_if_empty:NF \l_keys_value_tl { = {#1} }
+            \str_use:N \l_keys_key_str
+            \tl_if_empty:NF \l_keys_value_tl { = \exp_not:n { {#1} } }
           }
       }
   }
@@ -899,7 +899,7 @@
     \tl_use:N \l__eb_fntext_after_tl
   }
 
-\tl_clear:N \@thefnmark
+\tl_clear_new:N \@thefnmark
 \tl_new:N \@the at up@fnmark
 \cs_new:Npn \eb@@makefnmark #1#2
   {
@@ -998,8 +998,7 @@
       { \use:c { CTEX@#1 at tocline }{#1}{#2} }
     \group_end:
   }
-\eb_seq_map_inline:nn
-  { chapter,section,subsection }
+\cs_new_protected:Npn \RegisterBititle #1
   {
     \exp_args:Nc \NewDocumentCommand { bi#1 }{sO{##3}mm}
       {
@@ -1017,11 +1016,44 @@
           }
       }
   }
+\clist_map_function:nN
+  { chapter,section,subsection }
+  \RegisterBititle
 \eb_preto_cmd:nn { @chapter }
   {
     \skip_if_eq:nnF { \eb at toc@lol at skip } { \c_zero_skip }
       { \addtocontents{lol}{\protect\addvspace{\skip_use:N \eb at toc@lol at skip}} }
   }
+\cs_new_protected:Npn \NewTitleCommand #1#2
+  {
+    \newcounter{#1}
+    \cs_set_eq:cN { #1mark } \use_none:n
+    \tl_clear:N \l__ctex_tmp_tl
+    \__ctex_initial_heading:n {#1}
+    \__ctex_def_heading_keys:n {#1}
+    \exp_args:No \ctex_define:n { \l__ctex_tmp_tl }
+    \cs_gset_protected:cpx {#1}
+      {
+        \exp_not:N \@startsection{#1}{#2}
+          {\exp_not:c { CTEX@#1 at indent }}
+          {\exp_not:c { CTEX@#1 at beforeskip }}
+          {\exp_not:c { CTEX@#1 at afterskip }}
+          {\exp_not:N \normalfont\exp_not:c { CTEX@#1 at format }}
+      }
+    \cs_new:cpn { CTEX@#1 at tocline } ##1##2
+      { \CTEXnumberline{##1}##2 }
+    \exp_args:Nc \providecommand { toclevel@#1 }{#2}
+  }
+\NewDocumentCommand{\NewTitleEntryCommand}{O{toc}m}
+  {
+    \cs_new_protected:cpn { #2entry } ##1
+      {
+        \bool_if:cTF { CTEX@#2 at numbering }
+          { \CTEX at ifnametrue }
+          { \CTEX at ifnamefalse }
+        \addcontentsline{#1}{#2}{\use:c { CTEX@#2 at tocline }{#2}{##1}}
+      }
+  }
 
 \ctex_define:nn { style }
   {
@@ -1260,8 +1292,8 @@
         #1/tocend .tl_set:c     = l__eb_toc_#1_end_tl
       }
   }
-\tl_new:N \l_eb_tmpa_tl
-\tl_new:N \l_eb_tmpb_tl
+\tl_new:N \l__eb_toc_tmpa_tl
+\tl_new:N \l__eb_toc_tmpb_tl
 \cs_new_protected:Npn \eb_toc_format_initial:nn #1#2
   {
     \exp_last_unbraced:Nx
@@ -1269,7 +1301,7 @@
       {
         \exp_not:N
         \titlecontents
-        \tl_use:N \l_eb_tmpa_tl
+        \tl_use:N \l__eb_toc_tmpa_tl
         \exp_not:n
           {
             {#2}
@@ -1279,10 +1311,11 @@
             {\tl_use:c { l__eb_toc_#2_rule_tl }}
             [\tl_use:c { l__eb_toc_#2_below_tl }]
           }
-        \exp_not:o { \l_eb_tmpb_tl }
+        \exp_not:o { \l__eb_toc_tmpb_tl }
       }
     \ctex_set:nn {#2}
       {
+        tocformat = \IfBooleanT{#1}{\contentsmargin{0pt}},
         tocindent = 0em,
         tocrule   = \IfBooleanTF{#1}{,~\thecontentspage}{\tocrule{$\cdot$}},
         toclabel  =
@@ -1290,13 +1323,7 @@
             \bool_if:NTF \l__eb_toc_entry_hang_bool
               { \IfBooleanTF{##3}{\use:n}{\contentspush} }
               { \use:n }
-              {
-                \bool_if:NTF \l__eb_toc_number_color_bool
-                  { \textcolor{ctex at toc@number} }
-                  { \use:n }
-                  { ##1 }
-                \tl_use:c { l__eb_toc_##2_after_tl }
-              }
+              { ##1\tl_use:c { l__eb_toc_##2_after_tl } }
           },
         tocafter  = \hspace{1em},
         tocsep    = .—,
@@ -1307,8 +1334,9 @@
   {
     \IfBooleanT{#1}
       {
-        \tl_set:Nn \l_eb_tmpa_tl {*}
-        \tl_set:Nn \l_eb_tmpb_tl
+        \ctex_set:nn { tocset } { between = { },bibetween = { } }
+        \tl_set:Nn \l__eb_toc_tmpa_tl {*}
+        \tl_set:Nn \l__eb_toc_tmpb_tl
           {
             [\tl_use:c { l__eb_toc_#2_sep_tl }]
             [\tl_use:c { l__eb_toc_#2_end_tl }]
@@ -1316,6 +1344,8 @@
       }
     \eb_toc_format_define:n {#2}
     \eb_toc_format_initial:nn {#1} {#2}
+    \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
@@ -1949,6 +1979,12 @@
 \lstloadlanguages{C,C++,Java,Python,Matlab}
 
 \clist_new:N \l__eb_hyperref_clist
+\cs_new_protected:Npn \eb_set_hyperref:n #1
+  {
+    \IfPackageLoadedTF{hyperref}
+      {\hypersetup}
+      {\eb_put_hyperref:n}{#1}
+  }
 \cs_new_protected:Npn \eb_put_hyperref:n #1
   { \clist_put_right:Nn \l__eb_hyperref_clist {#1} }
 \cs_new_protected:Npn \eb_define_link_color:nnn #1#2#3
@@ -2013,10 +2049,8 @@
     color-every .code:n     = \eb_define_theme_color:n { \exp_not:n {#1} }
   }
 
-\bool_new:N \l__eb_toc_number_color_bool
 \cs_new_protected:Npn \eb_link_border_set:n #1
   {
-    \bool_set_false:N \l__eb_toc_number_color_bool
     \ctex_at_end_package:nn { hyperref }
       {
         \def\@pdfborder{#1}
@@ -2023,26 +2057,12 @@
         \def\Hy at colorlink ##1 {\begingroup}
         \def\Hy at endcolorlink{\endgroup}
       }
-    \eb_put_hyperref:n { colorlinks = false }
+    \eb_set_hyperref:n { colorlinks = false }
   }
 \cs_new_protected:Npn \eb_link_colors_set:
-  {
-    \bool_set_true:N \l__eb_toc_number_color_bool
-    \colorlet{ctex at toc@number}{ctex at link}
-    \eb_put_hyperref:n { colorlinks }
-  }
+  { \eb_set_hyperref:n { colorlinks } }
 \cs_new_protected:Npn \eb_link_toc_put:n #1
-  {
-    \eb_put_hyperref:n { linktoc = #1 }
-    \eb_seq_map_inline:nn { page,none }
-      {
-        \tl_if_eq:NnT \l_keys_value_tl {##1}
-          {
-            \colorlet{ctex at toc@number}{black}
-            \seq_map_break:
-          }
-      }
-  }
+  { \eb_set_hyperref:n { linktoc = #1 } }
 \ctex_define:nn { refset }
   {
     linktype .choice:,
@@ -2053,15 +2073,15 @@
     linktype/various .meta:n    = linktype/colors,
     linktype .initial:n         = edge,
     linktoc .choice:,
+    linktoc .value_required:n   = true,
     linktoc/unknown .code:n     = \eb_link_toc_put:n {#1},
-    linktoc .default:n          = all,
     linktoc .initial:n          = all,
     unknown .code:n             =
       {
-        \eb_put_hyperref:x
+        \eb_set_hyperref:x
           {
-            \l_keys_key_str
-            \tl_if_empty:NF \l_keys_value_tl { = {#1} }
+            \str_use:N \l_keys_key_str
+            \tl_if_empty:NF \l_keys_value_tl { = \exp_not:n { {#1} } }
           }
       }
   }

Modified: trunk/Master/texmf-dist/tex/latex/easybook/easybook.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/easybook/easybook.cls	2024-04-23 19:29:54 UTC (rev 71045)
+++ trunk/Master/texmf-dist/tex/latex/easybook/easybook.cls	2024-04-23 19:30:03 UTC (rev 71046)
@@ -20,7 +20,7 @@
 %% This work has the LPPL maintenance status `maintained'.
 \NeedsTeXFormat{LaTeX2e}[2021/11/15]
 \RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2024/04/19}{2024as}
+\ProvidesExplClass{easybook}{2024/04/22}{2024aw}
   {Easily typesetting Chinese theses or books}
 
 \bool_new:N \l__eb_compile_draft_bool

Modified: trunk/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg	2024-04-23 19:29:54 UTC (rev 71045)
+++ trunk/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg	2024-04-23 19:30:03 UTC (rev 71046)
@@ -18,7 +18,7 @@
 %% LaTeX version 2005/12/01 or later.
 %% 
 %% This work has the LPPL maintenance status `maintained'.
-\ProvidesExplFile{eb-tcolorbox.cfg}{2024/04/19}{2024as}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2024/04/22}{2024aw}
   {Customization of tcolorbox for easybook}
 
 \cs_set_protected:Npn \addtotcbstyle #1#2



More information about the tex-live-commits mailing list.