diff options
author | Norbert Preining <preining@logic.at> | 2021-04-05 22:44:59 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2021-04-05 22:44:59 +0000 |
commit | 1347bfb1c9e27a8be7d4e4a6a9301a453a363d91 (patch) | |
tree | a7e991510fdf1ef797a680c9b9b16a1ee63922a7 /Master/texmf-dist/tex/latex | |
parent | f4734932da0d63063af2a47e6d7788878d1045d9 (diff) |
easybook (6apr21)
git-svn-id: svn://tug.org/texlive/trunk@58762 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybook.cls | 123 |
1 files changed, 59 insertions, 64 deletions
diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index 07834e95828..4cae8557d8e 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} -\ProvidesExplClass{easybook}{2021/04/03}{1.24c}{beta} +\ProvidesExplClass{easybook}{2021/04/04}{1.24d}{beta} \cs_generate_variant:Nn \keys_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} @@ -44,20 +44,17 @@ english .code:n = \bool_set_false:N \l__lang_chinese_bool, enstyle .meta:n = {newline,entitle,english}, - font .choice:, - font .value_required:n = true, - font/overleaf .code:n = {}, - font/adobe .code:n = \__put_ctexbook:n {fontset = #1}, - font/founder .code:n = \__put_ctexbook:n {fontset = #1}, - font/mac .code:n = \__put_ctexbook:n {fontset = #1}, - font/windows .code:n = \__put_ctexbook:n {fontset = #1}, - font/linux .code:n = \__put_ctexbook:n {fontset = ubuntu}, - font/none .code:n = \__put_ctexbook:n {fontset = #1}, + font .choices:nn = + {adobe,founder,mac,windows,none} + {\__put_ctexbook:n {fontset = \l_keys_choice_tl}}, font/noto .code:n = { \bool_set_true:N \l__font_noto_bool \__put_ctexbook:n {fontset = none} }, + font/overleaf .code:n = {}, + font/linux .code:n = \__put_ctexbook:n {fontset = ubuntu}, + font .value_required:n = true, font .initial:n = overleaf, paper .choice:, @@ -131,39 +128,36 @@ } \__ctex_define:nn {style} { - multoc .bool_set:N = \l__multoc_bool, - multoc .default:n = true, - withpart .bool_set:N = \l__chap_withpart_bool, - withpart .default:n = true, - withpart .initial:n = false, - notomath .bool_set:N = \l__notomath_bool, - notomath .default:n = true, - notomath .initial:n = false, - rulewidth .dim_set:N = \l__rule_width_dim, - rulewidth .initial:n = 0.75pt, - uppercase .bool_set:N = \l__uppercase_bool, - uppercase .default:n = true, - uppercase .initial:n = true, + multoc .bool_set:N = \l__multoc_bool, + multoc .default:n = true, + withpart .bool_set:N = \l__chap_withpart_bool, + withpart .default:n = true, + withpart .initial:n = false, + notomath .bool_set:N = \l__notomath_bool, + notomath .default:n = true, + notomath .initial:n = false, + rulewidth .dim_set:N = \l__rule_width_dim, + rulewidth .initial:n = 0.75pt, + uppercase .bool_set:N = \l__uppercase_bool, + uppercase .default:n = true, + uppercase .initial:n = true, - footwith .choice:, - footwith .value_required:n = true, - footwith/part .code:n = - {\tl_set:Nn \l__foot_numberwith_tl{#1}}, - footwith/page .code:n = - {\tl_set:Nn \l__foot_numberwith_tl{#1}}, - footwith/chapter .code:n = {}, - footwith .initial:n = chapter, + footwith .choices:nn = + {part,page,chapter} + {\tl_set_eq:NN \l__foot_numberwith_tl\l_keys_choice_tl}, + footwith .value_required:n = true, + footwith .initial:n = chapter, - figure-sep .tl_set:N = \l__figure_separator_tl, - table-sep .tl_set:N = \l__table_separator_tl, - listing-sep .tl_set:N = \l__lstlisting_separator_tl, - equation-sep .tl_set:N = \l__equation_separator_tl, - number-sep .meta:n = + figure-sep .tl_set:N = \l__figure_separator_tl, + table-sep .tl_set:N = \l__table_separator_tl, + listing-sep .tl_set:N = \l__lstlisting_separator_tl, + equation-sep .tl_set:N = \l__equation_separator_tl, + number-sep .meta:n = { figure-sep = {#1},table-sep = {#1}, listing-sep = {#1},equation-sep = {#1} }, - number-sep .initial:n = {.} + number-sep .initial:n = {.} } \RequirePackage @@ -587,7 +581,8 @@ book .code:n = {}, multoc .bool_set:N = \l__multoc_bool, multoc .default:n = true, - multoc .initial:n = false + multoc .initial:n = false, + title .tl_set:N = \toc@title } \cs_new_protected:Npn \__title_mark_intoc:n #1 @@ -633,12 +628,19 @@ \fi }{\tl_set:Nn \l__toc_type_tl{article}} } +\cs_new_protected:Npn \__title_ifintoc_set:n #1 + { + \IfBooleanTF{#1} + {\__title_mark:n {\toc@title}} + {\__title_mark_intoc:n {\toc@title}} + } \RenewDocumentCommand{\tableofcontents}{o} { \group_begin: + \tl_set_eq:NN \toc@title\contentsname \IfValueT{#1}{\keys_set:nn {listoc}{#1}} \__ifmultoc_pre_set: - \__title_mark:n {\contentsname} + \__title_mark:n {\toc@title} \vspace*{\dim_use:N \l__toc_offset_dim} \@starttoc{toc} \__ifmultoc_post_set: @@ -647,11 +649,10 @@ \RenewDocumentCommand{\listoffigures}{so} { \group_begin: + \tl_set_eq:NN \toc@title\listfigurename \IfValueT{#2}{\keys_set:nn {listoc}{#2}} \__ifmultoc_pre_set: - \IfBooleanTF{#1} - {\__title_mark:n {\listfigurename}} - {\__title_mark_intoc:n {\listfigurename}} + \__title_ifintoc_set:n {#1} \dim_add:NV \l__toc_offset_dim\l__toc_listsoffset_dim \vspace*{\dim_use:N \l__toc_offset_dim} \@starttoc{lof} @@ -661,11 +662,10 @@ \RenewDocumentCommand{\listoftables}{so} { \group_begin: + \tl_set_eq:NN \toc@title\listtablename \IfValueT{#2}{\keys_set:nn {listoc}{#2}} \__ifmultoc_pre_set: - \IfBooleanTF{#1} - {\__title_mark:n {\listtablename}} - {\__title_mark_intoc:n {\listtablename}} + \__title_ifintoc_set:n {#1} \dim_add:NV \l__toc_offset_dim\l__toc_listsoffset_dim \vspace*{\dim_use:N \l__toc_offset_dim} \@starttoc{lot} @@ -675,11 +675,10 @@ \NewDocumentCommand{\listoflistings}{so} { \group_begin: + \tl_set_eq:NN \toc@title\lstlistlistingname \IfValueT{#2}{\keys_set:nn {listoc}{#2}} \__ifmultoc_pre_set: - \IfBooleanTF{#1} - {\__title_mark:n {\lstlistlistingname}} - {\__title_mark_intoc:n {\lstlistlistingname}} + \__title_ifintoc_set:n {#1} \dim_add:NV \l__toc_offset_dim\l__toc_listsoffset_dim \vspace*{\dim_use:N \l__toc_offset_dim} \@starttoc{lol} @@ -1226,14 +1225,10 @@ \NewDocumentCommand{\printbibliography}{so} { \group_begin: + \tl_set_eq:NN \toc@title\bibname \IfValueT{##2}{\keys_set:nn {listoc}{##2}} \__ifmultoc_pre_set: - \cs_set:Npn \bibsection - { - \IfBooleanTF{##1} - {\__title_mark:n {\bibname}} - {\__title_mark_intoc:n {\bibname}} - } + \cs_set:Npn \bibsection{\__title_ifintoc_set:n {##1}} \exp_args:NV \bibliography\l__bib_file_tl \__ifmultoc_post_set: \group_end: @@ -1460,13 +1455,13 @@ { \keys_set_known:nn {ctex} { - contentsname = {目\hspace{\ccwd}录}, - indexname = {索\hspace{\ccwd}引}, - listfigurename = {图片索引}, - listtablename = {表格索引}, - abstractname = {摘\hspace{\ccwd}要}, - lstlistlistingname = {代码索引}, - lstlistingname = {代码} + contentsname = 目\hspace{\ccwd}录, + indexname = 索\hspace{\ccwd}引, + listfigurename = 图片索引, + listtablename = 表格索引, + abstractname = 摘\hspace{\ccwd}要, + lstlistlistingname = 代码索引, + lstlistingname = 代码 } \crefformat{equation}{#2式(#1)#3} \crefformat{align}{#2式(#1)#3} @@ -1486,9 +1481,9 @@ }{ \keys_set_known:nn {ctex} { - abstractname = {Abstract}, - lstlistlistingname = {List~of~Listings}, - lstlistingname = {Code} + abstractname = Abstract, + lstlistlistingname = List~of~Listings, + lstlistingname = Code } \crefformat{equation}{#2Equation~(#1)#3} \crefformat{align}{#2Equation~(#1)#3} |