summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/easybook/easybook.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/easybook/easybook.dtx')
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx101
1 files changed, 55 insertions, 46 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index fb8203e55f..659bc9e1e8 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -15,7 +15,7 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2021/10/25}{1.40H}
+\ProvidesExplClass{easybook}{2021/10/30}{1.40I}
{Typeset Chinese theses or books}
\bool_set_false:N \l__eb_compile_draft_bool
@@ -325,7 +325,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2021/10/25}{1.40H}
+\ProvidesExplPackage{easybase}{2021/10/30}{1.40I}
{Typeset Chinese theses or books}
\cs_generate_variant:Nn \dim_set:Nn { NV }
@@ -2302,49 +2302,6 @@
{ color } { theme }
}
{ \eb_color_assign_cmd_set:nn #1 }
-
-\bool_set_false:N \l__eb_toc_number_color_bool
-\ctex_define:nn { refset }
- {
- linktype .choice:,
- linktype .value_required:n = true,
- linktype/edge .code:n =
- { \AtBeginDocument[hyperref]{\tl_set:Nn \@pdfborder { 0~0~1 }} },
- linktype/none .code:n =
- { \AtBeginDocument[hyperref]{\tl_set:Nn \@pdfborder { 0~0~0 }} },
- linktype/colors .code:n =
- {
- \bool_set_true:N \l__eb_toc_number_color_bool
- \colorlet{ctex@toc@number}{ctex@link}
- \eb_put_hyperref:n { colorlinks }
- },
- linktype/various .meta:n = linktype/colors,
- linktype .initial:n = edge,
-
- linktoc .choice:,
- linktoc/unknown .code:n =
- {
- \eb_put_hyperref:n { linktoc = #1 }
- \eb_clist_map_inline:nn { page,none }
- {
- \tl_if_eq:NnT \l_keys_value_tl {##1}
- {
- \colorlet{ctex@toc@number}{black}
- \seq_map_break:
- }
- }
- },
- 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 { refset }
{
linkcolor .choice:,
@@ -2378,6 +2335,58 @@
{ \eb_define_theme_color:n { \exp_not:n {#1} } }
}
+\bool_set_false:N \l__eb_toc_number_color_bool
+\cs_new_protected:Npn \eb_link_border_set:n #1
+ {
+ \AtBeginDocument
+ {
+ \def\@pdfborder{#1}
+ \def\Hy@colorlink ##1 {\begingroup}
+ \def\Hy@endcolorlink{\endgroup}
+ }
+ }
+\cs_new_protected:Npn \eb_link_colors_set:
+ {
+ \bool_set_true:N \l__eb_toc_number_color_bool
+ \colorlet{ctex@toc@number}{ctex@link}
+ \eb_put_hyperref:n { colorlinks }
+ }
+\cs_new_protected:Npn \eb_link_toc_put:n #1
+ {
+ \eb_put_hyperref:n { linktoc = #1 }
+ \eb_clist_map_inline:nn { page,none }
+ {
+ \tl_if_eq:NnT \l_keys_value_tl {##1}
+ {
+ \colorlet{ctex@toc@number}{black}
+ \seq_map_break:
+ }
+ }
+ }
+\ctex_define:nn { refset }
+ {
+ linktype .choice:,
+ linktype .value_required:n = true,
+ linktype/edge .code:n = \eb_link_border_set:n { 0~0~1 },
+ linktype/none .code:n = \eb_link_border_set:n { 0~0~0 },
+ linktype/colors .code:n = \eb_link_colors_set:,
+ linktype/various .meta:n = linktype/colors,
+ linktype .initial:n = edge,
+
+ linktoc .choice:,
+ 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
+ {
+ \l_keys_key_str
+ \tl_if_empty:NF \l_keys_value_tl { = {#1} }
+ }
+ }
+ }
+
\cs_new:Npn \eb_allow_url_break:
{
\eb_appto_cmd:Nn \UrlBreaks
@@ -2445,7 +2454,7 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2021/10/25}{1.40H}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2021/10/30}{1.40I}
{Customization of tcolorbox for easybook}
\tl_gset:Nn \eb@tc@line@skip { 0.5\baselineskip }