diff options
68 files changed, 1424 insertions, 864 deletions
diff --git a/Master/texmf-dist/doc/latex/ctex/ctex.pdf b/Master/texmf-dist/doc/latex/ctex/ctex.pdf Binary files differindex 1f2e3782cad..c5faadac1e5 100644 --- a/Master/texmf-dist/doc/latex/ctex/ctex.pdf +++ b/Master/texmf-dist/doc/latex/ctex/ctex.pdf diff --git a/Master/texmf-dist/source/latex/ctex/ctex.dtx b/Master/texmf-dist/source/latex/ctex/ctex.dtx index e01c5519d51..0f966066251 100644 --- a/Master/texmf-dist/source/latex/ctex/ctex.dtx +++ b/Master/texmf-dist/source/latex/ctex/ctex.dtx @@ -443,7 +443,7 @@ Copyright and Licence %<class|style|ctexcap|ctexhook|ctexpatch>\NeedsTeXFormat{LaTeX2e} %<class>\input{ctexbackend.cfg} %<class|style|ctexcap|ctexhook|ctexpatch>\RequirePackage{expl3} -%<+!driver>\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +%<+!driver>\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ %<ctex> {Chinese adapter in LaTeX (CTEX)} %<ctex>\ProvidesExplPackage{\ExplFileName} %<ctexsize> {Chinese font size definition (CTEX)} @@ -530,7 +530,7 @@ Copyright and Licence %<founder>\ProvidesExplFile{ctex-fontset-founder.def} %<ubuntu> {Ubuntu fonts definition (CTEX)} %<ubuntu>\ProvidesExplFile{ctex-fontset-ubuntu.def} -%<!driver> {\ExplFileDate}{2.5.9}{\ExplFileDescription} +%<!driver> {\ExplFileDate}{2.5.10}{\ExplFileDescription} %</!(fd|ctexspa|dict|backend)> %<c19&rm>\ProvidesFile{c19rm.fd}% %<c19&sf>\ProvidesFile{c19sf.fd}% @@ -548,10 +548,10 @@ Copyright and Licence %<backend>\ProvidesFile{ctexbackend.cfg}% %<dict&theorem&GBK>\ProvidesDictionary{translator-theorem-dictionary}{ChineseGBK}% %<dict&theorem&UTF8>\ProvidesDictionary{translator-theorem-dictionary}{ChineseUTF8}% -%<fd> [2022/06/04 v2.5.9 Chinese font definition (CTEX)] -%<ctexspa> [2022/06/04 v2.5.9 Space info for CJKpunct (CTEX)] -%<backend> [2022/06/04 v2.5.9 Backend configuration file (CTEX)] -%<dict&theorem> [2022/06/04 v2.5.9 Chinese translation for theorem name (CTEX)] +%<fd> [2022/07/14 v2.5.10 Chinese font definition (CTEX)] +%<ctexspa> [2022/07/14 v2.5.10 Space info for CJKpunct (CTEX)] +%<backend> [2022/07/14 v2.5.10 Backend configuration file (CTEX)] +%<dict&theorem> [2022/07/14 v2.5.10 Chinese translation for theorem name (CTEX)] %</!(driver|readme|install|zhmap|spa|docstrip)> %<*driver> \documentclass{ctxdoc} @@ -575,7 +575,7 @@ Copyright and Licence % \changes{v2.4.15}{2019/03/23}{同步 \LaTeXiii{} 2019/03/05。} % \changes{v2.5.1}{2020/05/02}{\pkg{zhconv} 更名为 \pkg{ctex-zhconv}。} % -% \CheckSum{6444} +% \CheckSum{6630} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -1608,7 +1608,6 @@ Copyright and Licence % % 多层选项之间用斜线分开,例如,\opt{part/name} 选项设置 \tn{part} 标题的在数 % 字前后的名称,而 \opt{section/number} 选项设置 \tn{section} 标题的数字类型。 -% 注意,斜线 |/| 的前后不能有空格或者换行。 % % 使用 \tn{ctexset} 设置多级选项时,还可以在同一个上级选项下设置多个下级选项。 % 例如,同时设置 |part| 一级标题的 \opt{pagestyle} 选项,|chapter| 一级标题的 @@ -3294,10 +3293,13 @@ Copyright and Licence % \end{macrocode} % % \changes{v2.5.9}{2022/05/27}{设置消息模块的名字和类型。} +% \changes{v2.5.10}{2022/06/10}{更新一些内部函数。} +% \changes{v2.5.10}{2022/07/08}{不直接依赖 \pkg{xparse} 和 \pkg{l3keys2e}。} % % \begin{macrocode} %<*class|style> -\RequirePackage { xparse , l3keys2e } +\cs_if_exist:NF \NewDocumentCommand + { \RequirePackage { xparse } } %<class>\prop_gput:Nnn \g_msg_module_type_prop { ctex } { Class } %<article>\prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexart } %<book>\prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexbook } @@ -3317,7 +3319,7 @@ Copyright and Licence % \changes{v2.4.10}{2017/07/22}{使用 \texttt{lazy} 函数对 Boolean 表达式 % 进行最小化运算(\LaTeXiii{} 2017/07/19)。} % -% 检查 \pkg{expl3} 和 \pkg{l3keys2e} 的版本。 +% 检查 \pkg{expl3} 的版本。 % \begin{macrocode} \msg_new:nnnn { ctex } { l3-too-old } { Support~package~`#1'~too~old. } @@ -3326,12 +3328,8 @@ Copyright and Licence `l3kernel'~and~`l3packages'\\\\ using~your~TeX~package~manager~or~from~CTAN. } -\@ifpackagelater { expl3 } { 2020/07/17 } { } +\@ifpackagelater { expl3 } { 2021/02/10 } { } { \msg_error:nnn { ctex } { l3-too-old } { expl3 } } -%<*class> -\@ifpackagelater { l3keys2e } { 2015/12/20 } { } - { \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } } -%</class> % \end{macrocode} % % \begin{variable}{\c_@@_engine_str,\c_@@_engine_file_str} @@ -3561,10 +3559,19 @@ Copyright and Licence % \end{macrocode} % \end{macro} % -% \begin{variable}{\g_@@_std_options_clist} +% \begin{variable}{\ctex_load_std_class:n,\g_@@_std_options_clist} % 保存传递给标准文档类的选项。 +% 使用 \tn{PassOptionsToClass} 是为了预防可能存在的选项冲突,选项列表展开后再传递。 % \begin{macrocode} %<*class> +\cs_new_protected:Npn \ctex_load_std_class:n #1 + { + \tl_const:Nn \c_@@_class_tl {#1} + \exp_args:No \PassOptionsToClass + { \g_@@_std_options_clist } + {#1} + \LoadClass {#1} + } \clist_new:N \g_@@_std_options_clist %</class> % \end{macrocode} @@ -3797,7 +3804,7 @@ Copyright and Licence space .choices:nn = { true , auto , false } { - \exp_args:Nx \ctex_at_end:n + \exp_args:Ne \ctex_at_end:n { \ctex_set:n { space = \l_keys_choice_tl } } } , space .default:n = { true } , @@ -3983,7 +3990,12 @@ Copyright and Licence % 处理宏包选项。 % \begin{macrocode} %<*class|style> -\ProcessKeysOptions { ctex / option } +\cs_if_exist:NTF \ProcessKeyOptions + { \ProcessKeyOptions [ ctex / option ] } + { + \RequirePackage { l3keys2e } + \ProcessKeysOptions { ctex / option } + } %</class|style> % \end{macrocode} % @@ -4014,27 +4026,19 @@ Copyright and Licence } % \end{macrocode} % -% 使用 \tn{PassOptionsToClass} 是为了预防可能存在的选项冲突。 +% 载入标准文档类。 % \begin{macrocode} %<*article> -\tl_const:Nn \c_@@_class_tl { article } -\PassOptionsToClass { \g_@@_std_options_clist } { article } -\LoadClass { article } +\ctex_load_std_class:n { article } %</article> %<*book> -\tl_const:Nn \c_@@_class_tl { book } -\PassOptionsToClass { \g_@@_std_options_clist } { book } -\LoadClass { book } +\ctex_load_std_class:n { book } %</book> %<*report> -\tl_const:Nn \c_@@_class_tl { report } -\PassOptionsToClass { \g_@@_std_options_clist } { report } -\LoadClass { report } +\ctex_load_std_class:n { report } %</report> %<*beamer> -\tl_const:Nn \c_@@_class_tl { beamer } -\PassOptionsToClass { \g_@@_std_options_clist } { beamer } -\LoadClass { beamer } +\ctex_load_std_class:n { beamer } %</beamer> % \end{macrocode} % @@ -4151,8 +4155,8 @@ Copyright and Licence { \tl_gput_right:cn { #1 + #2 } { \ctex_add_cmap:n {#1} } } } } -\cs_generate_variant:Nn \ctex_family_cmap:nn { x } -\cs_new_eq:NN \CTEX@Family@CMap \ctex_family_cmap:xn +\cs_generate_variant:Nn \ctex_family_cmap:nn { ee } +\cs_new_eq:NN \CTEX@Family@CMap \ctex_family_cmap:ee % \end{macrocode} % \end{macro} % @@ -4160,6 +4164,7 @@ Copyright and Licence % % \begin{macro}[int]{\ctex_add_cmap:n} % \changes{v2.5.7}{2021/06/06}{确保 cmap 文件存在。} +% \changes{v2.5.10}{2022/07/11}{使用封装好的函数。} % 给 |#1| 编码的 CJK 字体加上 CMap。 % \begin{macrocode} \cs_new_protected:Npn \ctex_add_cmap:n #1 @@ -4179,12 +4184,14 @@ Copyright and Licence \exp_args:Ne \file_get_full_name:nNTF { \str_lowercase:n {#2} .cmap } \l_@@_cmap_file_tl { - \tex_immediate:D \tex_pdfobj:D stream ~ file { \l_@@_cmap_file_tl } + \pdf_object_unnamed_write:nx + { fstream } + { { } { \l_@@_cmap_file_tl } } \cs_new_protected:Npx #1 { \pdfnobuiltintounicode \tex_font:D \tex_pdffontattr:D \tex_font:D - { /ToUnicode ~ \int_value:w \tex_pdflastobj:D \c_space_tl 0 ~ R } + { /ToUnicode ~ \pdf_object_ref_last: } } } { \cs_new_eq:NN #1 \prg_do_nothing: } @@ -4196,39 +4203,40 @@ Copyright and Licence % \begin{macro}[int]{\DeclareFontFamily} % 只在 \pdfLaTeX{} 下加 CMap。如 \pkg{cmap} 宏包被引入,则不重复设置。 % \begin{macrocode} -\group_begin: -\char_set_catcode_other:N \# -\sys_if_output_pdf:TF +\sys_if_output_pdf:T { - \group_end: - \ctex_appto_cmd:NnnTF \DeclareFontFamily { \ExplSyntaxOff } - { \CTEX@Family@CMap {#1} {#2} } + \exp_args:Nno \use:n + { \cs_gset_protected:Npn \DeclareFontFamily #1#2#3 } { - \ctex_at_end_package:nn { cmap } - { - \cs_gset_eq:NN \ctex_add_cmap:n \use_none:n - \cs_gset_eq:NN \CTEX@Family@CMap \use_none:nn - } + \DeclareFontFamily {#1} {#2} {#3} + \CTEX@Family@CMap {#1} {#2} + } + \ctex_at_end_package:nn { cmap } + { + \cs_gset_eq:NN \ctex_add_cmap:n \use_none:n + \cs_gset_eq:NN \CTEX@Family@CMap \use_none:nn } - { \ctex_patch_failure:N \DeclareFontFamily } } - { \group_end: } % \end{macrocode} % \end{macro} % % 首先检查选项,决定是否载入 \pkg{zhmCJK} 宏包。 % \begin{macrocode} -\if_bool:N \g_@@_zhmCJK_bool - \PassOptionsToPackage { encoding = \g_@@_encoding_tl } { zhmCJK } - \RequirePackage { zhmCJK } +\bool_if:NTF \g_@@_zhmCJK_bool + { + \exp_args:Ne \PassOptionsToPackage + { encoding = \g_@@_encoding_tl } + { zhmCJK } + \RequirePackage { zhmCJK } + } % \end{macrocode} % 不载入 \pkg{zhmCJK} 宏包时直接调用 \pkg{CJK} 及相关宏包。 % \begin{macrocode} -\else: - \str_if_eq:onTF { \g_@@_encoding_tl } { GBK } - { \RequirePackage { CJK } } - { \RequirePackage { CJKutf8 } } - \RequirePackage { CJKpunct , CJKspace } + { + \str_if_eq:onTF { \g_@@_encoding_tl } { GBK } + { \RequirePackage { CJK } } + { \RequirePackage { CJKutf8 } } + \RequirePackage { CJKpunct , CJKspace } % \end{macrocode} % % \changes{v2.4.4}{2016/09/09}{解决 \opt{zhmap} 文件的 \tn{catcode} 问题。} @@ -4236,21 +4244,46 @@ Copyright and Licence % \begin{macro}[int]{\ctex_load_zhmap:nnnn} % 载入 \pkg{zhmetrics} 的字体映射文件,同时设置 \tn{CJKrmdefault} 等。 % \begin{macrocode} - \cs_new_protected:Npn \ctex_load_zhmap:nnnn #1#2#3#4 - { - \tl_set:Nn \CJKrmdefault {#1} - \tl_set:Nn \CJKsfdefault {#2} - \tl_set:Nn \CJKttdefault {#3} - \ctex_set_zhmap:n { \ctex_file_input:n { ctex-zhmap- #4 .tex } } - } - \@onlypreamble \ctex_load_zhmap:nnnn + \cs_new_protected:Npn \ctex_load_zhmap:nnnn #1#2#3#4 + { + \tl_set:Nn \CJKrmdefault {#1} + \tl_set:Nn \CJKsfdefault {#2} + \tl_set:Nn \CJKttdefault {#3} + \ctex_set_zhmap:n { \ctex_file_input:n { ctex-zhmap- #4 .tex } } + } + \@onlypreamble \ctex_load_zhmap:nnnn + } % \end{macrocode} % \end{macro} % -% \pkg{zhmCJK} 判断结束。 +% \changes{v2.5.10}{2022/06/10}{取消 \LaTeX\ 2022-06-01 对书名号的定义。} +% +% \begin{macro}{\ctex_undeclare_unicode_character:n,\ctex_utfviii_char:n} +% \LaTeX\ 2022-06-01 将通常用作中文书名号的 U+3008 和 U+3009 分别定义为 +% \tn{textlangle} 和 \tn{textrangle},这个定义会被 \pkg{CJKutf8} 包会优先使用。 +% 我们总是使用中文书名号,需要取消 \LaTeX\ 的定义,作用是局部的,不使用 \cs{cs_undefine:N}。 % \begin{macrocode} -\fi: +\cs_new_protected:Npn \ctex_undeclare_unicode_character:n #1 + { \cs_set_eq:cN { u8 : \ctex_utfviii_char:n {#1} } \tex_undefined:D } +\cs_new:Npn \ctex_utfviii_char:n #1 + { + \exp_last_unbraced:Ne \@@_utfviii_char_aux:nnnn + { \char_to_utfviii_bytes:n {#1} } + } +\cs_new:Npn \@@_utfviii_char_aux:nnnn #1#2#3#4 + { + \char_generate:nn {#1} { 12 } + \tl_if_empty:nF {#2} { \char_generate:nn {#2} { 12 } } + \tl_if_empty:nF {#3} { \char_generate:nn {#3} { 12 } } + \tl_if_empty:nF {#4} { \char_generate:nn {#4} { 12 } } + } +\CJKaddEncHook { UTF8 } + { + \ctex_undeclare_unicode_character:n { "3008 } + \ctex_undeclare_unicode_character:n { "3009 } + } % \end{macrocode} +% \end{macro} % % \begin{macro}[int]{\ctex_CJK_input:n,\CJK@input} % 载入 \pkg{CJK} 包的 \file{.enc} 和 \file{.bdg} 等文件时,需要设置 \tn{endlinechar} 为 $-1$。 @@ -4317,8 +4350,11 @@ Copyright and Licence % \begin{macrocode} \AtBeginDocument { - \str_if_eq:eeF { \l_@@_punct_tl } { quanjiao } - { \punctstyle { \l_@@_punct_tl } } + \use:e + { + \str_if_eq:nnF { \l_@@_punct_tl } { quanjiao } + { \exp_not:N \punctstyle { \l_@@_punct_tl } } + } } % \end{macrocode} % @@ -4327,22 +4363,8 @@ Copyright and Licence \ctex_at_end_preamble:n { \ctex_update_default_family: } % \end{macrocode} % -% 启用中文字符功能。\opt{GBK} 编码时,将汉字的首字节设置为活动字符,并对这些 -% 字符初始化;\opt{UTF8} 编码时,上游宏包已经处理好。 -% \tn{CJK@makeActive} 应该先于 \file{ctex-name-gbk.cfg} 等文件的载入。 -% 注意 \tn{CJK@loadBinding} 需要调用补丁后的 \tn{CJK@input}。使用 -% \pkg{zhmCJK} 时,此功能已经被启用。 -% \begin{macrocode} -\reverse_if:N \if_bool:N \g_@@_zhmCJK_bool - \str_if_eq:onF { \g_@@_encoding_tl } { UTF8 } - { - \CJK@makeActive - \CJK@loadBinding { standard } - } -% \end{macrocode} -% -% 在导言区结束时调用 \tn{CJK@envStart} 启用完整的中文功能。 -% +% 从 \LaTeX\ 2018-04-01 开始,传统引擎的默认编码被设置成 UTF-8, +% 汉字的首字节已经被设置成活动字符,我们无需再使用 \tn{CJK@makeActive} 设置。 % \tn{CJK@envStart} 的定义是 % \begin{verbatim} % \def\CJK@envStart#1#2#3{ @@ -4372,17 +4394,18 @@ Copyright and Licence % 最里层,最后也就不需要 \tn{clearpage}。\pkg{zhmCJK} 已经提供类似功能。 % 注意先使用 \cs{ctex_update_default_family:} 更新 \tn{CJKfamilydefault}。 % \begin{macrocode} - \exp_args:Nx \ctex_at_end_preamble:n - { - \exp_not:N \CJK@envStart - { } { \g_@@_encoding_tl } { \exp_not:N \CJKfamilydefault } - \exp_not:N \CJKtilde - } -% \end{macrocode} -% -% \pkg{zhmCJK} 判断结束。 -% \begin{macrocode} -\fi: +\bool_if:NF \g_@@_zhmCJK_bool + { + \str_if_eq:onTF { \g_@@_encoding_tl } { UTF8 } + { \CJK@loadBinding { UTF8 } } + { \CJK@loadBinding { standard } } + \exp_args:Ne \ctex_at_end_preamble:n + { + \exp_not:N \CJK@envStart + { } { \g_@@_encoding_tl } { \exp_not:N \CJKfamilydefault } + \exp_not:N \CJKtilde + } + } % \end{macrocode} % % \begin{macro}[int]{\ctex_auto_ignorespaces:} @@ -4392,6 +4415,200 @@ Copyright and Licence % \end{macrocode} % \end{macro} % +% \changes{v2.5.10}{2022/07/08}{解决 \pkg{CJK} 包与 \cs{text_uppercase:n} 等转化函数的冲突。} +% +% \begin{macro}{\CJK@X,\CJK@XX,\CJK@XXX,\CJK@XXXX} +% 最新 \LaTeX\ 中的 \tn{MakeUppercase} 等大小写转化命令被定义为 \LaTeXiii\ 中对应的 +% \cs{text_uppercase:n} 等函数。 +% 它会先将参数用 \cs{text_expand:n} 逐步展开,这与 \pkg{CJK} 包的定义不兼容。 +% 可以有多种方法解决这个冲突,最简单直接的方法是将首字节的活动字符用 \tn{protected} 来定义, +% 但可能有一定的兼容性问题。保险起见,我们采用将 \tn{CJK@X} 等内部宏转化为 \tn{protected} +% 宏的方式,并将参数提前由字符转化为数字,避免在移动参数中被进一步展开。 +% \begin{macrocode} +\cs_new:Npn \@@_char:N #1 + { \exp_args:Ne \CTEX@char@n { \int_value:w `#1 } } +\cs_new:Npn \@@_char:NN #1#2 + { + \token_if_eq_meaning:NNTF #2 \protect + { \@@_char_aux:NN #1 } + { \@@_char_aux:NN #1#2 } + } +\cs_new:Npn \@@_char_aux:NN #1#2 + { + \exp_last_unbraced:Ne \CTEX@char@nn + { + { \int_value:w `#1 } + { \int_value:w `#2 } + } + } +\cs_new:Npn \@@_char:NNN #1#2#3 + { + \token_if_eq_meaning:NNTF #2 \protect + { \@@_char_auxi:NNNN #1#3 } + { \@@_char_auxii:NNN #1#2#3 } + } +\cs_new:Npn \@@_char_auxi:NNN #1#2#3#4 + { \@@_char_auxii:NNN #1#2#4 } +\cs_new:Npn \@@_char_auxii:NNN #1#2#3 + { + \exp_last_unbraced:Ne \CTEX@char@nnn + { + { \int_value:w `#1 } + { \int_value:w `#2 } + { \int_value:w `#3 } + } + } +\cs_new:Npn \@@_char:NNNN #1#2#3#4 + { + \token_if_eq_meaning:NNTF #2 \protect + { \@@_char_auxi:NNNNN #1#3 } + { \@@_char_auxii:NNNN #1#2#3#4 } + } +\cs_new:Npn \@@_char_auxi:NNNNN #1#2#3#4#5 + { \@@_char_auxii:NNNN #1#2#3#5 } +\cs_new:Npn \@@_char_auxii:NNNN #1#2#3#4 + { + \exp_last_unbraced:Ne \CTEX@char@nnnn + { + { \int_value:w `#1 } + { \int_value:w `#2 } + { \int_value:w `#3 } + { \int_value:w `#4 } + } + } +\cs_gset_eq:NN \CJK@X \@@_char:N +\cs_gset_eq:NN \CJK@XX \@@_char:NN +\cs_gset_eq:NN \CJK@XXX \@@_char:NNN +\cs_gset_eq:NN \CJK@XXXX \@@_char:NNNN +% \end{macrocode} +% \pkg{CJKutf8} 包优先使用 |\u8:xxx| 的 \LaTeX\ 定义。 +% \begin{macrocode} +\str_if_eq:onF { \g_@@_encoding_tl } { GBK } + { + \exp_args:Nne \use:n + { \cs_gset:Npn \@@_char_aux:NN #1#2 } + { + \exp_not:N \cs_if_exist_use:cF + { u8: \exp_not:N \tl_to_str:n { #1#2 } } + { \exp_not:o { \@@_char_aux:NN {#1} {#2} } } + } + \exp_args:Nne \use:n + { \cs_gset:Npn \@@_char_auxii:NNN #1#2#3 } + { + \exp_not:N \cs_if_exist_use:cF + { u8: \exp_not:N \tl_to_str:n { #1#2#3 } } + { \exp_not:o { \@@_char_auxii:NNN {#1} {#2} {#3} } } + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mule@arg} +% 处理文档被 |extconv| 等工具预处理过的情况,只考虑最简单的情形。 +% \begin{macrocode} +\group_begin: +\char_set_catcode_active:n { "7F } +\cs_new:Npn \@@_char_preproc:w #1 ^^7f #2 ^^7f + { \exp_args:No \CTEX@char@nn { \int_value:w `#1 } {#2} } +\cs_gset_eq:NN \mule@arg \@@_char_preproc:w +\group_end: +\exp_args:Ne \ctex_at_end:n + { + \char_set_catcode:nn + { \int_value:w "7F } + { \char_value_catcode:n { "7F } } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\CTEX@char@n,\CTEX@char@nn,\CTEX@char@nnn,\CTEX@char@nnnn} +% 额外加入 \cs{mode_leave_vertical:} 是为了解决某些历史遗留问题。 +% \begin{macrocode} +\cs_new_protected:Npn \CTEX@char@n #1 + { + \mode_leave_vertical: + \use:c { CJK@ #1 } + \CJK@ignorespaces + } +\cs_new_protected:Npn \CTEX@char@nn #1#2 + { + \mode_leave_vertical: + \use:c { CJK@ #1 } {#2} + \CJK@ignorespaces + } +\cs_new_protected:Npn \CTEX@char@nnn #1#2#3 + { + \mode_leave_vertical: + \use:c { CJK@ #1 } {#2} {#3} + \CJK@ignorespaces + } +\cs_new_protected:Npn \CTEX@char@nnnn #1#2#3#4 + { + \mode_leave_vertical: + \use:c { CJK@ #1 } {#2} {#3} {#4} + \CJK@ignorespaces + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\CTEX@char@nn@n,\CTEX@char@nnn@n,\CTEX@char@nnnn@n} +% 以下给 \tn{CTEX@char@nn} 等定义在 \cs{text_expand:n} 中的等价形式, +% 将它们的参数用只有一个参数的 \tn{CTEX@char@nn@n} 等包装起来, +% 并将 \tn{CTEX@char@nn@n} 等放入排除列表中,避免可能的大小写转化。 +% \begin{macrocode} +\cs_new_protected:Npn \CTEX@char@nn@n #1 { \CTEX@char@nn #1 } +\cs_new_protected:Npn \CTEX@char@nnn@n #1 { \CTEX@char@nnn #1 } +\cs_new_protected:Npn \CTEX@char@nnnn@n #1 { \CTEX@char@nnnn #1 } +\cs_new:Npn \@@_char_wrap:nn #1#2 + { \CTEX@char@nn@n { {#1} {#2} } } +\cs_new:Npn \@@_char_wrap:nnn #1#2#3 + { \CTEX@char@nnn@n { {#1} {#2} {#3} } } +\cs_new:Npn \@@_char_wrap:nnnn #1#2#3#4 + { \CTEX@char@nnnn@n { {#1} {#2} {#3} {#4} } } +\tl_put_right:Nn \l_text_case_exclude_arg_tl + { + \CTEX@char@n + \CTEX@char@nn@n + \CTEX@char@nnn@n + \CTEX@char@nnnn@n + } +\text_declare_expand_equivalent:Nn \CTEX@char@nn { \@@_char_wrap:nn } +\text_declare_expand_equivalent:Nn \CTEX@char@nnn { \@@_char_wrap:nnn } +\text_declare_expand_equivalent:Nn \CTEX@char@nnnn { \@@_char_wrap:nnnn } +% \end{macrocode} +% 以下给 \tn{CTEX@char@nn@n} 等定义在 \cs{text_purify:n} 中的等价形式, +% 将参数中的数字转化回字符。 +% \begin{macrocode} +\cs_new:Npn \@@_char_raw:n #1 + { \char_generate:nn {#1} { 12 } } +\cs_new:Npn \@@_char_raw:nn #1#2 + { + \char_generate:nn {#1} { 12 } + \char_generate:nn {#2} { 12 } + } +\cs_new:Npn \@@_char_raw:nnn #1#2#3 + { + \char_generate:nn {#1} { 12 } + \char_generate:nn {#2} { 12 } + \char_generate:nn {#3} { 12 } + } +\cs_new:Npn \@@_char_raw:nnnn #1#2#3#4 + { + \char_generate:nn {#1} { 12 } + \char_generate:nn {#2} { 12 } + \char_generate:nn {#3} { 12 } + \char_generate:nn {#4} { 12 } + } +\cs_new:Npn \@@_char_raw_nn:n #1 { \use:e { \@@_char_raw:nn #1 } } +\cs_new:Npn \@@_char_raw_nnn:n #1 { \use:e { \@@_char_raw:nnn #1 } } +\cs_new:Npn \@@_char_raw_nnnn:n #1 { \use:e { \@@_char_raw:nnnn #1 } } +\text_declare_purify_equivalent:Nn \CTEX@char@n { \@@_char_raw:n } +\text_declare_purify_equivalent:Nn \CTEX@char@nn@n { \@@_char_raw_nn:n } +\text_declare_purify_equivalent:Nn \CTEX@char@nnn@n { \@@_char_raw_nnn:n } +\text_declare_purify_equivalent:Nn \CTEX@char@nnnn@n { \@@_char_raw_nnnn:n } +% \end{macrocode} +% \end{macro} +% % \begin{macro}[int]{\ctex_ignorespaces_case:N,\ctex_set_ignorespaces:} % 设置忽略空格的的方式。根据 \opt{space} 选项的值重定义 \tn{CJK@ignorespaces}, % 并保存起来供 \tn{CJKhook} 备用。 @@ -4518,7 +4735,7 @@ Copyright and Licence % \changes{v2.4.4}{2016/09/12}{不再默认设置 \pkg{xeCJK} 的伪粗体。} % \begin{macrocode} \RequirePackage { xeCJK } -\exp_args:Nx \xeCJKsetup +\exp_args:Ne \xeCJKsetup { LoadFandol = false , PunctStyle = \l_@@_punct_tl @@ -5187,7 +5404,7 @@ Copyright and Licence \cs_new:Npn \ctex_ltj_if_jfont:nTF #1 { \ctex_ltj_is_kenc:n { \@@_ltj_if_jfont:w #1 / \q_stop } - \ifin@ \exp_after:wN \use_i:nn \else: \exp_after:wN \use_ii:nn \fi: + \legacy_if:nTF { in@ } } \cs_new:Npn \@@_ltj_if_jfont:w #1 / #2 \q_stop {#1} @@ -6797,60 +7014,63 @@ Copyright and Licence % 定义。\pkg{pxeverysel} 宏包取消了检查,但也需要恢复定义,避免重复使用钩子。 % \pkg{KOMA-Script} 宏包也会进行检查,我们需要小心处理。 % \begin{macrocode} -\if_bool:N \c_@@_everysel_loaded_bool - \if_cs_exist:N \@EverySelectfont@Init - \group_begin: - \cs_set:Npn \@@_tmp:N #1 - { - \tl_set:Nn \l_@@_tmp_tl {#1} - \cs_new_eq:NN \CTEX@selectfont@save #1 - \cs_new_protected:Npn \@@_restore_selectfont: - { - \cs_if_free:NF \scr@new@selectfont - { +\bool_if:NTF \c_@@_everysel_loaded_bool + { + \cs_if_free:NF \@EverySelectfont@Init + { + \group_begin: + \cs_set:Npn \@@_tmp:N #1 + { + \tl_set:Nn \l_@@_tmp_tl {#1} + \cs_new_eq:NN \CTEX@selectfont@save #1 + \cs_new_protected:Npn \@@_restore_selectfont: + { + \cs_if_free:NF \scr@new@selectfont + { % \end{macrocode} % \pkg{CJK} 直接修改 \tn{selectfont} 和 \pkg{pxeverysel} 的补丁, % 会使 \pkg{KOMA-Script} 的 \tn{par@update} 失效。 % \begin{macrocode} %<*pdftex|uptex|aptex> - \cs_if_free:NF \par@update + \cs_if_free:NF \par@update %<*uptex|aptex> - { - \tl_put_right:Nn \@EverySelectfont@Init - { \tl_put_right:Nn #1 { \par@update } } - } + { + \tl_put_right:Nn \@EverySelectfont@Init + { \tl_put_right:Nn #1 { \par@update } } + } %</uptex|aptex> %<*pdftex> - { \tl_put_right:Nn #1 { \par@update } } - \cs_set_eq:NN \scr@selectfont \CTEX@selectfont@save + { \tl_put_right:Nn #1 { \par@update } } + \cs_set_eq:NN \scr@selectfont \CTEX@selectfont@save %</pdftex> %</pdftex|uptex|aptex> - \cs_set_eq:NN \scr@new@selectfont #1 -%<!pdftex> \cs_set_eq:NN \CTEX@selectfont@save \scr@selectfont - } - \tl_put_left:Nn \@EverySelectfont@Init - { \cs_set_eq:NN #1 \CTEX@selectfont@save } - \cs_undefine:N \@@_restore_selectfont: - } - } - \ctex_parse_name:NN \@@_tmp:N \selectfont - \exp_last_unbraced:NNo \group_end: - \ctex_patch_cmd_once:NnnnTF { \l_@@_tmp_tl } - { \ExplSyntaxOff } - { \size@update } - { \CTEX@selectfont@hook \size@update } - { \@@_restore_selectfont: } - { \ctex_patch_failure:N \selectfont } - \fi: - \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n - { \EverySelectfont } + \cs_set_eq:NN \scr@new@selectfont #1 +%<!pdftex> \cs_set_eq:NN \CTEX@selectfont@save \scr@selectfont + } + \tl_put_left:Nn \@EverySelectfont@Init + { \cs_set_eq:NN #1 \CTEX@selectfont@save } + \cs_undefine:N \@@_restore_selectfont: + } + } + \ctex_parse_name:NN \@@_tmp:N \selectfont + \exp_last_unbraced:NNo \group_end: + \ctex_patch_cmd_once:NnnnTF { \l_@@_tmp_tl } + { \ExplSyntaxOff } + { \size@update } + { \CTEX@selectfont@hook \size@update } + { \@@_restore_selectfont: } + { \ctex_patch_failure:N \selectfont } + } + \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n + { \EverySelectfont } + } % \end{macrocode} % 使用 \LaTeX \ 2021-06-01 的新钩子,不使用 \pkg{everysel} 包的情况。 % \begin{macrocode} -\else: - \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n - { \ctex_gadd_ltxhook:nn { selectfont } } -\fi: + { + \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n + { \ctex_gadd_ltxhook:nn { selectfont } } + } % \end{macrocode} % \end{macro} % @@ -7281,8 +7501,13 @@ Copyright and Licence % % \subsection{中文数字与日期} % +% 需要注意的是,\pkg{ltkeys} 设置的选项列表是 +% |\@raw@opt@|\meta{\textbackslash @currname}|.|\meta{\textbackslash @currext}, +% 该列表不会将 \tn{PassOptionsToPackage} 传递的选项完全展开。 % \begin{macrocode} -\PassOptionsToPackage { encoding = \g_@@_encoding_tl } { zhnumber } +\exp_args:Ne \PassOptionsToPackage + { encoding = \g_@@_encoding_tl } + { zhnumber } \RequirePackage { zhnumber } % \end{macrocode} % @@ -7514,11 +7739,11 @@ Copyright and Licence % \begin{macrocode} \cs_new_protected:Npn \@@_def_heading_keys:n #1 { - \tl_put_right:Nx \l_@@_tmp_tl + \exp_args:NNe \tl_put_right:Nn \l_@@_tmp_tl { - #1 .meta:nn = { ctex / #1 } { ####1 } , + #1 .meta:nn = { ctex / #1 } { ##1 } , #1 / name .code:n = - { \ctex_assign_heading_name:nn {#1} { ####1 } } , + { \ctex_assign_heading_name:nn {#1} { ##1 } } , #1 / number .tl_set:N = \exp_not:c { CTEX@the#1 } , #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } , #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} , @@ -7537,8 +7762,7 @@ Copyright and Licence #1 / hang .bool_set:N = \exp_not:c { CTEX@#1@hang } , #1 / hang .initial:n = true , #1 / runin .bool_set:N = \exp_not:c { CTEX@#1@runin } , - #1 / tocline .cs_set:Np = \exp_not:c { CTEX@#1@tocline} - \exp_not:n { ##1##2 } , + #1 / tocline .cs_set:Np = \exp_not:c { CTEX@#1@tocline } ##1##2 , \@@_plus_key_aux:nn {#1} { break } , %</article|book|report> \@@_plus_key_aux:nn {#1} { format } , @@ -7553,9 +7777,9 @@ Copyright and Licence { #1 / #2 .tl_set:N = \exp_not:c { CTEX@#1@#2 } , #1 / #2 + .code:n = - { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } , + { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } , #1 / #2 ~ + .code:n = - { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } + { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } } % \end{macrocode} % \end{macro} @@ -7696,6 +7920,18 @@ Copyright and Licence % \end{macrocode} % \end{macro} % +% \changes{v2.5.10}{2022/06/23}{展开传递 \opt{pagestyle} 的值。} +% +% \begin{macro}[int]{\CTEX@setthispagestyle} +% 将 \verb"\CTEX@(part|chapter)@pagestyle" 展开后再传给 \tn{thispagestyle}。 +% \begin{macrocode} +%<*book|report> +\cs_new_protected:Npn \CTEX@setthispagestyle #1 + { \exp_args:Ne \thispagestyle { \use:c { CTEX@#1@pagestyle } } } +%</book|report> +% \end{macrocode} +% \end{macro} +% % \changes{v2.4.4}{2016/09/18}{提供 \tn{partmark}。} % \begin{macro}[int]{\partmark} % 提供 \tn{partmark}。 @@ -7791,7 +8027,7 @@ Copyright and Licence % \fi \CTEX@part@break % \thispagestyle{plain}% - \thispagestyle{\CTEX@part@pagestyle}% + \CTEX@setthispagestyle{part}% \if@twocolumn \onecolumn \@tempswatrue @@ -7966,7 +8202,7 @@ Copyright and Licence % \if@openright\cleardoublepage\else\clearpage\fi % \thispagestyle{plain}% \CTEX@chapter@break - \thispagestyle{\CTEX@chapter@pagestyle}% + \CTEX@setthispagestyle{chapter}% \global\@topnum\z@ % \@afterindentfalse \ifodd \CTEX@chapter@afterindent @@ -8459,20 +8695,22 @@ Copyright and Licence \cs_new_protected:Npn \CTEX@hyperheadinghook { \group_begin: - \ifHy@implicit - \cs_set_eq:NN \H@old@chapter \Hy@org@chapter - \seq_map_inline:Nn \c_@@_headings_cs_seq - { - \cs_if_eq:ccT { H@old@ ##1 } { CTEX@ ##1 } - { - \cs_gset_eq:cc { @ ##1 } { CTEX@ ##1 } - \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor - } - } - \else: - \seq_map_inline:Nn \c_@@_headings_cs_seq - { \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor } - \fi: + \legacy_if:nTF { Hy@implicit } + { + \cs_set_eq:NN \H@old@chapter \Hy@org@chapter + \seq_map_inline:Nn \c_@@_headings_cs_seq + { + \cs_if_eq:ccT { H@old@ ##1 } { CTEX@ ##1 } + { + \cs_gset_eq:cc { @ ##1 } { CTEX@ ##1 } + \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor + } + } + } + { + \seq_map_inline:Nn \c_@@_headings_cs_seq + { \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor } + } \group_end: } % \end{macrocode} @@ -8657,7 +8895,7 @@ Copyright and Licence \CTEX@updatettlifname } \cs_new_protected:Npn \CTEX@updatettlifname - { \ifttl@label \CTEX@ifnametrue \else: \CTEX@ifnamefalse \fi: } + { \legacy_if:nTF { ttl@label } { \CTEX@ifnametrue } { \CTEX@ifnamefalse } } } % \end{macrocode} % @@ -8813,21 +9051,23 @@ Copyright and Licence % \changes{v2.4.11}{2017/09/13}{补充页眉空格。} % \begin{macrocode} %<*article> -\if@twoside - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection \quad \fi } - { \CTEXifname { \CTEXthesection \quad } { } } - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \@ne \thesubsection \quad \fi } - { \CTEXifname { \CTEXthesubsection \quad } { } } -\else: +\legacy_if:nTF { @twoside } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection \quad \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \@ne \thesubsection \quad \fi } + { \CTEXifname { \CTEXthesubsection \quad } { } } + } % \end{macrocode} % 不知为何,标准文档类此处对 \texttt{secnumdepth} 的判断为 $0$,与 \tn{section} 的层次 $1$ 不符。 % \begin{macrocode} - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \m@ne \thesection \quad \fi } - { \CTEXifname { \CTEXthesection \quad } { } } -\fi: + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \m@ne \thesection \quad \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + } %</article> %<*book|report> \ctex_patch_cmd:Nnn \ps@headings @@ -8839,11 +9079,12 @@ Copyright and Licence %<book> \fi \fi } { \CTEXifname { \CTEXthechapter \quad } { } } -\if@twoside - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } - { \CTEXifname { \CTEXthesection \quad } { } } -\fi: +\legacy_if:nT { @twoside } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + } %</book|report> % \end{macrocode} % \end{macro} @@ -8877,18 +9118,20 @@ Copyright and Licence \@ifpackagewith { fancyhdr } { headings } { %<*article> - \if@twoside - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection \quad \fi } - { \CTEXifname { \CTEXthesection \quad } { } } - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \@ne \thesubsection \quad \fi } - { \CTEXifname { \CTEXthesubsection \quad } { } } - \else: - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection \quad \fi } - { \CTEXifname { \CTEXthesection \quad } { } } - \fi: + \legacy_if:nTF { @twoside } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection \quad \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \@ne \thesubsection \quad \fi } + { \CTEXifname { \CTEXthesubsection \quad } { } } + } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection \quad \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + } %</article> %<*book|report> \ctex_patch_cmd:Nnn \ps@headings @@ -8900,11 +9143,12 @@ Copyright and Licence %<book> \fi \fi } { \CTEXifname { \CTEXthechapter \quad } { } } - \if@twoside - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } - { \CTEXifname { \CTEXthesection \quad } { } } - \fi: + \legacy_if:nT { @twoside } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + } %</book|report> } { } @@ -9627,8 +9871,7 @@ Copyright and Licence % 不使用标题定义时的通用设置,注意此处 \cs{c_@@_std_class_tl} 可能没有定义。 % \begin{macrocode} %<*generic> -\tl_set:Nn \l_@@_tmp_tl { beamer } -\tl_if_eq:NNTF \c_@@_std_class_tl \l_@@_tmp_tl +\tl_if_eq:NnTF \c_@@_std_class_tl { beamer } { \str_if_eq:onTF { \g_@@_encoding_tl } { GBK } { @@ -9714,7 +9957,7 @@ Copyright and Licence \seq_new:N \c_@@_font_size_seq \cs_new_protected:Npn \@@_save_font_size:nn #1#2 { - \use:x + \use:e { \prop_gput:Nnn \exp_not:N \c_@@_font_size_prop {#1} { @@ -10080,7 +10323,7 @@ Copyright and Licence { \file_if_exist:nF { ctex-fontset- \g_@@_fontset_tl .def } { - \use:x + \use:e { \ctex_detect_platform: \msg_error:nnxx { ctex } { fontset-not-found } @@ -10944,17 +11187,17 @@ Copyright and Licence % 文件标识信息。 % \begin{macrocode} %<adobe>\ProvidesFile{ctex-zhmap-adobe.tex}% -%<adobe> [2022/06/04 v2.5.9 Adobe font map loader for DVIPDFMx (CTEX)] +%<adobe> [2022/07/14 v2.5.10 Adobe font map loader for DVIPDFMx (CTEX)] %<fandol>\ProvidesFile{ctex-zhmap-fandol.tex}% -%<fandol> [2022/06/04 v2.5.9 Fandol font map loader for DVIPDFMx (CTEX)] +%<fandol> [2022/07/14 v2.5.10 Fandol font map loader for DVIPDFMx (CTEX)] %<founder>\ProvidesFile{ctex-zhmap-founder.tex}% -%<founder> [2022/06/04 v2.5.9 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)] +%<founder> [2022/07/14 v2.5.10 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)] %<mac>\ProvidesFile{ctex-zhmap-mac.tex}% -%<mac> [2022/06/04 v2.5.9 Mac font map loader for DVIPDFMx (CTEX)] +%<mac> [2022/07/14 v2.5.10 Mac font map loader for DVIPDFMx (CTEX)] %<ubuntu>\ProvidesFile{ctex-zhmap-ubuntu.tex}% -%<ubuntu> [2022/06/04 v2.5.9 Ubuntu font map loader for DVIPDFMx (CTEX)] +%<ubuntu> [2022/07/14 v2.5.10 Ubuntu font map loader for DVIPDFMx (CTEX)] %<windows>\ProvidesFile{ctex-zhmap-windows.tex}% -%<windows> [2022/06/04 v2.5.9 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)] +%<windows> [2022/07/14 v2.5.10 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)] % \end{macrocode} % % \paragraph{\pkg{ctex-zhmap-adobe.tex}} @@ -11885,7 +12128,7 @@ Copyright and Licence { \cs_if_exist_p:c { #1##3 } } { \group_begin: - \use:x + \use:e { \group_end: \@@_parse_name:nNNNnN @@ -11927,7 +12170,7 @@ Copyright and Licence } \cs_new:Npn \@@_parse_name:w ##1 #3 ~ ##2 #2 ##3 \q_stop { ##1##2 } } -\use:x +\use:e { \@@_tmp:w { \c_backslash_str } @@ -12004,7 +12247,7 @@ Copyright and Licence \@@_patch_rescan:NNn \l_@@_prefix_tl \l_@@_prefix_str {#2} \@@_patch_rescan:NNn \l_@@_parameter_tl \l_@@_parameter_str {#2} \@@_patch_rescan:NNn \l_@@_replacement_tl \l_@@_replacement_str {#2} - \use:x + \use:e { \exp_not:o { \l_@@_prefix_tl } \tex_def:D \exp_not:N #1 \exp_not:o { \l_@@_parameter_tl } @@ -12031,7 +12274,7 @@ Copyright and Licence \group_end: \ctex_if_rescanable:NnTF #1 {#3} { - \use:x + \use:e { \@@_patch_replace:nnnTF {#2} { \tl_to_str:n {#4} } diff --git a/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-adobe.tex b/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-adobe.tex index 383aecd7783..de30bda13dd 100644 --- a/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-adobe.tex +++ b/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-adobe.tex @@ -75,7 +75,7 @@ \fi \endgroup \ProvidesFile{ctex-zhmap-adobe.tex}% - [2022/06/04 v2.5.9 Adobe font map loader for DVIPDFMx (CTEX)] + [2022/07/14 v2.5.10 Adobe font map loader for DVIPDFMx (CTEX)] \ifzhmappdf %% pdfTeX does not support OTF fonts \else diff --git a/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-fandol.tex b/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-fandol.tex index c368844316f..a2dfeb57cbb 100644 --- a/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-fandol.tex +++ b/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-fandol.tex @@ -75,7 +75,7 @@ \fi \endgroup \ProvidesFile{ctex-zhmap-fandol.tex}% - [2022/06/04 v2.5.9 Fandol font map loader for DVIPDFMx (CTEX)] + [2022/07/14 v2.5.10 Fandol font map loader for DVIPDFMx (CTEX)] \ifzhmappdf %% pdfTeX does not support OTF fonts \else diff --git a/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-founder.tex b/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-founder.tex index afac393e221..c8b08b9ca01 100644 --- a/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-founder.tex +++ b/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-founder.tex @@ -75,7 +75,7 @@ \fi \endgroup \ProvidesFile{ctex-zhmap-founder.tex}% - [2022/06/04 v2.5.9 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)] + [2022/07/14 v2.5.10 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)] \ifzhmappdf \pdfmapline{=gbk@UGBK@ <FZSSK.TTF} \pdfmapline{=gbksong@UGBK@ <FZSSK.TTF} diff --git a/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-mac.tex b/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-mac.tex index d6dba9ab731..8f63aa25302 100644 --- a/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-mac.tex +++ b/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-mac.tex @@ -75,7 +75,7 @@ \fi \endgroup \ProvidesFile{ctex-zhmap-mac.tex}% - [2022/06/04 v2.5.9 Mac font map loader for DVIPDFMx (CTEX)] + [2022/07/14 v2.5.10 Mac font map loader for DVIPDFMx (CTEX)] \ifzhmappdf %% pdfTeX does not support OTF fonts \else diff --git a/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-ubuntu.tex b/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-ubuntu.tex index 1225d0cd944..277dbd2f6db 100644 --- a/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-ubuntu.tex +++ b/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-ubuntu.tex @@ -75,7 +75,7 @@ \fi \endgroup \ProvidesFile{ctex-zhmap-ubuntu.tex}% - [2022/06/04 v2.5.9 Ubuntu font map loader for DVIPDFMx (CTEX)] + [2022/07/14 v2.5.10 Ubuntu font map loader for DVIPDFMx (CTEX)] \ifzhmappdf %% pdfTeX does not support OTF fonts \else diff --git a/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-windows.tex b/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-windows.tex index 78a921c0f03..1d5a835b0e3 100644 --- a/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-windows.tex +++ b/Master/texmf-dist/tex/generic/ctex/zhmap/ctex-zhmap-windows.tex @@ -75,7 +75,7 @@ \fi \endgroup \ProvidesFile{ctex-zhmap-windows.tex}% - [2022/06/04 v2.5.9 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)] + [2022/07/14 v2.5.10 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)] \ifzhmappdf \pdfmapline{=gbk@UGBK@ <simsun.ttc} \pdfmapline{=gbksong@UGBK@ <simsun.ttc} diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg index 057819d48e7..6e53a2ffd1c 100644 --- a/Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg +++ b/Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Caption with encoding GBK (CTEX)} \ProvidesExplFile{ctex-name-gbk.cfg} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \keys_set_known:nn { ctex } { contentsname = Ŀ¼ , diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg index 159c67159c3..085080b9cb6 100644 --- a/Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg +++ b/Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Caption with encoding UTF-8 (CTEX)} \ProvidesExplFile{ctex-name-utf8.cfg} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \keys_set_known:nn { ctex } { contentsname = 目录 , diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg index 6ed114f2ca9..68aafb8f4e4 100644 --- a/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg +++ b/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Configuration file (CTEX)} \ProvidesExplFile{\ExplFileName.cfg} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} %% %% %% diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctexbackend.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctexbackend.cfg index a32d4c6cd5e..d3ebf513ec1 100644 --- a/Master/texmf-dist/tex/latex/ctex/config/ctexbackend.cfg +++ b/Master/texmf-dist/tex/latex/ctex/config/ctexbackend.cfg @@ -25,7 +25,7 @@ %% --------------------------------------------------------------------- %% \ProvidesFile{ctexbackend.cfg}% - [2022/06/04 v2.5.9 Backend configuration file (CTEX)] + [2022/07/14 v2.5.10 Backend configuration file (CTEX)] \begingroup \expandafter\ifx\csname Umathchardef\endcsname\relax \else\expandafter\endgroup\expandafter\endinput\fi diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg index ca5fb4a44d8..967bd3be7fc 100644 --- a/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg +++ b/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Option configuration file (CTEX)} \ProvidesExplFile{ctexopts.cfg} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} %% %% \ctex_set:nn { option } { fontset = windows } %% diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo b/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo index ed71119c338..4dee4fea1e8 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo +++ b/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {c5size option (CTEX)} \ProvidesExplFile{ctex-c5size.clo} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \ctex_set_font_size:Nnn \normalsize { 5 } { \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo b/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo index cc856e81d4f..b2fd0f4b2cb 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo +++ b/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {cs4size option (CTEX)} \ProvidesExplFile{ctex-cs4size.clo} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \ctex_set_font_size:Nnn \normalsize { -4 } { \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@ diff --git a/Master/texmf-dist/tex/latex/ctex/ctex.sty b/Master/texmf-dist/tex/latex/ctex/ctex.sty index 27b04eba187..90bfe5cac63 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex.sty +++ b/Master/texmf-dist/tex/latex/ctex/ctex.sty @@ -26,11 +26,12 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese adapter in LaTeX (CTEX)} \ProvidesExplPackage{\ExplFileName} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} -\RequirePackage { xparse , l3keys2e } + {\ExplFileDate}{2.5.10}{\ExplFileDescription} +\cs_if_exist:NF \NewDocumentCommand + { \RequirePackage { xparse } } \msg_new:nnnn { ctex } { l3-too-old } { Support~package~`#1'~too~old. } { @@ -38,7 +39,7 @@ `l3kernel'~and~`l3packages'\\\\ using~your~TeX~package~manager~or~from~CTAN. } -\@ifpackagelater { expl3 } { 2020/07/17 } { } +\@ifpackagelater { expl3 } { 2021/02/10 } { } { \msg_error:nnn { ctex } { l3-too-old } { expl3 } } \str_const:Nx \c__ctex_engine_str { \cs_if_exist:NTF \ngostype { aptex } { \c_sys_engine_str } } @@ -233,7 +234,7 @@ space .choices:nn = { true , auto , false } { - \exp_args:Nx \ctex_at_end:n + \exp_args:Ne \ctex_at_end:n { \ctex_set:n { space = \l_keys_choice_tl } } } , space .default:n = { true } , @@ -305,7 +306,12 @@ \exp_args:No \ctex_define_option:n { \l__ctex_tmp_tl } \tl_clear:N \l__ctex_tmp_tl \ctex_file_input:n { ctexopts.cfg } -\ProcessKeysOptions { ctex / option } +\cs_if_exist:NTF \ProcessKeyOptions + { \ProcessKeyOptions [ ctex / option ] } + { + \RequirePackage { l3keys2e } + \ProcessKeysOptions { ctex / option } + } \msg_new:nnn { ctex } { pdftex-utf8 } { UTF8~will~be~used~as~the~default~encoding. } \tl_if_empty:NT \g__ctex_encoding_tl @@ -487,7 +493,9 @@ { \parindent is~set~to~0pt. } \dim_zero:N \parindent } -\PassOptionsToPackage { encoding = \g__ctex_encoding_tl } { zhnumber } +\exp_args:Ne \PassOptionsToPackage + { encoding = \g__ctex_encoding_tl } + { zhnumber } \RequirePackage { zhnumber } \cs_new:Npn \chinese { \zhnum_counter:n } \cs_new_eq:NN \@chinese \@zhnum @@ -620,7 +628,7 @@ \seq_new:N \c__ctex_font_size_seq \cs_new_protected:Npn \__ctex_save_font_size:nn #1#2 { - \use:x + \use:e { \prop_gput:Nnn \exp_not:N \c__ctex_font_size_prop {#1} { @@ -761,7 +769,7 @@ { \file_if_exist:nF { ctex-fontset- \g__ctex_fontset_tl .def } { - \use:x + \use:e { \ctex_detect_platform: \msg_error:nnxx { ctex } { fontset-not-found } diff --git a/Master/texmf-dist/tex/latex/ctex/ctexart.cls b/Master/texmf-dist/tex/latex/ctex/ctexart.cls index 1242890cb2f..e132d5843f6 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexart.cls +++ b/Master/texmf-dist/tex/latex/ctex/ctexart.cls @@ -27,11 +27,12 @@ \NeedsTeXFormat{LaTeX2e} \input{ctexbackend.cfg} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese adapter for class article (CTEX)} \ProvidesExplClass{ctexart} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} -\RequirePackage { xparse , l3keys2e } + {\ExplFileDate}{2.5.10}{\ExplFileDescription} +\cs_if_exist:NF \NewDocumentCommand + { \RequirePackage { xparse } } \prop_gput:Nnn \g_msg_module_type_prop { ctex } { Class } \prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexart } \msg_new:nnnn { ctex } { l3-too-old } @@ -41,10 +42,8 @@ `l3kernel'~and~`l3packages'\\\\ using~your~TeX~package~manager~or~from~CTAN. } -\@ifpackagelater { expl3 } { 2020/07/17 } { } +\@ifpackagelater { expl3 } { 2021/02/10 } { } { \msg_error:nnn { ctex } { l3-too-old } { expl3 } } -\@ifpackagelater { l3keys2e } { 2015/12/20 } { } - { \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } } \str_const:Nx \c__ctex_engine_str { \cs_if_exist:NTF \ngostype { aptex } { \c_sys_engine_str } } \msg_new:nnnn { ctex } { engine-not-supported } @@ -122,6 +121,14 @@ \cs_new_eq:NN \ctex_if_autoindent_touched:F \use:n \cs_new_eq:NN \ctex_zhmap_case:nnn \use_ii:nnn \cs_new_protected:Npn \ctex_at_end:n { \AtEndOfClass } +\cs_new_protected:Npn \ctex_load_std_class:n #1 + { + \tl_const:Nn \c__ctex_class_tl {#1} + \exp_args:No \PassOptionsToClass + { \g__ctex_std_options_clist } + {#1} + \LoadClass {#1} + } \clist_new:N \g__ctex_std_options_clist \msg_new:nnn { ctex } { invalid-option } { Option~`\l_keys_key_tl'~is~invalid~in~current~mode. } @@ -241,7 +248,7 @@ space .choices:nn = { true , auto , false } { - \exp_args:Nx \ctex_at_end:n + \exp_args:Ne \ctex_at_end:n { \ctex_set:n { space = \l_keys_choice_tl } } } , space .default:n = { true } , @@ -321,7 +328,12 @@ { \clist_gput_right:No \g__ctex_std_options_clist { \CurrentOption } } } \ctex_file_input:n { ctexopts.cfg } -\ProcessKeysOptions { ctex / option } +\cs_if_exist:NTF \ProcessKeyOptions + { \ProcessKeyOptions [ ctex / option ] } + { + \RequirePackage { l3keys2e } + \ProcessKeysOptions { ctex / option } + } \msg_new:nnn { ctex } { pdftex-utf8 } { UTF8~will~be~used~as~the~default~encoding. } \tl_if_empty:NT \g__ctex_encoding_tl @@ -335,9 +347,7 @@ { 0 } { \clist_gput_right:Nn \g__ctex_std_options_clist { 10pt } } { 1 } { \clist_gput_right:Nn \g__ctex_std_options_clist { 12pt } } } -\tl_const:Nn \c__ctex_class_tl { article } -\PassOptionsToClass { \g__ctex_std_options_clist } { article } -\LoadClass { article } +\ctex_load_std_class:n { article } \@ifpackageloaded { hyperref } { \cs_new_protected:Npn \ctex_hypersetup:n #1 @@ -511,7 +521,9 @@ { \parindent is~set~to~0pt. } \dim_zero:N \parindent } -\PassOptionsToPackage { encoding = \g__ctex_encoding_tl } { zhnumber } +\exp_args:Ne \PassOptionsToPackage + { encoding = \g__ctex_encoding_tl } + { zhnumber } \RequirePackage { zhnumber } \cs_new:Npn \chinese { \zhnum_counter:n } \cs_new_eq:NN \@chinese \@zhnum @@ -607,11 +619,11 @@ } \cs_new_protected:Npn \__ctex_def_heading_keys:n #1 { - \tl_put_right:Nx \l__ctex_tmp_tl + \exp_args:NNe \tl_put_right:Nn \l__ctex_tmp_tl { - #1 .meta:nn = { ctex / #1 } { ####1 } , + #1 .meta:nn = { ctex / #1 } { ##1 } , #1 / name .code:n = - { \ctex_assign_heading_name:nn {#1} { ####1 } } , + { \ctex_assign_heading_name:nn {#1} { ##1 } } , #1 / number .tl_set:N = \exp_not:c { CTEX@the#1 } , #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } , #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} , @@ -629,8 +641,7 @@ #1 / hang .bool_set:N = \exp_not:c { CTEX@#1@hang } , #1 / hang .initial:n = true , #1 / runin .bool_set:N = \exp_not:c { CTEX@#1@runin } , - #1 / tocline .cs_set:Np = \exp_not:c { CTEX@#1@tocline} - \exp_not:n { ##1##2 } , + #1 / tocline .cs_set:Np = \exp_not:c { CTEX@#1@tocline } ##1##2 , \__ctex_plus_key_aux:nn {#1} { break } , \__ctex_plus_key_aux:nn {#1} { format } , \__ctex_plus_key_aux:nn {#1} { nameformat } , @@ -644,9 +655,9 @@ { #1 / #2 .tl_set:N = \exp_not:c { CTEX@#1@#2 } , #1 / #2 + .code:n = - { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } , + { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } , #1 / #2 ~ + .code:n = - { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } + { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } } \NewDocumentCommand \ctex_assign_heading_name:nn { m > { \SplitArgument { 1 } { , } } +m } @@ -970,20 +981,22 @@ \cs_new_protected:Npn \CTEX@hyperheadinghook { \group_begin: - \ifHy@implicit - \cs_set_eq:NN \H@old@chapter \Hy@org@chapter - \seq_map_inline:Nn \c__ctex_headings_cs_seq - { - \cs_if_eq:ccT { H@old@ ##1 } { CTEX@ ##1 } - { - \cs_gset_eq:cc { @ ##1 } { CTEX@ ##1 } - \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor - } - } - \else: - \seq_map_inline:Nn \c__ctex_headings_cs_seq - { \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor } - \fi: + \legacy_if:nTF { Hy@implicit } + { + \cs_set_eq:NN \H@old@chapter \Hy@org@chapter + \seq_map_inline:Nn \c__ctex_headings_cs_seq + { + \cs_if_eq:ccT { H@old@ ##1 } { CTEX@ ##1 } + { + \cs_gset_eq:cc { @ ##1 } { CTEX@ ##1 } + \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor + } + } + } + { + \seq_map_inline:Nn \c__ctex_headings_cs_seq + { \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor } + } \group_end: } \ctex_at_end_package:nn { hyperref } @@ -1108,7 +1121,7 @@ \CTEX@updatettlifname } \cs_new_protected:Npn \CTEX@updatettlifname - { \ifttl@label \CTEX@ifnametrue \else: \CTEX@ifnamefalse \fi: } + { \legacy_if:nTF { ttl@label } { \CTEX@ifnametrue } { \CTEX@ifnamefalse } } } \group_begin: \char_set_catcode_other:N \# @@ -1196,18 +1209,20 @@ } \__ctex_patch_toc_width:n { tocloft } \__ctex_patch_toc_width:n { titletoc } -\if@twoside - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection \quad \fi } - { \CTEXifname { \CTEXthesection \quad } { } } - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \@ne \thesubsection \quad \fi } - { \CTEXifname { \CTEXthesubsection \quad } { } } -\else: - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \m@ne \thesection \quad \fi } - { \CTEXifname { \CTEXthesection \quad } { } } -\fi: +\legacy_if:nTF { @twoside } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection \quad \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \@ne \thesubsection \quad \fi } + { \CTEXifname { \CTEXthesubsection \quad } { } } + } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \m@ne \thesection \quad \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + } \ctex_at_end_package:nn { fancyhdr } { \ctex_patch_cmd:Nnn \f@nch@initialise @@ -1225,18 +1240,20 @@ \f@nch@initialise \@ifpackagewith { fancyhdr } { headings } { - \if@twoside - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection \quad \fi } - { \CTEXifname { \CTEXthesection \quad } { } } - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \@ne \thesubsection \quad \fi } - { \CTEXifname { \CTEXthesubsection \quad } { } } - \else: - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection \quad \fi } - { \CTEXifname { \CTEXthesection \quad } { } } - \fi: + \legacy_if:nTF { @twoside } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection \quad \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \@ne \thesubsection \quad \fi } + { \CTEXifname { \CTEXthesubsection \quad } { } } + } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection \quad \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + } } { } } @@ -1340,7 +1357,7 @@ \seq_new:N \c__ctex_font_size_seq \cs_new_protected:Npn \__ctex_save_font_size:nn #1#2 { - \use:x + \use:e { \prop_gput:Nnn \exp_not:N \c__ctex_font_size_prop {#1} { @@ -1481,7 +1498,7 @@ { \file_if_exist:nF { ctex-fontset- \g__ctex_fontset_tl .def } { - \use:x + \use:e { \ctex_detect_platform: \msg_error:nnxx { ctex } { fontset-not-found } diff --git a/Master/texmf-dist/tex/latex/ctex/ctexbeamer.cls b/Master/texmf-dist/tex/latex/ctex/ctexbeamer.cls index 97f6903d364..c52c57139c2 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexbeamer.cls +++ b/Master/texmf-dist/tex/latex/ctex/ctexbeamer.cls @@ -27,11 +27,12 @@ \NeedsTeXFormat{LaTeX2e} \input{ctexbackend.cfg} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese adapter for class beamer (CTEX)} \ProvidesExplClass{ctexbeamer} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} -\RequirePackage { xparse , l3keys2e } + {\ExplFileDate}{2.5.10}{\ExplFileDescription} +\cs_if_exist:NF \NewDocumentCommand + { \RequirePackage { xparse } } \prop_gput:Nnn \g_msg_module_type_prop { ctex } { Class } \prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexbeamer } \msg_new:nnnn { ctex } { l3-too-old } @@ -41,10 +42,8 @@ `l3kernel'~and~`l3packages'\\\\ using~your~TeX~package~manager~or~from~CTAN. } -\@ifpackagelater { expl3 } { 2020/07/17 } { } +\@ifpackagelater { expl3 } { 2021/02/10 } { } { \msg_error:nnn { ctex } { l3-too-old } { expl3 } } -\@ifpackagelater { l3keys2e } { 2015/12/20 } { } - { \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } } \str_const:Nx \c__ctex_engine_str { \cs_if_exist:NTF \ngostype { aptex } { \c_sys_engine_str } } \msg_new:nnnn { ctex } { engine-not-supported } @@ -120,6 +119,14 @@ \cs_new_eq:NN \ctex_if_autoindent_touched:F \use:n \cs_new_eq:NN \ctex_zhmap_case:nnn \use_ii:nnn \cs_new_protected:Npn \ctex_at_end:n { \AtEndOfClass } +\cs_new_protected:Npn \ctex_load_std_class:n #1 + { + \tl_const:Nn \c__ctex_class_tl {#1} + \exp_args:No \PassOptionsToClass + { \g__ctex_std_options_clist } + {#1} + \LoadClass {#1} + } \clist_new:N \g__ctex_std_options_clist \msg_new:nnn { ctex } { invalid-option } { Option~`\l_keys_key_tl'~is~invalid~in~current~mode. } @@ -239,7 +246,7 @@ space .choices:nn = { true , auto , false } { - \exp_args:Nx \ctex_at_end:n + \exp_args:Ne \ctex_at_end:n { \ctex_set:n { space = \l_keys_choice_tl } } } , space .default:n = { true } , @@ -313,7 +320,12 @@ { \clist_gput_right:No \g__ctex_std_options_clist { \CurrentOption } } } \ctex_file_input:n { ctexopts.cfg } -\ProcessKeysOptions { ctex / option } +\cs_if_exist:NTF \ProcessKeyOptions + { \ProcessKeyOptions [ ctex / option ] } + { + \RequirePackage { l3keys2e } + \ProcessKeysOptions { ctex / option } + } \msg_new:nnn { ctex } { pdftex-utf8 } { UTF8~will~be~used~as~the~default~encoding. } \tl_if_empty:NT \g__ctex_encoding_tl @@ -327,9 +339,7 @@ { 0 } { \clist_gput_right:Nn \g__ctex_std_options_clist { 10pt } } { 1 } { \clist_gput_right:Nn \g__ctex_std_options_clist { 12pt } } } -\tl_const:Nn \c__ctex_class_tl { beamer } -\PassOptionsToClass { \g__ctex_std_options_clist } { beamer } -\LoadClass { beamer } +\ctex_load_std_class:n { beamer } \@ifpackageloaded { hyperref } { \cs_new_protected:Npn \ctex_hypersetup:n #1 @@ -503,7 +513,9 @@ { \parindent is~set~to~0pt. } \dim_zero:N \parindent } -\PassOptionsToPackage { encoding = \g__ctex_encoding_tl } { zhnumber } +\exp_args:Ne \PassOptionsToPackage + { encoding = \g__ctex_encoding_tl } + { zhnumber } \RequirePackage { zhnumber } \cs_new:Npn \chinese { \zhnum_counter:n } \cs_new_eq:NN \@chinese \@zhnum @@ -599,11 +611,11 @@ } \cs_new_protected:Npn \__ctex_def_heading_keys:n #1 { - \tl_put_right:Nx \l__ctex_tmp_tl + \exp_args:NNe \tl_put_right:Nn \l__ctex_tmp_tl { - #1 .meta:nn = { ctex / #1 } { ####1 } , + #1 .meta:nn = { ctex / #1 } { ##1 } , #1 / name .code:n = - { \ctex_assign_heading_name:nn {#1} { ####1 } } , + { \ctex_assign_heading_name:nn {#1} { ##1 } } , #1 / number .tl_set:N = \exp_not:c { CTEX@the#1 } , #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } , #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} , @@ -628,9 +640,9 @@ { #1 / #2 .tl_set:N = \exp_not:c { CTEX@#1@#2 } , #1 / #2 + .code:n = - { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } , + { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } , #1 / #2 ~ + .code:n = - { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } + { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } } \NewDocumentCommand \ctex_assign_heading_name:nn { m > { \SplitArgument { 1 } { , } } +m } @@ -813,7 +825,7 @@ \seq_new:N \c__ctex_font_size_seq \cs_new_protected:Npn \__ctex_save_font_size:nn #1#2 { - \use:x + \use:e { \prop_gput:Nnn \exp_not:N \c__ctex_font_size_prop {#1} { @@ -954,7 +966,7 @@ { \file_if_exist:nF { ctex-fontset- \g__ctex_fontset_tl .def } { - \use:x + \use:e { \ctex_detect_platform: \msg_error:nnxx { ctex } { fontset-not-found } diff --git a/Master/texmf-dist/tex/latex/ctex/ctexbook.cls b/Master/texmf-dist/tex/latex/ctex/ctexbook.cls index ff6b731b10b..12d2675abcf 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexbook.cls +++ b/Master/texmf-dist/tex/latex/ctex/ctexbook.cls @@ -27,11 +27,12 @@ \NeedsTeXFormat{LaTeX2e} \input{ctexbackend.cfg} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese adapter for class book (CTEX)} \ProvidesExplClass{ctexbook} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} -\RequirePackage { xparse , l3keys2e } + {\ExplFileDate}{2.5.10}{\ExplFileDescription} +\cs_if_exist:NF \NewDocumentCommand + { \RequirePackage { xparse } } \prop_gput:Nnn \g_msg_module_type_prop { ctex } { Class } \prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexbook } \msg_new:nnnn { ctex } { l3-too-old } @@ -41,10 +42,8 @@ `l3kernel'~and~`l3packages'\\\\ using~your~TeX~package~manager~or~from~CTAN. } -\@ifpackagelater { expl3 } { 2020/07/17 } { } +\@ifpackagelater { expl3 } { 2021/02/10 } { } { \msg_error:nnn { ctex } { l3-too-old } { expl3 } } -\@ifpackagelater { l3keys2e } { 2015/12/20 } { } - { \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } } \str_const:Nx \c__ctex_engine_str { \cs_if_exist:NTF \ngostype { aptex } { \c_sys_engine_str } } \msg_new:nnnn { ctex } { engine-not-supported } @@ -122,6 +121,14 @@ \cs_new_eq:NN \ctex_if_autoindent_touched:F \use:n \cs_new_eq:NN \ctex_zhmap_case:nnn \use_ii:nnn \cs_new_protected:Npn \ctex_at_end:n { \AtEndOfClass } +\cs_new_protected:Npn \ctex_load_std_class:n #1 + { + \tl_const:Nn \c__ctex_class_tl {#1} + \exp_args:No \PassOptionsToClass + { \g__ctex_std_options_clist } + {#1} + \LoadClass {#1} + } \clist_new:N \g__ctex_std_options_clist \msg_new:nnn { ctex } { invalid-option } { Option~`\l_keys_key_tl'~is~invalid~in~current~mode. } @@ -241,7 +248,7 @@ space .choices:nn = { true , auto , false } { - \exp_args:Nx \ctex_at_end:n + \exp_args:Ne \ctex_at_end:n { \ctex_set:n { space = \l_keys_choice_tl } } } , space .default:n = { true } , @@ -321,7 +328,12 @@ { \clist_gput_right:No \g__ctex_std_options_clist { \CurrentOption } } } \ctex_file_input:n { ctexopts.cfg } -\ProcessKeysOptions { ctex / option } +\cs_if_exist:NTF \ProcessKeyOptions + { \ProcessKeyOptions [ ctex / option ] } + { + \RequirePackage { l3keys2e } + \ProcessKeysOptions { ctex / option } + } \msg_new:nnn { ctex } { pdftex-utf8 } { UTF8~will~be~used~as~the~default~encoding. } \tl_if_empty:NT \g__ctex_encoding_tl @@ -335,9 +347,7 @@ { 0 } { \clist_gput_right:Nn \g__ctex_std_options_clist { 10pt } } { 1 } { \clist_gput_right:Nn \g__ctex_std_options_clist { 12pt } } } -\tl_const:Nn \c__ctex_class_tl { book } -\PassOptionsToClass { \g__ctex_std_options_clist } { book } -\LoadClass { book } +\ctex_load_std_class:n { book } \@ifpackageloaded { hyperref } { \cs_new_protected:Npn \ctex_hypersetup:n #1 @@ -511,7 +521,9 @@ { \parindent is~set~to~0pt. } \dim_zero:N \parindent } -\PassOptionsToPackage { encoding = \g__ctex_encoding_tl } { zhnumber } +\exp_args:Ne \PassOptionsToPackage + { encoding = \g__ctex_encoding_tl } + { zhnumber } \RequirePackage { zhnumber } \cs_new:Npn \chinese { \zhnum_counter:n } \cs_new_eq:NN \@chinese \@zhnum @@ -608,11 +620,11 @@ } \cs_new_protected:Npn \__ctex_def_heading_keys:n #1 { - \tl_put_right:Nx \l__ctex_tmp_tl + \exp_args:NNe \tl_put_right:Nn \l__ctex_tmp_tl { - #1 .meta:nn = { ctex / #1 } { ####1 } , + #1 .meta:nn = { ctex / #1 } { ##1 } , #1 / name .code:n = - { \ctex_assign_heading_name:nn {#1} { ####1 } } , + { \ctex_assign_heading_name:nn {#1} { ##1 } } , #1 / number .tl_set:N = \exp_not:c { CTEX@the#1 } , #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } , #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} , @@ -630,8 +642,7 @@ #1 / hang .bool_set:N = \exp_not:c { CTEX@#1@hang } , #1 / hang .initial:n = true , #1 / runin .bool_set:N = \exp_not:c { CTEX@#1@runin } , - #1 / tocline .cs_set:Np = \exp_not:c { CTEX@#1@tocline} - \exp_not:n { ##1##2 } , + #1 / tocline .cs_set:Np = \exp_not:c { CTEX@#1@tocline } ##1##2 , \__ctex_plus_key_aux:nn {#1} { break } , \__ctex_plus_key_aux:nn {#1} { format } , \__ctex_plus_key_aux:nn {#1} { nameformat } , @@ -645,9 +656,9 @@ { #1 / #2 .tl_set:N = \exp_not:c { CTEX@#1@#2 } , #1 / #2 + .code:n = - { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } , + { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } , #1 / #2 ~ + .code:n = - { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } + { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } } \NewDocumentCommand \ctex_assign_heading_name:nn { m > { \SplitArgument { 1 } { , } } +m } @@ -711,6 +722,8 @@ \cs_new_protected:Npn \CTEX@setheadingskip { \skip_set:Nn \l__ctex_heading_skip } \cs_new_eq:NN \CTEX@headingskip \l__ctex_heading_skip +\cs_new_protected:Npn \CTEX@setthispagestyle #1 + { \exp_args:Ne \thispagestyle { \use:c { CTEX@#1@pagestyle } } } \ProvideDocumentCommand \partmark { m } { \markboth { } { } } \cs_new_eq:NN \CTEXifname \use_ii:nn @@ -737,7 +750,7 @@ { \addcontentsline { toc } {#1} { \use:c { CTEX@#1@tocline } {#1} {#2} } } \renewcommand\part{% \CTEX@part@break - \thispagestyle{\CTEX@part@pagestyle}% + \CTEX@setthispagestyle{part}% \if@twocolumn \onecolumn \@tempswatrue @@ -802,7 +815,7 @@ \fi} \renewcommand\chapter{% \CTEX@chapter@break - \thispagestyle{\CTEX@chapter@pagestyle}% + \CTEX@setthispagestyle{chapter}% \global\@topnum\z@ \ifodd \CTEX@chapter@afterindent \@afterindenttrue @@ -1096,20 +1109,22 @@ \cs_new_protected:Npn \CTEX@hyperheadinghook { \group_begin: - \ifHy@implicit - \cs_set_eq:NN \H@old@chapter \Hy@org@chapter - \seq_map_inline:Nn \c__ctex_headings_cs_seq - { - \cs_if_eq:ccT { H@old@ ##1 } { CTEX@ ##1 } - { - \cs_gset_eq:cc { @ ##1 } { CTEX@ ##1 } - \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor - } - } - \else: - \seq_map_inline:Nn \c__ctex_headings_cs_seq - { \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor } - \fi: + \legacy_if:nTF { Hy@implicit } + { + \cs_set_eq:NN \H@old@chapter \Hy@org@chapter + \seq_map_inline:Nn \c__ctex_headings_cs_seq + { + \cs_if_eq:ccT { H@old@ ##1 } { CTEX@ ##1 } + { + \cs_gset_eq:cc { @ ##1 } { CTEX@ ##1 } + \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor + } + } + } + { + \seq_map_inline:Nn \c__ctex_headings_cs_seq + { \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor } + } \group_end: } \ctex_at_end_package:nn { hyperref } @@ -1235,7 +1250,7 @@ \CTEX@updatettlifname } \cs_new_protected:Npn \CTEX@updatettlifname - { \ifttl@label \CTEX@ifnametrue \else: \CTEX@ifnamefalse \fi: } + { \legacy_if:nTF { ttl@label } { \CTEX@ifnametrue } { \CTEX@ifnamefalse } } } \group_begin: \char_set_catcode_other:N \# @@ -1330,11 +1345,12 @@ \fi \fi } { \CTEXifname { \CTEXthechapter \quad } { } } -\if@twoside - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } - { \CTEXifname { \CTEXthesection \quad } { } } -\fi: +\legacy_if:nT { @twoside } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + } \ctex_at_end_package:nn { fancyhdr } { \ctex_patch_cmd:Nnn \f@nch@initialise @@ -1359,11 +1375,12 @@ \fi \fi } { \CTEXifname { \CTEXthechapter \quad } { } } - \if@twoside - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } - { \CTEXifname { \CTEXthesection \quad } { } } - \fi: + \legacy_if:nT { @twoside } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + } } { } } @@ -1468,7 +1485,7 @@ \seq_new:N \c__ctex_font_size_seq \cs_new_protected:Npn \__ctex_save_font_size:nn #1#2 { - \use:x + \use:e { \prop_gput:Nnn \exp_not:N \c__ctex_font_size_prop {#1} { @@ -1609,7 +1626,7 @@ { \file_if_exist:nF { ctex-fontset- \g__ctex_fontset_tl .def } { - \use:x + \use:e { \ctex_detect_platform: \msg_error:nnxx { ctex } { fontset-not-found } diff --git a/Master/texmf-dist/tex/latex/ctex/ctexcap.sty b/Master/texmf-dist/tex/latex/ctex/ctexcap.sty index 4bf19b3c729..d01d4fc3eb0 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexcap.sty +++ b/Master/texmf-dist/tex/latex/ctex/ctexcap.sty @@ -26,10 +26,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese adapter in LaTeX (CTEX)} \ProvidesExplPackage{ctexcap} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \clist_new:N \l__ctex_ctexcap_options_clist \clist_set:Nx \l__ctex_ctexcap_options_clist { \exp_not:v { opt@ \@currname . \@currext } , heading } diff --git a/Master/texmf-dist/tex/latex/ctex/ctexheading.sty b/Master/texmf-dist/tex/latex/ctex/ctexheading.sty index ed958cf4aaf..983b3772092 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexheading.sty +++ b/Master/texmf-dist/tex/latex/ctex/ctexheading.sty @@ -26,11 +26,12 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Heading style modification (CTEX)} \ProvidesExplPackage{ctexheading} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} -\RequirePackage { xparse , l3keys2e } + {\ExplFileDate}{2.5.10}{\ExplFileDescription} +\cs_if_exist:NF \NewDocumentCommand + { \RequirePackage { xparse } } \prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexheading } \RequirePackage { ctexhook , ctexpatch } \tl_clear_new:N \l__ctex_tmp_tl @@ -70,7 +71,12 @@ scheme .default:n = { plain } , scheme .initial:n = { plain } } -\ProcessKeysOptions { ctex / option } +\cs_if_exist:NTF \ProcessKeyOptions + { \ProcessKeyOptions [ ctex / option ] } + { + \RequirePackage { l3keys2e } + \ProcessKeysOptions { ctex / option } + } \NewDocumentCommand \ctexset { } { \ctex_set:n } \clist_map_inline:nn { article , book , report , beamer } { diff --git a/Master/texmf-dist/tex/latex/ctex/ctexhook.sty b/Master/texmf-dist/tex/latex/ctex/ctexhook.sty index c8790544a1b..ea1a05051ff 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexhook.sty +++ b/Master/texmf-dist/tex/latex/ctex/ctexhook.sty @@ -26,10 +26,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Document and package hooks (CTEX)} \ProvidesExplPackage{ctexhook} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \cs_new:Npn \ctex_if_format_at_least:nTF { \@ifl@t@r \fmtversion } \cs_new_protected:Npn \ctex_file_input:n #1 diff --git a/Master/texmf-dist/tex/latex/ctex/ctexpatch.sty b/Master/texmf-dist/tex/latex/ctex/ctexpatch.sty index d9218a83e88..546e651edf0 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexpatch.sty +++ b/Master/texmf-dist/tex/latex/ctex/ctexpatch.sty @@ -26,10 +26,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Patching commands (CTEX)} \ProvidesExplPackage{ctexpatch} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \cs_new_protected:Npn \ctex_patch_cmd_once:NnnnTF #1#2 { \ctex_patch_boot:NNnnTF \__ctex_patch_cmd:Nnnnnw #1 @@ -87,7 +87,7 @@ { \cs_if_exist_p:c { #1##3 } } { \group_begin: - \use:x + \use:e { \group_end: \__ctex_parse_name:nNNNnN @@ -129,7 +129,7 @@ } \cs_new:Npn \__ctex_parse_name:w ##1 #3 ~ ##2 #2 ##3 \q_stop { ##1##2 } } -\use:x +\use:e { \__ctex_tmp:w { \c_backslash_str } @@ -180,7 +180,7 @@ \__ctex_patch_rescan:NNn \l__ctex_prefix_tl \l__ctex_prefix_str {#2} \__ctex_patch_rescan:NNn \l__ctex_parameter_tl \l__ctex_parameter_str {#2} \__ctex_patch_rescan:NNn \l__ctex_replacement_tl \l__ctex_replacement_str {#2} - \use:x + \use:e { \exp_not:o { \l__ctex_prefix_tl } \tex_def:D \exp_not:N #1 \exp_not:o { \l__ctex_parameter_tl } @@ -201,7 +201,7 @@ \group_end: \ctex_if_rescanable:NnTF #1 {#3} { - \use:x + \use:e { \__ctex_patch_replace:nnnTF {#2} { \tl_to_str:n {#4} } diff --git a/Master/texmf-dist/tex/latex/ctex/ctexrep.cls b/Master/texmf-dist/tex/latex/ctex/ctexrep.cls index 731762daa9d..69a38e1e27c 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexrep.cls +++ b/Master/texmf-dist/tex/latex/ctex/ctexrep.cls @@ -27,11 +27,12 @@ \NeedsTeXFormat{LaTeX2e} \input{ctexbackend.cfg} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese adapter for class report (CTEX)} \ProvidesExplClass{ctexrep} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} -\RequirePackage { xparse , l3keys2e } + {\ExplFileDate}{2.5.10}{\ExplFileDescription} +\cs_if_exist:NF \NewDocumentCommand + { \RequirePackage { xparse } } \prop_gput:Nnn \g_msg_module_type_prop { ctex } { Class } \prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexrep } \msg_new:nnnn { ctex } { l3-too-old } @@ -41,10 +42,8 @@ `l3kernel'~and~`l3packages'\\\\ using~your~TeX~package~manager~or~from~CTAN. } -\@ifpackagelater { expl3 } { 2020/07/17 } { } +\@ifpackagelater { expl3 } { 2021/02/10 } { } { \msg_error:nnn { ctex } { l3-too-old } { expl3 } } -\@ifpackagelater { l3keys2e } { 2015/12/20 } { } - { \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } } \str_const:Nx \c__ctex_engine_str { \cs_if_exist:NTF \ngostype { aptex } { \c_sys_engine_str } } \msg_new:nnnn { ctex } { engine-not-supported } @@ -122,6 +121,14 @@ \cs_new_eq:NN \ctex_if_autoindent_touched:F \use:n \cs_new_eq:NN \ctex_zhmap_case:nnn \use_ii:nnn \cs_new_protected:Npn \ctex_at_end:n { \AtEndOfClass } +\cs_new_protected:Npn \ctex_load_std_class:n #1 + { + \tl_const:Nn \c__ctex_class_tl {#1} + \exp_args:No \PassOptionsToClass + { \g__ctex_std_options_clist } + {#1} + \LoadClass {#1} + } \clist_new:N \g__ctex_std_options_clist \msg_new:nnn { ctex } { invalid-option } { Option~`\l_keys_key_tl'~is~invalid~in~current~mode. } @@ -241,7 +248,7 @@ space .choices:nn = { true , auto , false } { - \exp_args:Nx \ctex_at_end:n + \exp_args:Ne \ctex_at_end:n { \ctex_set:n { space = \l_keys_choice_tl } } } , space .default:n = { true } , @@ -321,7 +328,12 @@ { \clist_gput_right:No \g__ctex_std_options_clist { \CurrentOption } } } \ctex_file_input:n { ctexopts.cfg } -\ProcessKeysOptions { ctex / option } +\cs_if_exist:NTF \ProcessKeyOptions + { \ProcessKeyOptions [ ctex / option ] } + { + \RequirePackage { l3keys2e } + \ProcessKeysOptions { ctex / option } + } \msg_new:nnn { ctex } { pdftex-utf8 } { UTF8~will~be~used~as~the~default~encoding. } \tl_if_empty:NT \g__ctex_encoding_tl @@ -335,9 +347,7 @@ { 0 } { \clist_gput_right:Nn \g__ctex_std_options_clist { 10pt } } { 1 } { \clist_gput_right:Nn \g__ctex_std_options_clist { 12pt } } } -\tl_const:Nn \c__ctex_class_tl { report } -\PassOptionsToClass { \g__ctex_std_options_clist } { report } -\LoadClass { report } +\ctex_load_std_class:n { report } \@ifpackageloaded { hyperref } { \cs_new_protected:Npn \ctex_hypersetup:n #1 @@ -511,7 +521,9 @@ { \parindent is~set~to~0pt. } \dim_zero:N \parindent } -\PassOptionsToPackage { encoding = \g__ctex_encoding_tl } { zhnumber } +\exp_args:Ne \PassOptionsToPackage + { encoding = \g__ctex_encoding_tl } + { zhnumber } \RequirePackage { zhnumber } \cs_new:Npn \chinese { \zhnum_counter:n } \cs_new_eq:NN \@chinese \@zhnum @@ -608,11 +620,11 @@ } \cs_new_protected:Npn \__ctex_def_heading_keys:n #1 { - \tl_put_right:Nx \l__ctex_tmp_tl + \exp_args:NNe \tl_put_right:Nn \l__ctex_tmp_tl { - #1 .meta:nn = { ctex / #1 } { ####1 } , + #1 .meta:nn = { ctex / #1 } { ##1 } , #1 / name .code:n = - { \ctex_assign_heading_name:nn {#1} { ####1 } } , + { \ctex_assign_heading_name:nn {#1} { ##1 } } , #1 / number .tl_set:N = \exp_not:c { CTEX@the#1 } , #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } , #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} , @@ -630,8 +642,7 @@ #1 / hang .bool_set:N = \exp_not:c { CTEX@#1@hang } , #1 / hang .initial:n = true , #1 / runin .bool_set:N = \exp_not:c { CTEX@#1@runin } , - #1 / tocline .cs_set:Np = \exp_not:c { CTEX@#1@tocline} - \exp_not:n { ##1##2 } , + #1 / tocline .cs_set:Np = \exp_not:c { CTEX@#1@tocline } ##1##2 , \__ctex_plus_key_aux:nn {#1} { break } , \__ctex_plus_key_aux:nn {#1} { format } , \__ctex_plus_key_aux:nn {#1} { nameformat } , @@ -645,9 +656,9 @@ { #1 / #2 .tl_set:N = \exp_not:c { CTEX@#1@#2 } , #1 / #2 + .code:n = - { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } , + { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } , #1 / #2 ~ + .code:n = - { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } + { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } } \NewDocumentCommand \ctex_assign_heading_name:nn { m > { \SplitArgument { 1 } { , } } +m } @@ -711,6 +722,8 @@ \cs_new_protected:Npn \CTEX@setheadingskip { \skip_set:Nn \l__ctex_heading_skip } \cs_new_eq:NN \CTEX@headingskip \l__ctex_heading_skip +\cs_new_protected:Npn \CTEX@setthispagestyle #1 + { \exp_args:Ne \thispagestyle { \use:c { CTEX@#1@pagestyle } } } \ProvideDocumentCommand \partmark { m } { \markboth { } { } } \cs_new_eq:NN \CTEXifname \use_ii:nn @@ -737,7 +750,7 @@ { \addcontentsline { toc } {#1} { \use:c { CTEX@#1@tocline } {#1} {#2} } } \renewcommand\part{% \CTEX@part@break - \thispagestyle{\CTEX@part@pagestyle}% + \CTEX@setthispagestyle{part}% \if@twocolumn \onecolumn \@tempswatrue @@ -802,7 +815,7 @@ \fi} \renewcommand\chapter{% \CTEX@chapter@break - \thispagestyle{\CTEX@chapter@pagestyle}% + \CTEX@setthispagestyle{chapter}% \global\@topnum\z@ \ifodd \CTEX@chapter@afterindent \@afterindenttrue @@ -1091,20 +1104,22 @@ \cs_new_protected:Npn \CTEX@hyperheadinghook { \group_begin: - \ifHy@implicit - \cs_set_eq:NN \H@old@chapter \Hy@org@chapter - \seq_map_inline:Nn \c__ctex_headings_cs_seq - { - \cs_if_eq:ccT { H@old@ ##1 } { CTEX@ ##1 } - { - \cs_gset_eq:cc { @ ##1 } { CTEX@ ##1 } - \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor - } - } - \else: - \seq_map_inline:Nn \c__ctex_headings_cs_seq - { \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor } - \fi: + \legacy_if:nTF { Hy@implicit } + { + \cs_set_eq:NN \H@old@chapter \Hy@org@chapter + \seq_map_inline:Nn \c__ctex_headings_cs_seq + { + \cs_if_eq:ccT { H@old@ ##1 } { CTEX@ ##1 } + { + \cs_gset_eq:cc { @ ##1 } { CTEX@ ##1 } + \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor + } + } + } + { + \seq_map_inline:Nn \c__ctex_headings_cs_seq + { \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor } + } \group_end: } \ctex_at_end_package:nn { hyperref } @@ -1230,7 +1245,7 @@ \CTEX@updatettlifname } \cs_new_protected:Npn \CTEX@updatettlifname - { \ifttl@label \CTEX@ifnametrue \else: \CTEX@ifnamefalse \fi: } + { \legacy_if:nTF { ttl@label } { \CTEX@ifnametrue } { \CTEX@ifnamefalse } } } \group_begin: \char_set_catcode_other:N \# @@ -1325,11 +1340,12 @@ \fi } { \CTEXifname { \CTEXthechapter \quad } { } } -\if@twoside - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } - { \CTEXifname { \CTEXthesection \quad } { } } -\fi: +\legacy_if:nT { @twoside } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + } \ctex_at_end_package:nn { fancyhdr } { \ctex_patch_cmd:Nnn \f@nch@initialise @@ -1354,11 +1370,12 @@ \fi } { \CTEXifname { \CTEXthechapter \quad } { } } - \if@twoside - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } - { \CTEXifname { \CTEXthesection \quad } { } } - \fi: + \legacy_if:nT { @twoside } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + } } { } } @@ -1463,7 +1480,7 @@ \seq_new:N \c__ctex_font_size_seq \cs_new_protected:Npn \__ctex_save_font_size:nn #1#2 { - \use:x + \use:e { \prop_gput:Nnn \exp_not:N \c__ctex_font_size_prop {#1} { @@ -1604,7 +1621,7 @@ { \file_if_exist:nF { ctex-fontset- \g__ctex_fontset_tl .def } { - \use:x + \use:e { \ctex_detect_platform: \msg_error:nnxx { ctex } { fontset-not-found } diff --git a/Master/texmf-dist/tex/latex/ctex/ctexsize.sty b/Master/texmf-dist/tex/latex/ctex/ctexsize.sty index 1e972ec977a..d492471ad77 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexsize.sty +++ b/Master/texmf-dist/tex/latex/ctex/ctexsize.sty @@ -26,11 +26,12 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese font size definition (CTEX)} \ProvidesExplPackage{ctexsize} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} -\RequirePackage { xparse , l3keys2e } + {\ExplFileDate}{2.5.10}{\ExplFileDescription} +\cs_if_exist:NF \NewDocumentCommand + { \RequirePackage { xparse } } \prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexsize } \RequirePackage { fix-cm } \cs_new_protected:Npn \ctex_define_option:n @@ -61,7 +62,12 @@ } \exp_args:No \ctex_define_option:n { \l__ctex_tmp_tl } \tl_clear:N \l__ctex_tmp_tl -\ProcessKeysOptions { ctex / option } +\cs_if_exist:NTF \ProcessKeyOptions + { \ProcessKeyOptions [ ctex / option ] } + { + \RequirePackage { l3keys2e } + \ProcessKeysOptions { ctex / option } + } \NewDocumentCommand \zihao { m } { \exp_args:Nx \ctex_zihao:n {#1} \tex_ignorespaces:D } \cs_new_protected:Npn \ctex_zihao:n #1 @@ -81,7 +87,7 @@ \seq_new:N \c__ctex_font_size_seq \cs_new_protected:Npn \__ctex_save_font_size:nn #1#2 { - \use:x + \use:e { \prop_gput:Nnn \exp_not:N \c__ctex_font_size_prop {#1} { diff --git a/Master/texmf-dist/tex/latex/ctex/ctexspa.def b/Master/texmf-dist/tex/latex/ctex/ctexspa.def index 9d417b1fac5..4ea57ea473e 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexspa.def +++ b/Master/texmf-dist/tex/latex/ctex/ctexspa.def @@ -26,7 +26,7 @@ %% --------------------------------------------------------------------- %% \ProvidesFile{ctexspa.def}% - [2022/06/04 v2.5.9 Space info for CJKpunct (CTEX)] + [2022/07/14 v2.5.10 Space info for CJKpunct (CTEX)] \ctexspadef{adobezhsong}{70,15,61,8,63,14,58,7,64,13,62,12,60,11,61,15,62,14,51,6,58,5,58,8,7,5,12,12,10,68,13,63,17,63,20,69,19,69,17,63,19,70,17,55,10,10,14,63,10,65,10,61,13,62,15,61,7,49,7,56,8,58,15,69,8,61,14,63,8,57,,,} \ctexspadef{adobezhhei}{78,3,64,3,64,2,61,3,72,3,70,3,72,3,70,3,60,3,51,3,62,3,66,3,0,0,10,10,3,70,5,70,6,75,6,78,17,67,13,67,17,67,4,50,8,8,3,72,3,70,3,72,3,70,3,60,3,51,3,62,3,66,3,78,7,62,3,63,3,61,,,} \ctexspadef{adobezhkai}{76,10,55,8,63,4,62,4,71,4,65,4,71,4,74,4,54,4,54,4,62,4,62,4,0,0,11,11,5,72,6,71,7,78,7,79,18,68,18,68,18,68,2,46,14,12,4,71,4,65,4,71,4,74,4,54,4,54,4,62,4,62,10,76,8,55,4,63,4,62,,,} diff --git a/Master/texmf-dist/tex/latex/ctex/ctxdoc.cls b/Master/texmf-dist/tex/latex/ctex/ctxdoc.cls index 8b353bd0e3c..4713ca81e88 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctxdoc.cls +++ b/Master/texmf-dist/tex/latex/ctex/ctxdoc.cls @@ -1,7 +1,7 @@ %% %% File ctxdoc.cls %% -%% Copyright (C) 2016--2020 +%% Copyright (C) 2016--2022 %% CTEX.ORG and any individual authors listed in the documentation. %%--------------------------------------------------------------------- %% @@ -21,7 +21,7 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctxdoc.cls 87d629c 2022-05-23 22:55:12 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctxdoc.cls c3e8eb5 2022-06-07 19:08:17 +0800 Qing Lee <sobenlee@gmail.com> $ {ctex documentation (CTEX)} \ProvidesExplClass{ctxdoc}{\ExplFileDate}{}{\ExplFileDescription} \ExplSyntaxOff @@ -123,6 +123,7 @@ \setlist[1]{labelindent=\parindent} \setlist[enumerate]{leftmargin=*} \setlist[itemize]{leftmargin=*} +\setlist[trivlist]{topsep=\medskipamount} \renewlist{arguments}{enumerate}{1} \setlist[arguments]{nolistsep, leftmargin=\parindent, labelindent=0pt, labelsep=*, @@ -169,12 +170,9 @@ \define@key{FV}{labelref}{\def\ctexexamlabelref{\label{#1}}} \let\ctexexamlabelref\empty \newcounter{ctexexam} -\BeforeBeginEnvironment{function}{\par\nointerlineskip} -\AtEndEnvironment{function}{% - \par\xdef\ctexfixprevdepth{\prevdepth=\the\prevdepth\space}} -\AfterEndEnvironment{function}{\ctexfixprevdepth} +\AtEndEnvironment{function}{\ctexsetverticalspacing} +\AfterEndEnvironment{function}{\ctexfixverticalspacing} \AtBeginEnvironment{syntax}{\linespread{1}\ctexplainps\ctexdisableecglue} -\BeforeBeginEnvironment{SideBySideExample}{\par\addvspace{\medskipamount}} \newrobustcmd\exptarget{% \AddLineBeginMainAux{\csgdef{Codedoc@expstar}{}}% \Hy@raisedlink{\hypertarget{expstar}{}}} @@ -184,6 +182,35 @@ \newrobustcmd\expstar{\hyperlink{expstar}{$\star$}} \newrobustcmd\rexpstar{\hyperlink{rexpstar}{\ding{73}}} \ExplSyntaxOn +\cs_new_protected:Npn \ctexsetverticalspacing + { + \par + \tl_gset:Nx \ctexfixverticalspacing + { \dim_set:Nn \prevdepth { \dim_use:N \prevdepth } } + \int_compare:nNnT \lastnodetype = { 11 } + { + \tl_gput_right:Nx \ctexfixverticalspacing + { \exp_not:N \skip_vertical:n { \skip_use:N \lastskip } } + \unskip + } + } +\tl_new:N \ctexfixverticalspacing +\NewDocumentCommand \SideBySideExampleSet { } + { \prop_put_from_keyval:Nn \l__ctxdoc_side_example_prop } +\prop_new:N \l__ctxdoc_side_example_prop +\prop_set_from_keyval:Nn \l__ctxdoc_side_example_prop + { frame=single, numbers=left, gobble=5, xrightmargin=.5\linewidth } +\tl_put_left:Nn \SideBySideExample + { + \trivlist \item \relax + \exp_args:Ne \fvset + { \prop_to_keyval:N \l__ctxdoc_side_example_prop } + } +\tl_put_right:Nn \endSideBySideExample + { \endtrivlist } +\ctex_patch_cmd:Nnn \__codedoc_function_typeset_start: + { \bigskip } + { \nointerlineskip \addvspace { \bigskipamount } } %% l3doc 会设置列表环境中 \listparindent=\z@,我们在这里恢复它。 \cs_set_eq:NN \list \__codedoc_oldlist:nn \cs_new_nopar:Npn \zihaopt #1 diff --git a/Master/texmf-dist/tex/latex/ctex/dictionary/translator-theorem-dictionary-ChineseGBK.dict b/Master/texmf-dist/tex/latex/ctex/dictionary/translator-theorem-dictionary-ChineseGBK.dict index d74cabd99d3..d9f9b297a90 100644 --- a/Master/texmf-dist/tex/latex/ctex/dictionary/translator-theorem-dictionary-ChineseGBK.dict +++ b/Master/texmf-dist/tex/latex/ctex/dictionary/translator-theorem-dictionary-ChineseGBK.dict @@ -25,7 +25,7 @@ %% --------------------------------------------------------------------- %% \ProvidesDictionary{translator-theorem-dictionary}{ChineseGBK}% - [2022/06/04 v2.5.9 Chinese translation for theorem name (CTEX)] + [2022/07/14 v2.5.10 Chinese translation for theorem name (CTEX)] \providetranslation{Comments}{} \providetranslation{comments}{} \providetranslation{Comment}{} diff --git a/Master/texmf-dist/tex/latex/ctex/dictionary/translator-theorem-dictionary-ChineseUTF8.dict b/Master/texmf-dist/tex/latex/ctex/dictionary/translator-theorem-dictionary-ChineseUTF8.dict index 3a3c402acf1..bc5ea083ae9 100644 --- a/Master/texmf-dist/tex/latex/ctex/dictionary/translator-theorem-dictionary-ChineseUTF8.dict +++ b/Master/texmf-dist/tex/latex/ctex/dictionary/translator-theorem-dictionary-ChineseUTF8.dict @@ -25,7 +25,7 @@ %% --------------------------------------------------------------------- %% \ProvidesDictionary{translator-theorem-dictionary}{ChineseUTF8}% - [2022/06/04 v2.5.9 Chinese translation for theorem name (CTEX)] + [2022/07/14 v2.5.10 Chinese translation for theorem name (CTEX)] \providetranslation{Comments}{评论} \providetranslation{comments}{评论} \providetranslation{Comment}{评论} diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-aptex.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-aptex.def index 17c3e8d931a..b7ff5eeb28e 100644 --- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-aptex.def +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-aptex.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Asian pTeX adapter (CTEX)} \ProvidesExplFile{ctex-engine-aptex.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \cs_new_protected:Npn \ctex_set_zhmap:n { \tl_gput_right:Nx \g__ctex_zhmap_tl } \cs_new_protected:Npn \ctex_use_zhmap: @@ -216,45 +216,48 @@ { \exp_not:o { \CTEX@selectfont@hook #1 } } } \cs_new_eq:NN \CTEX@selectfont@hook \prg_do_nothing: -\if_bool:N \c__ctex_everysel_loaded_bool - \if_cs_exist:N \@EverySelectfont@Init - \group_begin: - \cs_set:Npn \__ctex_tmp:N #1 - { - \tl_set:Nn \l__ctex_tmp_tl {#1} - \cs_new_eq:NN \CTEX@selectfont@save #1 - \cs_new_protected:Npn \__ctex_restore_selectfont: - { - \cs_if_free:NF \scr@new@selectfont - { - \cs_if_free:NF \par@update - { - \tl_put_right:Nn \@EverySelectfont@Init - { \tl_put_right:Nn #1 { \par@update } } - } - \cs_set_eq:NN \scr@new@selectfont #1 - \cs_set_eq:NN \CTEX@selectfont@save \scr@selectfont - } - \tl_put_left:Nn \@EverySelectfont@Init - { \cs_set_eq:NN #1 \CTEX@selectfont@save } - \cs_undefine:N \__ctex_restore_selectfont: - } - } - \ctex_parse_name:NN \__ctex_tmp:N \selectfont - \exp_last_unbraced:NNo \group_end: - \ctex_patch_cmd_once:NnnnTF { \l__ctex_tmp_tl } - { \ExplSyntaxOff } - { \size@update } - { \CTEX@selectfont@hook \size@update } - { \__ctex_restore_selectfont: } - { \ctex_patch_failure:N \selectfont } - \fi: - \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n - { \EverySelectfont } -\else: - \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n - { \ctex_gadd_ltxhook:nn { selectfont } } -\fi: +\bool_if:NTF \c__ctex_everysel_loaded_bool + { + \cs_if_free:NF \@EverySelectfont@Init + { + \group_begin: + \cs_set:Npn \__ctex_tmp:N #1 + { + \tl_set:Nn \l__ctex_tmp_tl {#1} + \cs_new_eq:NN \CTEX@selectfont@save #1 + \cs_new_protected:Npn \__ctex_restore_selectfont: + { + \cs_if_free:NF \scr@new@selectfont + { + \cs_if_free:NF \par@update + { + \tl_put_right:Nn \@EverySelectfont@Init + { \tl_put_right:Nn #1 { \par@update } } + } + \cs_set_eq:NN \scr@new@selectfont #1 + \cs_set_eq:NN \CTEX@selectfont@save \scr@selectfont + } + \tl_put_left:Nn \@EverySelectfont@Init + { \cs_set_eq:NN #1 \CTEX@selectfont@save } + \cs_undefine:N \__ctex_restore_selectfont: + } + } + \ctex_parse_name:NN \__ctex_tmp:N \selectfont + \exp_last_unbraced:NNo \group_end: + \ctex_patch_cmd_once:NnnnTF { \l__ctex_tmp_tl } + { \ExplSyntaxOff } + { \size@update } + { \CTEX@selectfont@hook \size@update } + { \__ctex_restore_selectfont: } + { \ctex_patch_failure:N \selectfont } + } + \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n + { \EverySelectfont } + } + { + \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n + { \ctex_gadd_ltxhook:nn { selectfont } } + } \ctex_gadd_selectfont_hook:n { \CTEX@selectfont@hook } \cs_new_protected:Npn \ctex_update_xkanjiskip: { diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def index 4cb859a27ec..385852488ae 100644 --- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {LuaLaTeX adapter (CTEX)} \ProvidesExplFile{ctex-engine-luatex.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \msg_new:nnn { ctex } { luatexja-loaded } { Package~`luatexja'~can~not~be~loaded~before~`ctex'.\\ @@ -355,7 +355,7 @@ \cs_new:Npn \ctex_ltj_if_jfont:nTF #1 { \ctex_ltj_is_kenc:n { \__ctex_ltj_ltj_if_jfont:w #1 / \q_stop } - \ifin@ \exp_after:wN \use_i:nn \else: \exp_after:wN \use_ii:nn \fi: + \legacy_if:nTF { in@ } } \cs_new:Npn \__ctex_ltj_ltj_if_jfont:w #1 / #2 \q_stop {#1} @@ -1180,40 +1180,43 @@ { \exp_not:o { \CTEX@selectfont@hook #1 } } } \cs_new_eq:NN \CTEX@selectfont@hook \prg_do_nothing: -\if_bool:N \c__ctex_everysel_loaded_bool - \if_cs_exist:N \@EverySelectfont@Init - \group_begin: - \cs_set:Npn \__ctex_tmp:N #1 - { - \tl_set:Nn \l__ctex_tmp_tl {#1} - \cs_new_eq:NN \CTEX@selectfont@save #1 - \cs_new_protected:Npn \__ctex_restore_selectfont: - { - \cs_if_free:NF \scr@new@selectfont - { - \cs_set_eq:NN \scr@new@selectfont #1 - \cs_set_eq:NN \CTEX@selectfont@save \scr@selectfont - } - \tl_put_left:Nn \@EverySelectfont@Init - { \cs_set_eq:NN #1 \CTEX@selectfont@save } - \cs_undefine:N \__ctex_restore_selectfont: - } - } - \ctex_parse_name:NN \__ctex_tmp:N \selectfont - \exp_last_unbraced:NNo \group_end: - \ctex_patch_cmd_once:NnnnTF { \l__ctex_tmp_tl } - { \ExplSyntaxOff } - { \size@update } - { \CTEX@selectfont@hook \size@update } - { \__ctex_restore_selectfont: } - { \ctex_patch_failure:N \selectfont } - \fi: - \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n - { \EverySelectfont } -\else: - \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n - { \ctex_gadd_ltxhook:nn { selectfont } } -\fi: +\bool_if:NTF \c__ctex_everysel_loaded_bool + { + \cs_if_free:NF \@EverySelectfont@Init + { + \group_begin: + \cs_set:Npn \__ctex_tmp:N #1 + { + \tl_set:Nn \l__ctex_tmp_tl {#1} + \cs_new_eq:NN \CTEX@selectfont@save #1 + \cs_new_protected:Npn \__ctex_restore_selectfont: + { + \cs_if_free:NF \scr@new@selectfont + { + \cs_set_eq:NN \scr@new@selectfont #1 + \cs_set_eq:NN \CTEX@selectfont@save \scr@selectfont + } + \tl_put_left:Nn \@EverySelectfont@Init + { \cs_set_eq:NN #1 \CTEX@selectfont@save } + \cs_undefine:N \__ctex_restore_selectfont: + } + } + \ctex_parse_name:NN \__ctex_tmp:N \selectfont + \exp_last_unbraced:NNo \group_end: + \ctex_patch_cmd_once:NnnnTF { \l__ctex_tmp_tl } + { \ExplSyntaxOff } + { \size@update } + { \CTEX@selectfont@hook \size@update } + { \__ctex_restore_selectfont: } + { \ctex_patch_failure:N \selectfont } + } + \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n + { \EverySelectfont } + } + { + \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n + { \ctex_gadd_ltxhook:nn { selectfont } } + } \ctex_gadd_selectfont_hook:n { \CTEX@selectfont@hook } \ctex_add_to_selectfont:n { diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def index dc8cd6c91c3..770240c7aa0 100644 --- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {(pdf)LaTeX adapter (CTEX)} \ProvidesExplFile{ctex-engine-pdftex.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \cs_new_protected:Npn \ctex_set_zhmap:n { \tl_gput_right:Nx \g__ctex_zhmap_tl } \cs_new_protected:Npn \ctex_use_zhmap: @@ -62,8 +62,8 @@ { \tl_gput_right:cn { #1 + #2 } { \ctex_add_cmap:n {#1} } } } } -\cs_generate_variant:Nn \ctex_family_cmap:nn { x } -\cs_new_eq:NN \CTEX@Family@CMap \ctex_family_cmap:xn +\cs_generate_variant:Nn \ctex_family_cmap:nn { ee } +\cs_new_eq:NN \CTEX@Family@CMap \ctex_family_cmap:ee \cs_new_protected:Npn \ctex_add_cmap:n #1 { \cs_if_free:NF \CJK@plane @@ -81,51 +81,73 @@ \exp_args:Ne \file_get_full_name:nNTF { \str_lowercase:n {#2} .cmap } \l__ctex_cmap_file_tl { - \tex_immediate:D \tex_pdfobj:D stream ~ file { \l__ctex_cmap_file_tl } + \pdf_object_unnamed_write:nx + { fstream } + { { } { \l__ctex_cmap_file_tl } } \cs_new_protected:Npx #1 { \pdfnobuiltintounicode \tex_font:D \tex_pdffontattr:D \tex_font:D - { /ToUnicode ~ \int_value:w \tex_pdflastobj:D \c_space_tl 0 ~ R } + { /ToUnicode ~ \pdf_object_ref_last: } } } { \cs_new_eq:NN #1 \prg_do_nothing: } } \tl_new:N \l__ctex_cmap_file_tl -\group_begin: -\char_set_catcode_other:N \# -\sys_if_output_pdf:TF +\sys_if_output_pdf:T { - \group_end: - \ctex_appto_cmd:NnnTF \DeclareFontFamily { \ExplSyntaxOff } - { \CTEX@Family@CMap {#1} {#2} } + \exp_args:Nno \use:n + { \cs_gset_protected:Npn \DeclareFontFamily #1#2#3 } { - \ctex_at_end_package:nn { cmap } - { - \cs_gset_eq:NN \ctex_add_cmap:n \use_none:n - \cs_gset_eq:NN \CTEX@Family@CMap \use_none:nn - } + \DeclareFontFamily {#1} {#2} {#3} + \CTEX@Family@CMap {#1} {#2} } - { \ctex_patch_failure:N \DeclareFontFamily } - } - { \group_end: } -\if_bool:N \g__ctex_zhmCJK_bool - \PassOptionsToPackage { encoding = \g__ctex_encoding_tl } { zhmCJK } - \RequirePackage { zhmCJK } -\else: - \str_if_eq:onTF { \g__ctex_encoding_tl } { GBK } - { \RequirePackage { CJK } } - { \RequirePackage { CJKutf8 } } - \RequirePackage { CJKpunct , CJKspace } - \cs_new_protected:Npn \ctex_load_zhmap:nnnn #1#2#3#4 - { - \tl_set:Nn \CJKrmdefault {#1} - \tl_set:Nn \CJKsfdefault {#2} - \tl_set:Nn \CJKttdefault {#3} - \ctex_set_zhmap:n { \ctex_file_input:n { ctex-zhmap- #4 .tex } } - } - \@onlypreamble \ctex_load_zhmap:nnnn -\fi: + \ctex_at_end_package:nn { cmap } + { + \cs_gset_eq:NN \ctex_add_cmap:n \use_none:n + \cs_gset_eq:NN \CTEX@Family@CMap \use_none:nn + } + } +\bool_if:NTF \g__ctex_zhmCJK_bool + { + \exp_args:Ne \PassOptionsToPackage + { encoding = \g__ctex_encoding_tl } + { zhmCJK } + \RequirePackage { zhmCJK } + } + { + \str_if_eq:onTF { \g__ctex_encoding_tl } { GBK } + { \RequirePackage { CJK } } + { \RequirePackage { CJKutf8 } } + \RequirePackage { CJKpunct , CJKspace } + \cs_new_protected:Npn \ctex_load_zhmap:nnnn #1#2#3#4 + { + \tl_set:Nn \CJKrmdefault {#1} + \tl_set:Nn \CJKsfdefault {#2} + \tl_set:Nn \CJKttdefault {#3} + \ctex_set_zhmap:n { \ctex_file_input:n { ctex-zhmap- #4 .tex } } + } + \@onlypreamble \ctex_load_zhmap:nnnn + } +\cs_new_protected:Npn \ctex_undeclare_unicode_character:n #1 + { \cs_set_eq:cN { u8 : \ctex_utfviii_char:n {#1} } \tex_undefined:D } +\cs_new:Npn \ctex_utfviii_char:n #1 + { + \exp_last_unbraced:Ne \__ctex_utfviii_char_aux:nnnn + { \char_to_utfviii_bytes:n {#1} } + } +\cs_new:Npn \__ctex_utfviii_char_aux:nnnn #1#2#3#4 + { + \char_generate:nn {#1} { 12 } + \tl_if_empty:nF {#2} { \char_generate:nn {#2} { 12 } } + \tl_if_empty:nF {#3} { \char_generate:nn {#3} { 12 } } + \tl_if_empty:nF {#4} { \char_generate:nn {#4} { 12 } } + } +\CJKaddEncHook { UTF8 } + { + \ctex_undeclare_unicode_character:n { "3008 } + \ctex_undeclare_unicode_character:n { "3009 } + } \cs_new_protected:Npn \ctex_CJK_input:n #1 { \ctex_push_file: @@ -166,24 +188,180 @@ } \AtBeginDocument { - \str_if_eq:eeF { \l__ctex_punct_tl } { quanjiao } - { \punctstyle { \l__ctex_punct_tl } } + \use:e + { + \str_if_eq:nnF { \l__ctex_punct_tl } { quanjiao } + { \exp_not:N \punctstyle { \l__ctex_punct_tl } } + } } \ctex_at_end_preamble:n { \ctex_update_default_family: } -\reverse_if:N \if_bool:N \g__ctex_zhmCJK_bool - \str_if_eq:onF { \g__ctex_encoding_tl } { UTF8 } - { - \CJK@makeActive - \CJK@loadBinding { standard } - } - \exp_args:Nx \ctex_at_end_preamble:n - { - \exp_not:N \CJK@envStart - { } { \g__ctex_encoding_tl } { \exp_not:N \CJKfamilydefault } - \exp_not:N \CJKtilde - } -\fi: +\bool_if:NF \g__ctex_zhmCJK_bool + { + \str_if_eq:onTF { \g__ctex_encoding_tl } { UTF8 } + { \CJK@loadBinding { UTF8 } } + { \CJK@loadBinding { standard } } + \exp_args:Ne \ctex_at_end_preamble:n + { + \exp_not:N \CJK@envStart + { } { \g__ctex_encoding_tl } { \exp_not:N \CJKfamilydefault } + \exp_not:N \CJKtilde + } + } \cs_new_eq:NN \ctex_auto_ignorespaces: \CJK@@ignorespaces +\cs_new:Npn \__ctex_char:N #1 + { \exp_args:Ne \CTEX@char@n { \int_value:w `#1 } } +\cs_new:Npn \__ctex_char:NN #1#2 + { + \token_if_eq_meaning:NNTF #2 \protect + { \__ctex_char_aux:NN #1 } + { \__ctex_char_aux:NN #1#2 } + } +\cs_new:Npn \__ctex_char_aux:NN #1#2 + { + \exp_last_unbraced:Ne \CTEX@char@nn + { + { \int_value:w `#1 } + { \int_value:w `#2 } + } + } +\cs_new:Npn \__ctex_char:NNN #1#2#3 + { + \token_if_eq_meaning:NNTF #2 \protect + { \__ctex_char_auxi:NNNN #1#3 } + { \__ctex_char_auxii:NNN #1#2#3 } + } +\cs_new:Npn \__ctex_char_auxi:NNN #1#2#3#4 + { \__ctex_char_auxii:NNN #1#2#4 } +\cs_new:Npn \__ctex_char_auxii:NNN #1#2#3 + { + \exp_last_unbraced:Ne \CTEX@char@nnn + { + { \int_value:w `#1 } + { \int_value:w `#2 } + { \int_value:w `#3 } + } + } +\cs_new:Npn \__ctex_char:NNNN #1#2#3#4 + { + \token_if_eq_meaning:NNTF #2 \protect + { \__ctex_char_auxi:NNNNN #1#3 } + { \__ctex_char_auxii:NNNN #1#2#3#4 } + } +\cs_new:Npn \__ctex_char_auxi:NNNNN #1#2#3#4#5 + { \__ctex_char_auxii:NNNN #1#2#3#5 } +\cs_new:Npn \__ctex_char_auxii:NNNN #1#2#3#4 + { + \exp_last_unbraced:Ne \CTEX@char@nnnn + { + { \int_value:w `#1 } + { \int_value:w `#2 } + { \int_value:w `#3 } + { \int_value:w `#4 } + } + } +\cs_gset_eq:NN \CJK@X \__ctex_char:N +\cs_gset_eq:NN \CJK@XX \__ctex_char:NN +\cs_gset_eq:NN \CJK@XXX \__ctex_char:NNN +\cs_gset_eq:NN \CJK@XXXX \__ctex_char:NNNN +\str_if_eq:onF { \g__ctex_encoding_tl } { GBK } + { + \exp_args:Nne \use:n + { \cs_gset:Npn \__ctex_char_aux:NN #1#2 } + { + \exp_not:N \cs_if_exist_use:cF + { u8: \exp_not:N \tl_to_str:n { #1#2 } } + { \exp_not:o { \__ctex_char_aux:NN {#1} {#2} } } + } + \exp_args:Nne \use:n + { \cs_gset:Npn \__ctex_char_auxii:NNN #1#2#3 } + { + \exp_not:N \cs_if_exist_use:cF + { u8: \exp_not:N \tl_to_str:n { #1#2#3 } } + { \exp_not:o { \__ctex_char_auxii:NNN {#1} {#2} {#3} } } + } + } +\group_begin: +\char_set_catcode_active:n { "7F } +\cs_new:Npn \__ctex_char_preproc:w #1 ^^7f #2 ^^7f + { \exp_args:No \CTEX@char@nn { \int_value:w `#1 } {#2} } +\cs_gset_eq:NN \mule@arg \__ctex_char_preproc:w +\group_end: +\exp_args:Ne \ctex_at_end:n + { + \char_set_catcode:nn + { \int_value:w "7F } + { \char_value_catcode:n { "7F } } + } +\cs_new_protected:Npn \CTEX@char@n #1 + { + \mode_leave_vertical: + \use:c { CJK@ #1 } + \CJK@ignorespaces + } +\cs_new_protected:Npn \CTEX@char@nn #1#2 + { + \mode_leave_vertical: + \use:c { CJK@ #1 } {#2} + \CJK@ignorespaces + } +\cs_new_protected:Npn \CTEX@char@nnn #1#2#3 + { + \mode_leave_vertical: + \use:c { CJK@ #1 } {#2} {#3} + \CJK@ignorespaces + } +\cs_new_protected:Npn \CTEX@char@nnnn #1#2#3#4 + { + \mode_leave_vertical: + \use:c { CJK@ #1 } {#2} {#3} {#4} + \CJK@ignorespaces + } +\cs_new_protected:Npn \CTEX@char@nn@n #1 { \CTEX@char@nn #1 } +\cs_new_protected:Npn \CTEX@char@nnn@n #1 { \CTEX@char@nnn #1 } +\cs_new_protected:Npn \CTEX@char@nnnn@n #1 { \CTEX@char@nnnn #1 } +\cs_new:Npn \__ctex_char_wrap:nn #1#2 + { \CTEX@char@nn@n { {#1} {#2} } } +\cs_new:Npn \__ctex_char_wrap:nnn #1#2#3 + { \CTEX@char@nnn@n { {#1} {#2} {#3} } } +\cs_new:Npn \__ctex_char_wrap:nnnn #1#2#3#4 + { \CTEX@char@nnnn@n { {#1} {#2} {#3} {#4} } } +\tl_put_right:Nn \l_text_case_exclude_arg_tl + { + \CTEX@char@n + \CTEX@char@nn@n + \CTEX@char@nnn@n + \CTEX@char@nnnn@n + } +\text_declare_expand_equivalent:Nn \CTEX@char@nn { \__ctex_char_wrap:nn } +\text_declare_expand_equivalent:Nn \CTEX@char@nnn { \__ctex_char_wrap:nnn } +\text_declare_expand_equivalent:Nn \CTEX@char@nnnn { \__ctex_char_wrap:nnnn } +\cs_new:Npn \__ctex_char_raw:n #1 + { \char_generate:nn {#1} { 12 } } +\cs_new:Npn \__ctex_char_raw:nn #1#2 + { + \char_generate:nn {#1} { 12 } + \char_generate:nn {#2} { 12 } + } +\cs_new:Npn \__ctex_char_raw:nnn #1#2#3 + { + \char_generate:nn {#1} { 12 } + \char_generate:nn {#2} { 12 } + \char_generate:nn {#3} { 12 } + } +\cs_new:Npn \__ctex_char_raw:nnnn #1#2#3#4 + { + \char_generate:nn {#1} { 12 } + \char_generate:nn {#2} { 12 } + \char_generate:nn {#3} { 12 } + \char_generate:nn {#4} { 12 } + } +\cs_new:Npn \__ctex_char_raw_nn:n #1 { \use:e { \__ctex_char_raw:nn #1 } } +\cs_new:Npn \__ctex_char_raw_nnn:n #1 { \use:e { \__ctex_char_raw:nnn #1 } } +\cs_new:Npn \__ctex_char_raw_nnnn:n #1 { \use:e { \__ctex_char_raw:nnnn #1 } } +\text_declare_purify_equivalent:Nn \CTEX@char@n { \__ctex_char_raw:n } +\text_declare_purify_equivalent:Nn \CTEX@char@nn@n { \__ctex_char_raw_nn:n } +\text_declare_purify_equivalent:Nn \CTEX@char@nnn@n { \__ctex_char_raw_nnn:n } +\text_declare_purify_equivalent:Nn \CTEX@char@nnnn@n { \__ctex_char_raw_nnnn:n } \cs_new_protected:Npn \ctex_ignorespaces_case:N #1 { \cs_set_protected:Npn \ctex_set_ignorespaces: @@ -367,42 +545,45 @@ { \exp_not:o { \CTEX@selectfont@hook #1 } } } \cs_new_eq:NN \CTEX@selectfont@hook \prg_do_nothing: -\if_bool:N \c__ctex_everysel_loaded_bool - \if_cs_exist:N \@EverySelectfont@Init - \group_begin: - \cs_set:Npn \__ctex_tmp:N #1 - { - \tl_set:Nn \l__ctex_tmp_tl {#1} - \cs_new_eq:NN \CTEX@selectfont@save #1 - \cs_new_protected:Npn \__ctex_restore_selectfont: - { - \cs_if_free:NF \scr@new@selectfont - { - \cs_if_free:NF \par@update - { \tl_put_right:Nn #1 { \par@update } } - \cs_set_eq:NN \scr@selectfont \CTEX@selectfont@save - \cs_set_eq:NN \scr@new@selectfont #1 - } - \tl_put_left:Nn \@EverySelectfont@Init - { \cs_set_eq:NN #1 \CTEX@selectfont@save } - \cs_undefine:N \__ctex_restore_selectfont: - } - } - \ctex_parse_name:NN \__ctex_tmp:N \selectfont - \exp_last_unbraced:NNo \group_end: - \ctex_patch_cmd_once:NnnnTF { \l__ctex_tmp_tl } - { \ExplSyntaxOff } - { \size@update } - { \CTEX@selectfont@hook \size@update } - { \__ctex_restore_selectfont: } - { \ctex_patch_failure:N \selectfont } - \fi: - \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n - { \EverySelectfont } -\else: - \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n - { \ctex_gadd_ltxhook:nn { selectfont } } -\fi: +\bool_if:NTF \c__ctex_everysel_loaded_bool + { + \cs_if_free:NF \@EverySelectfont@Init + { + \group_begin: + \cs_set:Npn \__ctex_tmp:N #1 + { + \tl_set:Nn \l__ctex_tmp_tl {#1} + \cs_new_eq:NN \CTEX@selectfont@save #1 + \cs_new_protected:Npn \__ctex_restore_selectfont: + { + \cs_if_free:NF \scr@new@selectfont + { + \cs_if_free:NF \par@update + { \tl_put_right:Nn #1 { \par@update } } + \cs_set_eq:NN \scr@selectfont \CTEX@selectfont@save + \cs_set_eq:NN \scr@new@selectfont #1 + } + \tl_put_left:Nn \@EverySelectfont@Init + { \cs_set_eq:NN #1 \CTEX@selectfont@save } + \cs_undefine:N \__ctex_restore_selectfont: + } + } + \ctex_parse_name:NN \__ctex_tmp:N \selectfont + \exp_last_unbraced:NNo \group_end: + \ctex_patch_cmd_once:NnnnTF { \l__ctex_tmp_tl } + { \ExplSyntaxOff } + { \size@update } + { \CTEX@selectfont@hook \size@update } + { \__ctex_restore_selectfont: } + { \ctex_patch_failure:N \selectfont } + } + \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n + { \EverySelectfont } + } + { + \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n + { \ctex_gadd_ltxhook:nn { selectfont } } + } \ctex_gadd_selectfont_hook:n { \cs_if_exist:NF \CJK@plane { \CTEX@selectfont@hook } } \ctex_define:n diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-uptex.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-uptex.def index 69708e9ae69..889f051a207 100644 --- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-uptex.def +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-uptex.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {upTeX adapter (CTEX)} \ProvidesExplFile{ctex-engine-uptex.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \cs_new_protected:Npn \ctex_set_zhmap:n { \tl_gput_right:Nx \g__ctex_zhmap_tl } \cs_new_protected:Npn \ctex_use_zhmap: @@ -216,45 +216,48 @@ { \exp_not:o { \CTEX@selectfont@hook #1 } } } \cs_new_eq:NN \CTEX@selectfont@hook \prg_do_nothing: -\if_bool:N \c__ctex_everysel_loaded_bool - \if_cs_exist:N \@EverySelectfont@Init - \group_begin: - \cs_set:Npn \__ctex_tmp:N #1 - { - \tl_set:Nn \l__ctex_tmp_tl {#1} - \cs_new_eq:NN \CTEX@selectfont@save #1 - \cs_new_protected:Npn \__ctex_restore_selectfont: - { - \cs_if_free:NF \scr@new@selectfont - { - \cs_if_free:NF \par@update - { - \tl_put_right:Nn \@EverySelectfont@Init - { \tl_put_right:Nn #1 { \par@update } } - } - \cs_set_eq:NN \scr@new@selectfont #1 - \cs_set_eq:NN \CTEX@selectfont@save \scr@selectfont - } - \tl_put_left:Nn \@EverySelectfont@Init - { \cs_set_eq:NN #1 \CTEX@selectfont@save } - \cs_undefine:N \__ctex_restore_selectfont: - } - } - \ctex_parse_name:NN \__ctex_tmp:N \selectfont - \exp_last_unbraced:NNo \group_end: - \ctex_patch_cmd_once:NnnnTF { \l__ctex_tmp_tl } - { \ExplSyntaxOff } - { \size@update } - { \CTEX@selectfont@hook \size@update } - { \__ctex_restore_selectfont: } - { \ctex_patch_failure:N \selectfont } - \fi: - \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n - { \EverySelectfont } -\else: - \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n - { \ctex_gadd_ltxhook:nn { selectfont } } -\fi: +\bool_if:NTF \c__ctex_everysel_loaded_bool + { + \cs_if_free:NF \@EverySelectfont@Init + { + \group_begin: + \cs_set:Npn \__ctex_tmp:N #1 + { + \tl_set:Nn \l__ctex_tmp_tl {#1} + \cs_new_eq:NN \CTEX@selectfont@save #1 + \cs_new_protected:Npn \__ctex_restore_selectfont: + { + \cs_if_free:NF \scr@new@selectfont + { + \cs_if_free:NF \par@update + { + \tl_put_right:Nn \@EverySelectfont@Init + { \tl_put_right:Nn #1 { \par@update } } + } + \cs_set_eq:NN \scr@new@selectfont #1 + \cs_set_eq:NN \CTEX@selectfont@save \scr@selectfont + } + \tl_put_left:Nn \@EverySelectfont@Init + { \cs_set_eq:NN #1 \CTEX@selectfont@save } + \cs_undefine:N \__ctex_restore_selectfont: + } + } + \ctex_parse_name:NN \__ctex_tmp:N \selectfont + \exp_last_unbraced:NNo \group_end: + \ctex_patch_cmd_once:NnnnTF { \l__ctex_tmp_tl } + { \ExplSyntaxOff } + { \size@update } + { \CTEX@selectfont@hook \size@update } + { \__ctex_restore_selectfont: } + { \ctex_patch_failure:N \selectfont } + } + \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n + { \EverySelectfont } + } + { + \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n + { \ctex_gadd_ltxhook:nn { selectfont } } + } \ctex_gadd_selectfont_hook:n { \CTEX@selectfont@hook } \cs_new_protected:Npn \ctex_update_xkanjiskip: { diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def index d51a9e4f952..d04fe9490f7 100644 --- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def @@ -24,12 +24,12 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {XeLaTeX adapter (CTEX)} \ProvidesExplFile{ctex-engine-xetex.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \RequirePackage { xeCJK } -\exp_args:Nx \xeCJKsetup +\exp_args:Ne \xeCJKsetup { LoadFandol = false , PunctStyle = \l__ctex_punct_tl @@ -78,40 +78,43 @@ { \exp_not:o { \CTEX@selectfont@hook #1 } } } \cs_new_eq:NN \CTEX@selectfont@hook \prg_do_nothing: -\if_bool:N \c__ctex_everysel_loaded_bool - \if_cs_exist:N \@EverySelectfont@Init - \group_begin: - \cs_set:Npn \__ctex_tmp:N #1 - { - \tl_set:Nn \l__ctex_tmp_tl {#1} - \cs_new_eq:NN \CTEX@selectfont@save #1 - \cs_new_protected:Npn \__ctex_restore_selectfont: - { - \cs_if_free:NF \scr@new@selectfont - { - \cs_set_eq:NN \scr@new@selectfont #1 - \cs_set_eq:NN \CTEX@selectfont@save \scr@selectfont - } - \tl_put_left:Nn \@EverySelectfont@Init - { \cs_set_eq:NN #1 \CTEX@selectfont@save } - \cs_undefine:N \__ctex_restore_selectfont: - } - } - \ctex_parse_name:NN \__ctex_tmp:N \selectfont - \exp_last_unbraced:NNo \group_end: - \ctex_patch_cmd_once:NnnnTF { \l__ctex_tmp_tl } - { \ExplSyntaxOff } - { \size@update } - { \CTEX@selectfont@hook \size@update } - { \__ctex_restore_selectfont: } - { \ctex_patch_failure:N \selectfont } - \fi: - \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n - { \EverySelectfont } -\else: - \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n - { \ctex_gadd_ltxhook:nn { selectfont } } -\fi: +\bool_if:NTF \c__ctex_everysel_loaded_bool + { + \cs_if_free:NF \@EverySelectfont@Init + { + \group_begin: + \cs_set:Npn \__ctex_tmp:N #1 + { + \tl_set:Nn \l__ctex_tmp_tl {#1} + \cs_new_eq:NN \CTEX@selectfont@save #1 + \cs_new_protected:Npn \__ctex_restore_selectfont: + { + \cs_if_free:NF \scr@new@selectfont + { + \cs_set_eq:NN \scr@new@selectfont #1 + \cs_set_eq:NN \CTEX@selectfont@save \scr@selectfont + } + \tl_put_left:Nn \@EverySelectfont@Init + { \cs_set_eq:NN #1 \CTEX@selectfont@save } + \cs_undefine:N \__ctex_restore_selectfont: + } + } + \ctex_parse_name:NN \__ctex_tmp:N \selectfont + \exp_last_unbraced:NNo \group_end: + \ctex_patch_cmd_once:NnnnTF { \l__ctex_tmp_tl } + { \ExplSyntaxOff } + { \size@update } + { \CTEX@selectfont@hook \size@update } + { \__ctex_restore_selectfont: } + { \ctex_patch_failure:N \selectfont } + } + \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n + { \EverySelectfont } + } + { + \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n + { \ctex_gadd_ltxhook:nn { selectfont } } + } \ctex_gadd_selectfont_hook:n { \CTEX@selectfont@hook } \ctex_define:n { diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd b/Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd index ef35cf49d59..36285d98bfd 100644 --- a/Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd +++ b/Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd @@ -25,7 +25,7 @@ %% --------------------------------------------------------------------- %% \ProvidesFile{c19rm.fd}% - [2022/06/04 v2.5.9 Chinese font definition (CTEX)] + [2022/07/14 v2.5.10 Chinese font definition (CTEX)] %% %% Chinese characters %% diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd b/Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd index 7ab9fd5389d..d9f648e5f81 100644 --- a/Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd +++ b/Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd @@ -25,7 +25,7 @@ %% --------------------------------------------------------------------- %% \ProvidesFile{c19sf.fd}% - [2022/06/04 v2.5.9 Chinese font definition (CTEX)] + [2022/07/14 v2.5.10 Chinese font definition (CTEX)] %% %% Chinese characters %% diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd b/Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd index 9298ea2ce1f..9f1e763927f 100644 --- a/Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd +++ b/Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd @@ -25,7 +25,7 @@ %% --------------------------------------------------------------------- %% \ProvidesFile{c19tt.fd}% - [2022/06/04 v2.5.9 Chinese font definition (CTEX)] + [2022/07/14 v2.5.10 Chinese font definition (CTEX)] %% %% Chinese characters %% diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd b/Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd index 1f63868913c..04da4ec137e 100644 --- a/Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd +++ b/Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd @@ -25,7 +25,7 @@ %% --------------------------------------------------------------------- %% \ProvidesFile{c70rm.fd}% - [2022/06/04 v2.5.9 Chinese font definition (CTEX)] + [2022/07/14 v2.5.10 Chinese font definition (CTEX)] %% %% Chinese characters %% diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd b/Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd index 8d5888dd6b2..3aa65f3173f 100644 --- a/Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd +++ b/Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd @@ -25,7 +25,7 @@ %% --------------------------------------------------------------------- %% \ProvidesFile{c70sf.fd}% - [2022/06/04 v2.5.9 Chinese font definition (CTEX)] + [2022/07/14 v2.5.10 Chinese font definition (CTEX)] %% %% Chinese characters %% diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd b/Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd index 7b314238167..866a09276f2 100644 --- a/Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd +++ b/Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd @@ -25,7 +25,7 @@ %% --------------------------------------------------------------------- %% \ProvidesFile{c70tt.fd}% - [2022/06/04 v2.5.9 Chinese font definition (CTEX)] + [2022/07/14 v2.5.10 Chinese font definition (CTEX)] %% %% Chinese characters %% diff --git a/Master/texmf-dist/tex/latex/ctex/fd/jt2zhrm.fd b/Master/texmf-dist/tex/latex/ctex/fd/jt2zhrm.fd index d5e8e8b8fa0..229419b3d44 100644 --- a/Master/texmf-dist/tex/latex/ctex/fd/jt2zhrm.fd +++ b/Master/texmf-dist/tex/latex/ctex/fd/jt2zhrm.fd @@ -25,7 +25,7 @@ %% --------------------------------------------------------------------- %% \ProvidesFile{jt2zhrm.fd}% - [2022/06/04 v2.5.9 Chinese font definition (CTEX)] + [2022/07/14 v2.5.10 Chinese font definition (CTEX)] \DeclareKanjiFamily{JT2}{zhrm}{} \DeclareFontShape{JT2}{zhrm}{m}{n}{<-> upzhserif-v}{} \DeclareFontShape{JT2}{zhrm}{m}{it}{<-> upzhserifit-v}{} diff --git a/Master/texmf-dist/tex/latex/ctex/fd/jt2zhsf.fd b/Master/texmf-dist/tex/latex/ctex/fd/jt2zhsf.fd index 2adb53b670a..a5ca9c1feac 100644 --- a/Master/texmf-dist/tex/latex/ctex/fd/jt2zhsf.fd +++ b/Master/texmf-dist/tex/latex/ctex/fd/jt2zhsf.fd @@ -25,7 +25,7 @@ %% --------------------------------------------------------------------- %% \ProvidesFile{jt2zhsf.fd}% - [2022/06/04 v2.5.9 Chinese font definition (CTEX)] + [2022/07/14 v2.5.10 Chinese font definition (CTEX)] \DeclareKanjiFamily{JT2}{zhsf}{} \DeclareFontShape{JT2}{zhsf}{m}{n}{<-> upzhsans-v}{} \DeclareFontShape{JT2}{zhsf}{b}{n}{<-> upzhsansb-v}{} diff --git a/Master/texmf-dist/tex/latex/ctex/fd/jt2zhtt.fd b/Master/texmf-dist/tex/latex/ctex/fd/jt2zhtt.fd index ecbaed5bf95..c81c32e652f 100644 --- a/Master/texmf-dist/tex/latex/ctex/fd/jt2zhtt.fd +++ b/Master/texmf-dist/tex/latex/ctex/fd/jt2zhtt.fd @@ -25,7 +25,7 @@ %% --------------------------------------------------------------------- %% \ProvidesFile{jt2zhtt.fd}% - [2022/06/04 v2.5.9 Chinese font definition (CTEX)] + [2022/07/14 v2.5.10 Chinese font definition (CTEX)] \DeclareKanjiFamily{JT2}{zhtt}{} \DeclareFontShape{JT2}{zhtt}{m}{n}{<-> upzhmono-v}{} %% diff --git a/Master/texmf-dist/tex/latex/ctex/fd/jy2zhrm.fd b/Master/texmf-dist/tex/latex/ctex/fd/jy2zhrm.fd index 6aff51f5e20..e301afd1c25 100644 --- a/Master/texmf-dist/tex/latex/ctex/fd/jy2zhrm.fd +++ b/Master/texmf-dist/tex/latex/ctex/fd/jy2zhrm.fd @@ -25,7 +25,7 @@ %% --------------------------------------------------------------------- %% \ProvidesFile{jy2zhrm.fd}% - [2022/06/04 v2.5.9 Chinese font definition (CTEX)] + [2022/07/14 v2.5.10 Chinese font definition (CTEX)] \DeclareKanjiFamily{JY2}{zhrm}{} \DeclareFontShape{JY2}{zhrm}{m}{n}{<-> upzhserif-h}{} \DeclareFontShape{JY2}{zhrm}{m}{it}{<-> upzhserifit-h}{} diff --git a/Master/texmf-dist/tex/latex/ctex/fd/jy2zhsf.fd b/Master/texmf-dist/tex/latex/ctex/fd/jy2zhsf.fd index 8d8a25568dd..f248cf0a8c6 100644 --- a/Master/texmf-dist/tex/latex/ctex/fd/jy2zhsf.fd +++ b/Master/texmf-dist/tex/latex/ctex/fd/jy2zhsf.fd @@ -25,7 +25,7 @@ %% --------------------------------------------------------------------- %% \ProvidesFile{jy2zhsf.fd}% - [2022/06/04 v2.5.9 Chinese font definition (CTEX)] + [2022/07/14 v2.5.10 Chinese font definition (CTEX)] \DeclareKanjiFamily{JY2}{zhsf}{} \DeclareFontShape{JY2}{zhsf}{m}{n}{<-> upzhsans-h}{} \DeclareFontShape{JY2}{zhsf}{b}{n}{<-> upzhsansb-h}{} diff --git a/Master/texmf-dist/tex/latex/ctex/fd/jy2zhtt.fd b/Master/texmf-dist/tex/latex/ctex/fd/jy2zhtt.fd index 0c1b3b561cb..2a0c5e7b55e 100644 --- a/Master/texmf-dist/tex/latex/ctex/fd/jy2zhtt.fd +++ b/Master/texmf-dist/tex/latex/ctex/fd/jy2zhtt.fd @@ -25,7 +25,7 @@ %% --------------------------------------------------------------------- %% \ProvidesFile{jy2zhtt.fd}% - [2022/06/04 v2.5.9 Chinese font definition (CTEX)] + [2022/07/14 v2.5.10 Chinese font definition (CTEX)] \DeclareKanjiFamily{JY2}{zhtt}{} \DeclareFontShape{JY2}{zhtt}{m}{n}{<-> upzhmono-h}{} %% diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def index 5e75f080c08..4dcd99259d3 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Adobe fonts definition (CTEX)} \ProvidesExplFile{ctex-fontset-adobe.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \ctex_fontset_case:nnnn { \ctex_fontset_error:n { adobe } } { diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def index 310a96d2dfe..1c43aefd695 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Fandol fonts definition (CTEX)} \ProvidesExplFile{ctex-fontset-fandol.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \ctex_fontset_case:nnnn { \ctex_fontset_error:n { fandol } } { diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def index dd715916ae2..c3cecded5df 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Founder fonts definition (CTEX)} \ProvidesExplFile{ctex-fontset-founder.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \ctex_fontset_case:nnn { \ctex_zhmap_case:nnn diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def index 8a5b2916d32..35683084b30 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {macOS fonts definition (CTEX)} \ProvidesExplFile{ctex-fontset-mac.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \file_if_exist:nTF { /System/Library/Fonts/PingFang.ttc } { \ctex_file_input:n { ctex-fontset-macnew.def } } { \ctex_file_input:n { ctex-fontset-macold.def } } diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-macnew.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-macnew.def index a9d2c85fa5b..731d23bfe5e 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-macnew.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-macnew.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {macOS fonts definition for El Capitan or later version (CTEX)} \ProvidesExplFile{ctex-fontset-macnew.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \ctex_fontset_case:nnnn { \ctex_fontset_error:n { mac } } { diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-macold.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-macold.def index 286c76c2cea..645c0b6cfc4 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-macold.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-macold.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {macOS fonts definition for Yosemite or earlier version (CTEX)} \ProvidesExplFile{ctex-fontset-macold.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \ctex_fontset_case:nnnn { \ctex_fontset_error:n { mac } } { \ctex_fontset_error:n { macold } } diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def index dadb03c2343..3cf0ef1a102 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Ubuntu fonts definition (CTEX)} \ProvidesExplFile{ctex-fontset-ubuntu.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \ctex_fontset_case:nnnn { \ctex_fontset_error:n { ubuntu } } { diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def index da40c90ccf3..5330b0bb718 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Windows fonts definition (CTEX)} \ProvidesExplFile{ctex-fontset-windows.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \file_if_exist:nTF { \c_dollar_str WINDIR/Fonts/msyh.ttc } { \tl_const:Nn \c__ctex_msyh_suffix_tl { ttc } } { diff --git a/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-article.def b/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-article.def index 2f2ee4728ec..c0ddb32403b 100644 --- a/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-article.def +++ b/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-article.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Heading modification for article (CTEX)} \ProvidesExplFile{ctex-article.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \seq_const_from_clist:Nn \c__ctex_section_headings_seq { section , subsection , subsubsection , paragraph , subparagraph } \seq_new:N \c__ctex_headings_seq @@ -65,11 +65,11 @@ } \cs_new_protected:Npn \__ctex_def_heading_keys:n #1 { - \tl_put_right:Nx \l__ctex_tmp_tl + \exp_args:NNe \tl_put_right:Nn \l__ctex_tmp_tl { - #1 .meta:nn = { ctex / #1 } { ####1 } , + #1 .meta:nn = { ctex / #1 } { ##1 } , #1 / name .code:n = - { \ctex_assign_heading_name:nn {#1} { ####1 } } , + { \ctex_assign_heading_name:nn {#1} { ##1 } } , #1 / number .tl_set:N = \exp_not:c { CTEX@the#1 } , #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } , #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} , @@ -87,8 +87,7 @@ #1 / hang .bool_set:N = \exp_not:c { CTEX@#1@hang } , #1 / hang .initial:n = true , #1 / runin .bool_set:N = \exp_not:c { CTEX@#1@runin } , - #1 / tocline .cs_set:Np = \exp_not:c { CTEX@#1@tocline} - \exp_not:n { ##1##2 } , + #1 / tocline .cs_set:Np = \exp_not:c { CTEX@#1@tocline } ##1##2 , \__ctex_plus_key_aux:nn {#1} { break } , \__ctex_plus_key_aux:nn {#1} { format } , \__ctex_plus_key_aux:nn {#1} { nameformat } , @@ -102,9 +101,9 @@ { #1 / #2 .tl_set:N = \exp_not:c { CTEX@#1@#2 } , #1 / #2 + .code:n = - { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } , + { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } , #1 / #2 ~ + .code:n = - { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } + { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } } \NewDocumentCommand \ctex_assign_heading_name:nn { m > { \SplitArgument { 1 } { , } } +m } @@ -428,20 +427,22 @@ \cs_new_protected:Npn \CTEX@hyperheadinghook { \group_begin: - \ifHy@implicit - \cs_set_eq:NN \H@old@chapter \Hy@org@chapter - \seq_map_inline:Nn \c__ctex_headings_cs_seq - { - \cs_if_eq:ccT { H@old@ ##1 } { CTEX@ ##1 } - { - \cs_gset_eq:cc { @ ##1 } { CTEX@ ##1 } - \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor - } - } - \else: - \seq_map_inline:Nn \c__ctex_headings_cs_seq - { \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor } - \fi: + \legacy_if:nTF { Hy@implicit } + { + \cs_set_eq:NN \H@old@chapter \Hy@org@chapter + \seq_map_inline:Nn \c__ctex_headings_cs_seq + { + \cs_if_eq:ccT { H@old@ ##1 } { CTEX@ ##1 } + { + \cs_gset_eq:cc { @ ##1 } { CTEX@ ##1 } + \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor + } + } + } + { + \seq_map_inline:Nn \c__ctex_headings_cs_seq + { \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor } + } \group_end: } \ctex_at_end_package:nn { hyperref } @@ -566,7 +567,7 @@ \CTEX@updatettlifname } \cs_new_protected:Npn \CTEX@updatettlifname - { \ifttl@label \CTEX@ifnametrue \else: \CTEX@ifnamefalse \fi: } + { \legacy_if:nTF { ttl@label } { \CTEX@ifnametrue } { \CTEX@ifnamefalse } } } \group_begin: \char_set_catcode_other:N \# @@ -654,18 +655,20 @@ } \__ctex_patch_toc_width:n { tocloft } \__ctex_patch_toc_width:n { titletoc } -\if@twoside - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection \quad \fi } - { \CTEXifname { \CTEXthesection \quad } { } } - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \@ne \thesubsection \quad \fi } - { \CTEXifname { \CTEXthesubsection \quad } { } } -\else: - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \m@ne \thesection \quad \fi } - { \CTEXifname { \CTEXthesection \quad } { } } -\fi: +\legacy_if:nTF { @twoside } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection \quad \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \@ne \thesubsection \quad \fi } + { \CTEXifname { \CTEXthesubsection \quad } { } } + } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \m@ne \thesection \quad \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + } \ctex_at_end_package:nn { fancyhdr } { \ctex_patch_cmd:Nnn \f@nch@initialise @@ -683,18 +686,20 @@ \f@nch@initialise \@ifpackagewith { fancyhdr } { headings } { - \if@twoside - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection \quad \fi } - { \CTEXifname { \CTEXthesection \quad } { } } - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \@ne \thesubsection \quad \fi } - { \CTEXifname { \CTEXthesubsection \quad } { } } - \else: - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection \quad \fi } - { \CTEXifname { \CTEXthesection \quad } { } } - \fi: + \legacy_if:nTF { @twoside } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection \quad \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \@ne \thesubsection \quad \fi } + { \CTEXifname { \CTEXthesubsection \quad } { } } + } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection \quad \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + } } { } } diff --git a/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-beamer.def b/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-beamer.def index 14c03920518..bffb9725a39 100644 --- a/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-beamer.def +++ b/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-beamer.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Heading modification for beamer (CTEX)} \ProvidesExplFile{ctex-beamer.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \seq_const_from_clist:Nn \c__ctex_headings_seq { part , section , subsection } \cs_new_protected:Npn \__ctex_initial_heading:n #1 @@ -62,11 +62,11 @@ } \cs_new_protected:Npn \__ctex_def_heading_keys:n #1 { - \tl_put_right:Nx \l__ctex_tmp_tl + \exp_args:NNe \tl_put_right:Nn \l__ctex_tmp_tl { - #1 .meta:nn = { ctex / #1 } { ####1 } , + #1 .meta:nn = { ctex / #1 } { ##1 } , #1 / name .code:n = - { \ctex_assign_heading_name:nn {#1} { ####1 } } , + { \ctex_assign_heading_name:nn {#1} { ##1 } } , #1 / number .tl_set:N = \exp_not:c { CTEX@the#1 } , #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } , #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} , @@ -91,9 +91,9 @@ { #1 / #2 .tl_set:N = \exp_not:c { CTEX@#1@#2 } , #1 / #2 + .code:n = - { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } , + { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } , #1 / #2 ~ + .code:n = - { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } + { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } } \NewDocumentCommand \ctex_assign_heading_name:nn { m > { \SplitArgument { 1 } { , } } +m } diff --git a/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-book.def b/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-book.def index 194e8924bc1..ac300b3e8ef 100644 --- a/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-book.def +++ b/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-book.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Heading modification for book (CTEX)} \ProvidesExplFile{ctex-book.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \seq_const_from_clist:Nn \c__ctex_section_headings_seq { section , subsection , subsubsection , paragraph , subparagraph } \seq_new:N \c__ctex_headings_seq @@ -66,11 +66,11 @@ } \cs_new_protected:Npn \__ctex_def_heading_keys:n #1 { - \tl_put_right:Nx \l__ctex_tmp_tl + \exp_args:NNe \tl_put_right:Nn \l__ctex_tmp_tl { - #1 .meta:nn = { ctex / #1 } { ####1 } , + #1 .meta:nn = { ctex / #1 } { ##1 } , #1 / name .code:n = - { \ctex_assign_heading_name:nn {#1} { ####1 } } , + { \ctex_assign_heading_name:nn {#1} { ##1 } } , #1 / number .tl_set:N = \exp_not:c { CTEX@the#1 } , #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } , #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} , @@ -88,8 +88,7 @@ #1 / hang .bool_set:N = \exp_not:c { CTEX@#1@hang } , #1 / hang .initial:n = true , #1 / runin .bool_set:N = \exp_not:c { CTEX@#1@runin } , - #1 / tocline .cs_set:Np = \exp_not:c { CTEX@#1@tocline} - \exp_not:n { ##1##2 } , + #1 / tocline .cs_set:Np = \exp_not:c { CTEX@#1@tocline } ##1##2 , \__ctex_plus_key_aux:nn {#1} { break } , \__ctex_plus_key_aux:nn {#1} { format } , \__ctex_plus_key_aux:nn {#1} { nameformat } , @@ -103,9 +102,9 @@ { #1 / #2 .tl_set:N = \exp_not:c { CTEX@#1@#2 } , #1 / #2 + .code:n = - { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } , + { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } , #1 / #2 ~ + .code:n = - { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } + { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } } \NewDocumentCommand \ctex_assign_heading_name:nn { m > { \SplitArgument { 1 } { , } } +m } @@ -169,6 +168,8 @@ \cs_new_protected:Npn \CTEX@setheadingskip { \skip_set:Nn \l__ctex_heading_skip } \cs_new_eq:NN \CTEX@headingskip \l__ctex_heading_skip +\cs_new_protected:Npn \CTEX@setthispagestyle #1 + { \exp_args:Ne \thispagestyle { \use:c { CTEX@#1@pagestyle } } } \ProvideDocumentCommand \partmark { m } { \markboth { } { } } \cs_new_eq:NN \CTEXifname \use_ii:nn @@ -195,7 +196,7 @@ { \addcontentsline { toc } {#1} { \use:c { CTEX@#1@tocline } {#1} {#2} } } \renewcommand\part{% \CTEX@part@break - \thispagestyle{\CTEX@part@pagestyle}% + \CTEX@setthispagestyle{part}% \if@twocolumn \onecolumn \@tempswatrue @@ -260,7 +261,7 @@ \fi} \renewcommand\chapter{% \CTEX@chapter@break - \thispagestyle{\CTEX@chapter@pagestyle}% + \CTEX@setthispagestyle{chapter}% \global\@topnum\z@ \ifodd \CTEX@chapter@afterindent \@afterindenttrue @@ -554,20 +555,22 @@ \cs_new_protected:Npn \CTEX@hyperheadinghook { \group_begin: - \ifHy@implicit - \cs_set_eq:NN \H@old@chapter \Hy@org@chapter - \seq_map_inline:Nn \c__ctex_headings_cs_seq - { - \cs_if_eq:ccT { H@old@ ##1 } { CTEX@ ##1 } - { - \cs_gset_eq:cc { @ ##1 } { CTEX@ ##1 } - \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor - } - } - \else: - \seq_map_inline:Nn \c__ctex_headings_cs_seq - { \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor } - \fi: + \legacy_if:nTF { Hy@implicit } + { + \cs_set_eq:NN \H@old@chapter \Hy@org@chapter + \seq_map_inline:Nn \c__ctex_headings_cs_seq + { + \cs_if_eq:ccT { H@old@ ##1 } { CTEX@ ##1 } + { + \cs_gset_eq:cc { @ ##1 } { CTEX@ ##1 } + \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor + } + } + } + { + \seq_map_inline:Nn \c__ctex_headings_cs_seq + { \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor } + } \group_end: } \ctex_at_end_package:nn { hyperref } @@ -693,7 +696,7 @@ \CTEX@updatettlifname } \cs_new_protected:Npn \CTEX@updatettlifname - { \ifttl@label \CTEX@ifnametrue \else: \CTEX@ifnamefalse \fi: } + { \legacy_if:nTF { ttl@label } { \CTEX@ifnametrue } { \CTEX@ifnamefalse } } } \group_begin: \char_set_catcode_other:N \# @@ -788,11 +791,12 @@ \fi \fi } { \CTEXifname { \CTEXthechapter \quad } { } } -\if@twoside - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } - { \CTEXifname { \CTEXthesection \quad } { } } -\fi: +\legacy_if:nT { @twoside } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + } \ctex_at_end_package:nn { fancyhdr } { \ctex_patch_cmd:Nnn \f@nch@initialise @@ -817,11 +821,12 @@ \fi \fi } { \CTEXifname { \CTEXthechapter \quad } { } } - \if@twoside - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } - { \CTEXifname { \CTEXthesection \quad } { } } - \fi: + \legacy_if:nT { @twoside } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + } } { } } diff --git a/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-report.def b/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-report.def index bd41442bf50..795e7b96fec 100644 --- a/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-report.def +++ b/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-report.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Heading modification for report (CTEX)} \ProvidesExplFile{ctex-report.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \seq_const_from_clist:Nn \c__ctex_section_headings_seq { section , subsection , subsubsection , paragraph , subparagraph } \seq_new:N \c__ctex_headings_seq @@ -66,11 +66,11 @@ } \cs_new_protected:Npn \__ctex_def_heading_keys:n #1 { - \tl_put_right:Nx \l__ctex_tmp_tl + \exp_args:NNe \tl_put_right:Nn \l__ctex_tmp_tl { - #1 .meta:nn = { ctex / #1 } { ####1 } , + #1 .meta:nn = { ctex / #1 } { ##1 } , #1 / name .code:n = - { \ctex_assign_heading_name:nn {#1} { ####1 } } , + { \ctex_assign_heading_name:nn {#1} { ##1 } } , #1 / number .tl_set:N = \exp_not:c { CTEX@the#1 } , #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } , #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} , @@ -88,8 +88,7 @@ #1 / hang .bool_set:N = \exp_not:c { CTEX@#1@hang } , #1 / hang .initial:n = true , #1 / runin .bool_set:N = \exp_not:c { CTEX@#1@runin } , - #1 / tocline .cs_set:Np = \exp_not:c { CTEX@#1@tocline} - \exp_not:n { ##1##2 } , + #1 / tocline .cs_set:Np = \exp_not:c { CTEX@#1@tocline } ##1##2 , \__ctex_plus_key_aux:nn {#1} { break } , \__ctex_plus_key_aux:nn {#1} { format } , \__ctex_plus_key_aux:nn {#1} { nameformat } , @@ -103,9 +102,9 @@ { #1 / #2 .tl_set:N = \exp_not:c { CTEX@#1@#2 } , #1 / #2 + .code:n = - { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } , + { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } , #1 / #2 ~ + .code:n = - { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } + { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } } \NewDocumentCommand \ctex_assign_heading_name:nn { m > { \SplitArgument { 1 } { , } } +m } @@ -169,6 +168,8 @@ \cs_new_protected:Npn \CTEX@setheadingskip { \skip_set:Nn \l__ctex_heading_skip } \cs_new_eq:NN \CTEX@headingskip \l__ctex_heading_skip +\cs_new_protected:Npn \CTEX@setthispagestyle #1 + { \exp_args:Ne \thispagestyle { \use:c { CTEX@#1@pagestyle } } } \ProvideDocumentCommand \partmark { m } { \markboth { } { } } \cs_new_eq:NN \CTEXifname \use_ii:nn @@ -195,7 +196,7 @@ { \addcontentsline { toc } {#1} { \use:c { CTEX@#1@tocline } {#1} {#2} } } \renewcommand\part{% \CTEX@part@break - \thispagestyle{\CTEX@part@pagestyle}% + \CTEX@setthispagestyle{part}% \if@twocolumn \onecolumn \@tempswatrue @@ -260,7 +261,7 @@ \fi} \renewcommand\chapter{% \CTEX@chapter@break - \thispagestyle{\CTEX@chapter@pagestyle}% + \CTEX@setthispagestyle{chapter}% \global\@topnum\z@ \ifodd \CTEX@chapter@afterindent \@afterindenttrue @@ -549,20 +550,22 @@ \cs_new_protected:Npn \CTEX@hyperheadinghook { \group_begin: - \ifHy@implicit - \cs_set_eq:NN \H@old@chapter \Hy@org@chapter - \seq_map_inline:Nn \c__ctex_headings_cs_seq - { - \cs_if_eq:ccT { H@old@ ##1 } { CTEX@ ##1 } - { - \cs_gset_eq:cc { @ ##1 } { CTEX@ ##1 } - \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor - } - } - \else: - \seq_map_inline:Nn \c__ctex_headings_cs_seq - { \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor } - \fi: + \legacy_if:nTF { Hy@implicit } + { + \cs_set_eq:NN \H@old@chapter \Hy@org@chapter + \seq_map_inline:Nn \c__ctex_headings_cs_seq + { + \cs_if_eq:ccT { H@old@ ##1 } { CTEX@ ##1 } + { + \cs_gset_eq:cc { @ ##1 } { CTEX@ ##1 } + \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor + } + } + } + { + \seq_map_inline:Nn \c__ctex_headings_cs_seq + { \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor } + } \group_end: } \ctex_at_end_package:nn { hyperref } @@ -688,7 +691,7 @@ \CTEX@updatettlifname } \cs_new_protected:Npn \CTEX@updatettlifname - { \ifttl@label \CTEX@ifnametrue \else: \CTEX@ifnamefalse \fi: } + { \legacy_if:nTF { ttl@label } { \CTEX@ifnametrue } { \CTEX@ifnamefalse } } } \group_begin: \char_set_catcode_other:N \# @@ -783,11 +786,12 @@ \fi } { \CTEXifname { \CTEXthechapter \quad } { } } -\if@twoside - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } - { \CTEXifname { \CTEXthesection \quad } { } } -\fi: +\legacy_if:nT { @twoside } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + } \ctex_at_end_package:nn { fancyhdr } { \ctex_patch_cmd:Nnn \f@nch@initialise @@ -812,11 +816,12 @@ \fi } { \CTEXifname { \CTEXthechapter \quad } { } } - \if@twoside - \ctex_patch_cmd:Nnn \ps@headings - { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } - { \CTEXifname { \CTEXthesection \quad } { } } - \fi: + \legacy_if:nT { @twoside } + { + \ctex_patch_cmd:Nnn \ps@headings + { \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi } + { \CTEXifname { \CTEXthesection \quad } { } } + } } { } } diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def index da6b67bbc68..d6a695fd413 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese scheme for article (CTEX)} \ProvidesExplFile{ctex-scheme-chinese-article.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \ctex_set:nn { part } { aftertitle = \par , diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-beamer.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-beamer.def index 0887fe02d04..77f87662a60 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-beamer.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-beamer.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese scheme for beamer (CTEX)} \ProvidesExplFile{ctex-scheme-chinese-beamer.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \ctex_set:nn { part } { aftertitle = \par , diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def index 11959999882..9fcb76ef5bd 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese scheme for book (CTEX)} \ProvidesExplFile{ctex-scheme-chinese-book.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \ctex_set:nn { part } { aftertitle = \par , diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def index 6be01a803b8..d6c00683bdc 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese scheme for report (CTEX)} \ProvidesExplFile{ctex-scheme-chinese-report.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \ctex_set:nn { part } { aftertitle = \par , diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def index adca2b3d36e..14549f6eef4 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def @@ -24,15 +24,14 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese scheme for generic (CTEX)} \ProvidesExplFile{ctex-scheme-chinese.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \ctex_set:n { today = small } \ctex_if_autoindent_touched:F { \ctex_set:n { autoindent = true } } -\tl_set:Nn \l__ctex_tmp_tl { beamer } -\tl_if_eq:NNTF \c__ctex_std_class_tl \l__ctex_tmp_tl +\tl_if_eq:NnTF \c__ctex_std_class_tl { beamer } { \str_if_eq:onTF { \g__ctex_encoding_tl } { GBK } { diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def index 5b43f3aa016..6ff3887d832 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Plain scheme for article (CTEX)} \ProvidesExplFile{ctex-scheme-plain-article.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \ctex_set:nn { part } { aftertitle = \par , diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-beamer.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-beamer.def index 34fa8678fde..9f626b2a6e2 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-beamer.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-beamer.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Plain scheme for beamer (CTEX)} \ProvidesExplFile{ctex-scheme-plain-beamer.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \ctex_set:nn { part } { aftertitle = \par , diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def index d6e513afda1..0940e51c2d7 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Plain scheme for book (CTEX)} \ProvidesExplFile{ctex-scheme-plain-book.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \ctex_set:nn { part } { aftertitle = \par , diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def index 75304d9de8b..7d4fd8468c7 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Plain scheme for report (CTEX)} \ProvidesExplFile{ctex-scheme-plain-report.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} \ctex_set:nn { part } { aftertitle = \par , diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def index c1231b1cec3..4349bf95915 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def @@ -24,10 +24,10 @@ %% %% --------------------------------------------------------------------- %% -\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Plain scheme for generic (CTEX)} \ProvidesExplFile{ctex-scheme-plain.def} - {\ExplFileDate}{2.5.9}{\ExplFileDescription} + {\ExplFileDate}{2.5.10}{\ExplFileDescription} %% %% %% End of file `ctex-scheme-plain.def'. |