diff options
-rw-r--r-- | Master/texmf-dist/doc/latex/easybook/chapter1.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf | bin | 268704 -> 268709 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/easybook/easybook-demo.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/easybook/easybook.pdf | bin | 465175 -> 465154 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/easybook/easybook.dtx | 163 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybook.cls | 137 |
6 files changed, 157 insertions, 147 deletions
diff --git a/Master/texmf-dist/doc/latex/easybook/chapter1.tex b/Master/texmf-dist/doc/latex/easybook/chapter1.tex index 58d20eb0e81..62d88981755 100644 --- a/Master/texmf-dist/doc/latex/easybook/chapter1.tex +++ b/Master/texmf-dist/doc/latex/easybook/chapter1.tex @@ -61,7 +61,7 @@ \zhlipsum*[59][name = aspirin] \end{ebparbox} -\begin{exercise}+[LightBlue][1.](习题)[after skip = 3.25ex][\zhlipsum*[20][name = zhufu]] +\begin{exercise}+[LightSkyBlue][1.](习题)[after skip = 3.25ex][\zhlipsum*[20][name = zhufu]] \index{x@习题环境} \item \zhlipsum*[20][name = zhufu] \begin{tasks} diff --git a/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf b/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf Binary files differindex bcfab496973..79e9ef2ef1f 100644 --- a/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf +++ b/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf diff --git a/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex b/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex index 3d9bd6212f9..d92084a44e2 100644 --- a/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex +++ b/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex @@ -106,7 +106,7 @@ \url{https://latexstudio.net} \\ \url{https://gitee.com/texl3/easybook}\thanks{Gitee为项目的主要发布地址。} } -\date{2021/04/25\hskip\ccwd\relax v1.24t} +\date{2021/04/27\hskip\ccwd\relax v1.24u} \frontmatter[roman] \maketitle diff --git a/Master/texmf-dist/doc/latex/easybook/easybook.pdf b/Master/texmf-dist/doc/latex/easybook/easybook.pdf Binary files differindex bd22407ff24..b2dd8f3d31a 100644 --- a/Master/texmf-dist/doc/latex/easybook/easybook.pdf +++ b/Master/texmf-dist/doc/latex/easybook/easybook.pdf diff --git a/Master/texmf-dist/source/latex/easybook/easybook.dtx b/Master/texmf-dist/source/latex/easybook/easybook.dtx index dd209df1373..c4966338421 100644 --- a/Master/texmf-dist/source/latex/easybook/easybook.dtx +++ b/Master/texmf-dist/source/latex/easybook/easybook.dtx @@ -56,7 +56,7 @@ The latest version of this license is in % % \title{\sffamily easybook 书籍文档类} % \author{瞿毅} -% \date{2021/04/25\hskip\ccwd\relax v1.24t\thanks{\url{https://gitee.com/texl3/easybook}}} +% \date{2021/04/27\hskip\ccwd\relax v1.24u\thanks{\url{https://gitee.com/texl3/easybook}}} % \maketitle % \begin{abstract} % \cls{easybook} 是基于 \cls{ctexbook} 书籍文档类创建以极简为风格的模板,可以看作对 \cls{ctexbook} 的进一步包装。虽然\CTeX 文档类提供了较好的中文支持,但想实现个性化功能一般需要在其基础上载入更多宏包来定制。\cls{easybook} 考虑了一些细节并载入一些常用宏包实现一般的排版需求,它适用于排版中英文书籍或笔记,甚至可稍加调整成为学位论文模板。 @@ -183,7 +183,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.24t}{2021/04/04}{目录命令的可选参数增加标题键值。} +% \changes{v1.24u}{2021/04/04}{目录命令的可选参数增加标题键值。} % \end{function} % % \section{接口选项} @@ -266,7 +266,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.24t}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。} +% \changes{v1.24u}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。} % \end{function} % % \begin{optdesc} @@ -345,7 +345,7 @@ 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.24t}{2021/04/09}{可以不载入参考文献包手动配置参考文献格式。} +% \changes{v1.24u}{2021/04/09}{可以不载入参考文献包手动配置参考文献格式。} % \end{function} % % \begin{optdesc} @@ -417,7 +417,7 @@ The latest version of this license is in % \end{syntax} % 文档类已预置8个定理环境,环境名及对应的定理标题名见小节 \ref{subsec:theorem},如果需要新的定理标题名或定理样式可使用这两个命令。 % \changes{v1.23}{2021/03/12}{重新定义了新定理环境命令 \tn{newtheorem}。} -% \changes{v1.24t}{2021/04/25}{增加定义定理环境命令 \tn{EbNewtheorem}。} +% \changes{v1.24u}{2021/04/25}{增加定义定理环境命令 \tn{EbNewtheorem}。} % \end{function} % % \begin{optdesc} @@ -501,7 +501,7 @@ The latest version of this license is in % \changes{v1.21}{2021/01/13}{增加配置页眉页脚的选项。} % \changes{v1.23}{2021/03/08}{优化页眉页脚设置,增加 \opt{chap-mark} 和 \opt{sec-mark} 标志选项。} % \changes{v1.23}{2021/03/14}{可以手动绘制页眉、页脚和脚注的横线。} -% \changes{v1.24t}{2021/04/09}{增加 \opt{subsec-mark} 标志选项,仅在 \opt{article} 模式生效。} +% \changes{v1.24u}{2021/04/09}{增加 \opt{subsec-mark} 标志选项,仅在 \opt{article} 模式生效。} % \end{function} % % \begin{function}[added = 2021-01-13,updated = 2021-03-14]{\easyhead,\easyfoot} @@ -540,7 +540,7 @@ The latest version of this license is in % % \opt{format} 是目录中标题的格式,可以设置字体和加入垂直间距等,垂直间距最好使用无间距重合的 \tn{addvspace} 命令。\opt{indent} 是目录中标题在页面左侧的缩进距离,应该有长度单位。\opt{rule} 选项中一般应当使用 \tn{tocrule} 命令,将会在接下来介绍。\opt{numsep} 是有编号的标题在目录中编号与标题的间距。 % \changes{v1.21}{2021/01/13}{增加配置目录样式的选项。} -% \changes{v1.24t}{2021/04/20}{增加目录中编号与标题的间距选项 \opt{numsep}。} +% \changes{v1.24u}{2021/04/20}{增加目录中编号与标题的间距选项 \opt{numsep}。} % \end{function} % % \begin{function}[added = 2021-01-13,updated = 2021-04-20]{\tocrule,\EbNumberline} @@ -579,9 +579,9 @@ The latest version of this license is in % indent-all = <目录标题左边缩进> % \end{syntax} % \ding{229} 以上选项路径为 \opt{tocset/lists/...} 或 \opt{tocset/...} -% \changes{v1.24t}{2021/04/05}{可以设置图、表和代码目录的标签。} -% \changes{v1.24t}{2021/04/06}{增加目录引导线右边对齐方式。} -% \changes{v1.24t}{2021/04/19}{给目录增加 \opt{hang} 样式选项。} +% \changes{v1.24u}{2021/04/05}{可以设置图、表和代码目录的标签。} +% \changes{v1.24u}{2021/04/06}{增加目录引导线右边对齐方式。} +% \changes{v1.24u}{2021/04/19}{给目录增加 \opt{hang} 样式选项。} % \end{function} % % \begin{optdesc} @@ -621,7 +621,7 @@ The latest version of this license is in % \tn{end}\marg{环境名} % \end{syntax} % \pkg{enumitem} 宏包为系统预置的列表环境 \env{enumerate}、\env{itemize}和 \env{description} 提供了更灵活的标签以及间距的控制,可使用 \tn{setlist} 命令设置原有的三种列表格式,也可以直接使用可选参数的键值列表,具体选项见 \pkg{enumitem} 宏包文档。已为三种列表预置了三个级别的格式可相互嵌套,默认标签与 \cls{book} 文档类相同,若自定义标签可例如 -% \changes{v1.24t}{2021/04/08}{重新优化列表环境的配置。} +% \changes{v1.24u}{2021/04/08}{重新优化列表环境的配置。} % \end{function} % % \begin{ctexexam} @@ -740,7 +740,7 @@ The latest version of this license is in % \tn{end}\marg{ebparbox} % \end{syntax} % 环境 \env{ebparbox} 与 \env{easybox} 类似,同样带有三个可选参数。当使用星号参数时盒子左边带有一条竖线,\meta{颜色名} 选项可以自定义竖线颜色,使用不带有星号的环境则盒子带有竖线颜色的浅色背景。\meta{段落标题} 选项可以设置标题,默认无标题。 -% \changes{v1.24t}{2021/04/19}{优化盒子环境的选项,增加可带有标题的扁平盒子 \env{ebparbox}。} +% \changes{v1.24u}{2021/04/19}{优化盒子环境的选项,增加可带有标题的扁平盒子 \env{ebparbox}。} % \end{function} % % \subsubsection{行内盒子} @@ -799,7 +799,7 @@ The latest version of this license is in % \tn{labelformat}\marg{计数器}\marg{标签引用格式} % \end{syntax} % 使用 \tn{ref} 命令进行引用将会自动检测环境并添加相应的前缀,\tn{labelformat} 可以设置标签引用格式,第二个参数中\#1代表 \tn{the}\meta{计数器},可以设置引用序号的前缀和后缀。 -% \changes{v1.24t}{2021/04/11}{取消载入 \pkg{cleveref} 宏包来交叉引用。} +% \changes{v1.24u}{2021/04/11}{取消载入 \pkg{cleveref} 宏包来交叉引用。} % \end{function} % % \subsubsection{索引} @@ -909,7 +909,7 @@ The latest version of this license is in %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplClass{easybook}{2021/04/25}{1.24t}{beta} +\ProvidesExplClass{easybook}{2021/04/27}{1.24u}{beta} \cs_generate_variant:Nn \__ctex_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} @@ -1403,6 +1403,7 @@ The latest version of this license is in \hspace{\use:c {eb@toc@#1@numsep}} }{} } +\newtoggle{eb@titletoc@hang@fix} \__ctex_define:nn {tocset} { lists/lolskip .skip_set:N = \l__eb_toc_lolskip_skip, @@ -1417,29 +1418,22 @@ The latest version of this license is in tocline-fig .initial:n = { \figurename\space#1 - \ifodd\eb@titletoc@hang@fix - \else - \hspace{\eb@toc@lists@numsep} - \fi + \iftoggle{eb@titletoc@hang@fix}{} + {\hspace{\eb@toc@lists@numsep}} }, tocline-tab .cs_set:Np = \eb@labelname@lot#1, tocline-tab .initial:n = { \tablename\space#1 - \ifodd\eb@titletoc@hang@fix - \else - \hspace{\eb@toc@lists@numsep} - \fi + \iftoggle{eb@titletoc@hang@fix}{} + {\hspace{\eb@toc@lists@numsep}} }, tocline-lst .tl_set:N = \eb@labelname@lol, tocline-lst .initial:n = { - \lstlistingname\space - \thelstlisting - \ifodd\eb@titletoc@hang@fix - \else - \hspace{\eb@toc@lists@numsep} - \fi + \lstlistingname\space\thelstlisting + \iftoggle{eb@titletoc@hang@fix}{} + {\hspace{\eb@toc@lists@numsep}} }, line-align .bool_set:N = \l__eb_toc_line_align_bool, line-align .default:n = true, @@ -1448,7 +1442,7 @@ The latest version of this license is in hang .choice:, hang/true .code:n = { - \bool_set_true:N \eb@titletoc@hang@fix + \toggletrue{eb@titletoc@hang@fix} \ctex_set:n { chapter/tocline = \CTEXnumberline{##1}##2, @@ -1458,7 +1452,6 @@ The latest version of this license is in }, hang/false .code:n = { - \bool_set_false:N \eb@titletoc@hang@fix \ctex_set:n { chapter/tocline = \EbNumberline{##1}##2, @@ -1532,14 +1525,15 @@ The latest version of this license is in [\use:c {l__eb_toc_#2_indent_tl}] {\use:c {l__eb_toc_#2_format_tl}} { - \ifodd\eb@titletoc@hang@fix - \contentspush - { - \color{ctex@link} - \thecontentslabel - \hspace{\use:c {eb@toc@#2@numsep}} - } - \fi + \iftoggle{eb@titletoc@hang@fix} + { + \contentspush + { + \bool_if:NT \l__eb_toc_color_bool{\color{ctex@toc}} + \thecontentslabel + \hspace{\use:c {eb@toc@#2@numsep}} + } + }{} }{} {\use:c {l__eb_toc_#2_rule_tl}} } @@ -1565,9 +1559,7 @@ The latest version of this license is in { \addcontentsline{#1}{#2} { - \ifodd\eb@titletoc@hang@fix - \protect\numberline - \fi + \iftoggle{eb@titletoc@hang@fix}{\protect\numberline}{} {\prop_item:Nn \l__eb_label_name_prop{#2}{#3}}{#4} } } @@ -1578,9 +1570,7 @@ The latest version of this license is in }{ \addcontentsline{lol}{lstlisting} { - \ifodd\eb@titletoc@hang@fix - \protect\numberline - \fi + \iftoggle{eb@titletoc@hang@fix}{\protect\numberline}{} {\eb@labelname@lol}\lst@@caption } } @@ -2062,7 +2052,7 @@ The latest version of this license is in { label = (\Alph*), after-item-skip = 0ex plus .1ex, - column-sep = .5\ccwd, + column-sep = \ccwd, item-indent = 2\ccwd, label-width = 1.5\ccwd } @@ -2174,7 +2164,7 @@ The latest version of this license is in \end{tcolorbox} }{} \NewDocumentEnvironment{exercise} - {st+O{LightBlue}O{1.}D(){\c__eb_name_exercise_tl}o+O{}+b} + {st+O{LightSkyBlue}O{1.}D(){\c__eb_name_exercise_tl}o+O{}+b} { \IfBooleanTF{#2} { @@ -2498,29 +2488,43 @@ The latest version of this license is in }, } -\cs_new:Npn \__eb_allow_urlbreak: - { - \cs_new:Npn \__eb_add_urlbreak_points: - {\tl_map_function:NN \c__eb_urlbreak_points_tl\do} - \__eb_appto_cmd:Nn - \UrlBreaks{\UrlOrds\__eb_add_urlbreak_points:} - } -\tl_const:Nn \c__eb_urlbreak_points_tl - { - ABCDEFGHIJKLMNOPQRSTUVWXYZ - abcdefghijklmnopqrstuvwxyz - 0123456789 - } - -\__ctex_define:nx {link} +\bool_set_false:N \l__eb_toc_color_bool +\__ctex_define:nn {link} { hyperlink .choice:, hyperlink/edge .code:n = {}, - hyperlink/various .code:n = \__eb_put_hyperref:n {colorlinks}, hyperlink/none .code:n = \__eb_put_hyperref:n {hidelinks}, + hyperlink/various .code:n = + { + \bool_set_true:N \l__eb_toc_color_bool + \__eb_put_hyperref:n {colorlinks} + }, hyperlink .default:n = edge, hyperlink .initial:n = edge, + linktoc .choice:, + linktoc/unknown .code:n = + { + \__eb_put_hyperref:n {linktoc = #1} + \clist_map_inline:nn {page,none} + { + \tl_if_eq:NnT \l_keys_value_tl{##1} + {\clist_map_break:n {\colorlet{ctex@toc}{black}}} + } + }, + linktoc .default:n = all, + linktoc .initial:n = all, + unknown .code:n = + { + \__eb_put_hyperref:x + { + \l_keys_key_str + \tl_if_empty:NF \l_keys_value_tl{ = {#1}} + } + } + } +\__ctex_define:nx {link} + { linkcolor .choice:, \clist_map_function:nN { @@ -2532,23 +2536,10 @@ The latest version of this license is in \__eb_linkcolor_set:n linkcolor .default:n = navyblue, linkcolor .initial:n = navyblue, - linkcol-all .code:n = \__eb_define_linkcolor:n {\exp_not:n {#1}}, - - linktoc .choice:, - linktoc/unknown .code:n = - {\__eb_put_hyperref:n {linktoc = \exp_not:n {#1}}}, - linktoc .default:n = all, - linktoc .initial:n = all, - unknown .code:n = - { - \__eb_put_hyperref:x - { - \exp_not:N \l_keys_key_str - \exp_not:N \tl_if_empty:NF - \exp_not:N \l_keys_value_tl{ = \exp_not:n {#1}} - } - } + linkcol-all .code:n = + {\__eb_define_linkcolor:n {\exp_not:n {#1}}} } +\colorlet{ctex@toc}{ctex@link} \__ctex_define:nx {style} { color .choice:, @@ -2562,9 +2553,23 @@ The latest version of this license is in } \__eb_themecolor_set:n color .initial:n = none, - color-all .code:n = \__eb_define_themecolor:n {\exp_not:n {#1}} + color-all .code:n = + {\__eb_define_themecolor:n {\exp_not:n {#1}}} } +\cs_new:Npn \__eb_allow_urlbreak: + { + \cs_new:Npn \__eb_add_urlbreak_points: + {\tl_map_function:NN \c__eb_urlbreak_points_tl\do} + \__eb_appto_cmd:Nn + \UrlBreaks{\UrlOrds\__eb_add_urlbreak_points:} + } +\tl_const:Nn \c__eb_urlbreak_points_tl + { + ABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyz + 0123456789 + } \ctex_at_end_preamble:n { \RequirePackage{hyperref} diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index 519d1f72d66..aeb580d2cfe 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybook.cls +++ b/Master/texmf-dist/tex/latex/easybook/easybook.cls @@ -13,7 +13,7 @@ %% https://creativecommons.org/licenses/by/4.0/legalcode \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplClass{easybook}{2021/04/25}{1.24t}{beta} +\ProvidesExplClass{easybook}{2021/04/27}{1.24u}{beta} \cs_generate_variant:Nn \__ctex_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} @@ -507,6 +507,7 @@ \hspace{\use:c {eb@toc@#1@numsep}} }{} } +\newtoggle{eb@titletoc@hang@fix} \__ctex_define:nn {tocset} { lists/lolskip .skip_set:N = \l__eb_toc_lolskip_skip, @@ -521,29 +522,22 @@ tocline-fig .initial:n = { \figurename\space#1 - \ifodd\eb@titletoc@hang@fix - \else - \hspace{\eb@toc@lists@numsep} - \fi + \iftoggle{eb@titletoc@hang@fix}{} + {\hspace{\eb@toc@lists@numsep}} }, tocline-tab .cs_set:Np = \eb@labelname@lot#1, tocline-tab .initial:n = { \tablename\space#1 - \ifodd\eb@titletoc@hang@fix - \else - \hspace{\eb@toc@lists@numsep} - \fi + \iftoggle{eb@titletoc@hang@fix}{} + {\hspace{\eb@toc@lists@numsep}} }, tocline-lst .tl_set:N = \eb@labelname@lol, tocline-lst .initial:n = { - \lstlistingname\space - \thelstlisting - \ifodd\eb@titletoc@hang@fix - \else - \hspace{\eb@toc@lists@numsep} - \fi + \lstlistingname\space\thelstlisting + \iftoggle{eb@titletoc@hang@fix}{} + {\hspace{\eb@toc@lists@numsep}} }, line-align .bool_set:N = \l__eb_toc_line_align_bool, line-align .default:n = true, @@ -552,7 +546,7 @@ hang .choice:, hang/true .code:n = { - \bool_set_true:N \eb@titletoc@hang@fix + \toggletrue{eb@titletoc@hang@fix} \ctex_set:n { chapter/tocline = \CTEXnumberline{##1}##2, @@ -562,7 +556,6 @@ }, hang/false .code:n = { - \bool_set_false:N \eb@titletoc@hang@fix \ctex_set:n { chapter/tocline = \EbNumberline{##1}##2, @@ -636,14 +629,15 @@ [\use:c {l__eb_toc_#2_indent_tl}] {\use:c {l__eb_toc_#2_format_tl}} { - \ifodd\eb@titletoc@hang@fix - \contentspush - { - \color{ctex@link} - \thecontentslabel - \hspace{\use:c {eb@toc@#2@numsep}} - } - \fi + \iftoggle{eb@titletoc@hang@fix} + { + \contentspush + { + \bool_if:NT \l__eb_toc_color_bool{\color{ctex@toc}} + \thecontentslabel + \hspace{\use:c {eb@toc@#2@numsep}} + } + }{} }{} {\use:c {l__eb_toc_#2_rule_tl}} } @@ -669,9 +663,7 @@ { \addcontentsline{#1}{#2} { - \ifodd\eb@titletoc@hang@fix - \protect\numberline - \fi + \iftoggle{eb@titletoc@hang@fix}{\protect\numberline}{} {\prop_item:Nn \l__eb_label_name_prop{#2}{#3}}{#4} } } @@ -682,9 +674,7 @@ }{ \addcontentsline{lol}{lstlisting} { - \ifodd\eb@titletoc@hang@fix - \protect\numberline - \fi + \iftoggle{eb@titletoc@hang@fix}{\protect\numberline}{} {\eb@labelname@lol}\lst@@caption } } @@ -1166,7 +1156,7 @@ { label = (\Alph*), after-item-skip = 0ex plus .1ex, - column-sep = .5\ccwd, + column-sep = \ccwd, item-indent = 2\ccwd, label-width = 1.5\ccwd } @@ -1278,7 +1268,7 @@ \end{tcolorbox} }{} \NewDocumentEnvironment{exercise} - {st+O{LightBlue}O{1.}D(){\c__eb_name_exercise_tl}o+O{}+b} + {st+O{LightSkyBlue}O{1.}D(){\c__eb_name_exercise_tl}o+O{}+b} { \IfBooleanTF{#2} { @@ -1602,29 +1592,43 @@ }, } -\cs_new:Npn \__eb_allow_urlbreak: - { - \cs_new:Npn \__eb_add_urlbreak_points: - {\tl_map_function:NN \c__eb_urlbreak_points_tl\do} - \__eb_appto_cmd:Nn - \UrlBreaks{\UrlOrds\__eb_add_urlbreak_points:} - } -\tl_const:Nn \c__eb_urlbreak_points_tl - { - ABCDEFGHIJKLMNOPQRSTUVWXYZ - abcdefghijklmnopqrstuvwxyz - 0123456789 - } - -\__ctex_define:nx {link} +\bool_set_false:N \l__eb_toc_color_bool +\__ctex_define:nn {link} { hyperlink .choice:, hyperlink/edge .code:n = {}, - hyperlink/various .code:n = \__eb_put_hyperref:n {colorlinks}, hyperlink/none .code:n = \__eb_put_hyperref:n {hidelinks}, + hyperlink/various .code:n = + { + \bool_set_true:N \l__eb_toc_color_bool + \__eb_put_hyperref:n {colorlinks} + }, hyperlink .default:n = edge, hyperlink .initial:n = edge, + linktoc .choice:, + linktoc/unknown .code:n = + { + \__eb_put_hyperref:n {linktoc = #1} + \clist_map_inline:nn {page,none} + { + \tl_if_eq:NnT \l_keys_value_tl{##1} + {\clist_map_break:n {\colorlet{ctex@toc}{black}}} + } + }, + linktoc .default:n = all, + linktoc .initial:n = all, + unknown .code:n = + { + \__eb_put_hyperref:x + { + \l_keys_key_str + \tl_if_empty:NF \l_keys_value_tl{ = {#1}} + } + } + } +\__ctex_define:nx {link} + { linkcolor .choice:, \clist_map_function:nN { @@ -1636,23 +1640,10 @@ \__eb_linkcolor_set:n linkcolor .default:n = navyblue, linkcolor .initial:n = navyblue, - linkcol-all .code:n = \__eb_define_linkcolor:n {\exp_not:n {#1}}, - - linktoc .choice:, - linktoc/unknown .code:n = - {\__eb_put_hyperref:n {linktoc = \exp_not:n {#1}}}, - linktoc .default:n = all, - linktoc .initial:n = all, - unknown .code:n = - { - \__eb_put_hyperref:x - { - \exp_not:N \l_keys_key_str - \exp_not:N \tl_if_empty:NF - \exp_not:N \l_keys_value_tl{ = \exp_not:n {#1}} - } - } + linkcol-all .code:n = + {\__eb_define_linkcolor:n {\exp_not:n {#1}}} } +\colorlet{ctex@toc}{ctex@link} \__ctex_define:nx {style} { color .choice:, @@ -1666,9 +1657,23 @@ } \__eb_themecolor_set:n color .initial:n = none, - color-all .code:n = \__eb_define_themecolor:n {\exp_not:n {#1}} + color-all .code:n = + {\__eb_define_themecolor:n {\exp_not:n {#1}}} } +\cs_new:Npn \__eb_allow_urlbreak: + { + \cs_new:Npn \__eb_add_urlbreak_points: + {\tl_map_function:NN \c__eb_urlbreak_points_tl\do} + \__eb_appto_cmd:Nn + \UrlBreaks{\UrlOrds\__eb_add_urlbreak_points:} + } +\tl_const:Nn \c__eb_urlbreak_points_tl + { + ABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyz + 0123456789 + } \ctex_at_end_preamble:n { \RequirePackage{hyperref} |