diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex/ctexbook.cls')
-rw-r--r-- | Master/texmf-dist/tex/latex/ctex/ctexbook.cls | 73 |
1 files changed, 35 insertions, 38 deletions
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexbook.cls b/Master/texmf-dist/tex/latex/ctex/ctexbook.cls index e99d1bae32f..67f587f15d8 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexbook.cls +++ b/Master/texmf-dist/tex/latex/ctex/ctexbook.cls @@ -27,10 +27,10 @@ \NeedsTeXFormat{LaTeX2e} \input{ctexbackend.cfg} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx 76d4e94 2020-06-06 23:22:18 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx e805781 2020-08-23 21:30:35 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese adapter for class book (CTEX)} \ProvidesExplClass{ctexbook} - {\ExplFileDate}{2.5.3}{\ExplFileDescription} + {\ExplFileDate}{2.5.4}{\ExplFileDescription} \tl_const:Nx \c__ctex_version_tl { \cs_if_exist_use:cF { ver@ \@currname . \@currext } { 9999/99/99 } } \cs_new_eq:cN { ver@ctex. \@pkgextension } \c__ctex_version_tl @@ -45,7 +45,7 @@ `l3kernel'~and~`l3packages'\\\\ using~your~TeX~package~manager~or~from~CTAN. } -\@ifpackagelater { expl3 } { 2020/04/06 } { } +\@ifpackagelater { expl3 } { 2020/07/17 } { } { \msg_error:nnn { ctex } { l3-too-old } { expl3 } } \@ifpackagelater { l3keys2e } { 2015/12/20 } { } { \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } } @@ -75,43 +75,27 @@ { \keys_set:nn { ctex } } \cs_new_protected:Npn \ctex_set:nn #1 { \keys_set:nn { ctex / #1 } } -\cs_new_protected:Npn \ctex_file_wrapper:nnn +\cs_new_protected:Npn \ctex_file_input:n #1 { - \exp_args:NNx \ExplSyntaxOff - \__ctex_file_wrapper_aux:nnnn - { - \bool_if:NTF \l__kernel_expl_bool - { \ExplSyntaxOn } - { \ExplSyntaxOff } - } + \cctab_begin:N \c__ctex_package_cctab + \file_input:n {#1} + \cctab_end: } -\cs_new_protected:Npn \__ctex_file_wrapper_aux:nnnn #1#2#3#4 +\cctab_const:Nn \c__ctex_package_cctab { - \use:x - { - \char_set_catcode_letter:n { 64 } - #2 - \exp_not:n {#3} - \char_set_catcode:nn { 64 } { \char_value_catcode:n { 64 } } - #4 - } - #1 + \cctab_select:N \c_document_cctab + \char_set_catcode_letter:n { 64 } } -\cs_new_protected:Npn \ctex_file_input:n #1 - { \ctex_file_wrapper:nnn { } { \file_input:n {#1} } { } } \cs_new_protected:Npn \ctex_scheme_input:n #1 { - \ctex_file_wrapper:nnn - { } - { - \tl_if_exist:NTF \c__ctex_class_tl - { - \file_if_exist_input:nF { ctex-scheme- #1 - \c__ctex_class_tl .def } - { \file_input:n { ctex-scheme- #1 .def } } - } - { \file_input:n { ctex-scheme- #1 .def } } - } - { } + \cctab_begin:N \c__ctex_package_cctab + \tl_if_exist:NTF \c__ctex_class_tl + { + \file_if_exist_input:nF { ctex-scheme- #1 - \c__ctex_class_tl .def } + { \file_input:n { ctex-scheme- #1 .def } } + } + { \file_input:n { ctex-scheme- #1 .def } } + \cctab_end: } \cs_generate_variant:Nn \ctex_scheme_input:n { o } \int_new:N \g__ctex_section_depth_int @@ -1401,12 +1385,25 @@ } \cs_new_protected:Npn \ctex_cleveref_hook: { - \ctex_patch_cmd:Nnn \refstepcounter@noarg - { \endcsname \csname the } - { \expandafter \endcsname \csname the } - \ctex_patch_cmd:Nnn \refstepcounter@optarg + \@ifpackageloaded { hyperref } + { \__ctex_cleveref_hook_aux:N \H@refstepcounter } + { + \__ctex_cleveref_hook_aux:N \refstepcounter@noarg + \__ctex_cleveref_hook_aux:N \refstepcounter@optarg + } + \__ctex_cleveref_hook_aux:N \appendix + } +\cs_new_protected:Npn \__ctex_cleveref_hook_aux:N #1 + { + \ctex_patch_cmd_all:NnnnTF #1 + { + \ExplSyntaxOff + \char_set_catcode_letter:n { 64 } + } { \endcsname \csname the } { \expandafter \endcsname \csname the } + { } + { \ctex_patch_failure:N #1 } } \cs_if_exist:NTF \labelformat { \ctex_varioref_hook: } |