From c7f4af9351d2e5e406973a85376ef74ca65b221f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 13 Feb 2022 21:25:26 +0000 Subject: easybook (13feb22) git-svn-id: svn://tug.org/texlive/trunk@62005 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/easybook/easybase.sty | 130 ++++++++------------- Master/texmf-dist/tex/latex/easybook/easybook.cls | 4 +- .../texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg | 2 +- 3 files changed, 49 insertions(+), 87 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/easybook/easybase.sty b/Master/texmf-dist/tex/latex/easybook/easybase.sty index f41e3752594..5fdd44f154e 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}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2022/02/12}{1.624} +\ProvidesExplPackage{easybase}{2022/02/13}{1.625} {Typeset Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -99,13 +99,13 @@ \msg_new:nnn { easybase } { package-repeat-load-ii } { The~macro~package~'#1'~has~been~loaded~repeatedly. } \cs_set_eq:NN \eb@usepackage@save \usepackage -\RenewDocumentCommand{\usepackage}{O{}m} +\RenewDocumentCommand{\usepackage}{O{}mO{}} { \PassOptionsToPackage{#1}{#2} \eb_seq_map_inline:nn {#2} { \eb_if_package_loaded:nnF {##1} {#1} - { \eb@usepackage@save{##1} } + { \eb@usepackage@save{##1}[#3] } } } \NewDocumentCommand{\LoadPackage}{O{}m} @@ -207,7 +207,7 @@ \msg_new:nnn { easybase } { no-chapter } { Your~document~class~is~in~'article'~mode. \\ - The~\string\chapter\ command~will~not~be~used. + The~'\string\chapter'\ command~will~not~be~used. } \LoadPackage @@ -1140,12 +1140,7 @@ \CTEX@addtocline{#1}{##2} \tl_if_empty:oF {##4} { \CTEX@addbitocline{#1}{##4} } \tl_set:Nn \l__eb__bitoc_mark_title_level_tl {#1} - \str_case:nn {#1} - { - { chapter } { \chaptermark{##2} } - { section } { \sectionmark{##2} } - { subsection } { \subsectionmark{##2} } - } + \use:c { #1mark }{##2} }{ \stepcounter{bi#1} \use:c {#1}[##2]{##3} @@ -1187,16 +1182,19 @@ } } -\tl_set:Nx \l__eb_toc_title_level_tl - { \bool_if:NTF \l__eb_class_mode_book_bool { chapter } { section } } \tl_new:N \eb@bitoc@title \keys_define:nn { eb/listoc } { - section .code:n = \tl_set:Nn \l__eb_toc_title_level_tl { section }, - chapter .code:n = \tl_set:Nn \l__eb_toc_title_level_tl { chapter }, - none .code:n = \tl_set:Nn \l__eb_toc_title_level_tl { none }, - article .meta:n = section, - book .meta:n = chapter, + level .tl_set:N = \eb@toc@title@level, + level .initial:n = + { + \bool_if:NTF \l__eb_class_mode_book_bool + { \bichapter* } + { \bisection* } + }, + section .meta:n = { level = \bisection* }, + chapter .meta:n = { level = \bichapter* }, + none .code:n = { }, multoc .int_set:N = \l__eb_toc_columns_int, multoc .default:n = 2, multoc .initial:n = 1, @@ -1217,48 +1215,7 @@ { \tl_clear:N \eb@bitoc@title } { \tl_set:Nn \eb@bitoc@title {#2} } } - -\cs_new_protected:Npn \eb_toc_title_level_initial: - { - \bool_if:NF \l__eb_class_mode_book_bool - { - \tl_if_eq:NnT \l__eb_toc_title_level_tl { chapter } - { \tl_set:Nn \l__eb_toc_title_level_tl { section } } - } - } -\cs_new_protected:Npn \eb_title_mark_intoc:n #1 - { - \str_case:Vn \l__eb_toc_title_level_tl - { - { chapter } { \bichapter*{#1}{\eb@bitoc@title} } - { section } { \bisection*{#1}{\eb@bitoc@title} } - } - } -\cs_new_protected:Npn \eb_title_mark_notoc:n #1 - { - \str_case:Vn \l__eb_toc_title_level_tl - { - { chapter } { \chapter*{\phantomsection #1}\chaptermark{#1} } - { section } { \section*{\phantomsection #1}\sectionmark{#1} } - } - } -\cs_new_protected:Npn \eb_title_number_intoc_spec:nn #1#2 - { - \eb_toc_title_level_initial: - \IfBooleanTF{#1} - { - \str_case:Vn \l__eb_toc_title_level_tl - { - { chapter } { \bichapter{\eb@toc@title}{\eb@bitoc@title} } - { section } { \bisection{\eb@toc@title}{\eb@bitoc@title} } - } - }{ - \IfBooleanTF{#2} - {\eb_title_mark_notoc:n { \eb@toc@title }} - {\eb_title_mark_intoc:n { \eb@toc@title }} - } - } -\cs_new_protected:Npn \eb_biber_title_level_spec:n #1 +\cs_new_protected:Npn \eb_biber_toc_title:n #1 { \bool_if:NTF \l__eb_class_mode_book_bool { \bichapter*{#1}{\eb@bib@bitoc@title} } @@ -1275,18 +1232,23 @@ } { \@starttoc{#1} } } -\cs_new_protected:Npn \eb_toc_if_title_between_hook:n #1 +\cs_new_protected:Npn \eb_toc_if_title_between_hook:nn #1#2 + { + \IfBooleanF{#1} + {\tl_use:c { l__eb_toc_#2_between_hook_tl }} + } +\cs_new_protected:Npn \eb_toc_title_level_cmd:n #1 { - \tl_if_eq:NnF \l__eb_toc_title_level_tl { none } - { \tl_use:c { l__eb_toc_#1_between_hook_tl } } + \IfBooleanF{#1} + {\eb@toc@title@level{\eb@toc@title}{\eb@bitoc@title}} } \cs_new_protected:Npn \eb_toc_list_parse:nnnnn #1#2#3#4#5 { \group_begin: \tl_set_eq:Nc \eb@toc@title { list#4name } \IfValueT{#3}{\keys_set:nn { eb/listoc } {#3}} - \eb_title_number_intoc_spec:nn {#2} {#1} - \eb_toc_if_title_between_hook:n {#4} + \eb_toc_title_level_cmd:n {#1} + \eb_toc_if_title_between_hook:nn {#1} {#4} \eb_toc_start_multi_column_ext:n {#5} \group_end: } @@ -1303,20 +1265,25 @@ } { \eb_list_content_cmd_set:nn #1 } \cs_set_eq:NN \listoflistings \listoflstlistings -\RenewDocumentCommand{\tableofcontents}{t+oD(){}} +\RenewDocumentCommand{\tableofcontents}{st+oD(){}} { \group_begin: \tl_set_eq:NN \eb@toc@title \contentsname \tl_set:Nn \eb@bitoc@title { Contents } - \IfValueT{#2}{\keys_set:nn { eb/listoc } {#2}} - \eb_toc_title_level_initial: - \eb_title_mark_notoc:n { \eb@toc@title } - \eb_toc_if_title_between_hook:n { main } - \eb_toc_start_multi_column_ext:n { toc }#3 - \IfBooleanT{#1} - { - \eb_title_mark_notoc:n { \eb@bitoc@title } - \eb_toc_if_title_between_hook:n { main } + \tl_set:Nn \eb@toc@title@level + { + \bool_if:NTF \l__eb_class_mode_book_bool + { \chapter* } + { \section* } + } + \IfValueT{#3}{\keys_set:nn { eb/listoc } {#3}} + \IfBooleanF{#1}{\eb@toc@title@level{\eb@toc@title}{}} + \eb_toc_if_title_between_hook:nn {#1} { main } + \eb_toc_start_multi_column_ext:n { toc }#4 + \IfBooleanT{#2} + { + \IfBooleanF{#1}{\eb@toc@title@level{\eb@bitoc@title}{}} + \eb_toc_if_title_between_hook:nn {#1} { main } \eb_toc_start_multi_column_ext:n { tec } } \group_end: @@ -1334,7 +1301,7 @@ \IfValueT{#3}{\keys_set:nn { eb/listoc } {#3}} \cs_set_protected:Npn \imki@indexheaders { - \eb_title_number_intoc_spec:nn {#2} {#1} + \eb_toc_title_level_cmd:n {#1} \cs_set_eq:NN \thispagestyle \use_none:n \cs_undefine:N \imki@firstpagestyle } @@ -1740,7 +1707,7 @@ \IfValueT{##3}{ \keys_set:nn { eb/listoc } {##3} } \cs_set_protected:Npn \bibsection { - \eb_title_number_intoc_spec:nn {##2} {##1} + \eb_toc_title_level_cmd:n {##1} \int_compare:nNnT { \l__eb_toc_columns_int } > { 1 } { \begin{multicols}{\int_use:N \l__eb_toc_columns_int} } } @@ -1769,7 +1736,7 @@ \LoadPackage[backend = biber]{biblatex} \clist_map_function:NN \l__eb_bib_datafile_clist \addbibresource \tl_gset:Nn \blx@default@theheading { bibintoc } - \defbibheading{bibintoc}[\bibname]{\eb_biber_title_level_spec:n {##1}} + \defbibheading{bibintoc}[\bibname]{\eb_biber_toc_title:n {##1}} \skip_zero:N \bibitemsep } \eb_at_end_preamble:n @@ -1996,18 +1963,15 @@ \keys_set_known:nn { ctex } { contentsname = 目\hspace{1em}录, - indexname = 索\hspace{1em}引, - abstractname = 摘\hspace{1em}要, - listfigurename = 图片索引, - listtablename = 表格索引, - lstlistlistingname = 代码索引, + listfigurename = 插图清单, + listtablename = 附表清单, + lstlistlistingname = 代码清单, lstlistingname = 代码 } } { \keys_set_known:nn { ctex } { - abstractname = Abstract, lstlistlistingname = List~of~Codes, lstlistingname = Code } diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index 925061d743b..c66837288a5 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}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2022/02/12}{1.624} +\ProvidesExplClass{easybook}{2022/02/13}{1.625} {Typeset Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool @@ -53,8 +53,6 @@ \bool_set_false:N \l__eb_class_mode_book_bool \eb_put_ctexbook:n { oneside } }, - book .meta:n = { class = book }, - article .meta:n = { class = article }, config .clist_gset:N = \g__eb_config_file_clist, floatpage .bool_set:N = \l__eb_float_page_bool, theorem .bool_set:N = \l__eb_theorem_support_bool, diff --git a/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg index 5355f457b16..1bdc14859ff 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}{2022/02/12}{1.624} +\ProvidesExplFile{eb-tcolorbox.cfg}{2022/02/13}{1.625} {Customization of tcolorbox for easybook} \cs_set_protected:Npn \addtotcbstyle #1#2 -- cgit v1.2.3