From aacc74ddc46c0bc769b6bda7d662c21f0bbaa511 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 4 Jun 2022 20:25:13 +0000 Subject: ctex (4jun22) git-svn-id: svn://tug.org/texlive/trunk@63484 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/ctex/ctex.dtx | 110 ++++++++++++++++----------- 1 file changed, 67 insertions(+), 43 deletions(-) (limited to 'Master/texmf-dist/source/latex/ctex/ctex.dtx') diff --git a/Master/texmf-dist/source/latex/ctex/ctex.dtx b/Master/texmf-dist/source/latex/ctex/ctex.dtx index adc4440bc7f..e01c5519d51 100644 --- a/Master/texmf-dist/source/latex/ctex/ctex.dtx +++ b/Master/texmf-dist/source/latex/ctex/ctex.dtx @@ -2,7 +2,7 @@ % !TeX program = XeLaTeX % !TeX encoding = UTF-8 % -% Copyright (C) 2003--2021 +% Copyright (C) 2003--2022 % CTEX.ORG and any individual authors listed elsewhere in this file. % -------------------------------------------------------------------------- % @@ -56,7 +56,7 @@ Issues and pull requests are welcome. Copyright and Licence --------------------- - Copyright (C) 2003--2021 + Copyright (C) 2003--2022 CTEX.ORG and any individual authors listed elsewhere in this file. ---------------------------------------------------------------------- @@ -163,7 +163,7 @@ Copyright and Licence \preamble - Copyright (C) 2003--2021 + Copyright (C) 2003--2022 CTEX.ORG and any individual authors listed in the documentation. --------------------------------------------------------------------- @@ -443,7 +443,7 @@ Copyright and Licence %\NeedsTeXFormat{LaTeX2e} %\input{ctexbackend.cfg} %\RequirePackage{expl3} -%<+!driver>\GetIdInfo$Id: ctex.dtx fcbe2c0 2021-12-12 18:20:54 +0800 Qing Lee $ +%<+!driver>\GetIdInfo$Id: ctex.dtx c6b2e9c 2022-06-04 19:41:06 +0800 Qing Lee $ % {Chinese adapter in LaTeX (CTEX)} %\ProvidesExplPackage{\ExplFileName} % {Chinese font size definition (CTEX)} @@ -530,7 +530,7 @@ Copyright and Licence %\ProvidesExplFile{ctex-fontset-founder.def} % {Ubuntu fonts definition (CTEX)} %\ProvidesExplFile{ctex-fontset-ubuntu.def} -% {\ExplFileDate}{2.5.8}{\ExplFileDescription} +% {\ExplFileDate}{2.5.9}{\ExplFileDescription} % %\ProvidesFile{c19rm.fd}% %\ProvidesFile{c19sf.fd}% @@ -548,10 +548,10 @@ Copyright and Licence %\ProvidesFile{ctexbackend.cfg}% %\ProvidesDictionary{translator-theorem-dictionary}{ChineseGBK}% %\ProvidesDictionary{translator-theorem-dictionary}{ChineseUTF8}% -% [2021/12/12 v2.5.8 Chinese font definition (CTEX)] -% [2021/12/12 v2.5.8 Space info for CJKpunct (CTEX)] -% [2021/12/12 v2.5.8 Backend configuration file (CTEX)] -% [2021/12/12 v2.5.8 Chinese translation for theorem name (CTEX)] +% [2022/06/04 v2.5.9 Chinese font definition (CTEX)] +% [2022/06/04 v2.5.9 Space info for CJKpunct (CTEX)] +% [2022/06/04 v2.5.9 Backend configuration file (CTEX)] +% [2022/06/04 v2.5.9 Chinese translation for theorem name (CTEX)] % %<*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{6420} +% \CheckSum{6444} % % \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 @@ -3211,6 +3211,7 @@ Copyright and Licence % \item \pkg{ltxcmds} 宏包。 % \item \pkg{pdftexcmds} 宏包。 % \item \pkg{xkeyval} 宏包。 +% \item \pkg{chinese-jfm} 宏包。 % \end{itemize} % \item \pkg{fontspec} 宏包。 % \item[\ding{229}] 以上是使用 \LuaLaTeX{} 编译时的依赖项。 @@ -3292,9 +3293,18 @@ Copyright and Licence %<@@=ctex> % \end{macrocode} % +% \changes{v2.5.9}{2022/05/27}{设置消息模块的名字和类型。} +% % \begin{macrocode} %<*class|style> \RequirePackage { xparse , l3keys2e } +%\prop_gput:Nnn \g_msg_module_type_prop { ctex } { Class } +%
\prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexart } +%\prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexbook } +%\prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexrep } +%\prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexbeamer } +%\prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexsize } +%\prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexheading } % % \end{macrocode} % @@ -4550,9 +4560,9 @@ Copyright and Licence { \msg_critical:nnx { ctex } { luatexja-loaded } { \g_file_curr_name_str } } { \ctex_at_begin_package:nn { luatexja } - { \msg_redirect_name:nnn { ctex } { disable-package } { info } } + { \msg_redirect_name:nnn { ctexhook } { disable-package } { info } } \ctex_at_end_package:nn { luatexja } - { \msg_redirect_name:nnn { ctex } { disable-package } { } } + { \msg_redirect_name:nnn { ctexhook } { disable-package } { } } \ctex_disable_package:n { ltj-latex } } % \end{macrocode} @@ -4860,14 +4870,6 @@ Copyright and Licence end, "global") % \end{macrocode} % \end{macro} -% \begin{macro}{\ctex_ltj_use_jfont:} -% 使用 jfont,确保当前的 \tn{font} 是 jfont。 -% \begin{macrocode} - newluacmd("ctex_ltj_use_jfont:", function () - font.current(getattribute("ltj@curjfnt")) - end, "global", "protected") -% \end{macrocode} -% \end{macro} % \begin{macro}{\ctex_ltj_set_alt_font:nnnn} % |#1| 和 |#2| 分别是字符区间的首末,|#3| 是基础字体,|#4| 是替代字体。 % \begin{macrocode} @@ -5057,6 +5059,14 @@ Copyright and Licence % \end{macrocode} % \end{macro} % +% \begin{macro}{\ctex_ltj_use_jfont:} +% 使用 jfont,确保当前的 \tn{font} 是 jfont。 +% \begin{macrocode} +\cs_new_protected_nopar:Npn \ctex_ltj_use_jfont: + { \tex_setfontid:D \ltj@curjfnt } +% \end{macrocode} +% \end{macro} +% % \begin{macro}[int]{\ctex_ltj_subst_font:} % \tn{do@subst@correction} 在设置通过 \texttt{sub} 或者 \texttt{ssub} 函数定义的 % 字体时会用到。如果没有设置 \opt{SlantedFont},\pkg{fontspec} 会设置 @@ -5285,19 +5295,33 @@ Copyright and Licence % % \paragraph{字体族的定义与使用} % -% \begin{macro}[int]{\ctex_mono_jfm:n} -% \begin{variable}{\l_@@_jfm_tl} -% \pkg{LuaTeX-ja} 中与标点格式 \opt{plain} 对应的 \texttt{JFM} 是 \opt{mono}。 +% \changes{v2.5.9}{2022/05/26}{依赖 \pkg{chinese-jfm} 宏包。} +% +% \begin{macro}[int]{\ctex_set_jfm:n} +% \begin{variable}{\l_@@_jfm_tl, \l_@@_redirect_jfm_prop} +% 设置 \texttt{JFM},需要进行一些重定向操作。 % \begin{macrocode} -\cs_new_protected:Npn \ctex_mono_jfm:n #1 +\cs_new_protected:Npn \ctex_set_jfm:n #1 { - \str_if_eq:nnTF {#1} { plain } - { \tl_set:Nn \l_@@_jfm_tl { mono } } + \prop_get:NnNF \l_@@_redirect_jfm_prop {#1} \l_@@_jfm_tl { \tl_set:Nn \l_@@_jfm_tl {#1} } } +\cs_generate_variant:Nn \ctex_set_jfm:n { o } +\prop_new:N \l_@@_redirect_jfm_prop +\prop_set_from_keyval:Nn \l_@@_redirect_jfm_prop + { + plain = mono , + quanjiao = zh_CN / quanjiao , + banjiao = zh_CN / banjiao , + kaiming = zh_CN / kaiming + } +\keys_define:nn { ctex_ltj / fontspec } + { + JFM .code:n = \ctex_set_jfm:n {#1} , + JFM .value_required:n = true + } \tl_new:N \l_@@_jfm_tl -\cs_generate_variant:Nn \ctex_mono_jfm:n { o } -\ctex_mono_jfm:o { \l__ctex_punct_tl } +\ctex_set_jfm:o { \l__ctex_punct_tl } % \end{macrocode} % \end{variable} % \end{macro} @@ -6966,7 +6990,7 @@ Copyright and Licence \tl_set:Nx \l_@@_punct_tl {#1} % \punctstyle { \l_@@_punct_tl } % \xeCJKsetup { PunctStyle = \l_@@_punct_tl } -% \ctex_mono_jfm:o { \l_@@_punct_tl } +% \ctex_set_jfm:o { \l_@@_punct_tl } % \msg_warning:nn { ctex } { invalid-option } } , punct .default:n = { quanjiao } , @@ -10920,17 +10944,17 @@ Copyright and Licence % 文件标识信息。 % \begin{macrocode} %\ProvidesFile{ctex-zhmap-adobe.tex}% -% [2021/12/12 v2.5.8 Adobe font map loader for DVIPDFMx (CTEX)] +% [2022/06/04 v2.5.9 Adobe font map loader for DVIPDFMx (CTEX)] %\ProvidesFile{ctex-zhmap-fandol.tex}% -% [2021/12/12 v2.5.8 Fandol font map loader for DVIPDFMx (CTEX)] +% [2022/06/04 v2.5.9 Fandol font map loader for DVIPDFMx (CTEX)] %\ProvidesFile{ctex-zhmap-founder.tex}% -% [2021/12/12 v2.5.8 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)] +% [2022/06/04 v2.5.9 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)] %\ProvidesFile{ctex-zhmap-mac.tex}% -% [2021/12/12 v2.5.8 Mac font map loader for DVIPDFMx (CTEX)] +% [2022/06/04 v2.5.9 Mac font map loader for DVIPDFMx (CTEX)] %\ProvidesFile{ctex-zhmap-ubuntu.tex}% -% [2021/12/12 v2.5.8 Ubuntu font map loader for DVIPDFMx (CTEX)] +% [2022/06/04 v2.5.9 Ubuntu font map loader for DVIPDFMx (CTEX)] %\ProvidesFile{ctex-zhmap-windows.tex}% -% [2021/12/12 v2.5.8 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)] +% [2022/06/04 v2.5.9 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)] % \end{macrocode} % % \paragraph{\pkg{ctex-zhmap-adobe.tex}} @@ -11558,7 +11582,7 @@ Copyright and Licence \@ifpackageloaded {#1} { \msg_error:nnxx } { \@@_disable_package_aux:nnnn } - { ctex } { disable-package } {#1} { \@currname } + { ctexhook } { disable-package } {#1} { \@currname } } \cs_new_protected:Npx \@@_disable_package_aux:nnnn #1#2#3#4 { @@ -11569,7 +11593,7 @@ Copyright and Licence } { \tl_const:cn { ver@ #3 . \exp_not:N \@pkgextension } { 9999/99/99 } } } -\msg_new:nnn { ctex } { disable-package } +\msg_new:nnn { ctexhook } { disable-package } { Package~`#1'~can~not~be~loaded~with~`#2'. } % \end{macrocode} % \end{macro} @@ -11589,8 +11613,8 @@ Copyright and Licence } { \cs_new_protected:Npn \ctex_replace_package:nn - { \msg_warning:nnnn { ctex } { replace-package-invalid } } - \msg_new:nnn { ctex } { replace-package-invalid } + { \msg_warning:nnnn { ctexhook } { replace-package-invalid } } + \msg_new:nnn { ctexhook } { replace-package-invalid } { \token_to_str:N \ctex_replace_package:nn \{#1\}\{#2\}~is~invalid~ before~LaTeX~2020-10-01. @@ -11609,8 +11633,8 @@ Copyright and Licence { \ctex_gadd_package_hook:nnn { before } {#1} } } \cs_new_protected:Npn \@@_package_loaded_warning:nn #1#2 - { \msg_warning:nnx { ctex } { invalid-hook } {#1} } -\msg_new:nnn { ctex } { invalid-hook } + { \msg_warning:nnx { ctexhook } { invalid-hook } {#1} } +\msg_new:nnn { ctexhook } { invalid-hook } { Package~`#1'~is~loaded. \\ \token_to_str:N \ctex_at_begin_package:nn \{#1\}\{...\}~is~invalid. @@ -11783,8 +11807,8 @@ Copyright and Licence { \ctex_patch_failure:N #1 } } \cs_new_protected:Npn \ctex_patch_failure:N #1 - { \msg_warning:nnx { ctex } { patch-failure } { \token_to_str:N #1 } } -\msg_new:nnn { ctex } { patch-failure } + { \msg_warning:nnx { ctexpatch } { patch-failure } { \token_to_str:N #1 } } +\msg_new:nnn { ctexpatch } { patch-failure } { Oops!~Command~`#1'~is~NOT~patchable.\\ } % \end{macrocode} % \end{macro} -- cgit v1.2.3