summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/easybook
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-04-23 19:30:03 +0000
committerKarl Berry <karl@freefriends.org>2024-04-23 19:30:03 +0000
commitbb06846f91f3f2b4a56b9c875413dd9045ce4c29 (patch)
treeafb5b88953769aa97feeca0ec3acbf75a8bc0ed7 /Master/texmf-dist/tex/latex/easybook
parentab00113714975aa55e149ffed5ee9c8ac62346b2 (diff)
easybook (23apr24)
git-svn-id: svn://tug.org/texlive/trunk@71046 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/easybook')
-rw-r--r--Master/texmf-dist/tex/latex/easybook/easybase.sty106
-rw-r--r--Master/texmf-dist/tex/latex/easybook/easybook.cls2
-rw-r--r--Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg2
3 files changed, 65 insertions, 45 deletions
diff --git a/Master/texmf-dist/tex/latex/easybook/easybase.sty b/Master/texmf-dist/tex/latex/easybook/easybase.sty
index b28fd502d9a..1ec8b9ca6c5 100644
--- a/Master/texmf-dist/tex/latex/easybook/easybase.sty
+++ b/Master/texmf-dist/tex/latex/easybook/easybase.sty
@@ -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@up@fnmark
\cs_new:Npn \eb@@makefnmark #1#2
{
@@ -998,8 +998,7 @@
{ \use:c { CTEX@#1@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@toc@lol@skip } { \c_zero_skip }
{ \addtocontents{lol}{\protect\addvspace{\skip_use:N \eb@toc@lol@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@indent }}
+ {\exp_not:c { CTEX@#1@beforeskip }}
+ {\exp_not:c { CTEX@#1@afterskip }}
+ {\exp_not:N \normalfont\exp_not:c { CTEX@#1@format }}
+ }
+ \cs_new:cpn { CTEX@#1@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@numbering }
+ { \CTEX@ifnametrue }
+ { \CTEX@ifnamefalse }
+ \addcontentsline{#1}{#2}{\use:c { CTEX@#2@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@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,36 +2049,20 @@
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}
\def\Hy@colorlink ##1 {\begingroup}
\def\Hy@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@toc@number}{ctex@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@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} } }
}
}
}
diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls
index 7cffe14e679..0cbf6efe167 100644
--- a/Master/texmf-dist/tex/latex/easybook/easybook.cls
+++ b/Master/texmf-dist/tex/latex/easybook/easybook.cls
@@ -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
diff --git a/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg
index 48f32dc5d45..48cd0cc7d07 100644
--- a/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg
+++ b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg
@@ -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