diff options
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/easybook/easybook.dtx | 138 |
1 files changed, 50 insertions, 88 deletions
diff --git a/Master/texmf-dist/source/latex/easybook/easybook.dtx b/Master/texmf-dist/source/latex/easybook/easybook.dtx index d242a6773be..0e348a84ed7 100644 --- a/Master/texmf-dist/source/latex/easybook/easybook.dtx +++ b/Master/texmf-dist/source/latex/easybook/easybook.dtx @@ -15,7 +15,7 @@ %<*class> \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 @@ -48,8 +48,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, @@ -305,7 +303,7 @@ %<*package> \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 } @@ -384,13 +382,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} @@ -492,7 +490,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 @@ -1425,12 +1423,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} @@ -1472,16 +1465,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, @@ -1502,48 +1498,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} } @@ -1560,18 +1515,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: } @@ -1588,20 +1548,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: @@ -1619,7 +1584,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 } @@ -1727,7 +1692,7 @@ caption-listing = #1 }, caption-every .initial:n = 1.2, - every .meta:n = + every .meta:n = { line = #1,table = #1,math = #1, caption-every = #1,footnote = #1 @@ -2025,7 +1990,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} } } @@ -2054,7 +2019,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 @@ -2281,25 +2246,22 @@ \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 } } %</package> %<*tcolorbox> -\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 |