From e82dc2952cd2f17091b636be166cf6d74c1527f5 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 1 May 2020 21:29:24 +0000 Subject: xecjk (1may20) git-svn-id: svn://tug.org/texlive/trunk@54961 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx | 1139 ++++++++++++---------- Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins | 160 +++ 2 files changed, 765 insertions(+), 534 deletions(-) create mode 100644 Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins (limited to 'Master/texmf-dist/source/xelatex') diff --git a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx index 360459e5417..998b4d5ca1a 100644 --- a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx +++ b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx @@ -40,7 +40,7 @@ Copyright and Licence and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later. - This work has the LPPL maintenance status `maintained'. + This work has the LPPL maintenance status "maintained". The Current Maintainers of this work are Leo Liu and Qing Lee. @@ -106,7 +106,7 @@ Copyright and Licence and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later. - This work has the LPPL maintenance status `maintained'. + This work has the LPPL maintenance status "maintained". The Current Maintainers of this work are Leo Liu and Qing Lee. @@ -194,7 +194,7 @@ Copyright and Licence %<*package|config|fntef|listings|xunicode|xunextra> %\NeedsTeXFormat{LaTeX2e} %\RequirePackage{expl3} -%<+!driver>\GetIdInfo$Id: xeCJK.dtx 165cecc 2020-02-18 20:38:34 +0800 Qing Lee $ +%<+!driver>\GetIdInfo$Id: xeCJK.dtx b971c22 2020-05-01 21:10:43 +0800 Qing Lee $ % {Typesetting CJK scripts with XeLaTeX} % {Configuration file for xeCJK package} % {xeCJK font effect} @@ -207,7 +207,7 @@ Copyright and Licence %\ProvidesExplPackage{xeCJK-listings} %\ProvidesExplPackage{xunicode-addon} %\ProvidesExplFile{xunicode-extra.def} -% {\ExplFileDate}{3.8.2}{\ExplFileDescription} +% {\ExplFileDate}{3.8.3}{\ExplFileDescription} % %<*driver> \documentclass{ctxdoc} @@ -284,8 +284,9 @@ Copyright and Licence % \changes{v3.7.2}{2019/03/23}{同步 \LaTeXiii{} 2019/03/05。} % \changes{v3.8.0}{2020/02/09}{兼容 \LaTeXe\ 2020/02/02 对 \pkg{NFSS} 的修改。} % \changes{v3.8.0}{2020/02/09}{清理过时的兼容性补丁代码。} +% \changes{v3.8.3}{2020/04/07}{删除 \texttt{\_nopar}。} % -% \CheckSum{10763} +% \CheckSum{10799} % \GetFileId{xeCJK.sty} % % \title{\bfseries\pkg{xeCJK} 宏包} @@ -303,7 +304,7 @@ Copyright and Licence % \pkg{xeCJK} 是一个 \XeLaTeX 宏包,用于排版中日韩(CJK)文字。主要功能: % \begin{enumerate} % \item 分别设置 CJK 和英文字体; -% \item 自动忽略 CJK 文字间的空格而保留其它空格,允许在非标点汉字和英文 +% \item 自动忽略 CJK 文字间的空格而保留其他空格,允许在非标点汉字和英文 % 字母 (a -- z, A -- Z) 间断行; % \item 提供多种标点处理方式: 全角式、半角式、开明式、行末半角式和 CCT 式; % \item 自动调整中英文间空白。 @@ -311,7 +312,7 @@ Copyright and Licence % % \pkg{xeCJK} 使用了 \XeTeX 的一些最新特性,需要 \XeTeX{} 0.9995.0 (2009/06/29) 以 % 后的版本。\pkg{xeCJK} 依赖 \LaTeXiii{} 项目的宏包套件 -% \package{l3kernel} 和 \package{l3packages} 。 +% \package{l3kernel} 和 \package{l3packages}。 % \pkg{xeCJK} 还需要通过 \package{fontspec} 宏包来调用系统字体。 % \pkg{xeCJK} 会自动根据需要载入这些宏包。 % @@ -802,7 +803,7 @@ Copyright and Licence % \tn{addCJKfontfeatures} * \oarg{block_1, block_2, ...} \Arg{font features} % \end{syntax} % 临时增加当前使用的 CJK 字体的选项。第一条命令,仅对当前 CJK 主分区字体有效; -% 第二条对主分区和其它分区的字体都有效;第三条仅对可选参数中指定的分区有效; +% 第二条对主分区和其他分区的字体都有效;第三条仅对可选参数中指定的分区有效; % 第四条对主分区和可选参数中指定的分区有效。例如,使用 % \begin{ctexexam} % \addCJKfontfeatures{Scale=1.1} @@ -1353,8 +1354,8 @@ Copyright and Licence % \begin{function}[added=2016-06-03]{textformat} % 设置下划线或点的正文的格式。例如:\smallskip % \begin{Example}[frame=single,numbers=left,gobble=6] -% \CJKunderline[textformat=\color{red}]{虚室生白,吉祥止止}\\ -% \CJKunderdot[textformat=\bfseries, format=\color{blue}]{虚室生白,吉祥止止} +% \CJKunderline[textformat=\color{blue}]{虚室生白,吉祥止止}\\ +% \CJKunderdot[textformat=\bfseries, format=\color{red}]{虚室生白,吉祥止止} % \end{Example} % \end{function} % @@ -1505,7 +1506,7 @@ Copyright and Licence % 等宽字体的代码对齐等情形。需要注意的是,\tn{xeCJKVerbAddon} 对 \pkg{xeCJK} 的内 % 部进行了比较大的修改,使用它之后,将禁止在 CJK 字符类之间自动换行,这与西文在 % 抄录环境中的情况是一致的。所以不应该单独使用,应该放在分组里限制其作用域,否则 -% 是无效的。当然它可以和其它关于代码抄录的宏包配合使用。例如,可以使用于 +% 是无效的。当然它可以和其他关于代码抄录的宏包配合使用。例如,可以使用于 % \package{fancyvrb} 宏包的 \texttt{formatcom} 选项。此时设置的西文字体应该确实 % 是等宽的以保证对齐。若西文等宽字体发生变动(包括字体大小),则需要在其后面使用 % \tn{xeCJKVerbAddon},重新计算间距的宽度。\tn{xeCJKOffVerbAddon} @@ -1526,7 +1527,7 @@ Copyright and Licence % \pkg{xeCJK} 在正文中的一些特殊设置(汉字下加点、在 \env{verbatim} 或 % \env{lstlisting} 环境中分页)可能会影响到 \TeX 的输出例行程序(output routine) % 中的内容(比如页眉和页脚)。\tn{xeCJKShipoutHook} 用于恢复正文中的普通设置。 -% \pkg{xeCJK} 已经处理了页眉和页脚的情况,其它的就需要根据情况自行调用。 +% \pkg{xeCJK} 已经处理了页眉和页脚的情况,其他的就需要根据情况自行调用。 % 比如若使用 \pkg{eso-pic} 或者 \pkg{atbegshi} 实现文字水印,并且正文中使用了 % 以上所列的特殊形式,就需要在命令 \tn{AtBeginShipout} 的参数的最前面使用 % \tn{xeCJKShipoutHook}。 @@ -1534,7 +1535,7 @@ Copyright and Licence % % \section{已知问题和兼容性} % -% \XeTeX 在配置文件 \file{unicode-letters.tex} 中将所有 CJK 表意文字的 \tn{catcode} +% 根据 \pkg{unicode-data} 宏包,\XeTeX 将所有 CJK 表意文字的 \tn{catcode} % 设置为 $11$。因此汉字可以直接用作控制序列的名字,但是当汉字出现在控制序列后面的 % 时候,要用空格分隔开,否则就会出现“\texttt{! Undefined control sequence.}”的错误。 % @@ -1565,7 +1566,7 @@ Copyright and Licence % \let\cprotect\icprotect % \end{frameverb} % 来取消 \tn{cprotect} 的外部宏限制。但由于 \tn{cprotect} 的特殊性,应该只在外部 -% 使用它,即不要让它出现在任何宏的参数中。其它 \tn{outer} 宏的情况,可以在它前面 +% 使用它,即不要让它出现在任何宏的参数中。其他 \tn{outer} 宏的情况,可以在它前面 % 加上 \tn{relax} 来回避上面的错误。 % % \pkg{xeCJK} 依赖 \XeTeX 的 \tn{XeTeXinterchartoks} 机制,与使用相同机制的宏包(例如 @@ -1677,60 +1678,56 @@ Copyright and Licence % {\@@_msg_new:nn ,\@@_error:n,\@@_error:nx,\@@_warning:nx,\@@_info:nxx} % 各种信息函数的缩略形式。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_msg_new:nn { \msg_new:nnn { xeCJK } } -\cs_new_protected_nopar:Npn \@@_msg_new:nnn { \msg_new:nnnn { xeCJK } } -\cs_new_protected_nopar:Npn \@@_error:n { \msg_error:nn { xeCJK } } -\cs_new_protected_nopar:Npn \@@_error:nx { \msg_error:nnx { xeCJK } } -\cs_new_protected_nopar:Npn \@@_warning:n { \msg_warning:nn { xeCJK } } -\cs_new_protected_nopar:Npn \@@_warning:nx { \msg_warning:nnx { xeCJK } } -\cs_new_protected_nopar:Npn \@@_warning:nxx { \msg_warning:nnxx { xeCJK } } -\cs_new_protected_nopar:Npn \@@_warning:nxxx { \msg_warning:nnxxx { xeCJK } } -\cs_new_protected_nopar:Npn \@@_info:nxx { \msg_info:nnxx { xeCJK } } +\cs_new_protected:Npn \@@_msg_new:nn { \msg_new:nnn { xeCJK } } +\cs_new_protected:Npn \@@_msg_new:nnn { \msg_new:nnnn { xeCJK } } +\cs_new_protected:Npn \@@_error:n { \msg_error:nn { xeCJK } } +\cs_new_protected:Npn \@@_error:nx { \msg_error:nnx { xeCJK } } +\cs_new_protected:Npn \@@_warning:n { \msg_warning:nn { xeCJK } } +\cs_new_protected:Npn \@@_warning:nx { \msg_warning:nnx { xeCJK } } +\cs_new_protected:Npn \@@_warning:nxx { \msg_warning:nnxx { xeCJK } } +\cs_new_protected:Npn \@@_warning:nxxx { \msg_warning:nnxxx { xeCJK } } +\cs_new_protected:Npn \@@_info:nxx { \msg_info:nnxx { xeCJK } } % \end{macrocode} % \end{macro} % % \begin{macro}[int]{\xeCJK_allow_break:,\xeCJK_no_break:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_allow_break: +\cs_new_protected:Npn \xeCJK_allow_break: { \tex_penalty:D \c_zero_int } -\cs_new_protected_nopar:Npn \xeCJK_no_break: +\cs_new_protected:Npn \xeCJK_no_break: { \tex_penalty:D \c_@@_nobreak_penalty_int } \int_const:Nn \c_@@_nobreak_penalty_int { 10 000 } % \end{macrocode} % \end{macro} % +% \changes{v3.8.3}{2020/04/07}{依赖 \pkg{ctexhook} 宏包。} +% % \begin{macro} -% {\@@_at_end_preamble:n,\@@_after_preamble:n,\@@_after_end_preamble:n} -% 在 \tn{document} 前后加上各种钩子。 -% \begin{macrocode} +% {\@@_at_end_preamble:n,\@@_after_preamble:n, +% \@@_after_end_preamble:n,\@@_package_hook:nn} +% 在 \tn{document} 前后和宏包后加上各种钩子,依赖 \pkg{ctexhook}。 +% \begin{macrocode} +\RequirePackage { ctexhook } +\AtBeginDocument { \xeCJK@document@hook } +\ctex_at_end_preamble:n { \xeCJK@document@left@hook } +\ctex_after_end_preamble:n { \xeCJK@document@right@hook } +\cs_new_protected:Npn \xeCJK@document@hook + { \tl_use:N \g_@@_after_preamble_hook_tl } +\cs_new_protected:Npn \xeCJK@document@left@hook + { \tl_use:N \g_@@_at_end_preamble_hook_tl } +\cs_new_protected:Npn \xeCJK@document@right@hook + { \tl_use:N \g_@@_after_end_preamble_hook_tl } +\cs_new_protected:Npn \@@_at_end_preamble:n + { \tl_gput_right:Nn \g_@@_at_end_preamble_hook_tl } +\cs_new_protected:Npn \@@_after_preamble:n + { \tl_gput_right:Nn \g_@@_after_preamble_hook_tl } +\cs_new_protected:Npn \@@_after_end_preamble:n + { \tl_gput_right:Nn \g_@@_after_end_preamble_hook_tl } +\cs_new_protected:Npn \@@_package_hook:nn + { \ctex_at_end_package:nn } \tl_new:N \g_@@_at_end_preamble_hook_tl \tl_new:N \g_@@_after_preamble_hook_tl \tl_new:N \g_@@_after_end_preamble_hook_tl -\cs_new_protected:Npn \@@_at_end_preamble:n #1 - { \tl_gput_right:Nn \g_@@_at_end_preamble_hook_tl {#1} } -\cs_new_protected:Npn \@@_after_preamble:n #1 - { \tl_gput_right:Nn \g_@@_after_preamble_hook_tl {#1} } -\cs_new_protected:Npn \@@_after_end_preamble:n #1 - { \tl_gput_right:Nn \g_@@_after_end_preamble_hook_tl {#1} } -\xeCJK_if_package_loaded:nTF { etoolbox } - { - \AtEndPreamble { \g_@@_at_end_preamble_hook_tl } - \AfterPreamble { \g_@@_after_preamble_hook_tl } - \AfterEndPreamble { \g_@@_after_end_preamble_hook_tl } - } - { - \AtBeginDocument { \g_@@_after_preamble_hook_tl } - \cs_new_protected_nopar:Npn \xeCJK@document@left@hook - { \group_end: \g_@@_at_end_preamble_hook_tl \group_begin: } - \cs_new_protected_nopar:Npn \xeCJK@document@right@hook - { \scan_stop: \g_@@_after_end_preamble_hook_tl \tex_ignorespaces:D } - \cs_gset_nopar:Npx \document - { - \xeCJK@document@left@hook - \exp_not:o { \document } - \xeCJK@document@right@hook - } - } % \end{macrocode} % \end{macro} % @@ -1745,7 +1742,7 @@ Copyright and Licence % \begin{macrocode} \@@_after_preamble:n { \tl_put_right:Nn \@begindvi { \xeCJK@first@begindvi } } -\cs_new_protected_nopar:Npn \xeCJK@first@begindvi +\cs_new_protected:Npn \xeCJK@first@begindvi { \xeCJKShipoutHook \cs_if_exist:NTF \@begindvi @@ -1780,7 +1777,7 @@ Copyright and Licence % \changes{v3.2.4}{2013/07/02}{去掉外层分组括号时,移除空格,避免死循环。} % 去掉 |#1| 外层的分组括号。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_tl_remove_outer_braces:N #1 +\cs_new_protected:Npn \xeCJK_tl_remove_outer_braces:N #1 { \tl_set:Nx #1 { \exp_args:No \xeCJK_tl_remove_outer_braces:n {#1} } } \cs_new:Npn \xeCJK_tl_remove_outer_braces:n #1 { @@ -1827,7 +1824,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_font_gset_to_current:N} % |#1| 是控制序列的名字,令它等于当前字体命令。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_font_gset_to_current:N #1 +\cs_new_protected:Npn \xeCJK_font_gset_to_current:N #1 { \exp_after:wN \cs_gset_eq:NN \exp_after:wN #1 \tex_the:D \tex_font:D } \cs_generate_variant:Nn \xeCJK_font_gset_to_current:N { c } % \end{macrocode} @@ -1870,13 +1867,13 @@ Copyright and Licence { \int_compare:nNnTF \g_@@_space_factor_int < { 2000 } { - \_@@_space_skip_scale:nnn + \@@_space_skip_scale:nnn { \tex_fontdimen:D 2 ~ \tex_font:D } } { \skip_if_eq:nnTF \tex_xspaceskip:D \c_zero_skip { - \_@@_space_skip_scale:nnn + \@@_space_skip_scale:nnn { \tex_fontdimen:D 2 ~ \tex_font:D + \tex_fontdimen:D 7 ~ \tex_font:D @@ -1889,11 +1886,11 @@ Copyright and Licence } { \int_compare:nNnTF \g_@@_space_factor_int < { 2000 } - { \_@@_space_skip_scale:nnn { \tex_spaceskip:D } } + { \@@_space_skip_scale:nnn { \tex_spaceskip:D } } { \skip_if_eq:nnTF \tex_xspaceskip:D \c_zero_skip { - \_@@_space_skip_scale:nnn + \@@_space_skip_scale:nnn { \tex_spaceskip:D + \tex_fontdimen:D 7 ~ \tex_font:D @@ -1906,7 +1903,7 @@ Copyright and Licence } } } -\cs_new_nopar:Npn \_@@_space_skip_scale:nnn #1#2#3 +\cs_new:Npn \@@_space_skip_scale:nnn #1#2#3 { \dim_eval:n {#1} plus \fp_eval:n { \g_@@_space_factor_int / 1000 } #2 @@ -1914,15 +1911,26 @@ Copyright and Licence \int_div_truncate:nn { 1000 * \int_value:w #3 } { \g_@@_space_factor_int } sp } +% \end{macrocode} +% \end{variable} +% +% \begin{macro}[int]{\xeCJK_reset_space_factor:} +% \begin{variable}[int]{\g_@@_space_factor_int} +% 在 \tn{XeTeXinterchartoks} 里,\tn{spacefactor} 已经被重置为 $1000$。 +% 我们需要在 Default 类里保存 \tn{spacefactor} 用于计算空格宽度。 +% \begin{macrocode} \int_new:N \g_@@_space_factor_int -\int_gset:Nn \g_@@_space_factor_int { 1000 } +\cs_new_protected:Npn \xeCJK_reset_space_factor: + { \int_gset:Nn \g_@@_space_factor_int { 1000 } } +\xeCJK_reset_space_factor: % \end{macrocode} % \end{variable} +% \end{macro} % % \begin{macro}[int]{\xeCJK_glue_to_skip:nN} % 取得一个 |glue| 的长度,包括伸展和收缩部分。如果参数不是 |glue|,则取其宽度。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_glue_to_skip:nN #1#2 +\cs_new_protected:Npn \xeCJK_glue_to_skip:nN #1#2 { \group_begin: \hbox_set:Nw \l_@@_tmp_box #1 \scan_stop: @@ -1989,7 +1997,7 @@ Copyright and Licence \group_align_safe_begin: \peek_after:Nw \@@_peek_catcode_ignore_spaces_branches:w } -\cs_new_protected_nopar:Npn \@@_peek_catcode_ignore_spaces_branches:w +\cs_new_protected:Npn \@@_peek_catcode_ignore_spaces_branches:w { \if_meaning:w \l_peek_token \c_space_token \bool_set_true:N \l_@@_peek_ignore_spaces_bool @@ -2020,7 +2028,7 @@ Copyright and Licence % 用于取得记号 |#1| 所在的 \XeTeX 字符类。|#1| 应为 \tn{catcode} 为 |11| 或 |12| % 的显性或隐性记号。 % \begin{macrocode} -\cs_new_nopar:Npn \xeCJK_token_value_class:N #1 +\cs_new:Npn \xeCJK_token_value_class:N #1 { \tex_XeTeXcharclass:D \xeCJK_token_value_charcode:N #1 } % \end{macrocode} % \end{macro} @@ -2038,20 +2046,20 @@ Copyright and Licence % 这一 Bug 在 TeX Live 2015 的 \texttt{0.99992} 版中得到修复^^A % \footnote{参见\url{http://tug.org/pipermail/xetex/2015-May/025941.html}}。 % \begin{macrocode} -\cs_new_nopar:Npn \xeCJK_token_value_charcode:N #1 +\cs_new:Npn \xeCJK_token_value_charcode:N #1 { \exp_after:wN \@@_get_charcode:w \token_to_meaning:N #1 \q_stop } \group_begin: \cs_set:Npn \@@_tmp:w #1 ~ #2 ~ #3#4#5 \q_stop { \tl_if_empty:nTF { #4#5 } { - \cs_new_nopar:Npn \@@_get_charcode:w ##1 ~ ##2 ~ ##3 \q_stop + \cs_new:Npn \@@_get_charcode:w ##1 ~ ##2 ~ ##3 \q_stop { \int_eval:n { `##3 } } } { \tl_if_empty:nTF {#5} { - \cs_new_nopar:Npn \@@_get_charcode:w ##1 ~ ##2 ~ ##3##4 \q_stop + \cs_new:Npn \@@_get_charcode:w ##1 ~ ##2 ~ ##3##4 \q_stop { \int_eval:n { @@ -2062,7 +2070,7 @@ Copyright and Licence } } { - \cs_new_nopar:Npn \@@_get_charcode:w ##1 ~ ##2 ~ ##3##4 \q_stop + \cs_new:Npn \@@_get_charcode:w ##1 ~ ##2 ~ ##3##4 \q_stop { \int_eval:n { \tl_if_empty:nTF { ##4 } { `##3 } { "20000 } } } } } @@ -2082,7 +2090,7 @@ Copyright and Licence \cs_end: \prg_return_true: \else: \prg_return_false: \fi: } -\cs_new_nopar:Npn \@@_CJK_class_tl:n #1 +\cs_new:Npn \@@_CJK_class_tl:n #1 { c_@@_CJK_class_ \int_eval:n {#1} _tl } % \end{macrocode} % \end{macro} @@ -2102,7 +2110,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_make_boundary:} % 利用 \cs{scan_stop:} 结束 CJK 分组,用于恢复字体等。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_make_boundary: +\cs_new_protected:Npn \xeCJK_make_boundary: { \bool_if:NT \l_@@_CJK_group_bool { \scan_stop: } } % \end{macrocode} % \end{macro} @@ -2149,7 +2157,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_new_class:n} % 新建一个字符类别。|#1| 是自定义名称。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_new_class:n #1 +\cs_new_protected:Npn \xeCJK_new_class:n #1 { \int_if_exist:cTF { \@@_class_csname:n {#1} } { \@@_error:nx { class-already-defined } {#1} } @@ -2170,7 +2178,7 @@ Copyright and Licence % {使用 \cs{xeCJK_save_class:nn} 保存 \XeTeX 预定义的字符类别。} % 保存 \XeTeX 预定义的字符类别。|#1| 是自定义名称,|#2| 是编号。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_save_class:nn #1#2 +\cs_new_protected:Npn \xeCJK_save_class:nn #1#2 { \int_if_exist:cTF { \@@_class_csname:n {#1} } { \@@_error:nx { class-already-defined } {#1} } @@ -2186,7 +2194,7 @@ Copyright and Licence % \begin{macro}{\@@_class_csname:n} % 字符类名称对应的控制序列名字。 % \begin{macrocode} -\cs_new_nopar:Npn \@@_class_csname:n #1 { c_@@_#1_class_int } +\cs_new:Npn \@@_class_csname:n #1 { c_@@_#1_class_int } \cs_new_eq:cN { \@@_class_csname:n { Others } } \l_@@_tmp_int \@@_msg_new:nn { class-already-defined } { @@ -2453,6 +2461,8 @@ Copyright and Licence % \changes{v3.4.1}{2016/08/18}{补充 Unicode 9.0.0 的西夏文。} % \changes{v3.5.0}{2017/07/22}{补充 Ext-F。} % \changes{v3.7.3}{2019/04/15}{补充日文假名扩展。} +% \changes{v3.8.3}{2020/03/15}{同步 Unicode 13.0.0。} +% \changes{v3.8.3}{2020/04/09}{补充 \texttt{U+02EA} 和 \texttt{U+02EB}。} % % \begin{variable}{\c_@@_CJK_chars_clist} % CJK 字符类,包括文字和标点符号。 @@ -2461,6 +2471,10 @@ Copyright and Licence { % \end{macrocode} % \begin{itemize}[nosep,leftmargin=0pt] +% \item 闽南语、客家话阴去和阳去声调标记 +% \begin{macrocode} + "02EA -> "02EB , +% \end{macrocode} % \item CJK Radicals Supplement (中日韩部首补充) % \begin{macrocode} "2E80 -> "2EFF , @@ -2569,6 +2583,14 @@ Copyright and Licence % \begin{macrocode} "18800 -> "18AFF , % \end{macrocode} +% \item Khitan Small Script (契丹小字) +% \begin{macrocode} + "18B00 -> "18CFF , +% \end{macrocode} +% \item Tangut Supplement (西夏文增补) +% \begin{macrocode} + "18D00 -> "18D8F , +% \end{macrocode} % \item Kana Supplement (日文假名增补) % \begin{macrocode} "1B000 -> "1B0FF , @@ -2607,7 +2629,11 @@ Copyright and Licence % \end{macrocode} % \item CJK Compatibility Ideographs Supplement (中日韩兼容表意文字增补) % \begin{macrocode} - "2F800 -> "2FA1F + "2F800 -> "2FA1F , +% \end{macrocode} +% \item CJK Unified Ideographs Extension-G (中日韩统一表意文字扩展 G) +% \begin{macrocode} + "30000 -> "3134F % \end{macrocode} % \end{itemize} % \begin{macrocode} @@ -2687,7 +2713,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_class_num:n} % |#1| 为字符类别名称,用于取得字符类别对应的编号。 % \begin{macrocode} -\cs_new_nopar:Npn \xeCJK_class_num:n #1 +\cs_new:Npn \xeCJK_class_num:n #1 { \use:c { \@@_class_csname:n {#1} } } % \end{macrocode} % \end{macro} @@ -2707,12 +2733,12 @@ Copyright and Licence % 用于设置字符所属的类别,|#1| 为类别名称,|#2| 为字符的 |Unicode|,相邻字符用 % 半角逗号隔开,支持类似 |"1100 -> "11FF| 起止范围的使用方式。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_declare_char_class:nn #1#2 +\cs_new_protected:Npn \xeCJK_declare_char_class:nn #1#2 { \clist_set:Nx \l_@@_tmp_clist {#2} \xeCJK_declare_char_class:nN {#1} \l_@@_tmp_clist } -\cs_new_protected_nopar:Npn \xeCJK_declare_char_class:nN #1#2 +\cs_new_protected:Npn \xeCJK_declare_char_class:nN #1#2 { \clist_gconcat:ccN { g_@@_#1_range_clist } { g_@@_#1_range_clist } #2 @@ -2735,7 +2761,7 @@ Copyright and Licence % % \begin{macro}{\@@_check_num_range:nnNN} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_check_num_range:nnNN #1#2#3#4 +\cs_new_protected:Npn \@@_check_num_range:nnNN #1#2#3#4 { \bool_lazy_or:nnTF { \xeCJK_if_blank_x_p:n {#1} } @@ -2772,7 +2798,7 @@ Copyright and Licence % \changes{v3.1.1}{2012/12/05}{在文档中设置字符类别时不重复设置 \tn{catcode}。} % 设置字符类别,|#1| 和 |#2| 为字符类别起止的 |Unicode|,|#3| 为类别名称对应编号。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_set_char_class:nnn #1#2#3 +\cs_new_protected:Npn \xeCJK_set_char_class:nnn #1#2#3 { \@@_check_num_range:nnNN {#1} {#2} \l_@@_begin_int \l_@@_end_int \int_set:Nn \l_@@_tmp_int {#3} @@ -2790,7 +2816,7 @@ Copyright and Licence % 将字符类 |#1| 中的字符全部设置成字符类 |#2|。只适用于 |#1| 的字符类范围为离散的 % 逗号列表的情况。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_set_char_class_eq:nn #1#2 +\cs_new_protected:Npn \@@_set_char_class_eq:nn #1#2 { \int_set:Nn \l_@@_tmp_int { \xeCJK_class_num:n {#2} } \clist_map_inline:cn { c_@@_#1_chars_clist } @@ -2854,7 +2880,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_inter_class_toks:nnn} % 在相邻类别之间插入内容。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_inter_class_toks:nnn #1#2#3 +\cs_new_protected:Npn \xeCJK_inter_class_toks:nnn #1#2#3 { \tex_XeTeXinterchartoks:D \xeCJK_class_num:n {#1} ~ \xeCJK_class_num:n {#2} = {#3} @@ -2866,7 +2892,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_get_inter_class_toks:nn} % 取出相邻类别之间的内容。 % \begin{macrocode} -\cs_new_nopar:Npn \xeCJK_get_inter_class_toks:nn #1#2 +\cs_new:Npn \xeCJK_get_inter_class_toks:nn #1#2 { \tex_the:D \tex_XeTeXinterchartoks:D \xeCJK_class_num:n {#1} ~ \xeCJK_class_num:n {#2} @@ -2886,8 +2912,10 @@ Copyright and Licence % \bye % \end{verbatim} % 如果把上述例子中的分组 \tn{begingroup} 和 \tn{endgroup} 去掉,则结果正常,甚为怪异。 +% 此处 \XeTeX 的 bug 已经在 0.999992 版中修复^^A +% \footnote{\url{http://tug.org/svn/texlive?view=revision&revision=53880}}。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_clear_inter_class_toks:nn #1#2 +\cs_new_protected:Npn \xeCJK_clear_inter_class_toks:nn #1#2 { \xeCJK_inter_class_toks:nnn {#1} {#2} { \prg_do_nothing: } } % \end{macrocode} % \end{macro} @@ -2895,7 +2923,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_pre_inter_class_toks:nnn} % 在相邻类别之间已有的内容前增加内容。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_pre_inter_class_toks:nnn #1#2#3 +\cs_new_protected:Npn \xeCJK_pre_inter_class_toks:nnn #1#2#3 { \xeCJK_inter_class_toks:nnx {#1} {#2} { \exp_not:n {#3} \xeCJK_get_inter_class_toks:nn {#1} {#2} } @@ -2907,7 +2935,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_app_inter_class_toks:nnn} % 在相邻类别之间已有的内容后追加内容。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_app_inter_class_toks:nnn #1#2#3 +\cs_new_protected:Npn \xeCJK_app_inter_class_toks:nnn #1#2#3 { \xeCJK_inter_class_toks:nnx {#1} {#2} { \xeCJK_get_inter_class_toks:nn {#1} {#2} \exp_not:n {#3} } @@ -2919,7 +2947,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_copy_inter_class_toks:nnnn} % 将 |#3| 和 |#4| 之间的内容复制到 |#1| 和 |#2| 之间。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_copy_inter_class_toks:nnnn #1#2#3#4 +\cs_new_protected:Npn \xeCJK_copy_inter_class_toks:nnnn #1#2#3#4 { \tl_set:Nx \l_@@_tmp_tl { \xeCJK_get_inter_class_toks:nn {#3} {#4} } @@ -2938,7 +2966,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_replace_inter_class_toks:nnnn} % 将 |#1| 和 |#2| 之间出现的 |#3| 用 |#4| 替换。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_replace_inter_class_toks:nnnn #1#2#3#4 +\cs_new_protected:Npn \xeCJK_replace_inter_class_toks:nnnn #1#2#3#4 { \tl_set:Nx \l_@@_tmp_tl { \xeCJK_get_inter_class_toks:nn {#1} {#2} } @@ -2956,11 +2984,11 @@ Copyright and Licence % \changes{v3.4.2}{2016/10/19}{提高效率,避免重复循环。} % 清除边界与 CJK 文字、全角左右标点之间的内容。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_clear_Boundary_and_CJK_toks: +\cs_new_protected:Npn \xeCJK_clear_Boundary_and_CJK_toks: { } -\cs_new_protected_nopar:Npn \@@_update_clear_toks:n #1 +\cs_new_protected:Npn \@@_update_clear_toks:n #1 { - \cs_gset_protected_nopar:Npx \xeCJK_clear_Boundary_and_CJK_toks: + \cs_gset_protected:Npx \xeCJK_clear_Boundary_and_CJK_toks: { \exp_not:o { \xeCJK_clear_Boundary_and_CJK_toks: } \tex_XeTeXinterchartoks:D @@ -2981,7 +3009,7 @@ Copyright and Licence \seq_gset_from_clist:Nn \g_@@_non_CJK_class_seq { Default , HalfLeft , HalfRight , NormalSpace , Boundary } \seq_new:N \g_@@_CJK_class_seq -\cs_new_protected_nopar:Npn \@@_save_CJK_class:n #1 +\cs_new_protected:Npn \@@_save_CJK_class:n #1 { \seq_gput_right:Nn \g_@@_CJK_class_seq {#1} \tl_const:cn @@ -3100,11 +3128,11 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_class_group_begin:,\xeCJK_class_group_end:} % 在 CJK 类开始时,设置 \tn{XeTeXdashbreakstate} 为零,避免破折号之间的折行。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_class_group_begin: +\cs_new_protected:Npn \xeCJK_class_group_begin: { \c_group_begin_token \bool_set_true:N \l_@@_CJK_group_bool - \int_gset:Nn \g_@@_space_factor_int { 1000 } + \xeCJK_reset_space_factor: \int_zero:N \tex_XeTeXdashbreakstate:D } \bool_new:N \l_@@_CJK_group_bool @@ -3175,15 +3203,15 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_Boundary_and_Default:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_Boundary_and_Default: +\cs_new_protected:Npn \xeCJK_Boundary_and_Default: { \xeCJK_check_for_ecglue: } -\cs_new_protected_nopar:Npn \@@_check_for_xecglue: +\cs_new_protected:Npn \@@_check_for_xecglue: { \int_compare:nNnTF \tex_lastnodetype:D = { 11 } { \@@_replace_space: } { \@@_check_for_ecglue: } } -\cs_new_protected_nopar:Npn \@@_check_for_ecglue: +\cs_new_protected:Npn \@@_check_for_ecglue: { \xeCJK_if_last_node:nTF { CJK } { \use_i:nn } @@ -3204,7 +3232,7 @@ Copyright and Licence % 将空格替换为 \tn{CJKecglue}。注意由 \tn{leaders} 等产生的 glue,并不能正确地还回去。 % 好在 \LaTeXe{} 中常用的 \tn{hrulefill} 和 \tn{dotfill} 定义末尾都有 |\kern\z@| 保护。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_replace_space: +\cs_new_protected:Npn \@@_replace_space: { \skip_set_eq:NN \l_@@_last_skip \tex_lastskip:D \tex_unskip:D @@ -3259,15 +3287,15 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_Boundary_and_NormalSp:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_Boundary_and_NormalSp: +\cs_new_protected:Npn \xeCJK_Boundary_and_NormalSp: { \xeCJK_check_for_ecglue_normalsp: } -\cs_new_protected_nopar:Npn \@@_check_for_xecglue_normalsp: +\cs_new_protected:Npn \@@_check_for_xecglue_normalsp: { \int_compare:nNnTF \tex_lastnodetype:D = { 11 } { \@@_replace_space: } { \@@_check_for_ecglue_normalsp: } } -\cs_new_protected_nopar:Npn \@@_check_for_ecglue_normalsp: +\cs_new_protected:Npn \@@_check_for_ecglue_normalsp: { \xeCJK_if_last_node:nT { CJK-space } { \xeCJK_remove_node: \xeCJK_space_or_xecglue: } @@ -3309,7 +3337,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_check_for_glue:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_check_for_glue: +\cs_new_protected:Npn \xeCJK_check_for_glue: { \int_compare:nNnTF \tex_lastnodetype:D = { 12 } { \@@_check_for_glue_auxi: } @@ -3319,7 +3347,7 @@ Copyright and Licence { \@@_check_for_glue_auxii: } } } -\cs_new_protected_nopar:Npn \@@_check_for_glue_auxi: +\cs_new_protected:Npn \@@_check_for_glue_auxi: { \dim_case:nn { \tex_lastkern:D } { @@ -3333,13 +3361,13 @@ Copyright and Licence { \xeCJK_remove_node: \CJKecglue } } } -\cs_new_protected_nopar:Npn \@@_check_for_glue_auxii: +\cs_new_protected:Npn \@@_check_for_glue_auxii: { \xeCJK_if_last_punct:TF { \@@_check_for_glue_auxiii: } { \xeCJK_check_for_xglue: } } -\cs_new_protected_nopar:Npn \@@_check_for_glue_auxiii: +\cs_new_protected:Npn \@@_check_for_glue_auxiii: { \bool_if:NT \l_@@_last_penalty_bool { \tex_penalty:D \l_@@_last_penalty_int } @@ -3347,7 +3375,7 @@ Copyright and Licence \tl_if_eq:NNF \l_@@_aligni_tl \c_@@_left_tl { \CJKglue } } \cs_new_eq:NN \xeCJK_check_for_xglue: \prg_do_nothing: -\cs_new_protected_nopar:Npn \@@_check_for_xglue: +\cs_new_protected:Npn \@@_check_for_xglue: { \int_compare:nNnT \tex_lastnodetype:D = { 11 } { @@ -3362,7 +3390,7 @@ Copyright and Licence } } } -\cs_new_protected_nopar:Npn \@@_check_for_xglue_aux: +\cs_new_protected:Npn \@@_check_for_xglue_aux: { \skip_if_eq:nnTF { \l_@@_last_skip } @@ -3382,7 +3410,7 @@ Copyright and Licence } { \skip_horizontal:N \l_@@_last_skip } } -\cs_new_protected_nopar:Npn \@@_ccglue_or_space: +\cs_new_protected:Npn \@@_ccglue_or_space: { \CJKglue } % \end{macrocode} % \end{macro} @@ -3403,7 +3431,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_declare_node:n,\xeCJK_make_node:n} % 用于判断插入的各种 |kern|。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_declare_node:n #1 +\cs_new_protected:Npn \xeCJK_declare_node:n #1 { \int_gincr:N \g_@@_node_int \dim_if_exist:cTF { c_@@_#1_node_dim } @@ -3412,16 +3440,16 @@ Copyright and Licence } \int_new:N \g_@@_node_int \int_gset:Nn \g_@@_node_int { 10 } -\cs_new_protected_nopar:Npn \xeCJK_make_node:n #1 +\cs_new_protected:Npn \xeCJK_make_node:n #1 { \exp_args:Nc \@@_make_node:N { c_@@_#1_node_dim } } -\cs_new_nopar:Npn \@@_node:n #1 +\cs_new:Npn \@@_node:n #1 { \use:c { c_@@_#1_node_dim } } -\cs_new_protected_nopar:Npn \@@_make_node:N #1 +\cs_new_protected:Npn \@@_make_node:N #1 { \tex_kern:D - #1 \tex_kern:D #1 } -\cs_new_protected_nopar:Npn \xeCJK_remove_node: +\cs_new_protected:Npn \xeCJK_remove_node: { \tex_unkern:D \tex_unkern:D } \xeCJK_declare_node:n { CJK } \xeCJK_declare_node:n { CJK-space } @@ -3439,7 +3467,7 @@ Copyright and Licence { CJKglue .code:n = { - \cs_set_protected_nopar:Npn \CJKglue {#1} + \cs_set_protected:Npn \CJKglue {#1} \xeCJK_glue_to_skip:nN {#1} \l_@@_ccglue_skip } } @@ -3456,7 +3484,7 @@ Copyright and Licence { CJKecglue .code:n = { - \cs_set_protected_nopar:Npn \CJKecglue {#1} + \cs_set_protected:Npn \CJKecglue {#1} \xeCJK_glue_to_skip:nN {#1} \l_@@_ecglue_skip } , xCJKecglue .choice: , @@ -3483,7 +3511,7 @@ Copyright and Licence xCJKecglue / unknown .code:n = { \bool_set_true:N \l_@@_xecglue_bool - \cs_set_protected_nopar:Npn \CJKecglue {#1} + \cs_set_protected:Npn \CJKecglue {#1} \xeCJK_glue_to_skip:nN {#1} \l_@@_ecglue_skip \cs_set_eq:NN \xeCJK_space_or_xecglue: \CJKecglue \cs_set_eq:NN \xeCJK_check_for_xglue: \@@_check_for_xglue: @@ -3512,13 +3540,13 @@ Copyright and Licence CJKspace / true .code:n = { \bool_set_true:N \l_@@_reserve_space_bool - \cs_set_protected_nopar:Npn \@@_ccglue_or_space: + \cs_set_protected:Npn \@@_ccglue_or_space: { \xeCJK_space_glue: } } , CJKspace / false .code:n = { \bool_set_false:N \l_@@_reserve_space_bool - \cs_set_protected_nopar:Npn \@@_ccglue_or_space: + \cs_set_protected:Npn \@@_ccglue_or_space: { \CJKglue } } , CJKspace .default:n = { true } , @@ -3540,7 +3568,7 @@ Copyright and Licence % 这样就可能出现问题\footnote{参见 \url{http://bbs.ctex.org/forum.php?mod=viewthread&tid=71563}。}。 % 原来是都在未定义控制序列前都加上 \cs{exp_not:N},现在是采用分组结束后手工恢复的方式。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_CJK_and_Boundary:w +\cs_new_protected:Npn \xeCJK_CJK_and_Boundary:w { \xeCJK_peek_catcode_ignore_spaces:NTF \c_math_toggle_token { @@ -3563,7 +3591,7 @@ Copyright and Licence } } } -\cs_new_protected_nopar:Npn \@@_boundary_reserve_space: +\cs_new_protected:Npn \@@_boundary_reserve_space: { \@@_boundary_group_end:n { CJK-space } \xeCJK_space_or_xecglue: @@ -3574,7 +3602,7 @@ Copyright and Licence \token_if_eq_meaning:NNTF #1 \scan_stop: {#1} { \cs_set_eq:NN #1 \scan_stop: #1 } } -\cs_new_protected_nopar:Npn \@@_boundary_group_end:n #1 +\cs_new_protected:Npn \@@_boundary_group_end:n #1 { \group_align_safe_end: \xeCJK_class_group_end: @@ -3585,7 +3613,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_ignore_spaces:w} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_ignore_spaces:w +\cs_new_protected:Npn \xeCJK_ignore_spaces:w { \xeCJK_peek_catcode_ignore_spaces:NTF \c_math_toggle_token { @@ -3609,7 +3637,7 @@ Copyright and Licence } } } -\cs_new_protected_nopar:Npn \@@_reserve_space_aux: +\cs_new_protected:Npn \@@_reserve_space_aux: { \group_align_safe_end: \xeCJK_space_or_xecglue: @@ -3625,7 +3653,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_CJK_and_CJK:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_CJK_and_CJK:N +\cs_new_protected:Npn \xeCJK_CJK_and_CJK:N { \CJKglue \CJKsymbol } % \end{macrocode} % \end{macro} @@ -3667,7 +3695,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_FullLeft_and_Boundary:} % \hypertarget{fl-fr-bound}{} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_Boundary: +\cs_new_protected:Npn \xeCJK_FullLeft_and_Boundary: { \@@_punct_if_middle:NTF \g_@@_last_punct_tl { @@ -3689,7 +3717,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_FullRight_and_Boundary:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_FullRight_and_Boundary: +\cs_new_protected:Npn \xeCJK_FullRight_and_Boundary: { \@@_punct_rule:NN \c_@@_right_tl \g_@@_last_punct_tl \xeCJK_class_group_end: @@ -3703,7 +3731,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_punct_node:N} % 保存标点的当前边界宽度和字符码,通过插入 \tn{kern} 实现。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_punct_node:N #1 +\cs_new_protected:Npn \xeCJK_punct_node:N #1 { \@@_punct_bound_unitization:NN #1 \l_@@_tmp_dim \@@_make_node:N \l_@@_tmp_dim @@ -3717,7 +3745,7 @@ Copyright and Licence % 我们不想出现过大的 \tn{kern},因此当边界大于 \SI{1}{pt} 时,以 \cs{c_max_dim} 为标准 % 对其进行“单位化”。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_punct_bound_unitization:NN #1#2 +\cs_new_protected:Npn \@@_punct_bound_unitization:NN #1#2 { \dim_set:Nn #2 { @@ -3734,12 +3762,12 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_punct_bound_kern:N} % \begin{macro}{\@@_punct_bound_kern:NN} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_punct_bound_kern:N #1 +\cs_new_protected:Npn \xeCJK_punct_bound_kern:N #1 { \exp_after:wN \@@_punct_bound_kern:NN \g_@@_last_punct_tl #1 } -\cs_new_protected_nopar:Npn \@@_punct_bound_kern:NN #1#2 +\cs_new_protected:Npn \@@_punct_bound_kern:NN #1#2 { \xeCJK_get_punct_bounds:NN \l_@@_aligni_tl #1 \xeCJK_get_punct_kerning:NN #1 #2 @@ -3764,7 +3792,7 @@ Copyright and Licence % \begin{macro}{\@@_punct_bound_kern_ratio:NN} % 当标点前后的字体情况不一致时,按一定的比例进行压缩。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_punct_bound_kern_ratio:NN #1#2 +\cs_new_protected:Npn \@@_punct_bound_kern_ratio:NN #1#2 { \dim_set:Nn \l_@@_bound_dim { \@@_use_punct_dim:nNN { bound_width } #1 #2 } @@ -3781,7 +3809,7 @@ Copyright and Licence \@@_punct_bound_kern_ratio_aux:N #2 } } -\cs_new_protected_nopar:Npn \@@_punct_bound_kern_ratio_aux:N #1 +\cs_new_protected:Npn \@@_punct_bound_kern_ratio_aux:N #1 { \skip_set:Nn \l_@@_punct_kern_skip { @@ -3801,12 +3829,12 @@ Copyright and Licence % \begin{macro}{\@@_nobreak_hskip:N,\@@_nobreak_hskip:n, % \@@_punct_bound_kern:N, \@@_punct_bound_breakable_kern:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_nobreak_hskip:N +\cs_new_protected:Npn \@@_nobreak_hskip:N { \xeCJK_no_break: \skip_horizontal:N } -\cs_new_protected_nopar:Npn \@@_nobreak_hskip:n +\cs_new_protected:Npn \@@_nobreak_hskip:n { \xeCJK_no_break: \skip_horizontal:n } \cs_new_eq:NN \@@_punct_bound_kern:N \@@_nobreak_hskip:N -\cs_new_protected_nopar:Npn \@@_punct_bound_breakable_kern:N +\cs_new_protected:Npn \@@_punct_bound_breakable_kern:N { \tl_if_eq:NNTF \l_@@_aligni_tl \c_@@_right_tl { @@ -3816,7 +3844,7 @@ Copyright and Licence } { \@@_nobreak_hskip:N } } -\cs_new_protected_nopar:Npn \@@_punct_bound_kern_aux:NNN #1#2 +\cs_new_protected:Npn \@@_punct_bound_kern_aux:NNN #1#2 { \str_if_eq:nnTF {#1} {#2} { \@@_nobreak_hskip:N } @@ -3848,7 +3876,7 @@ Copyright and Licence % \begin{macro}{\@@_punct_bound_rule:NN} % 用于抹去标点符号的全部左/右空白。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_punct_bound_rule:NN #1#2 +\cs_new_protected:Npn \@@_punct_bound_rule:NN #1#2 { \tex_vrule:D width - \@@_use_punct_dim:nNN { bound } #1 #2 ~ @@ -3861,7 +3889,7 @@ Copyright and Licence % \begin{macro}{\@@_punct_rule:NN} % 用于减少标点符号的左/右空白。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_punct_rule:NN #1#2 +\cs_new_protected:Npn \@@_punct_rule:NN #1#2 { \tex_vrule:D width \@@_use_punct_dim:nNN { rule } #1 #2 ~ @@ -3876,7 +3904,7 @@ Copyright and Licence % {标点符号左/右空白的伸展值不超过原始边界,收缩值不小于另一侧边界。} % 根据所选的标点处理方式在标点符号左/右增加的空白。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_punct_glue:NN #1#2 +\cs_new_protected:Npn \@@_punct_glue:NN #1#2 { \@@_punct_hskip:n { \@@_use_dim_or_skip:nNN { glue } #1 #2 } } \cs_new_eq:NN \@@_punct_hskip:n \skip_horizontal:n % \end{macrocode} @@ -3886,7 +3914,7 @@ Copyright and Licence % \begin{macro}{\xeCJK_punct_kern:NN,\@@_punct_kern:NN} % 相邻两个标点之间的间距,总允许长标点与其他标点之间折行。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_punct_kern:NN #1#2 +\cs_new_protected:Npn \@@_punct_kern:NN #1#2 { \str_if_eq:eeTF {#1} {#2} { \@@_punct_nobreak_kern:NN } @@ -3907,7 +3935,7 @@ Copyright and Licence % % \begin{macro}{\@@_punct_nobreak_kern:NN} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_punct_nobreak_kern:NN #1#2 +\cs_new_protected:Npn \@@_punct_nobreak_kern:NN #1#2 { \@@_nobreak_hskip:n { \@@_use_dim_or_skip:nNN { kern } #1 #2 } } % \end{macrocode} % \end{macro} @@ -3919,7 +3947,7 @@ Copyright and Licence % % \begin{macro}{\@@_punct_breakable_kern:NN} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_punct_breakable_kern:NN #1#2 +\cs_new_protected:Npn \@@_punct_breakable_kern:NN #1#2 { \exp_after:wN \@@_punct_if_right:NT #1 { \@@_punct_rule:NN \c_@@_right_tl #1 } @@ -3941,7 +3969,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_FullLeft_and_CJK:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_CJK: +\cs_new_protected:Npn \xeCJK_FullLeft_and_CJK: { \@@_punct_if_middle:NTF \g_@@_last_punct_tl { @@ -3960,7 +3988,7 @@ Copyright and Licence % \changes{v3.7.2}{2018/05/21}{再次修正 FullLeft 类字符与西文连用断词失败的问题。} % \cs{@@_nobreak_zero_glue:} 用于确保 FullLeft 类后的西文单词可以断词。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_Default: +\cs_new_protected:Npn \xeCJK_FullLeft_and_Default: { \@@_punct_if_middle:NTF \g_@@_last_punct_tl { @@ -3973,19 +4001,19 @@ Copyright and Licence \@@_nobreak_zero_glue: } } -\cs_new_protected_nopar:Npn \@@_nobreak_zero_glue: +\cs_new_protected:Npn \@@_nobreak_zero_glue: { \tex_penalty:D \c_@@_nobreak_penalty_int \skip_horizontal:N \c_zero_skip } -\cs_new_protected_nopar:Npn \@@_zero_glue: +\cs_new_protected:Npn \@@_zero_glue: { \skip_horizontal:N \c_zero_skip } % \end{macrocode} % \end{macro} % % \begin{macro}[int]{\xeCJK_FullRight_and_CJK:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_FullRight_and_CJK: +\cs_new_protected:Npn \xeCJK_FullRight_and_CJK: { \@@_punct_rule:NN \c_@@_right_tl \g_@@_last_punct_tl \@@_punct_glue:NN \c_@@_right_tl \g_@@_last_punct_tl @@ -3997,7 +4025,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_FullRight_and_Default:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_FullRight_and_Default: +\cs_new_protected:Npn \xeCJK_FullRight_and_Default: { \@@_punct_rule:NN \c_@@_right_tl \g_@@_last_punct_tl \xeCJK_class_group_end: @@ -4008,7 +4036,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_Default_and_FullLeft:nN} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_Default_and_FullLeft:nN #1#2 +\cs_new_protected:Npn \xeCJK_Default_and_FullLeft:nN #1#2 { \xeCJK_get_punct_bounds:NN \c_@@_left_tl #2 \@@_Default_and_FullLeft_glue:N #2 @@ -4020,14 +4048,14 @@ Copyright and Licence \@@_punct_rule:NN \c_@@_left_tl #2 \CJKpunctsymbol #2 } -\cs_new_protected_nopar:Npn \@@_Default_and_FullLeft_glue:N #1 +\cs_new_protected:Npn \@@_Default_and_FullLeft_glue:N #1 { \@@_punct_glue:NN \c_@@_left_tl #1 } % \end{macrocode} % \end{macro} % % \begin{macro}[int]{\xeCJK_CJK_and_FullLeft:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_CJK_and_FullLeft:N #1 +\cs_new_protected:Npn \xeCJK_CJK_and_FullLeft:N #1 { \xeCJK_get_punct_bounds:NN \c_@@_left_tl #1 \@@_CJK_and_FullLeft_glue:N #1 @@ -4036,7 +4064,7 @@ Copyright and Licence \@@_select_punct_font: \CJKpunctsymbol #1 } -\cs_new_protected_nopar:Npn \@@_CJK_and_FullLeft_glue:N #1 +\cs_new_protected:Npn \@@_CJK_and_FullLeft_glue:N #1 { \CJKglue \@@_punct_glue:NN \c_@@_left_tl #1 @@ -4046,7 +4074,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_Boundary_and_FullLeft:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_Boundary_and_FullLeft:N #1 +\cs_new_protected:Npn \xeCJK_Boundary_and_FullLeft:N #1 { \xeCJK_get_punct_bounds:NN \c_@@_left_tl #1 \@@_Boundary_and_FullLeft_glue:N #1 @@ -4068,7 +4096,7 @@ Copyright and Licence % \changes{v3.2.5}{2013/07/13}{增加对 \pkg{enumitem} 宏包修改的 \tn{item} 的判断。} % 根据 \cs{etex_lastnodetype:D} 的值进行分别处理。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_Boundary_and_FullLeft_glue:N #1 +\cs_new_protected:Npn \@@_Boundary_and_FullLeft_glue:N #1 { \tl_set_eq:NN \l_@@_alignii_tl \c_@@_left_tl \group_begin: \exp_args:NNc \group_end: \cs_if_exist_use:NTF @@ -4085,7 +4113,7 @@ Copyright and Licence % \cs{etex_lastnodetype:D} 为 $-1$ 表示 empty list,常出现在盒子的起始位置, % 在段落前使用 \tn{noindent} 就是这种情况。 % \begin{macrocode} -\cs_new_protected_nopar:cpn { @@_bound_type_ -1 _glue:Nn } #1#2 +\cs_new_protected:cpn { @@_bound_type_ -1 _glue:Nn } #1#2 { \@@_zero_glue: } % \end{macrocode} % \end{macro} @@ -4094,7 +4122,7 @@ Copyright and Licence % $1$ 表示 hlist node,在这里用来判断是否位于段首。基于正常情况下,\TeX 会在段落开头插入宽度为 % \tn{parindent} 的水平盒子用于缩进。 % \begin{macrocode} -\cs_new_protected_nopar:cpn { @@_bound_type_ 1 _glue:Nn } #1#2 +\cs_new_protected:cpn { @@_bound_type_ 1 _glue:Nn } #1#2 { \box_set_to_last:N \l_@@_tmp_box \int_compare:nNnTF \tex_lastnodetype:D = { -1 } @@ -4117,19 +4145,19 @@ Copyright and Licence % \env{description} 环境中使用的 \tn{item}(\tn{enit@postlabel@i}), % 在这里起到影响作用的是 |\penalty\z@ \hskip\labelsep|。 % \begin{macrocode} -\cs_new_protected_nopar:cpn { @@_bound_type_ 11 _glue:Nn } #1#2 +\cs_new_protected:cpn { @@_bound_type_ 11 _glue:Nn } #1#2 { \skip_if_finite:nTF { \tex_lastskip:D } { \@@_bound_glue_auxi:Nn #1 {#2} } { \@@_zero_glue: } } -\cs_new_protected_nopar:Npn \@@_bound_glue_auxi:Nn #1#2 +\cs_new_protected:Npn \@@_bound_glue_auxi:Nn #1#2 { \@@_if_last_punct_glue:TF { \xeCJK_punct_bound_kern:N #1 } { \@@_bound_glue_auxii:n {#2} } } -\cs_new_protected_nopar:Npn \@@_bound_glue_auxii:n #1 +\cs_new_protected:Npn \@@_bound_glue_auxii:n #1 { \skip_set_eq:NN \l_@@_last_skip \tex_lastskip:D \skip_if_eq:nnTF { \l_@@_last_skip } { 1sp } @@ -4155,7 +4183,7 @@ Copyright and Licence % \begin{macro}{\@@_bound_type_12_glue:Nn} % $12$ 表示 kern node,用于判断之前的字符是否是 CJK 类,如果是,则插入 \tn{CJKglue}。 % \begin{macrocode} -\cs_new_protected_nopar:cpn { @@_bound_type_ 12 _glue:Nn } #1#2 +\cs_new_protected:cpn { @@_bound_type_ 12 _glue:Nn } #1#2 { \xeCJK_if_last_node:nF { CJK } { \xeCJK_if_last_node:nF { CJK-space } { \use_none:nn } } @@ -4170,7 +4198,7 @@ Copyright and Licence % 能对齐到边界。判断基于 \tn{item} 的内部定义 \tn{@item} 对 \tn{everypar} 进行了修改,在这里起 % 到影响作用的是 |\box\@labels \penalty\z@|。以上判断都比较粗略,暂时也没有想起更好的办法。 % \begin{macrocode} -\cs_new_protected_nopar:cpn { @@_bound_type_ 13 _glue:Nn } #1#2 +\cs_new_protected:cpn { @@_bound_type_ 13 _glue:Nn } #1#2 { \@@_if_last_punct_penalty:TF { \xeCJK_punct_bound_kern:N #1 } @@ -4190,7 +4218,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_Default_and_FullRight:nN} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_Default_and_FullRight:nN #1#2 +\cs_new_protected:Npn \xeCJK_Default_and_FullRight:nN #1#2 { \xeCJK_get_punct_bounds:NN \c_@@_right_tl #2 \@@_Default_and_FullRight_glue:N #2 @@ -4206,7 +4234,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_Boundary_and_FullRight:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_Boundary_and_FullRight:N #1 +\cs_new_protected:Npn \xeCJK_Boundary_and_FullRight:N #1 { \xeCJK_get_punct_bounds:NN \c_@@_right_tl #1 \xeCJK_if_last_punct:TF @@ -4227,7 +4255,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_CJK_and_FullRight:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_CJK_and_FullRight:N #1 +\cs_new_protected:Npn \xeCJK_CJK_and_FullRight:N #1 { \xeCJK_get_punct_bounds:NN \c_@@_right_tl #1 \@@_CJK_and_FullRight_glue:N #1 @@ -4240,12 +4268,13 @@ Copyright and Licence % % \changes{v3.6.0}{2018/01/23}{解决标点中间被隔开的禁则与压缩问题。} % \changes{v3.7.3}{2019/04/15}{修复 penalty 数值错误。} +% \changes{v3.8.3}{2020/04/27}{修复 \opt{xCJKecglue} 选项。} % % \begin{macro}{\xeCJK_if_last_punct:TF} % \changes{v3.6.1}{2018/02/25}{细化判断。} % 判断之前是否是一个标点符号。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_if_last_punct:TF +\cs_new_protected:Npn \xeCJK_if_last_punct:TF { \bool_set_false:N \l_@@_last_penalty_bool \int_compare:nNnTF \tex_lastnodetype:D = { 11 } @@ -4256,14 +4285,14 @@ Copyright and Licence { \use_ii:nn } } } -\cs_new_protected_nopar:Npn \@@_if_last_punct_glue:TF +\cs_new_protected:Npn \@@_if_last_punct_glue:TF { \prop_get:NoNTF \g_@@_punct_skip_prop { \skip_use:N \tex_lastskip:D } \l_@@_tmp_tl { \@@_if_last_punct_glue_auxi:TF } { \@@_if_last_punct_glue_auxii:TF } } -\cs_new_protected_nopar:Npn \@@_if_last_punct_glue_auxi:TF +\cs_new_protected:Npn \@@_if_last_punct_glue_auxi:TF { \skip_set_eq:NN \l_@@_last_skip \tex_lastskip:D \tex_unskip:D @@ -4276,14 +4305,15 @@ Copyright and Licence } { \skip_horizontal:N \l_@@_last_skip \use_ii:nn } } -\cs_new_protected_nopar:Npn \@@_if_last_punct_glue_auxii:TF +\cs_new_protected:Npn \@@_if_last_punct_glue_auxii:TF { - \int_gset_eq:NN \g_@@_space_factor_int \tex_spacefactor:D - \skip_if_eq:nnTF { \tex_lastskip:D } { \c_xeCJK_space_skip_tl } - { \@@_if_last_punct_glue_auxiii:TF } - { \use_ii:nn } + \group_begin: + \g_@@_space_factor_int \tex_spacefactor:D + \skip_if_eq:nnTF { \tex_lastskip:D } { \c_xeCJK_space_skip_tl } + { \group_end: \@@_if_last_punct_glue_auxiii:TF } + { \group_end: \use_ii:nn } } -\cs_new_protected_nopar:Npn \@@_if_last_punct_glue_auxiii:TF +\cs_new_protected:Npn \@@_if_last_punct_glue_auxiii:TF { \skip_set_eq:NN \l_@@_tmp_skip \tex_lastskip:D \tex_unskip:D @@ -4297,7 +4327,7 @@ Copyright and Licence { \use:n } { \skip_horizontal:N \l_@@_tmp_skip \use_ii:nn } } -\cs_new_protected_nopar:Npn \@@_if_last_punct_penalty:TF +\cs_new_protected:Npn \@@_if_last_punct_penalty:TF { \int_set_eq:NN \l_@@_last_penalty_int \tex_lastpenalty:D \tex_unpenalty:D @@ -4307,7 +4337,7 @@ Copyright and Licence { \use:n } { \tex_penalty:D \l_@@_last_penalty_int \use_ii:nn } } -\cs_new_protected_nopar:Npn \@@_if_last_punct_auxi:TF +\cs_new_protected:Npn \@@_if_last_punct_auxi:TF { \tex_unpenalty:D \bool_if:NF \l_@@_last_penalty_bool @@ -4320,13 +4350,13 @@ Copyright and Licence { \use:n } { \xeCJK_no_break: \use_ii:nn } } -\cs_new_protected_nopar:Npn \@@_if_last_punct_auxii:TF +\cs_new_protected:Npn \@@_if_last_punct_auxii:TF { \dim_compare:nNnTF \l_@@_last_kern_dim > \c_zero_dim { \@@_if_last_punct_auxiii:TF } { \@@_make_node:N \l_@@_last_kern_dim \use_ii:nn } } -\cs_new_protected_nopar:Npn \@@_if_last_punct_auxiii:TF +\cs_new_protected:Npn \@@_if_last_punct_auxiii:TF { \int_case:nnTF { \tex_XeTeXcharclass:D \l_@@_last_kern_dim } { @@ -4338,7 +4368,7 @@ Copyright and Licence { \@@_if_last_punct_auxiv:TF } { \use_ii:nn } } -\cs_new_protected_nopar:Npn \@@_if_last_punct_auxiv:TF +\cs_new_protected:Npn \@@_if_last_punct_auxiv:TF { \dim_set_eq:NN \l_@@_tmp_dim \l_@@_last_kern_dim \xeCJK_if_last_node:TF @@ -4388,7 +4418,7 @@ Copyright and Licence % \begin{macro} % {\@@_CJK_and_FullRight_glue:N,\@@_Default_and_FullRight_glue:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_CJK_and_FullRight_glue:N #1 +\cs_new_protected:Npn \@@_CJK_and_FullRight_glue:N #1 { \@@_punct_if_long:NTF #1 { \xeCJK_allow_break: } @@ -4400,7 +4430,7 @@ Copyright and Licence \@@_punct_bound_rule:NN \c_@@_left_tl #1 } } -\cs_new_protected_nopar:Npn \@@_Default_and_FullRight_glue:N #1 +\cs_new_protected:Npn \@@_Default_and_FullRight_glue:N #1 { \@@_punct_if_long:NTF #1 { \xeCJK_allow_break: } @@ -4416,7 +4446,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_FullLeft_and_FullLeft:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_FullLeft:N #1 +\cs_new_protected:Npn \xeCJK_FullLeft_and_FullLeft:N #1 { \xeCJK_get_punct_bounds:NN \c_@@_left_tl #1 \xeCJK_get_punct_kerning:oN \g_@@_last_punct_tl #1 @@ -4429,7 +4459,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_FullLeft_and_FullRight:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_FullRight:N #1 +\cs_new_protected:Npn \xeCJK_FullLeft_and_FullRight:N #1 { \xeCJK_get_punct_bounds:NN \c_@@_right_tl #1 \xeCJK_get_punct_kerning:oN \g_@@_last_punct_tl #1 @@ -4442,7 +4472,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_FullRight_and_FullLeft:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_FullRight_and_FullLeft:N #1 +\cs_new_protected:Npn \xeCJK_FullRight_and_FullLeft:N #1 { \xeCJK_get_punct_bounds:NN \c_@@_left_tl #1 \xeCJK_get_punct_kerning:oN \g_@@_last_punct_tl #1 @@ -4455,7 +4485,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_FullRight_and_FullRight:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_FullRight_and_FullRight:N #1 +\cs_new_protected:Npn \xeCJK_FullRight_and_FullRight:N #1 { \xeCJK_get_punct_bounds:NN \c_@@_right_tl #1 \xeCJK_get_punct_kerning:oN \g_@@_last_punct_tl #1 @@ -4506,13 +4536,13 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_FullRight_symbol:N} % \begin{macrocode} -\cs_new_nopar:Npn \xeCJK_FullRight_symbol:N { \CJKpunctsymbol } +\cs_new:Npn \xeCJK_FullRight_symbol:N { \CJKpunctsymbol } % \end{macrocode} % \end{macro} % % \begin{macro}[int]{\xeCJK_check_FullRight:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_check_FullRight: +\cs_new_protected:Npn \xeCJK_check_FullRight: { \xeCJK_get_punct_bounds:No \c_@@_right_tl \g_@@_last_punct_tl \@@_punct_rule:NN \c_@@_right_tl \g_@@_last_punct_tl @@ -4535,7 +4565,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_check_FullRight_symbol:Nw} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_check_FullRight_symbol:Nw #1 +\cs_new_protected:Npn \xeCJK_check_FullRight_symbol:Nw #1 { \peek_remove_spaces:n { \@@_save_FullRight_symbol:N #1 } } % \end{macrocode} % \end{macro} @@ -4666,7 +4696,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_widow_penalty:} % 预防段末孤字而插入的 penalty,值为 \cs{l_@@_widow_penalty_int}。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_widow_penalty: +\cs_new_protected:Npn \xeCJK_widow_penalty: { \tex_penalty:D \l_@@_widow_penalty_int } % \end{macrocode} % \end{macro} @@ -4676,7 +4706,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_check_single:Nw} % \begin{macro}{\@@_check_single_end:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_check_single:Nw #1 +\cs_new_protected:Npn \xeCJK_check_single:Nw #1 { \group_align_safe_begin: \peek_catcode:NTF \c_catcode_letter_token @@ -4688,7 +4718,7 @@ Copyright and Licence #1 } } -\cs_new_protected_nopar:Npn \@@_check_single_end:N +\cs_new_protected:Npn \@@_check_single_end:N { \group_align_safe_end: \@@_check_single_save:N @@ -4704,7 +4734,7 @@ Copyright and Licence % 使用 \cs{group_align_safe_begin:} 和 \cs{group_align_safe_end:} 是为了防止在表格 % 里面报错。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_check_single:NNw #1#2 +\cs_new_protected:Npn \xeCJK_check_single:NNw #1#2 { \xeCJK_peek_catcode_ignore_spaces:NTF \c_catcode_letter_token { @@ -4731,7 +4761,7 @@ Copyright and Licence #1 #2 } } -\cs_new_protected_nopar:Npn \@@_check_single_aux:nNNw #1#2#3 +\cs_new_protected:Npn \@@_check_single_aux:nNNw #1#2#3 { \token_if_cs:NTF \l_peek_token { \xeCJK_check_single_cs:NNn } @@ -4745,10 +4775,10 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_check_single_end:NNnw} % \begin{macro}{\@@_check_single_end_aux:NNn,\@@_check_single_end_equation:NNnw} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_check_single_end_aux:NNn #1#2#3 +\cs_new_protected:Npn \@@_check_single_end_aux:NNn #1#2#3 { \@@_check_single_end:N #1 #2 #3 } \cs_new_eq:NN \xeCJK_check_single_end:NNnw \@@_check_single_end_aux:NNn -\cs_new_protected_nopar:Npn \@@_check_single_end_equation:NNnw +\cs_new_protected:Npn \@@_check_single_end_equation:NNnw { \token_if_math_toggle:NTF \l_peek_token { \xeCJK_check_single_equation:NNnNw } @@ -4785,7 +4815,7 @@ Copyright and Licence % \changes{v3.1.2}{2012/12/27} % {使用 \cs{xeCJK_if_CJK_class:NTF} 来代替 \cs{int_case:nnn} 判断是否是 CJK 字符类。} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_check_single_space:NN #1#2 +\cs_new_protected:Npn \@@_check_single_space:NN #1#2 { \xeCJK_if_CJK_class:NTF #2 { @@ -4800,7 +4830,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_check_single_equation:NNnNw} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_check_single_equation:NNnNw #1#2#3#4 +\cs_new_protected:Npn \xeCJK_check_single_equation:NNnNw #1#2#3#4 { \peek_catcode:NTF \c_math_toggle_token { @@ -4832,7 +4862,7 @@ Copyright and Licence % \tn{ifx} 判断。解决办法是将判断用 \cs{group_align_safe_begin:} 和 % \cs{group_align_safe_end:} 包起来。或者改用原语 \cs{tex_par:D} 作为判断条件。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_check_single_cs:NNn #1#2#3 +\cs_new_protected:Npn \xeCJK_check_single_cs:NNn #1#2#3 { \tl_case:NoF \l_peek_token { \l_@@_check_single_cs_case_tl } @@ -4851,7 +4881,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_check_single_env:nnNn} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_check_single_env:nnNn #1#2#3#4 +\cs_new_protected:Npn \xeCJK_check_single_env:nnNn #1#2#3#4 { \str_case_e:noTF {#4} { \l_@@_inline_env_case_tl } @@ -4980,7 +5010,7 @@ Copyright and Licence % % \begin{macro}{\@@_sub_restore_or_cancel:n} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_sub_restore_or_cancel:n #1 +\cs_new_protected:Npn \@@_sub_restore_or_cancel:n #1 { \clist_map_inline:nn {#1} { @@ -5005,7 +5035,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_declare_sub_char_class:nnn} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_declare_sub_char_class:nnn #1#2#3 +\cs_new_protected:Npn \xeCJK_declare_sub_char_class:nnn #1#2#3 { \int_if_exist:cF { \@@_class_csname:n { #1/#2 } } { @@ -5021,7 +5051,7 @@ Copyright and Licence % % \begin{macro}{\@@_set_sub_class_toks:nn} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_set_sub_class_toks:nn #1#2 +\cs_new_protected:Npn \@@_set_sub_class_toks:nn #1#2 { \seq_map_inline:Nn \g_@@_base_class_seq { @@ -5080,11 +5110,11 @@ Copyright and Licence { \keys_define:nn { xeCJK / options } { - PunctStyle / unknown .code:n = - { \@@_error:nx { punct-style-unknown } { \l_keys_value_tl } } + PunctStyle .code:n = + { \@@_error:nx { punct-style-unknown } {#1} } } \seq_gclear:N \g_@@_punct_style_seq - \keys_set:nn { xeCJK / options } { PunctStyle = plain } + \@@_set_punct_style:n { plain } } } % \end{macrocode} @@ -5183,11 +5213,11 @@ Copyright and Licence % \begin{macrocode} \clist_new:N \g_@@_special_punct_clist \clist_gset:Nn \g_@@_special_punct_clist { mixed_width , long , middle } -\cs_new_nopar:Npn \@@_special_punct_seq:n #1 { g_@@_special_punct_#1_seq } -\cs_new_nopar:Npn \@@_special_punct_tl:nN #1#2 { g_@@_special_punct_#1_#2_tl } +\cs_new:Npn \@@_special_punct_seq:n #1 { g_@@_special_punct_#1_seq } +\cs_new:Npn \@@_special_punct_tl:nN #1#2 { g_@@_special_punct_#1_#2_tl } \clist_map_inline:Nn \g_@@_special_punct_clist { \seq_new:c { \@@_special_punct_seq:n {#1} } } -\cs_new_protected_nopar:Npn \@@_set_special_punct:nn #1#2 +\cs_new_protected:Npn \@@_set_special_punct:nn #1#2 { \seq_map_inline:cn { \@@_special_punct_seq:n {#1} } { \cs_undefine:c { \@@_special_punct_tl:nN {#1} {##1} } } @@ -5198,7 +5228,7 @@ Copyright and Licence \seq_gput_right:cn { \@@_special_punct_seq:n {#1} } {##1} } } -\cs_new_protected_nopar:Npn \@@_add_special_punct:nn #1#2 +\cs_new_protected:Npn \@@_add_special_punct:nn #1#2 { \tl_map_inline:xn {#2} { @@ -5209,7 +5239,7 @@ Copyright and Licence } } } -\cs_new_protected_nopar:Npn \@@_sub_special_punct:nn #1#2 +\cs_new_protected:Npn \@@_sub_special_punct:nn #1#2 { \tl_map_inline:xn {#2} { @@ -5389,20 +5419,20 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_get_punct_bounds:NN} % |#1| 为 \cs{c_@@_left_tl} 或 \cs{c_@@_right_tl},|#2| 为标点符号。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_get_punct_bounds:NN #1#2 +\cs_new_protected:Npn \xeCJK_get_punct_bounds:NN #1#2 { \tl_if_exist:cF { \@@_punct_csname:n { dim/glue/#1/#2 } } { \@@_get_punct_bounds_aux:NN #1 #2 } } -\cs_new_protected_nopar:Npn \@@_get_punct_bounds_aux:NN +\cs_new_protected:Npn \@@_get_punct_bounds_aux:NN { \tl_if_eq:NNTF \l_xeCJK_punct_style_tl \c_@@_punct_style_plain_tl { \@@_save_punct_margin_plain:NN } { \@@_save_punct_margin:NN } } -\cs_new_protected_nopar:Npn \xeCJK_get_punct_bounds:No +\cs_new_protected:Npn \xeCJK_get_punct_bounds:No { \exp_last_unbraced:NNo \xeCJK_get_punct_bounds:NN } -\cs_new_protected_nopar:Npn \@@_save_punct_margin_plain:NN #1#2 +\cs_new_protected:Npn \@@_save_punct_margin_plain:NN #1#2 { \@@_save_punct_dim:nNNn { rule } #1 #2 { \c_zero_dim } \@@_save_punct_dim:nNNn { glue } #1 #2 { \c_zero_dim } @@ -5412,7 +5442,7 @@ Copyright and Licence \@@_save_punct_dim:nNNn { bound } \c_@@_right_tl {#2} { \c_zero_dim } \@@_save_punct_skip:nNNn { glue } #1 #2 { \c_zero_skip } } -\cs_new_protected_nopar:Npn \@@_save_punct_margin:NN #1#2 +\cs_new_protected:Npn \@@_save_punct_margin:NN #1#2 { \group_begin: \xeCJK_select_punct_font: @@ -5445,7 +5475,7 @@ Copyright and Licence % 相同长标点压缩。对于破折号,计算两标点之间的空白,保证它中间不被断开。 % 注意,破折号的边界可能为负值(比如方正新书宋),此时不必压缩。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_long_punct_kerning:N #1 +\cs_new_protected:Npn \@@_long_punct_kerning:N #1 { \dim_set:Nn \l_@@_tmp_dim { @@ -5474,7 +5504,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_get_punct_kerning:NN} % 标点压缩。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_get_punct_kerning:NN #1#2 +\cs_new_protected:Npn \xeCJK_get_punct_kerning:NN #1#2 { \tl_if_exist:cF { \@@_punct_csname:n { dim/kern/#1/#2 } } { @@ -5484,9 +5514,9 @@ Copyright and Licence #1 #2 } } -\cs_new_protected_nopar:Npn \xeCJK_get_punct_kerning:oN +\cs_new_protected:Npn \xeCJK_get_punct_kerning:oN { \exp_after:wN \xeCJK_get_punct_kerning:NN } -\cs_new_protected_nopar:Npn \@@_save_punct_kerning_plain:NN #1#2 +\cs_new_protected:Npn \@@_save_punct_kerning_plain:NN #1#2 { \@@_save_punct_dim:nNNn { kern } #1 #2 { \c_zero_dim } \@@_save_punct_dim:nNNn { bound_kern } #1 #2 { \c_zero_dim } @@ -5494,7 +5524,7 @@ Copyright and Licence \@@_save_punct_skip:nNNn { kern } #1 #2 { \c_zero_skip } \@@_save_punct_skip:nNNn { bound_kern } #1 #2 { \c_zero_skip } } -\cs_new_protected_nopar:Npn \@@_save_punct_kerning:NN +\cs_new_protected:Npn \@@_save_punct_kerning:NN { \UseInstance { xeCJK / punctuation } { \l_xeCJK_punct_style_tl } \xeCJK_punct_kerning_process:NN @@ -5504,7 +5534,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_punct_margin_process:NN} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_punct_margin_process:NN #1#2 +\cs_new_protected:Npn \xeCJK_punct_margin_process:NN #1#2 { \dim_set:Nn \l_@@_tmp_dim { @@ -5566,7 +5596,7 @@ Copyright and Licence % % \begin{macro}{\@@_calc_punct_width:N} % \begin{macrocode} -\cs_new_nopar:Npn \@@_calc_punct_width:N #1 +\cs_new:Npn \@@_calc_punct_width:N #1 { \@@_punct_if_middle:NTF #1 { \@@_punct_width_or_ratio:nN { middle } } @@ -5582,7 +5612,7 @@ Copyright and Licence % % \begin{macro}{\@@_calc_margin_width:N} % \begin{macrocode} -\cs_new_nopar:Npn \@@_calc_margin_width:N #1 +\cs_new:Npn \@@_calc_margin_width:N #1 { \@@_punct_if_middle:NTF #1 { @@ -5606,7 +5636,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_punct_offset_process:NN} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_punct_offset_process:NN #1#2 +\cs_new_protected:Npn \xeCJK_punct_offset_process:NN #1#2 { \dim_set:Nn \l_@@_tmp_dim { @@ -5680,7 +5710,7 @@ Copyright and Licence % % \begin{macro}{\@@_punct_width_or_ratio:nN} % \begin{macrocode} -\cs_new_nopar:Npn \@@_punct_width_or_ratio:nN #1#2 +\cs_new:Npn \@@_punct_width_or_ratio:nN #1#2 { \dim_compare:nNnTF { \use:c { l_@@_#1_punct_width_dim } } < \c_max_dim { \use:c { l_@@_#1_punct_width_dim } } @@ -5698,7 +5728,7 @@ Copyright and Licence % % \begin{macro}{\@@_margin_width_or_ratio:n} % \begin{macrocode} -\cs_new_nopar:Npn \@@_margin_width_or_ratio:n #1 +\cs_new:Npn \@@_margin_width_or_ratio:n #1 { \dim_compare:nNnTF { \use:c { l_@@_#1_margin_width_dim } } < \c_max_dim { \use:c { l_@@_#1_margin_width_dim } } @@ -5717,7 +5747,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_punct_kerning_process:NN} % 当标点之一为长标点时,不必进行压缩。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_punct_kerning_process:NN #1#2 +\cs_new_protected:Npn \xeCJK_punct_kerning_process:NN #1#2 { \dim_set:Nn \l_@@_margin_dim { \@@_original_kerning_margin:NN #1 #2 } @@ -5754,7 +5784,7 @@ Copyright and Licence } #1 #2 } -\cs_new_nopar:Npn \@@_punct_kerning_process_aux:NN #1#2 +\cs_new:Npn \@@_punct_kerning_process_aux:NN #1#2 { \bool_if:NTF \l_@@_enabled_kerning_bool { \@@_calc_kerning_margin:NN #1 #2 } @@ -5770,9 +5800,9 @@ Copyright and Licence % \begin{macro}{\@@_save_kerning:nnNN} % 相邻两个标点符号的间距能伸长到原始空白(未压缩时的状态),能收缩到较小边距。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_save_kerning:nnNN #1#2 +\cs_new_protected:Npn \@@_save_kerning:nnNN #1#2 { \@@_save_kerning:nnnNN {#1} {#2} {#2} } -\cs_new_protected_nopar:Npn \@@_save_kerning:nnnNN #1#2#3#4#5 +\cs_new_protected:Npn \@@_save_kerning:nnnNN #1#2#3#4#5 { \dim_set:Nn \l_@@_tmp_dim { @@ -5792,7 +5822,7 @@ Copyright and Licence % \begin{macro}{\@@_original_kerning_margin:NN} % 相邻两个标点符号之间的本来空白宽度。 % \begin{macrocode} -\cs_new_nopar:Npn \@@_original_kerning_margin:NN #1#2 +\cs_new:Npn \@@_original_kerning_margin:NN #1#2 { \dim_eval:n { @@ -5808,7 +5838,7 @@ Copyright and Licence % % \begin{macro}{\@@_calc_kerning_margin:NN,\@@_calc_kerning_margin_aux:NN} % \begin{macrocode} -\cs_new_nopar:Npn \@@_calc_kerning_margin:NN #1#2 +\cs_new:Npn \@@_calc_kerning_margin:NN #1#2 { \dim_max:nn { \l_@@_kerning_margin_minimum_dim } @@ -5823,7 +5853,7 @@ Copyright and Licence } } } -\cs_new_nopar:Npn \@@_calc_kerning_margin_aux:NN #1#2 +\cs_new:Npn \@@_calc_kerning_margin_aux:NN #1#2 { \dim_compare:nNnTF \l_@@_kerning_total_width_dim < \c_max_dim { \@@_calc_kerning_margin:nNN \l_@@_kerning_total_width_dim } @@ -5852,7 +5882,7 @@ Copyright and Licence % % \begin{macro}{\@@_kerning_width_or_ratio:nNN} % \begin{macrocode} -\cs_new_nopar:Npn \@@_kerning_width_or_ratio:nNN #1#2#3 +\cs_new:Npn \@@_kerning_width_or_ratio:nNN #1#2#3 { \dim_compare:nNnTF { \use:c { l_@@_#1_align_margin_dim } } < \c_max_dim { \use:c { l_@@_#1_align_margin_dim } } @@ -5872,7 +5902,7 @@ Copyright and Licence % % \begin{macro}{\@@_punct_min_bound:NN} % \begin{macrocode} -\cs_new_nopar:Npn \@@_punct_min_bound:NN #1#2 +\cs_new:Npn \@@_punct_min_bound:NN #1#2 { \dim_max:nn { @@ -5892,7 +5922,7 @@ Copyright and Licence % \begin{macro}{\@@_calc_kerning_margin:nNN} % |#2| 和 |#3| 为相邻的两个标点,|#1| 为要确定的相邻两个标点总共占的宽度。 % \begin{macrocode} -\cs_new_nopar:Npn \@@_calc_kerning_margin:nNN #1#2#3 +\cs_new:Npn \@@_calc_kerning_margin:nNN #1#2#3 { \dim_eval:n { @@ -5913,7 +5943,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_calc_punct_dimen:N} % 计算标点的左右实际边距和实际尺寸。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_calc_punct_dimen:N #1 +\cs_new_protected:Npn \xeCJK_calc_punct_dimen:N #1 { \@@_save_punct_dim:nNNn { bound } \c_@@_left_tl #1 { \xeCJK_glyph_bounds:NN 1 #1 } @@ -5934,37 +5964,54 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_glyph_bounds:NN} % 用 \tn{XeTeXglyphbounds} 取得标点符号的上下左右空白。 % \begin{macrocode} -\cs_new_nopar:Npn \xeCJK_glyph_bounds:NN #1#2 +\cs_new:Npn \xeCJK_glyph_bounds:NN #1#2 { \tex_XeTeXglyphbounds:D #1 ~ \tex_XeTeXcharglyph:D `#2 \exp_stop_f: } % \end{macrocode} % \end{macro} % +% \changes{v3.8.3}{2020/04/09}{重构 \opt{PunctStyle} 选项,完全展开参数。} +% % \begin{macro}{PunctStyle} % \begin{macrocode} \keys_define:nn { xeCJK / options } + { PunctStyle .code:n = \exp_args:Nx \@@_set_punct_style:n {#1} } +\cs_new_protected:Npn \@@_set_punct_style:n #1 { - PunctStyle .choice: , - PunctStyle .default:n = { quanjiao } , - PunctStyle / halfwidth .meta:n = { PunctStyle = banjiao } , - PunctStyle / fullwidth .meta:n = { PunctStyle = quanjiao } , - PunctStyle / mixedwidth .meta:n = { PunctStyle = kaiming } , - PunctStyle / marginkerning .meta:n = { PunctStyle = hangmobanjiao } , - PunctStyle / plain .code:n = - { \tl_set_eq:NN \l_xeCJK_punct_style_tl \c_@@_punct_style_plain_tl } , - PunctStyle / unknown .code:n = + \IfInstanceExistTF { xeCJK / punctuation } {#1} + { \tl_set:Nn \l_xeCJK_punct_style_tl {#1} } { - \IfInstanceExistTF { xeCJK / punctuation } { \l_keys_value_tl } - { \tl_set:Nx \l_xeCJK_punct_style_tl { \l_keys_value_tl } } - { \@@_error:nx { punct-style-unknown } { \l_keys_value_tl } } + \prop_get:NnNF \c_@@_punct_style_alias_prop + {#1} \l_xeCJK_punct_style_tl + { \@@_error:nx { punct-style-unknown } {#1} } } } +\prop_const_from_keyval:Nn \c_@@_punct_style_alias_prop + { + halfwidth = banjiao , + fullwidth = quanjiao , + mixedwidth = kaiming , + marginkerning = hangmobanjiao , + plain = plain + } \tl_new:N \l_xeCJK_punct_style_tl \tl_const:Nn \c_@@_punct_style_plain_tl { plain } \@@_msg_new:nn { punct-style-unknown } { Punctuation~style~"#1"~is~unknown. \\\\ The~available~styles~are~listed~as~follow.\\\\ - "plain,~\seq_use:Nnnn \g_@@_punct_style_seq { ~and~ } { ,~ } { ,~and~ }".\\ + "plain,~\seq_use:Nnnn \g_@@_punct_style_seq + { ~and~ } { ,~ } { ,~and~ }".\\ + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_trim_spaces:n} +% \pkg{xparse} 处理函数,先完全展开参数再删除两边空格。 +% \begin{macrocode} +\cs_new_protected:Npn \@@_trim_spaces:n #1 + { + \tl_set:Nx \ProcessedArgument + { \exp_args:Ne \tl_trim_spaces:n {#1} } } % \end{macrocode} % \end{macro} @@ -5972,12 +6019,13 @@ Copyright and Licence % \begin{macro}{\xeCJKDeclarePunctStyle} % 定义新的标点处理风格,已经存在的同名风格将被覆盖。 % \begin{macrocode} -\NewDocumentCommand \xeCJKDeclarePunctStyle { > { \TrimSpaces } m m } +\NewDocumentCommand \xeCJKDeclarePunctStyle + { > { \@@_trim_spaces:n } m m } { \IfInstanceExistTF { xeCJK / punctuation } {#1} { \@@_warning:nx { punct-style-already-defined } {#1} } - { \seq_gput_right:Nx \g_@@_punct_style_seq {#1} } - \exp_args:Nnx \DeclareInstance { xeCJK / punctuation } {#1} { basic } {#2} + { \seq_gput_right:Nn \g_@@_punct_style_seq {#1} } + \DeclareInstance { xeCJK / punctuation } {#1} { basic } {#2} } \seq_new:N \g_@@_punct_style_seq \@@_msg_new:nn { punct-style-already-defined } @@ -5992,10 +6040,11 @@ Copyright and Licence % \begin{macro}{\xeCJKEditPunctStyle} % 对已有的标点处理风格进行修改。 % \begin{macrocode} -\NewDocumentCommand \xeCJKEditPunctStyle { > { \TrimSpaces } m m } +\NewDocumentCommand \xeCJKEditPunctStyle + { > { \@@_trim_spaces:n } m m } { \IfInstanceExistTF { xeCJK / punctuation } {#1} - { \exp_args:Nnx \EditInstance { xeCJK / punctuation } {#1} {#2} } + { \EditInstance { xeCJK / punctuation } {#1} {#2} } { \@@_error:nx { punct-style-unknown } {#1} } } \@onlypreamble \xeCJKEditPunctStyle @@ -6072,7 +6121,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_fallback_test_glyph:N} % 测试当前字体中是否存在当前字符,如存在则直接输出,否则启用后备字体。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_fallback_test_glyph:N #1 +\cs_new_protected:Npn \xeCJK_fallback_test_glyph:N #1 { \xeCJK_glyph_if_exist:NTF #1 { \@@_fallback_save_CJKsymbol:N #1 } @@ -6092,7 +6141,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_aftergroup_reset_Boundary:N} % 在分组中暂时清空 |#1| 与边界的 toks,分组后恢复。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_aftergroup_reset_Boundary:N #1 +\cs_new_protected:Npn \xeCJK_aftergroup_reset_Boundary:N #1 { \tl_set:Nx \l_@@_tmp_tl { \tex_the:D \tex_XeTeXcharclass:D `#1 ~ \xeCJK_class_num:n { Boundary } } @@ -6114,7 +6163,7 @@ Copyright and Licence % 循环测试后备字体是否包含字符 |#1|。若后备字体中存在该字符或者再没有后备字体,则 % 结束循环。当前字体族没有备用字体时,使用 \tn{CJKfamilydefault} 的设置。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_fallback_loop:Nn #1#2 +\cs_new_protected:Npn \xeCJK_fallback_loop:Nn #1#2 { \xeCJK_family_if_exist:nTF {#2} { @@ -6163,7 +6212,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_set_family_fallback:nnn} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_set_family_fallback:nnn #1#2#3 +\cs_new_protected:Npn \xeCJK_set_family_fallback:nnn #1#2#3 { \group_begin: \tl_set:Nn \l_@@_fallback_family_tl {#1} @@ -6232,7 +6281,7 @@ Copyright and Licence % 用于定义 CJK 子区字体和备用字体的选项。 % \begin{macrocode} \seq_new:N \g_@@_sub_key_seq -\cs_new_protected_nopar:Npn \xeCJK_new_sub_key:n #1 +\cs_new_protected:Npn \xeCJK_new_sub_key:n #1 { \seq_gput_right:Nn \g_@@_sub_key_seq {#1} \keys_define:nn { xeCJK / features } @@ -6264,7 +6313,7 @@ Copyright and Licence % % \begin{macro}{\@@_get_sub_features:nn,\@@_get_sub_features:w} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_get_sub_features:nn #1#2 +\cs_new_protected:Npn \@@_get_sub_features:nn #1#2 { \tl_set:Nx \l_@@_tmp_tl { \xeCJK_tl_remove_outer_braces:n {#2} } \clist_clear:N \l_@@_sub_font_options_clist @@ -6279,7 +6328,7 @@ Copyright and Licence { \exp_not:V \l_@@_sub_font_name_tl } } } -\cs_new_protected_nopar:Npn \@@_get_sub_features:w #1 [#2] #3 \q_mark #4 \q_stop +\cs_new_protected:Npn \@@_get_sub_features:w #1 [#2] #3 \q_mark #4 \q_stop { \quark_if_nil:nTF {#2} { \tl_set_eq:NN \l_@@_sub_font_name_tl \l_@@_tmp_tl } @@ -6357,7 +6406,7 @@ Copyright and Licence % % \begin{macro}{\@@_set_family_initial:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_set_family_initial: +\cs_new_protected:Npn \@@_set_family_initial: { \int_gincr:N \g_@@_family_int \prop_clear:N \l_@@_sub_key_prop @@ -6383,7 +6432,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_set_family:nnn} % 设置一个 CJK 新字体族,与 \tn{newfontfamily} 类似,增加 |FallBack| 选项。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_set_family:nnn #1#2#3 +\cs_new_protected:Npn \xeCJK_set_family:nnn #1#2#3 { \group_begin: \@@_set_family_initial: @@ -6413,7 +6462,7 @@ Copyright and Licence % % \begin{macro}{\@@_binding_sub_family:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_binding_sub_family: +\cs_new_protected:Npn \@@_binding_sub_family: { \tl_if_empty:NF \l_@@_sub_family_name_tl { \tl_set_eq:NN \l_@@_family_name_tl \l_@@_sub_family_name_tl } @@ -6423,9 +6472,9 @@ Copyright and Licence % % \begin{macro}{\@@_gset_family_cs:x} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_gset_family_cs:x #1 +\cs_new_protected:Npn \@@_gset_family_cs:x #1 { - \cs_gset_protected_nopar:cpx { \@@_family_csname:n {#1} } + \cs_gset_protected:cpx { \@@_family_csname:n {#1} } { \group_begin: \exp_not:n { \cs_set_eq:NN \xeCJK@fontfamily \use_none:n } @@ -6446,7 +6495,7 @@ Copyright and Licence % % \begin{macro}{\@@_check_family:n} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_check_family:n #1 +\cs_new_protected:Npn \@@_check_family:n #1 { \prop_gpop:NnNT \g_@@_family_font_name_prop {#1} \l_@@_tmp_tl { @@ -6466,7 +6515,7 @@ Copyright and Licence % % \begin{macro}{\@@_parse_font_shape:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_parse_font_shape: +\cs_new_protected:Npn \@@_parse_font_shape: { \tl_if_blank:VTF \l_@@_font_name_bf_tl { @@ -6507,7 +6556,7 @@ Copyright and Licence % % \begin{macro}{\@@_save_family_info:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_save_family_info: +\cs_new_protected:Npn \@@_save_family_info: { \prop_gput:NVV \g_@@_family_font_name_prop \l_@@_family_name_tl \l_@@_font_name_tl @@ -6519,7 +6568,7 @@ Copyright and Licence % % \begin{macro}{\@@_set_sub_block_family:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_set_sub_block_family: +\cs_new_protected:Npn \@@_set_sub_block_family: { \prop_map_inline:Nn \l_@@_sub_key_prop { @@ -6532,7 +6581,7 @@ Copyright and Licence } } } -\cs_new_protected_nopar:Npn \@@_copy_sub_family:n #1 +\cs_new_protected:Npn \@@_copy_sub_family:n #1 { \@@_check_family:V \l_@@_sub_family_name_tl \prop_get:NoNT \g_@@_family_font_name_prop @@ -6548,7 +6597,7 @@ Copyright and Licence \prop_gput:NVV \g_@@_family_font_options_prop \l_@@_sub_family_name_tl \l_@@_sub_font_options_clist } - \cs_gset_protected_nopar:cpx + \cs_gset_protected:cpx { \@@_family_csname:n { \l_@@_sub_family_name_tl } } { \xeCJK_family_if_exist:xT { \l_@@_family_name_tl } @@ -6564,7 +6613,7 @@ Copyright and Licence % % \begin{macro}{\@@_copy_family:nn,\@@_copy_family:xx} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_copy_family:nn #1#2 +\cs_new_protected:Npn \@@_copy_family:nn #1#2 { \xeCJK_family_if_exist:nT {#2} { @@ -6584,7 +6633,7 @@ Copyright and Licence { \@@_family_nfss_csname:n {#2} } } } -\cs_new_protected_nopar:Npn \@@_copy_family:xx #1#2 +\cs_new_protected:Npn \@@_copy_family:xx #1#2 { \use:x { \@@_copy_family:nn {#1} {#2} } } % \end{macrocode} % \end{macro} @@ -6595,18 +6644,18 @@ Copyright and Licence % \begin{variable}[int]{\l_xeCJK_current_font_tl} % 缓存当前字体的原始格式,以加速编译。 % \begin{macrocode} -\cs_new_nopar:Npn \@@_font_csname:n #1 +\cs_new:Npn \@@_font_csname:n #1 { xeCJK/#1/\f@series/\f@shape/\f@size } \tl_new:N \l_xeCJK_current_font_tl \tl_set:No \l_xeCJK_current_font_tl { \@@_font_csname:n { \CJK@family } } -\cs_new_protected_nopar:Npn \xeCJK_select_font: +\cs_new_protected:Npn \xeCJK_select_font: { \@@_select_font:cn { \l_xeCJK_current_font_tl } { \l_xeCJK_family_tl } } -\cs_new_protected_nopar:Npn \@@_select_font:Nn #1#2 +\cs_new_protected:Npn \@@_select_font:Nn #1#2 { \cs_if_exist:NF #1 { \@@_font_initial:Nn #1 {#2} } #1 @@ -6624,7 +6673,7 @@ Copyright and Licence % 注意要将 \tn{selectfont} 放在分组中调用,防止 \tn{f@series} 等字体参数被修改, % 导致 \cs{l_xeCJK_current_font_tl} 标记前后不一致,引发错误(见~\ghissue{486})。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_font_initial:Nn #1#2 +\cs_new_protected:Npn \@@_font_initial:Nn #1#2 { \group_begin: \@@_family_use:n {#2} @@ -6639,7 +6688,7 @@ Copyright and Licence % 切换标点符号字体。 % \begin{macrocode} \cs_new_eq:NN \xeCJK_select_punct_font: \xeCJK_select_font: -\cs_new_protected_nopar:Npn \@@_select_punct_font_aux: +\cs_new_protected:Npn \@@_select_punct_font_aux: { \@@_select_font:cn { \l_xeCJK_current_punct_font_tl } @@ -6660,7 +6709,7 @@ Copyright and Licence % \changes{v3.1.0}{2012/11/18}{改进定义,加快切换速度。} % 两个 CJK 分区之间的字体切换。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_switch_font:nn #1#2 +\cs_new_protected:Npn \@@_switch_font:nn #1#2 { \str_if_eq:nnF {#1} {#2} { @@ -6681,26 +6730,26 @@ Copyright and Licence % 分区字体;若 \tn{CJKfamilydefault} 也没有定义该分区字体,则使用当前 CJK 字体族的 % 主分区字体。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_select_font:n #1 +\cs_new_protected:Npn \xeCJK_select_font:n #1 { \@@_select_font:cnn { \@@_font_csname:n { \CJK@family/#1 } } { \l_xeCJK_family_tl } {#1} } -\cs_new_protected_nopar:Npn \@@_select_font:Nnn #1#2#3 +\cs_new_protected:Npn \@@_select_font:Nnn #1#2#3 { \cs_if_exist:NF #1 { \@@_block_font_initial:Nnn #1 {#2} {#3} } #1 } \cs_generate_variant:Nn \@@_select_font:Nnn { c } -\cs_new_protected_nopar:Npn \@@_block_font_initial:Nnn #1#2#3 +\cs_new_protected:Npn \@@_block_font_initial:Nnn #1#2#3 { \xeCJK_block_family:nn {#2} {#3} \@@_font_initial:Nn #1 { #2/#3 } } -\cs_new_protected_nopar:Npn \xeCJK_block_family:nn #1#2 +\cs_new_protected:Npn \xeCJK_block_family:nn #1#2 { \xeCJK_family_if_exist:xF { #1/#2 } { @@ -6719,16 +6768,16 @@ Copyright and Licence % {\@@_family_csname:n,\@@_family_nfss_csname:n, % \@@_family_use:n,\@@_gset_family_nfss_cs:nn} % \begin{macrocode} -\cs_new_nopar:Npn \@@_family_csname:n #1 +\cs_new:Npn \@@_family_csname:n #1 { xeCJK/family/#1 } -\cs_new_nopar:Npn \@@_family_nfss_csname:n #1 +\cs_new:Npn \@@_family_nfss_csname:n #1 { xeCJK/family/nfss/#1 } -\cs_new_protected_nopar:Npn \@@_family_use:n #1 +\cs_new_protected:Npn \@@_family_use:n #1 { \use:c { \@@_family_nfss_csname:n {#1} } } -\cs_new_protected_nopar:Npn \@@_gset_family_nfss_cs:nn #1#2 +\cs_new_protected:Npn \@@_gset_family_nfss_cs:nn #1#2 { \prop_gput:Nnn \g_@@_family_name_prop {#1} {#2} - \cs_gset_protected_nopar:cpx + \cs_gset_protected:cpx { \@@_family_nfss_csname:n {#1} } { \@@_nfss_family:nn { \c_@@_encoding_tl } {#2} } } @@ -6741,7 +6790,7 @@ Copyright and Licence % \begin{macrocode} \cs_if_exist:NTF \fontseriesforce { - \cs_new_protected_nopar:Npn \@@_nfss_family:nn #1#2 + \cs_new_protected:Npn \@@_nfss_family:nn #1#2 { \fontencoding {#1} \str_if_eq:eeF { \f@series } { \bfdefault } @@ -6756,14 +6805,14 @@ Copyright and Licence \fontfamily {#2} \selectfont } - \cs_new_protected_nopar:Npn \@@_nfss_series:n #1 + \cs_new_protected:Npn \@@_nfss_series:n #1 { \str_if_eq:eeT { \f@series } { \use:c { bfseries@#1 } } { \fontseriesforce { \bfdefault } } } } { - \cs_new_protected_nopar:Npn \@@_nfss_family:nn #1#2 + \cs_new_protected:Npn \@@_nfss_family:nn #1#2 { \fontencoding {#1} \tl_set:Nn \f@family {#2} @@ -6798,7 +6847,7 @@ Copyright and Licence \xeCJK_family:NNx #1 #2 {#3} \tex_ignorespaces:D } -\cs_new_protected_nopar:Npn \xeCJK_family:NNn #1#2#3 +\cs_new_protected:Npn \xeCJK_family:NNn #1#2#3 { \tl_if_blank:nTF {#3} { @@ -6820,7 +6869,7 @@ Copyright and Licence } } \cs_generate_variant:Nn \xeCJK_family:NNn { NNx } -\cs_new_protected_nopar:Npn \xeCJK_switch_family:n #1 +\cs_new_protected:Npn \xeCJK_switch_family:n #1 { \xeCJK_family_if_exist:nTF {#1} { @@ -6853,7 +6902,7 @@ Copyright and Licence PunctFamily / unknown .code:n = { \xeCJK_punct_family:x {#1} } , } -\cs_new_protected_nopar:Npn \xeCJK_punct_family:n #1 +\cs_new_protected:Npn \xeCJK_punct_family:n #1 { \xeCJK_family_if_exist:nTF {#1} { @@ -6887,7 +6936,7 @@ Copyright and Licence % % \begin{macro}{\@@_gobble_CJKfamily:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_gobble_CJKfamily: +\cs_new_protected:Npn \@@_gobble_CJKfamily: { \cs_set_eq:NN \CJKfamily \@@_gobble_CJKfamily:wn } \NewExpandableDocumentCommand \@@_gobble_CJKfamily:wn { t+ t- m } { } % \end{macrocode} @@ -6895,7 +6944,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_family_if_exist_use:n} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_family_if_exist_use:n #1 +\cs_new_protected:Npn \xeCJK_family_if_exist_use:n #1 { \xeCJK_family_if_exist:nTF {#1} { \@@_family_use:n {#1} } @@ -6909,7 +6958,7 @@ Copyright and Licence % \changes{v3.1.2}{2013/01/01} % {在没有定义任何 CJK 字体的情况下,不再重复给出字体没有定义的警告。} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_family_unknown_warning:n #1 +\cs_new_protected:Npn \@@_family_unknown_warning:n #1 { \prop_if_empty:NF \g_@@_family_font_name_prop { @@ -6927,7 +6976,7 @@ Copyright and Licence Unknown~CJK~family~`\@@_msg_family_map:n {#1}'~is~being~ignored.\\\\ Try~to~use~`\@@_msg_def_family_map:n {#1}'~to~define~it. } -\cs_new_nopar:Npn \@@_msg_def_family_map:n #1 +\cs_new:Npn \@@_msg_def_family_map:n #1 { \str_case_e:nnF {#1} { @@ -6938,7 +6987,7 @@ Copyright and Licence { \token_to_str:N \setCJKfamilyfont \{ #1 \} } [...]\{...\} } -\cs_new_nopar:Npn \@@_msg_family_map:n #1 +\cs_new:Npn \@@_msg_family_map:n #1 { \str_case_e:nnF {#1} { @@ -7012,7 +7061,7 @@ Copyright and Licence % \begin{macro}{\@@_preamble_family:n} % 用在 \tn{setCJKmainfont} 等主要命令之后,确保导言区有 CJK 字体可用。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_preamble_family:n #1 +\cs_new_protected:Npn \@@_preamble_family:n #1 { \str_if_eq:eeT {#1} { \CJKfamilydefault } { \normalfont } } % \end{macrocode} % \end{macro} @@ -7031,7 +7080,7 @@ Copyright and Licence { \tl_set:Nx \l_@@_tmp_tl { \tl_if_novalue:nTF {#1} { \cs_to_str:N #2 } {#1} } - \cs_new_protected_nopar:Npx #2 + \cs_new_protected:Npx #2 { \xeCJK_switch_family:n { \l_@@_tmp_tl } } \@@_pass_args:nnnn { \xeCJK_set_family:nnn { \l_@@_tmp_tl } } {#3} {#4} @@ -7048,7 +7097,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_fontspec:nn} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_fontspec:nn #1#2 +\cs_new_protected:Npn \xeCJK_fontspec:nn #1#2 { \prop_get:NnNTF \g_@@_fontspec_prop { CJKfontspec/#1/#2/id } \l_xeCJK_family_tl @@ -7059,7 +7108,7 @@ Copyright and Licence {#1} {#2} } } -\cs_new_protected_nopar:Npn \@@_fontspec:nnn #1#2#3 +\cs_new_protected:Npn \@@_fontspec:nnn #1#2#3 { \prop_gput:Nnn \g_@@_fontspec_prop { CJKfontspec/#2/#3/id } {#1} \xeCJK_set_family:nnn {#1} {#2} {#3} @@ -7090,7 +7139,7 @@ Copyright and Licence % % \begin{macro}[int]{\xeCJK_add_font_features:Nnn} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_add_font_features:Nnn #1#2#3 +\cs_new_protected:Npn \xeCJK_add_font_features:Nnn #1#2#3 { \prop_get:NoNTF \g_@@_family_font_name_prop \l_xeCJK_family_tl \l_@@_font_name_tl @@ -7146,7 +7195,7 @@ Copyright and Licence % % \begin{macro}{\@@_add_sub_class_features:n} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_add_sub_class_features:n #1 +\cs_new_protected:Npn \@@_add_sub_class_features:n #1 { \prop_get:NoNTF \g_@@_family_font_name_prop { \l_xeCJK_family_tl/#1 } \l_@@_sub_font_name_tl @@ -7189,7 +7238,7 @@ Copyright and Licence % \begin{macrocode} \keys_define:nn { xeCJK / options } { LoadFandol .bool_gset:N = \g_@@_fandol_bool } -\cs_new_protected_nopar:Npn \@@_load_fandol: +\cs_new_protected:Npn \@@_load_fandol: { \xeCJK_set_family:xnn { \CJKrmdefault } { Extension = .otf , BoldFont = FandolSong-Bold , ItalicFont = FandolKai-Regular } @@ -7241,7 +7290,7 @@ Copyright and Licence } { \xeCJK_ensure_default_family: } } -\cs_new_protected_nopar:Npn \xeCJK_ensure_default_family: +\cs_new_protected:Npn \xeCJK_ensure_default_family: { \xeCJK_family_if_exist:xF { \CJKfamilydefault } { @@ -7315,8 +7364,9 @@ Copyright and Licence % \changes{v3.4.0}{2016/05/01}{CJKmath 的字符范围遵从 \tn{xeCJKDeclareCharClass} 的设置。} % 当没有设置 CJK 数学字体时,使用 \tn{CJKfamilydefault} 作为数学字体。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_set_mathfont: +\cs_new_protected:Npn \xeCJK_set_mathfont: { + \cs_if_exist_use:N \@@_save_um_char: \xeCJK_family_if_exist:xTF { \c_@@_math_tl } { \@@_set_mathfont_aux: } { @@ -7326,8 +7376,9 @@ Copyright and Licence \@@_set_mathfont_aux: } } + \cs_if_exist_use:N \@@_restore_um_char: } -\cs_new_protected_nopar:Npn \@@_set_mathfont_aux: +\cs_new_protected:Npn \@@_set_mathfont_aux: { \tl_const:Nx \c_@@_math_family_tl { \l_@@_fontspec_family_tl } @@ -7354,7 +7405,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_set_mathfont_block:} % 分区数学字体。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_set_mathfont_block: +\cs_new_protected:Npn \xeCJK_set_mathfont_block: { \seq_if_empty:NF \g_@@_CJK_sub_class_seq { @@ -7363,7 +7414,7 @@ Copyright and Licence \xeCJK_set_mathfont_block:n } } -\cs_new_protected_nopar:Npn \xeCJK_set_mathfont_block:n #1 +\cs_new_protected:Npn \xeCJK_set_mathfont_block:n #1 { \xeCJK_block_family:nn { \c_@@_math_tl } {#1} \prop_get:NoNTF \g_@@_fam_prop @@ -7378,7 +7429,7 @@ Copyright and Licence } \xeCJK_gset_mathcode:cn { g_@@_CJK/#1_range_clist } { \l_@@_fam_int } } -\cs_new_protected_nopar:Npn \@@_set_mathfont_block_aux:Nn #1#2 +\cs_new_protected:Npn \@@_set_mathfont_block_aux:Nn #1#2 { \int_set_eq:NN \l_@@_fam_int #1 \prop_gput:Nnn \g_@@_block_fam_prop {#2} {#1} @@ -7396,7 +7447,7 @@ Copyright and Licence % 而 \tn{updefault} 初始值是 \texttt{up},两者并不一致。 % \pkg{fontspec} 包定义字体使用的是 \tn{shapedefault}。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_declare_mathfont:nn #1#2 +\cs_new_protected:Npn \xeCJK_declare_mathfont:nn #1#2 { \xeCJK_declare_symbol_font:nnnnn {#1} { \c_@@_encoding_tl } {#2} { \mddefault } { \shapedefault } @@ -7465,7 +7516,7 @@ Copyright and Licence \cs_new_protected:Npn \@@_new_symbol_font:NN #1#2 { \tl_put_right:Nn \group@list { \group@elt #1 #2 } - \cs_set_nopar:Npn \version@elt ##1 + \cs_set:Npn \version@elt ##1 { \tl_put_right:Nn ##1 { \getanddefine@fonts #1 #2 } } \version@list } @@ -7478,7 +7529,7 @@ Copyright and Licence % \xeCJK_gset_mathcode:Nnn,\xeCJK_gset_mathcode:nnnn} % CJK 字符的数学类别固定为 $0$(\tn{mathord})。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_gset_mathcode:Nn #1#2 +\cs_new_protected:Npn \xeCJK_gset_mathcode:Nn #1#2 { \clist_map_inline:Nn #1 { @@ -7487,7 +7538,7 @@ Copyright and Licence } } \cs_generate_variant:Nn \xeCJK_gset_mathcode:Nn { c } -\cs_new_protected_nopar:Npn \xeCJK_gset_mathcode:nnnn #1#2#3#4 +\cs_new_protected:Npn \xeCJK_gset_mathcode:nnnn #1#2#3#4 { \@@_check_num_range:nnNN {#1} {#2} \l_@@_begin_int \l_@@_end_int \xeCJK_int_until_do:nn { \l_@@_begin_int > \l_@@_end_int } @@ -7496,7 +7547,7 @@ Copyright and Licence \int_incr:N \l_@@_begin_int } } -\cs_new_protected_nopar:Npn \xeCJK_gset_mathcode:Nnn #1#2#3 +\cs_new_protected:Npn \xeCJK_gset_mathcode:Nnn #1#2#3 { \tex_global:D \tex_Umathcode:D #1 = #2 ~ #3 ~ #1 } % \end{macrocode} % \end{macro} @@ -7524,7 +7575,7 @@ Copyright and Licence { \int_set_eq:NN \l_@@_verb_case_int \l_keys_choice_int } , Verb .default:n = { env } } -\cs_new_protected_nopar:Npn \@@_verb_font_hook: +\cs_new_protected:Npn \@@_verb_font_hook: { \if_case:w \l_@@_verb_case_int \or: @@ -7541,7 +7592,7 @@ Copyright and Licence } \@@_after_preamble:n { - \cs_set_protected_nopar:Npx \verbatim@font + \cs_set_protected:Npx \verbatim@font { \exp_not:o { \verbatim@font } \@@_verb_font_hook: } } % \end{macrocode} @@ -7550,7 +7601,7 @@ Copyright and Licence % \begin{macro}{\@@_nobreak_skip_zero:,\@@_nobreak_skip:} % \changes{v3.2.8}{2013/11/16}{禁止在 \tn{verb} 中断行。} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_nobreak_skip_zero: +\cs_new_protected:Npn \@@_nobreak_skip_zero: { \@@_reset_shipout_skip: \cs_set_eq:NN \@@_shipout_check_for_glue: \xeCJK_check_for_glue: @@ -7567,7 +7618,7 @@ Copyright and Licence \cs_set_eq:NN \@@_punct_hskip:n \@@_nobreak_hskip:n \cs_set_eq:NN \@@_punct_breakable_kern:n \@@_nobreak_hskip:n } -\cs_new_protected_nopar:Npn \@@_nobreak_skip: +\cs_new_protected:Npn \@@_nobreak_skip: { \@@_reset_shipout_skip: \xeCJK_glue_to_skip:nN { \CJKglue } \l_@@_ccglue_skip @@ -7581,16 +7632,16 @@ Copyright and Licence \cs_set_eq:NN \@@_punct_hskip:n \@@_nobreak_hskip:n \cs_set_eq:NN \@@_punct_breakable_kern:n \@@_nobreak_hskip:n } -\cs_new_protected_nopar:Npn \@@_nobreak_ccglue: +\cs_new_protected:Npn \@@_nobreak_ccglue: { \xeCJK_no_break: \skip_horizontal:N \l_@@_ccglue_skip } -\cs_new_protected_nopar:Npn \@@_nobreak_ecglue: +\cs_new_protected:Npn \@@_nobreak_ecglue: { \xeCJK_no_break: \skip_horizontal:N \l_@@_ecglue_skip } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_reset_shipout_skip:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_reset_shipout_skip: +\cs_new_protected:Npn \@@_reset_shipout_skip: { \cs_set_eq:NN \@@_shipout_CJKglue: \CJKglue \cs_set_eq:NN \@@_shipout_CJKecglue: \CJKecglue @@ -7657,7 +7708,7 @@ Copyright and Licence \NewDocumentCommand \xeCJKOffVerbAddon { } { \tl_use:N \l_@@_off_verb_addon_tl } \tl_new:N \l_@@_off_verb_addon_tl -\cs_new_protected_nopar:Npn \@@_verb_addon: +\cs_new_protected:Npn \@@_verb_addon: { \bool_if:NF \l_@@_verb_addon_bool { @@ -7671,7 +7722,7 @@ Copyright and Licence \cs_set_eq:NN \@@_shipout_CJKecglue: \CJKecglue \cs_set_eq:NN \@@_shipout_check_for_glue: \xeCJK_check_for_glue: \cs_set_eq:NN \@@_shipout_boundary:w \xeCJK_CJK_and_Boundary:w - \cs_set_protected_nopar:Npx \xeCJKOffVerbAddon + \cs_set_protected:Npx \xeCJKOffVerbAddon { \@@_reset_char_class:n { FullLeft } \@@_reset_char_class:n { FullRight } @@ -7706,9 +7757,9 @@ Copyright and Licence \cs_set_eq:NN \xeCJK_check_for_glue: \CJKecglue \cs_set_eq:NN \xeCJK_CJK_and_Boundary:w \@@_verb_CJK_and_Boundary:w } -\cs_new_protected_nopar:Npn \@@_verb_CJK_and_Boundary:w +\cs_new_protected:Npn \@@_verb_CJK_and_Boundary:w { \xeCJK_class_group_end: \CJKecglue } -\cs_new_protected_nopar:Npn \@@_reset_char_class:n #1 +\cs_new_protected:Npn \@@_reset_char_class:n #1 { \int_set:Nn \l_@@_tmp_int { \xeCJK_class_num:n {#1} } \clist_map_inline:cn { c_@@_#1_chars_clist } @@ -7725,7 +7776,7 @@ Copyright and Licence % 在抄录环境中,CJK 文字之间的间距为当前西文字体两个空格的宽度与当前字体大小之差, % 而与西文和空格的间距为 CJK 文字之间的间距的一半。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_set_verb_exspace: +\cs_new_protected:Npn \@@_set_verb_exspace: { \tl_if_exist:cTF { xeCJK/verb/\CJK@family/\curr@fontshape/\f@size } { @@ -7754,7 +7805,7 @@ Copyright and Licence % \begin{macro}{\@@_set_verb_exspace:n} % 当两个西文空格的宽度小于一个 CJK 文字的宽度时,对目前使用的 CJK 字体进行适当缩小。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_set_verb_exspace:n #1 +\cs_new_protected:Npn \@@_set_verb_exspace:n #1 { \skip_set:Nn \l_@@_verb_exspace_skip { 2 \tex_fontdimen:D 2 ~ \tex_font:D - #1 } @@ -7779,7 +7830,7 @@ Copyright and Licence % \begin{macro}{\@@_set_verb_scale:nn} % 缩小 CJK 字体,并保存相关信息。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_set_verb_scale:nn #1#2 +\cs_new_protected:Npn \@@_set_verb_scale:nn #1#2 { \fp_set:Nn \l_@@_scale_factor_fp { #1 / #2 } \@@_warning:nxx { scale-factor } @@ -7811,7 +7862,7 @@ Copyright and Licence % 如果文档不使用 \texttt{EU1} 作为默认字体编码,那么默认的打字机字体族很可能是 % 传统的 \TeX 字体,这时可视空格按照 \texttt{OT1} 编码传统一般就是字体中的 |\char32|。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_setup_visible_space: +\cs_new_protected:Npn \xeCJK_setup_visible_space: { \xeCJK_make_boundary: \xeCJK_glyph_if_exist:NTF { ^^^^2423 } @@ -7841,12 +7892,12 @@ Copyright and Licence % 的后备,但是 |lmtt| 的字体大小未必与当前字体匹配。因此,这里需要做一些调整,以 % 保证使用后备可视空格符号时,也能保证对齐。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_visible_space_fallback: +\cs_new_protected:Npn \@@_visible_space_fallback: { \exp_args:Nc \@@_visible_space_fallback_auxi:N { xeCJK/space/\curr@fontshape/\f@size } } -\cs_new_protected_nopar:Npn \@@_visible_space_fallback_auxi:N #1 +\cs_new_protected:Npn \@@_visible_space_fallback_auxi:N #1 { \cs_if_exist:NF #1 { \@@_visible_space_fallback_auxii:N #1 } @@ -7859,16 +7910,16 @@ Copyright and Licence % 当前字体空格的宽度与后备字体 |lmtt| 不一样时,就对 \tn{textvisiblespace} 的字体尺寸 % 按相应的比例放缩。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_visible_space_fallback_auxii:N #1 +\cs_new_protected:Npn \@@_visible_space_fallback_auxii:N #1 { \group_begin: \exp_args:No \@@_set_visible_space_size:n { \dim_use:N \tex_fontdimen:D 2 ~ \tex_font:D } - \cs_new_protected_nopar:Npx #1 + \cs_new_protected:Npx #1 { \group_begin: \tex_the:D \tex_font:D ^^^^2423 \group_end: } \group_end: } -\cs_new_protected_nopar:Npn \@@_set_visible_space_size:n #1 +\cs_new_protected:Npn \@@_set_visible_space_size:n #1 { \fontencoding { \UnicodeEncodingName } \tl_set:Nn \f@family { lmtt } @@ -7890,7 +7941,7 @@ Copyright and Licence % \end{macrocode} % \end{macro} % -% \subsection{\pkg{xeCJK} 其它选项} +% \subsection{\pkg{xeCJK} 其他选项} % % \begin{macro}{LocalConfig} % \changes{v3.1.0}{2012/11/20}{增加 \texttt{LocalConfig} 选项用于载入本地配置文件。} @@ -7979,8 +8030,8 @@ Copyright and Licence % % \begin{macro}[int]{\CJKsymbol, \CJKpunctsymbol} % \begin{macrocode} -\cs_new_nopar:Npn \CJKsymbol #1 {#1} -\cs_new_nopar:Npn \CJKpunctsymbol #1 {#1} +\cs_new:Npn \CJKsymbol #1 {#1} +\cs_new:Npn \CJKpunctsymbol #1 {#1} % \end{macrocode} % \end{macro} % @@ -8156,7 +8207,7 @@ Copyright and Licence % \tn{check@mathfonts} 之后生效,不会被它覆盖。 % 更合理的方式是定义一个新的 \tn{mathversion} 来切换。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK@update@fam +\cs_new_protected:Npn \xeCJK@update@fam { \addto@hook \everymath { @@ -8164,14 +8215,14 @@ Copyright and Licence \@@_update_block_fam: } } -\cs_new_protected_nopar:Npn \@@_update_main_fam: +\cs_new_protected:Npn \@@_update_main_fam: { \group_begin: \xeCJK_select_font: \exp_last_unbraced:NNNo \group_end: \tex_textfont:D \c_xeCJK_math_fam_int \tex_the:D \tex_font:D } -\cs_new_protected_nopar:Npn \@@_update_block_fam: +\cs_new_protected:Npn \@@_update_block_fam: { \prop_if_empty:NF \g_@@_block_fam_prop { @@ -8180,7 +8231,7 @@ Copyright and Licence \@@_update_block_fam:nn } } -\cs_new_protected_nopar:Npn \@@_update_block_fam:nn #1#2 +\cs_new_protected:Npn \@@_update_block_fam:nn #1#2 { \int_set:Nn \l_@@_fam_int {#2} \group_begin: @@ -8225,12 +8276,12 @@ Copyright and Licence % \pkg{fixltx2e} 使用 \tn{providecommand}|*| 来定义 \tn{MakeRobust})。但是 \pkg{ulem} % 的定义并不完全正确,没有考虑 \TeX 不会略去控制符号后面的空格的情况。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_math_robust:N #1 +\cs_new_protected:Npn \@@_math_robust:N #1 { \group_begin: \exp_args:NcNc \group_end: { @@_math_robust_aux:NN } #1 { \cs_to_str:N #1 ~ } } -\cs_new_protected_nopar:Npn \@@_math_robust_aux:NN #1#2 +\cs_new_protected:Npn \@@_math_robust_aux:NN #1#2 { \exp_args:Nx \str_case:nnTF { \cs_replacement_spec:N #1 } { @@ -8240,19 +8291,19 @@ Copyright and Licence { \@@_math_robust:NN #1#2 } { \@@_math_robust:NN #1#1 } } -\cs_new_protected_nopar:Npn \@@_math_robust:NN #1#2 +\cs_new_protected:Npn \@@_math_robust:NN #1#2 { \str_if_eq:eeTF { \cs_argument_spec:N #2 } { } { \exp_args:No \tl_if_head_eq_meaning:nNTF {#2} \scan_stop: { - \cs_gset_protected_nopar:Npx #1 + \cs_gset_protected:Npx #1 { \tl_tail:N #2 } } { \cs_if_eq:NNTF #1 \ensuremath { - \cs_gset_protected_nopar:Npx #1 + \cs_gset_protected:Npx #1 { \exp_not:o {#2} } } { @@ -8334,13 +8385,13 @@ Copyright and Licence \tl_set:Nx \f@family {#1} \xeCJK@fontfamily {#1} } - \cs_new_protected_nopar:Npn \xeCJK@fontfamily #1 + \cs_new_protected:Npn \xeCJK@fontfamily #1 { \str_if_eq:nnTF {#1} { \familydefault } { \xeCJK_switch_family:x { \CJKfamilydefault } } { \@@_update_family_aux: } } - \cs_new_protected_nopar:Npn \@@_update_family_aux: + \cs_new_protected:Npn \@@_update_family_aux: { \str_case_e:nn { \f@family } { @@ -8378,7 +8429,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK@italiccorr} % 修复倾斜校正,并处理汉字后面的空格。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK@italiccorr +\cs_new_protected:Npn \xeCJK@italiccorr { \int_compare:nNnTF \tex_XeTeXinterchartokenstate:D > \c_zero_int { \xeCJK_italic_correction: } @@ -8394,12 +8445,12 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_italic_correction:} % 修复倾斜校正,并处理汉字后面的空格。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_italic_correction: +\cs_new_protected:Npn \xeCJK_italic_correction: { \int_compare:nNnT \tex_lastnodetype:D = { 12 } { \@@_italic_correction: } } -\cs_new_protected_nopar:Npn \@@_italic_correction: +\cs_new_protected:Npn \@@_italic_correction: { \dim_case:nnF { \tex_lastkern:D } { @@ -8431,7 +8482,7 @@ Copyright and Licence % \verb*|\textit{...} | 等后面原来存在的空格作为完全展开的结束。要正确使用它还 % 需要另外的处理(使用 \cs{exp_stop_f:})。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_italic_correction_aux: +\cs_new_protected:Npn \@@_italic_correction_aux: { \exp_after:wN \exp_after:wN \exp_after:wN \exp_after:wN \exp_after:wN \exp_after:wN \exp_after:wN @@ -8469,7 +8520,7 @@ Copyright and Licence } } } -\cs_new_protected_nopar:Npn \@@_set_others_toks:n #1 +\cs_new_protected:Npn \@@_set_others_toks:n #1 { \int_set:cn { \@@_class_csname:n { Others } } {#1} \seq_map_inline:Nn \g_@@_CJK_class_seq @@ -8500,7 +8551,7 @@ Copyright and Licence % \begin{macro}{\@@_inactive_group_begin:,\@@_inactive_group_end:} % 用于保护下面歧义宽度标点的分组。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_inactive_group_begin: +\cs_new_protected:Npn \@@_inactive_group_begin: { \group_begin: \makexeCJKinactive } \cs_new_eq:NN \@@_inactive_group_end: \group_end: % \end{macrocode} @@ -8527,7 +8578,7 @@ Copyright and Licence "2E3A = \texttwoemdash } \@@_at_end_preamble:n { \@@_patch_text_command: } -\cs_new_protected_nopar:Npn \@@_patch_text_command: +\cs_new_protected:Npn \@@_patch_text_command: { \xeCJK_if_package_loaded:nTF { xunicode } { \@@_patch_xunicode_ambiguous_char: } @@ -8538,7 +8589,7 @@ Copyright and Licence \@@_patch_tuenc_composite: } } -\cs_new_protected_nopar:Npn \@@_patch_xunicode_ambiguous_char: +\cs_new_protected:Npn \@@_patch_xunicode_ambiguous_char: { \RequirePackage { xunicode-addon } \prop_map_inline:Nn \c_@@_ambiguous_char_prop @@ -8553,7 +8604,7 @@ Copyright and Licence } \xunadd_append_begin_hook:n { \xeCJK_make_boundary: } } -\cs_new_protected_nopar:Npn \@@_patch_tuenc_ambiguous_char:n #1 +\cs_new_protected:Npn \@@_patch_tuenc_ambiguous_char:n #1 { \prop_map_inline:Nn \c_@@_ambiguous_char_prop { @@ -8565,13 +8616,13 @@ Copyright and Licence } } } -\cs_new_protected_nopar:Npn \@@_patch_ambiguous_char:nN #1#2 +\cs_new_protected:Npn \@@_patch_ambiguous_char:nN #1#2 { \exp_args:Nx \@@_patch_ambiguous_char:nn { #1 \token_to_str:N #2 } { #1 - #2 } } -\cs_new_protected_nopar:Npx \@@_patch_ambiguous_char:nNn #1#2#3 +\cs_new_protected:Npx \@@_patch_ambiguous_char:nNn #1#2#3 { \exp_args:Nx \exp_not:N \@@_patch_ambiguous_char:nn { @@ -8581,28 +8632,28 @@ Copyright and Licence } { #1 - #2#3 } } -\cs_new_protected_nopar:Npn \@@_patch_ambiguous_char:nn #1#2 +\cs_new_protected:Npn \@@_patch_ambiguous_char:nn #1#2 { \cs_if_free:cF {#1} { \exp_args:Nc \@@_patch_ambiguous_char:Nn {#1} {#2} } } -\cs_new_protected_nopar:Npn \@@_patch_ambiguous_char:Nn #1#2 +\cs_new_protected:Npn \@@_patch_ambiguous_char:Nn #1#2 { \token_if_chardef:NTF #1 { \prop_gput:Nnx \c_@@_ambiguous_slot_prop {#2} { \int_eval:n {#1} } - \cs_set_protected_nopar:Npx #1 + \cs_set_protected:Npx #1 { \@@_ambiguous_char:n { \tex_Uchar:D #1 } } } { \prop_gput:Nnx \c_@@_ambiguous_slot_prop {#2} { \int_eval:n { \exp_after:wN ` #1 } } - \cs_set_protected_nopar:Npx #1 + \cs_set_protected:Npx #1 { \@@_ambiguous_char:n { \exp_not:o {#1} } } } } -\cs_new_protected_nopar:Npn \@@_ambiguous_char:n #1 +\cs_new_protected:Npn \@@_ambiguous_char:n #1 { \int_compare:nNnTF \tex_XeTeXinterchartokenstate:D > \c_zero_int { \@@_inactive_group_begin: #1 \@@_inactive_group_end: } @@ -8618,7 +8669,7 @@ Copyright and Licence % \tn{DeclareUnicodeComposite} 具有检查字符是否存在的功能, % 当符号命令紧跟在 CJK 字符类后面时,需要使字体回到西文状态 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_text_composite_patch: +\cs_new_protected:Npn \xeCJK_text_composite_patch: { \str_if_eq:eeT { \f@encoding } { \UnicodeEncodingName } { \xeCJK_make_boundary: } @@ -8627,7 +8678,7 @@ Copyright and Licence % 注意 \cs{xeCJK_text_composite_patch:} 可能会结束分组,从而导致 |##1| 没有定义时是 % \tn{undefined} 而不是 \tn{relax},所以不能将它与 \tn{relax} 作比较。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_patch_tuenc_composite: +\cs_new_protected:Npn \@@_patch_tuenc_composite: { \cs_set_nopar:Npn \@text@composite@x { @@ -8643,7 +8694,7 @@ Copyright and Licence % \begin{macrocode} \group_begin: \char_set_catcode_other:n { "A0 } -\cs_new_protected_nopar:Npn \@@_patch_tuenc_accent: +\cs_new_protected:Npn \@@_patch_tuenc_accent: { \cs_set_protected_nopar:Npn \add@unicode@accent ##1 ##2 { @@ -8690,13 +8741,13 @@ Copyright and Licence T5 = \` \ecircumflex } \@@_at_end_preamble:n { \@@_patch_middle_dot: } -\cs_new_protected_nopar:Npn \@@_patch_middle_dot: +\cs_new_protected:Npn \@@_patch_middle_dot: { \prop_map_inline:Nn \c_@@_middle_dot_prop { \@@_patch_middle_dot:nw { ##1 } ##2 \q_stop } \@@_patch_ambiguous_char:nNn { T5 } \` { \^ - e } } -\cs_new_protected_nopar:Npn \@@_patch_middle_dot:nw #1#2#3 \q_stop +\cs_new_protected:Npn \@@_patch_middle_dot:nw #1#2#3 \q_stop { \tl_if_empty:nTF {#3} { \@@_patch_ambiguous_char:nN {#1} #2 } @@ -8705,27 +8756,63 @@ Copyright and Licence % \end{macrocode} % \pkg{pifont} 宏包的符号 |\ding{183}| 也有冲突。 % \begin{macrocode} -\@@_after_end_preamble:n +\@@_package_hook:nn { pifont } + { + \RenewDocumentCommand \Pifont { m } + { \makexeCJKinactive \usefont { U } {#1} { m } { n } } + } +% \end{macrocode} +% \end{variable} +% \end{macro} +% +% \changes{v3.8.3}{2020/04/09}{兼容 \pkg{unicode-math} 和 \opt{CJKmath} 选项。} +% +% \begin{macro}{\@@_save_um_char:, \@@_save_um_char:} +% 兼容 \pkg{unicode-math} 和 \opt{CJKmath} 选项, +% 避免将一些中西文混用的标点设置为 CJK 字体。 +% \begin{macrocode} +\@@_package_hook:nn { unicode-math } { - \xeCJK_if_package_loaded:nT { pifont } + \prop_const_from_keyval:Nn \c_@@_um_ambiguous_char_prop + { + "00B7 = \cdotp , + "2025 = \enleadertwodots , + "2026 = \unicodeellipsis + } + \cs_new_protected:Npn \@@_save_um_char: { - \RenewDocumentCommand \Pifont { m } - { \makexeCJKinactive \usefont { U } {#1} { m } { n } } + \cs_set_protected:Npx \@@_restore_um_char: + { + \prop_map_function:NN + \c_@@_um_ambiguous_char_prop + \@@_restore_um_char_aux:nn + } + } + \cs_new_eq:NN \@@_restore_um_char: \prg_do_nothing: + \cs_new:Npn \@@_restore_um_char_aux:nn #1#2 + { + \@@_gset_mathcodenum:nn + { \int_value:w #1 } + { \int_value:w \tex_Umathcodenum:D #1 } + } + \cs_new_protected:Npn \@@_gset_mathcodenum:nn #1#2 + { + \int_compare:nNnF { \tex_Umathcodenum:D #1 } = {#2} + { \tex_global:D \tex_Umathcodenum:D #1 = #2 ~ } } } % \end{macrocode} -% \end{variable} % \end{macro} % % \begin{macro}{\@@_patch_microtype_get_slot:} % 兼容 \pkg{microtype}。 % \begin{macrocode} -\@@_at_end_preamble:n +\@@_package_hook:nn { microtype } { \cs_if_free:NF \MT@get@slot@ { \@@_patch_microtype_get_slot: } } -\cs_new_protected_nopar:Npn \@@_patch_microtype_get_slot: +\cs_new_protected:Npn \@@_patch_microtype_get_slot: { \cs_new_eq:NN \xeCJK@original@get@slot \MT@get@slot@ \cs_set_eq:NN \MT@get@slot@ \xeCJK@microtype@get@slot @@ -8737,7 +8824,7 @@ Copyright and Licence { \@@_get_ambiguous_slot: } \xeCJK@original@get@slot } -\cs_new_protected_nopar:Npn \@@_get_ambiguous_slot: +\cs_new_protected:Npn \@@_get_ambiguous_slot: { \exp_args:NNx \prop_get:NnNT \c_@@_ambiguous_slot_prop { \MT@encoding - \tex_the:D \MT@toks } \l_@@_tmp_tl @@ -8748,17 +8835,15 @@ Copyright and Licence % % 简单处理与 \pkg{hyperref} 宏包的兼容问题。 % \begin{macrocode} -\@@_after_end_preamble:n +\@@_package_hook:nn { hyperref } { - \cs_if_exist_use:NT \pdfstringdefDisableCommands + \pdfstringdefDisableCommands { - { - \@@_gobble_CJKfamily: - \xeCJK_cs_clear:N \@@_inactive_group_begin: - \xeCJK_cs_clear:N \@@_inactive_group_end: - \xeCJK_cs_clear:N \makexeCJKinactive - \xeCJK_cs_clear:N \xeCJK@composite@patch - } + \@@_gobble_CJKfamily: + \xeCJK_cs_clear:N \@@_inactive_group_begin: + \xeCJK_cs_clear:N \@@_inactive_group_end: + \xeCJK_cs_clear:N \makexeCJKinactive + \xeCJK_cs_clear:N \xeCJK@composite@patch } } % \end{macrocode} @@ -8766,11 +8851,9 @@ Copyright and Licence % \changes{v3.1.0}{2012/11/13}{取消 \tn{cprotect} 的外部宏限制。} % 当探测到 \pkg{cprotect} 宏包被引入时,则取消 \tn{cprotect} 宏的 \tn{outer} 定义。 % \begin{macrocode} -\@@_after_end_preamble:n +\@@_package_hook:nn { cprotect } { - \bool_lazy_and:nnT - { \xeCJK_if_package_loaded_p:n { cprotect } } - { \cs_if_exist_p:N \icprotect } + \cs_if_free:NF \icprotect { \exp_after:wN \tex_let:D \cs:w cprotect \cs_end: \icprotect } } % \end{macrocode} @@ -8778,30 +8861,21 @@ Copyright and Licence % \changes{v3.2.11}{2014/03/14}{删除 \tn{xeCJKcaption}。} % \changes{v3.8.0}{2020/02/09}{删除 \pkg{CJKfntef} 补丁。} % -% 导言区末尾检测到 \pkg{listings} 时,自动载入 \pkg{xeCJK-listings}。 +% 在 \pkg{listings} 宏包后自动载入 \pkg{xeCJK-listings}。 % \begin{macrocode} -\@@_at_end_preamble:n - { - \xeCJK_if_package_loaded:nT { listings } - { \RequirePackage { xeCJK-listings } } - } +\@@_package_hook:nn { listings } + { \RequirePackage { xeCJK-listings } } % \end{macrocode} % % % \changes{v3.3.3}{2015/12/12}{解决与 \pkg{microtype} 宏包的兼容问题。} -% 由于 \pkg{xeCJK} 假装 \pkg{CJK} 已经被引入了,这回导致 \pkg{everysel} 和 +% 由于 \pkg{xeCJK} 假装 \pkg{CJK} 已经被引入了,这会导致 \pkg{everysel} 和 % \pkg{microtype} 等宏包判断错误。需要在它们判断之前取消定义。 % \begin{macrocode} -\@@_at_end_preamble:n +\clist_map_inline:nn { everysel , microtype } { - \clist_map_inline:nn { everysel , microtype } - { - \xeCJK_if_package_loaded:nT {#1} - { - \cs_undefine:c { ver@CJK . \c_@@_package_ext_tl } - \clist_map_break: - } - } + \@@_package_hook:nn {#1} + { \cs_undefine:c { ver@CJK . \c_@@_package_ext_tl } } } % \end{macrocode} % @@ -8831,7 +8905,7 @@ Copyright and Licence { \cs_new_eq:NN \Unicode \xeCJK_unicode_char:nn } } } -\cs_new_nopar:Npn \xeCJK_unicode_char:nn #1#2 +\cs_new:Npn \xeCJK_unicode_char:nn #1#2 { \tex_Uchar:D \tex_numexpr:D (#1) * 256 + (#2) \scan_stop: } % \end{macrocode} % \end{macro} @@ -8884,7 +8958,7 @@ Copyright and Licence % \changes{v3.1.0}{2012/11/16}{简化对 \pkg{ulem} 宏包的兼容补丁。} % \changes{v3.1.1}{2012/12/08}{完全处理下划线里的标点符号的有关问题。} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_hook_for_ulem: +\cs_new_protected:Npn \xeCJK_hook_for_ulem: { \xeCJK_ulem_detect_node: \l_@@_ulem_text_format_tl @@ -8895,7 +8969,7 @@ Copyright and Licence } \xeCJK_ulem_begin_node: } -\cs_new_protected_nopar:Npn \@@_ulem_hook: +\cs_new_protected:Npn \@@_ulem_hook: { \@@_ulem_initial: \bool_if:NT \l_@@_ulem_subtract_bool @@ -8931,11 +9005,11 @@ Copyright and Licence \CJKecglue } \l_@@_ecglue_skip \xeCJK_glue_to_skip:nN { \xeCJK_space_glue: } \l_@@_space_skip - \cs_set_protected_nopar:Npn \CJKglue + \cs_set_protected:Npn \CJKglue { \@@_ulem_glue:n \l_@@_ccglue_skip } - \cs_set_protected_nopar:Npn \CJKecglue + \cs_set_protected:Npn \CJKecglue { \@@_ulem_glue:n \l_@@_ecglue_skip } - \cs_set_protected_nopar:Npn \xeCJK_space_glue: + \cs_set_protected:Npn \xeCJK_space_glue: { \@@_ulem_glue:n \l_@@_space_skip } \cs_set_eq:NN \xeCJK_punct_node:N \use_none:n \cs_set_eq:NN \xeCJK_if_last_punct:TF \use_ii:nn @@ -8950,7 +9024,7 @@ Copyright and Licence % \begin{macro}[int]{\UL@word,\xeCJK_ulem_word:nw} % 修改 \tn{UL@word},目的是取得分组中的 \tn{UL@leadtype},以便加入 \cs{xeCJK_ulem_right_skip:}。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_ulem_word:nw #1 ~ +\cs_new_protected:Npn \xeCJK_ulem_word:nw #1 ~ { \exp_after:wN \UL@start #1 ~ \exp_after:wN \if_meaning:w \exp_after:wN \UL@end #1 @@ -8959,7 +9033,7 @@ Copyright and Licence \exp_after:wN \@@_ulem_loop:nw \fi: } -\cs_new_protected_nopar:Npn \@@_ulem_end: +\cs_new_protected:Npn \@@_ulem_end: { \c_group_end_token \c_group_end_token @@ -8969,7 +9043,7 @@ Copyright and Licence \xeCJK_ulem_right_node: \int_set:Nn \tex_spacefactor:D { \UL@spfactor } } -\cs_new_protected_nopar:Npn \@@_ulem_loop:nw +\cs_new_protected:Npn \@@_ulem_loop:nw { \reverse_if:N \if_mode_math: \reverse_if:N \if_dim:w \tex_lastskip:D = \c_zero_dim @@ -8987,13 +9061,13 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_ulem_left:, \xeCJK_ulem_detect_node:} % 在下划线开始之前探测之前的 \texttt{node},以便随后插入 \tn{CJKglue} 或 \tn{CJKecglue}。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_ulem_left: +\cs_new_protected:Npn \xeCJK_ulem_left: { \xeCJK_ulem_left_node: \xeCJK_make_group_tag: } \cs_new_eq:NN \xeCJK_ulem_left_node: \prg_do_nothing: -\cs_new_protected_nopar:Npn \xeCJK_ulem_detect_node: +\cs_new_protected:Npn \xeCJK_ulem_detect_node: { \scan_stop: \dim_compare:nNnTF \tex_lastkern:D = \c_zero_dim @@ -9008,12 +9082,12 @@ Copyright and Licence \dim_compare:nNnTF \tex_lastkern:D = { - \l_@@_tmp_dim } { \tex_unkern:D - \cs_set_protected_nopar:Npx \xeCJK_ulem_left_node: + \cs_set_protected:Npx \xeCJK_ulem_left_node: { \tex_kern:D - \dim_use:N \l_@@_tmp_dim \exp_stop_f: \tex_kern:D \dim_use:N \l_@@_tmp_dim \exp_stop_f: } - \cs_set_protected_nopar:Npn \xeCJK_ulem_begin_node: + \cs_set_protected:Npn \xeCJK_ulem_begin_node: { { \xeCJK_make_node:n { ulem-begin } } } \cs_set_eq:NN \@@_ulem_hskip:n \@@_ulem_hskip_first:n } @@ -9034,7 +9108,7 @@ Copyright and Licence % 如果第一次调用的 \tn{CJKglue} 或 \tn{CJKecglue} 由下划线中的第一个文字和之前的 % 内容产生,就不用画下划线。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_hskip_first:n #1 +\cs_new_protected:Npn \@@_ulem_hskip_first:n #1 { \xeCJK_if_last_node:nTF { ulem-begin } { @@ -9045,7 +9119,7 @@ Copyright and Licence \cs_set_eq:NN \@@_ulem_hskip:n \xeCJK_ulem_hskip:n } \cs_new_eq:NN \@@_ulem_hskip:n \@@_ulem_hskip_first:n -\cs_new_protected_nopar:Npn \xeCJK_ulem_hskip:n #1 +\cs_new_protected:Npn \xeCJK_ulem_hskip:n #1 { { \skip_set:Nn \UL@skip {#1} \UL@leaders } } % \end{macrocode} % \end{macro} @@ -9053,7 +9127,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_ulem_right:, \xeCJK_ulem_right_node:} % 在下划线最后的位置保存 \texttt{node}。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_ulem_right: +\cs_new_protected:Npn \xeCJK_ulem_right: { \scan_stop: \dim_compare:nNnTF \tex_lastkern:D = \c_zero_dim @@ -9067,12 +9141,12 @@ Copyright and Licence } } } -\cs_new_protected_nopar:Npn \@@_ulem_right_aux:n #1 +\cs_new_protected:Npn \@@_ulem_right_aux:n #1 { \dim_compare:nNnTF \tex_lastkern:D = { - #1 } { \tex_unkern:D - \cs_gset_protected_nopar:Npn \xeCJK_ulem_right_node: + \cs_gset_protected:Npn \xeCJK_ulem_right_node: { \tex_kern:D - #1 \exp_stop_f: \tex_kern:D #1 \exp_stop_f: @@ -9091,9 +9165,9 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_ulem_var_leaders:} % 第一次画下划线时,不需要向左平移 \tn{UL@pixel},让左侧有间距。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_ulem_leaders: +\cs_new_protected:Npn \xeCJK_ulem_leaders: { \@@_ulem_var_leaders: } -\cs_new_protected_nopar:Npn \xeCJK_ulem_var_leaders: +\cs_new_protected:Npn \xeCJK_ulem_var_leaders: { \scan_stop: \skip_if_eq:nnF { \UL@skip } { \c_zero_skip } @@ -9112,7 +9186,7 @@ Copyright and Licence % 重新画一个减少 \tn{UL@pixel} 的。 % \begin{macrocode} \cs_new_eq:NN \xeCJK_ulem_right_skip: \prg_do_nothing: -\cs_new_protected_nopar:Npn \@@_ulem_right_skip: +\cs_new_protected:Npn \@@_ulem_right_skip: { \int_case:nn { \tex_lastnodetype:D } { @@ -9121,7 +9195,7 @@ Copyright and Licence { 13 } { \@@_ulem_right_skip_penalty: } } } -\cs_new_protected_nopar:Npn \@@_ulem_right_skip_hbox: +\cs_new_protected:Npn \@@_ulem_right_skip_hbox: { \box_set_to_last:N \l_@@_tmp_box \int_compare:nNnTF \tex_lastnodetype:D = { 12 } @@ -9129,7 +9203,7 @@ Copyright and Licence { \@@_ulem_right_skip_glue: } \box_use_drop:N \l_@@_tmp_box } -\cs_new_protected_nopar:Npn \@@_ulem_right_skip_kern: +\cs_new_protected:Npn \@@_ulem_right_skip_kern: { \dim_set:Nn \l_@@_tmp_dim { - \box_wd:N \l_@@_tmp_box } \dim_compare:nNnT \tex_lastkern:D = \l_@@_tmp_dim @@ -9139,7 +9213,7 @@ Copyright and Licence \tex_kern:D \l_@@_tmp_dim } } -\cs_new_protected_nopar:Npn \@@_ulem_right_skip_glue: +\cs_new_protected:Npn \@@_ulem_right_skip_glue: { \skip_if_eq:nnT { \tex_lastskip:D } { - \UL@pixel } { @@ -9149,7 +9223,7 @@ Copyright and Licence \UL@leadtype \skip_horizontal:N \l_@@_tmp_skip } } -\cs_new_protected_nopar:Npn \@@_ulem_right_skip_penalty: +\cs_new_protected:Npn \@@_ulem_right_skip_penalty: { \int_set_eq:NN \l_@@_tmp_int \tex_lastpenalty:D \tex_unpenalty:D @@ -9160,39 +9234,43 @@ Copyright and Licence % \end{macrocode} % \end{macro} % +% \changes{v3.8.3}{2020/04/23}{\opt{hidden} 选项保留原内容的高度和深度。} +% % \begin{macro}{\@@_ulem_hidden_box:} % 只画线,不输出盒子。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_hidden_box: +\cs_new_protected:Npn \@@_ulem_hidden_box: { \tl_if_empty:NF \UL@start { - \box_use:N \c_@@_null_box + \box_set_ht:Nn \l_@@_hidden_box { \box_ht:N \UL@box } + \box_set_dp:Nn \l_@@_hidden_box { \box_dp:N \UL@box } + \box_use:N \l_@@_hidden_box \xeCJK_no_break: \xeCJK_ulem_hskip:n { \box_wd:N \UL@box } - \box_use:N \c_@@_null_box + \box_use:N \l_@@_hidden_box } } -\box_new:N \c_@@_null_box -\hbox_gset:Nn \c_@@_null_box { } +\box_new:N \l_@@_hidden_box +\hbox_set:Nn \l_@@_hidden_box { } % \end{macrocode} % \end{macro} % % \begin{macro}{\@@_ulem_skip_punct_begin:,\@@_ulem_skip_punct_end:} % 让下划线跳过标点符号的设置。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_skip_punct_begin: +\cs_new_protected:Npn \@@_ulem_skip_punct_begin: { \cs_set_eq:NN \UL@putbox \@@_ulem_skip_putbox: \cs_set_eq:NN \xeCJK_ulem_hskip:n \skip_horizontal:n } -\cs_new_protected_nopar:Npn \@@_ulem_skip_punct_end: +\cs_new_protected:Npn \@@_ulem_skip_punct_end: { \cs_set_eq:NN \UL@putbox \@@_ulem_putbox: \cs_set_eq:NN \xeCJK_ulem_hskip:n \@@_ulem_hskip_aux:n } \cs_new_eq:NN \@@_ulem_putbox: \UL@putbox -\cs_new_protected_nopar:Npn \@@_ulem_skip_putbox: +\cs_new_protected:Npn \@@_ulem_skip_putbox: { \tl_if_empty:NF \UL@start { \box_use_drop:N \UL@box } @@ -9204,7 +9282,7 @@ Copyright and Licence % 这里的设置是为了在下划线状态下,下划线可以自动跳过全角标点符号和正确的在它们 % 前/后断行,并且与行首行末对齐。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_initial: +\cs_new_protected:Npn \@@_ulem_initial: { \@@_ulem_swap_cs:NN \xeCJK_FullLeft_and_Default: \@@_ulem_FullLeft_and_Default: @@ -9241,7 +9319,7 @@ Copyright and Licence } } } -\cs_new_protected_nopar:Npn \@@_ulem_swap_cs:NN #1#2 +\cs_new_protected:Npn \@@_ulem_swap_cs:NN #1#2 { \quark_if_recursion_tail_stop:N #1 \xeCJK_swap_cs:NN #1#2 @@ -9257,7 +9335,7 @@ Copyright and Licence % \verb*|\ | 等的定义,此时不需要使用 \tn{UL@stop} 和 \tn{UL@start} 来断开下划线而 % 产生断点。 % \begin{macrocode} -\cs_new_nopar:Npn \xeCJK_if_ulem_patch:TF +\cs_new:Npn \xeCJK_if_ulem_patch:TF { \if_meaning:w \ \LA@space \exp_after:wN \use_ii:nn @@ -9270,7 +9348,7 @@ Copyright and Licence % % \begin{macro}{\@@_ulem_CJK_and_Boundary:w} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_CJK_and_Boundary:w +\cs_new_protected:Npn \@@_ulem_CJK_and_Boundary:w { \xeCJK_if_ulem_patch:TF { @@ -9300,7 +9378,7 @@ Copyright and Licence % % \begin{macro}{\@@_ulem_fix_penalty:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_fix_penalty: +\cs_new_protected:Npn \@@_ulem_fix_penalty: { \xeCJK_if_ulem_patch:TF { \fix@penalty } @@ -9311,7 +9389,7 @@ Copyright and Licence % % \begin{macro}{\@@_ulem_CJK_and_CJK:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_CJK_and_CJK:N +\cs_new_protected:Npn \@@_ulem_CJK_and_CJK:N { \xeCJK_if_ulem_patch:TF { @@ -9328,7 +9406,7 @@ Copyright and Licence % % \begin{macro}{\@@_ulem_class_group_begin:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_class_group_begin: +\cs_new_protected:Npn \@@_ulem_class_group_begin: { \xeCJK_class_group_begin: \xeCJK_clear_Boundary_and_CJK_toks: @@ -9338,7 +9416,7 @@ Copyright and Licence % % \begin{macro}{\@@_ulem_between_CJK_blocks:nnN} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_between_CJK_blocks:nnN #1#2 +\cs_new_protected:Npn \@@_ulem_between_CJK_blocks:nnN #1#2 { \xeCJK_if_ulem_patch:TF { @@ -9360,7 +9438,7 @@ Copyright and Licence % % \begin{macro}{\@@_ulem_Default_and_FullLeft_glue:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_Default_and_FullLeft_glue:N #1 +\cs_new_protected:Npn \@@_ulem_Default_and_FullLeft_glue:N #1 { \xeCJK_if_ulem_patch:TF { @@ -9376,7 +9454,7 @@ Copyright and Licence % % \begin{macro}{\@@_ulem_Boundary_and_FullLeft_glue:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_Boundary_and_FullLeft_glue:N #1 +\cs_new_protected:Npn \@@_ulem_Boundary_and_FullLeft_glue:N #1 { \xeCJK_if_ulem_patch:TF { @@ -9392,7 +9470,7 @@ Copyright and Licence % % \begin{macro}{\@@_ulem_CJK_and_FullLeft_glue:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_CJK_and_FullLeft_glue:N #1 +\cs_new_protected:Npn \@@_ulem_CJK_and_FullLeft_glue:N #1 { \xeCJK_if_ulem_patch:TF { @@ -9412,7 +9490,7 @@ Copyright and Licence % % \begin{macro}{\@@_ulem_Default_and_FullRight_glue:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_Default_and_FullRight_glue:N #1 +\cs_new_protected:Npn \@@_ulem_Default_and_FullRight_glue:N #1 { \xeCJK_if_ulem_patch:TF { @@ -9436,7 +9514,7 @@ Copyright and Licence % \begin{macro}{\@@_ulem_CJK_and_FullRight_glue:N} % \changes{v3.2.2}{2013/05/30}{修正下划线不能跳过全角右标点的问题。} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_CJK_and_FullRight_glue:N #1 +\cs_new_protected:Npn \@@_ulem_CJK_and_FullRight_glue:N #1 { \xeCJK_if_ulem_patch:TF { @@ -9463,7 +9541,7 @@ Copyright and Licence % % \begin{macro}{\@@_ulem_FullLeft_and_Default:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_FullLeft_and_Default: +\cs_new_protected:Npn \@@_ulem_FullLeft_and_Default: { \xeCJK_if_ulem_patch:TF { @@ -9486,7 +9564,7 @@ Copyright and Licence % % \begin{macro}{\@@_ulem_FullLeft_and_Boundary:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_FullLeft_and_Boundary: +\cs_new_protected:Npn \@@_ulem_FullLeft_and_Boundary: { \xeCJK_if_ulem_patch:TF { @@ -9512,7 +9590,7 @@ Copyright and Licence % \changes{v3.2.3}{2013/06/04} % {修正全角左标点后下划线与 \tn{CJKunderdot} 连用时结果不正常的问题。} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_FullLeft_and_CJK: +\cs_new_protected:Npn \@@_ulem_FullLeft_and_CJK: { \xeCJK_if_ulem_patch:TF { @@ -9527,7 +9605,7 @@ Copyright and Licence % % \begin{macro}{\@@_ulem_FullRight_and_Default:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_FullRight_and_Default: +\cs_new_protected:Npn \@@_ulem_FullRight_and_Default: { \xeCJK_if_ulem_patch:TF { @@ -9545,7 +9623,7 @@ Copyright and Licence % % \begin{macro}{\@@_ulem_FullRight_and_Boundary:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_FullRight_and_Boundary: +\cs_new_protected:Npn \@@_ulem_FullRight_and_Boundary: { \xeCJK_if_ulem_patch:TF { @@ -9564,7 +9642,7 @@ Copyright and Licence % % \begin{macro}{\@@_ulem_FullRight_and_CJK:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_FullRight_and_CJK: +\cs_new_protected:Npn \@@_ulem_FullRight_and_CJK: { \xeCJK_if_ulem_patch:TF { @@ -9585,7 +9663,7 @@ Copyright and Licence % % \begin{macro}{\@@_ulem_punct_hskip:n} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_punct_hskip:n +\cs_new_protected:Npn \@@_ulem_punct_hskip:n { \xeCJK_if_ulem_patch:TF { \xeCJK_ulem_hskip:n } @@ -9596,7 +9674,7 @@ Copyright and Licence % % \begin{macro}{\@@_ulem_punct_breakable_kern:n} % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_punct_breakable_kern:n #1 +\cs_new_protected:Npn \@@_ulem_punct_breakable_kern:n #1 { \xeCJK_if_ulem_patch:TF { @@ -9613,7 +9691,7 @@ Copyright and Licence % \begin{macro}{\@@_ulem_glue:n,\@@_ulem_ccglue:,\@@_ulem_punct_ccglue:} % 在下划线状态下的分别代替 \tn{CJKglue} 等。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_ulem_glue:n #1 +\cs_new_protected:Npn \@@_ulem_glue:n #1 { \xeCJK_if_ulem_patch:TF { @@ -9627,7 +9705,7 @@ Copyright and Licence } { \skip_horizontal:n {#1} } } -\cs_new_protected_nopar:Npn \xeCJK_make_group_tag: +\cs_new_protected:Npn \xeCJK_make_group_tag: { \tl_set:Nx \l_@@_group_tag_tl { \c_@@_group_tag_tl } } \tl_new:N \l_@@_group_tag_tl \tl_const:Nn \c_@@_group_tag_tl @@ -9635,23 +9713,23 @@ Copyright and Licence T \int_use:N \tex_currentgrouptype:D L \int_use:N \tex_currentgrouplevel:D } -\cs_new_protected_nopar:Npn \@@_ulem_ccglue: +\cs_new_protected:Npn \@@_ulem_ccglue: { { \skip_set_eq:NN \UL@skip \l_@@_ccglue_skip \UL@leaders } } -\cs_new_protected_nopar:Npn \@@_ulem_punct_ccglue: +\cs_new_protected:Npn \@@_ulem_punct_ccglue: { \@@_punct_hskip:n { \l_@@_ccglue_skip } } % \end{macrocode} % \end{macro} % % \begin{macro}[int]{\xeCJK_ulem_group_begin:,\xeCJK_ulem_group_end:,\xeCJK_ulem_on:n} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_ulem_group_begin: +\cs_new_protected:Npn \xeCJK_ulem_group_begin: { \mode_leave_vertical: \c_group_begin_token } -\cs_new_protected_nopar:Npn \xeCJK_ulem_group_end: +\cs_new_protected:Npn \xeCJK_ulem_group_end: { \c_group_end_token } -\cs_new_protected_nopar:Npn \xeCJK_ulem_on:n +\cs_new_protected:Npn \xeCJK_ulem_on:n { \ULon } \cs_new_eq:NN \@@_ulem_on:n \UL@on \cs_set_protected:Npn \UL@on #1 @@ -9843,7 +9921,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_fntef_initial:n} % 不支持下划线的嵌套使用。下划线嵌套使用时,里层的下划线会被放在盒子里,不能折行。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_fntef_initial:n +\cs_new_protected:Npn \xeCJK_fntef_initial:n { \bool_if:NTF \l_@@_nest_bool { \@@_warning:n { fntef-nesting } } @@ -10001,20 +10079,10 @@ Copyright and Licence sout / height = 0.35 em , xout / skip = true } -\cs_if_free:NF \color - { - \keys_set:nn { xeCJK / options } - { - underdot / format = \color { red } , - underline / format = \color { blue } , - underdblline / format = \color { blue } , - underwave / format = \color { blue } , - sout / format = \color { red } , - xout / format = \color { blue } - } - } % \end{macrocode} % +% \changes{v3.8.3}{2020/04/07}{取消 \pkg{xeCJKfntef} 的初始彩色设置。} +% % \begin{macro}{\CJKunderanysymbol} % \begin{macrocode} \NewDocumentCommand \CJKunderanysymbol { o m m m } @@ -10044,7 +10112,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_under_symbol:nnnnnn} % 当处在下划线中时,我们先断开下划线,在分组外设置下划符号。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_under_symbol:nnnnnn +\cs_new_protected:Npn \xeCJK_under_symbol:nnnnnn { \xeCJK_if_ulem_patch:TF { \@@_under_symbol_auxi:nnnnnn } @@ -10153,7 +10221,7 @@ Copyright and Licence % \begin{macro}{\@@_under_CJKsymbol:N} % 盒子放在汉字的左侧,比较容易处理状态转移的问题。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_under_CJKsymbol:N +\cs_new_protected:Npn \@@_under_CJKsymbol:N { \box_use:N \l_@@_under_symbol_box \xeCJK_no_break: \@@_under_CJKsymbol:N @@ -10209,7 +10277,7 @@ Copyright and Licence % \pkg{colortbl} 将表格 |c| 列用于填充的 \tn{hfil} 改为了更高阶的 \texttt{fill}, % 影响到了 \env{CJKfilltwosides*}。因此,我们也要用高阶的 \texttt{filll}。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_fntef_hfilll: +\cs_new_protected:Npn \xeCJK_fntef_hfilll: { \skip_horizontal:N \c_@@_filll_skip } \skip_const:Nn \c_@@_filll_skip { \c_zero_dim plus 1 filll } % \end{macrocode} @@ -10266,7 +10334,7 @@ Copyright and Licence % \tn{lst@prebreak} 和 \tn{lst@postbreak} 是在 \tn{discretionary} 中直接输出的, % 应该恢复正常的 \tn{XeTeXinterchartoks}。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_listings_initial_hook: +\cs_new_protected:Npn \@@_listings_initial_hook: { \tex_noindent:D \bool_gset_false:N \g_@@_listings_CM_bool @@ -10290,7 +10358,7 @@ Copyright and Licence % 采用不同的 \tn{XeTeXinterchartoks} 处理方式,输入的时候是将汉字加入到 \pkg{listings} % 的输出队列,实际输出的时候是普通文字。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_listings_toks_hook: +\cs_new_protected:Npn \@@_listings_toks_hook: { \tl_clear:N \l_@@_restore_listings_toks_tl \seq_map_function:NN @@ -10313,7 +10381,7 @@ Copyright and Licence % \begin{macro}{\@@_backup_inter_class_toks:n} % 注意,给 \tn{XeTeXinterchartoks} 赋空值,会导致 \XeTeX 崩溃! % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_backup_inter_class_toks:n #1 +\cs_new_protected:Npn \@@_backup_inter_class_toks:n #1 { \tl_set:Nx \l_@@_tmp_tl { \xeCJK_get_inter_class_toks:nn { Boundary } {#1} } @@ -10334,7 +10402,7 @@ Copyright and Licence % \begin{macro}{\@@_listings_CJK_toks_hook:,\@@_listings_breaklines_toks:} % 根据 \texttt{breaklines} 选项的使用与否,选择不同的处理方式。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_listings_CJK_toks_hook: +\cs_new_protected:Npn \@@_listings_CJK_toks_hook: { \xeCJK_inter_class_toks:nnn { Boundary } { CJK } { \@@_listings_process_CJK:nN { 2 } } @@ -10350,7 +10418,7 @@ Copyright and Licence { \@@_listings_process_CJK:nN { 2 } } } } -\cs_new_protected_nopar:Npn \@@_listings_breaklines_toks: +\cs_new_protected:Npn \@@_listings_breaklines_toks: { \xeCJK_inter_class_toks:nnn { Boundary } { CJK } { \@@_listings_process_breaklines_CJK:nN { 2 } } @@ -10376,7 +10444,7 @@ Copyright and Licence % 七位或八位字符。} % 对于 \tn{charcode} 大于 $255$ 的字符,根据 \tn{catcode} 进行处理。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_listings_process_Default:nN #1#2 +\cs_new_protected:Npn \@@_listings_process_Default:nN #1#2 { \int_compare:nNnTF { \xeCJK_token_value_charcode:N #2 } > \l_@@_listings_max_char_int @@ -10391,7 +10459,7 @@ Copyright and Licence % 输出时,要注意把对应的 \tn{XeTeXinterchartoks} 清空掉,否则会造成死循环。 % \cs{scan_stop:} 是造边界,输出 \cs{group_end:}。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_listings_output_Default:nN #1#2 +\cs_new_protected:Npn \@@_listings_output_Default:nN #1#2 { \group_begin: \xeCJK_clear_inter_class_toks:nn { Boundary } {#1} @@ -10405,7 +10473,7 @@ Copyright and Licence % \begin{macro}{\@@_listings_process_CJK:nN} % 对 CJK 字符类的处理。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_listings_process_CJK:nN #1#2 +\cs_new_protected:Npn \@@_listings_process_CJK:nN #1#2 { \token_if_letter:NTF #2 { \@@_listings_process_letter:nN {#1} #2 } @@ -10419,7 +10487,7 @@ Copyright and Licence % 对 CJK 字符类中的一些半角字符(例如半角日文假名)没有区分开。\pkg{listings} 通过 % 重定义 \tn{lst@Append} 将代码写入外部文件,因此需要保留。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_listings_append:nN #1#2 +\cs_new_protected:Npn \@@_listings_append:nN #1#2 { \int_add:Nn \lst@length { #1 - 1 } \lst@Append #2 @@ -10430,7 +10498,7 @@ Copyright and Licence % \begin{macro}{\@@_listings_process_letter:nN,\@@_listings_process_other:nN} % 在 \texttt{letter} 类中区分汉字和西文字母。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_listings_process_letter:nN +\cs_new_protected:Npn \@@_listings_process_letter:nN { \lst@whitespacefalse \bool_if:NTF \l_@@_listings_letter_bool @@ -10442,7 +10510,7 @@ Copyright and Licence \@@_listings_append:nN } \bool_new:N \l_@@_listings_letter_bool -\cs_new_protected_nopar:Npn \@@_listings_process_other:nN #1#2 +\cs_new_protected:Npn \@@_listings_process_other:nN #1#2 { \lst@whitespacefalse \bool_if:NTF \l_@@_listings_letter_bool @@ -10467,7 +10535,7 @@ Copyright and Licence % 当使用 \texttt{breaklines} 选项时,立即输出之前的单个文字,以便于断行。并将标点 % 与它前/后的 CJK 文字放在同一个盒子中,以保持禁则。但是不能区分 letter 和 other。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_listings_process_breaklines_CJK:nN +\cs_new_protected:Npn \@@_listings_process_breaklines_CJK:nN { \lst@whitespacefalse \bool_if:NTF \l_@@_listings_letter_bool @@ -10482,7 +10550,7 @@ Copyright and Licence \int_set_eq:NN \l_@@_listings_flag_int \c_one_int \@@_listings_append:nN } -\cs_new_protected_nopar:Npn \@@_listings_process_FullLeft:nN #1#2 +\cs_new_protected:Npn \@@_listings_process_FullLeft:nN #1#2 { \lst@whitespacefalse \bool_if:NTF \l_@@_listings_letter_bool @@ -10502,7 +10570,7 @@ Copyright and Licence \int_set:Nn \l_@@_listings_flag_int { 2 } \@@_listings_append:nN {#1} #2 } -\cs_new_protected_nopar:Npn \@@_listings_process_FullRight:nN #1#2 +\cs_new_protected:Npn \@@_listings_process_FullRight:nN #1#2 { \lst@whitespacefalse \bool_if:NTF \l_@@_listings_letter_bool @@ -10524,7 +10592,7 @@ Copyright and Licence % % \begin{macro}[int]{\lst@AppendLetter,\lst@AppendOther} % \begin{macrocode} -\cs_set_protected_nopar:Npn \lst@AppendLetter +\cs_set_protected:Npn \lst@AppendLetter { \bool_if:NTF \l_@@_listings_letter_bool { @@ -10535,7 +10603,7 @@ Copyright and Licence \lst@ifbreaklines \int_zero:N \l_@@_listings_flag_int \fi: \lst@Append } -\cs_set_protected_nopar:Npn \lst@AppendOther +\cs_set_protected:Npn \lst@AppendOther { \bool_if:NTF \l_@@_listings_letter_bool { @@ -10552,7 +10620,7 @@ Copyright and Licence % \begin{macro}{\@@_listings_process_CM:nN} % \texttt{CM} 类作为 \texttt{letter} 处理,不用增加 \tn{lst@length}。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_listings_process_CM:nN +\cs_new_protected:Npn \@@_listings_process_CM:nN { \reverse_if:N \lst@ifflexible \bool_gset_true:N \g_@@_listings_CM_bool @@ -10566,7 +10634,7 @@ Copyright and Licence % 在使用 \texttt{columns=fixed} 选项时,\pkg{listings} 会在输出盒子里的每个字符 % 之间加入 \tn{hss},这就破坏了 \XeTeX 将基本字和组合标识正确的组合起来。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_listings_output_CM: +\cs_new_protected:Npn \@@_listings_output_CM: { \reverse_if:N \lst@ifflexible \bool_if:NT \g_@@_listings_CM_bool @@ -10583,7 +10651,7 @@ Copyright and Licence % % \begin{macro}{\@@_listings_peek_active_loop:TF} % \tn{lstinline} 通过判断参数中第一个字符是否是 \texttt{active} 类来区分 -% 它是否被用在其它宏的参数之中。如果这第一个字符不在 \pkg{listings} 预定义的 +% 它是否被用在其他宏的参数之中。如果这第一个字符不在 \pkg{listings} 预定义的 % 符号表中,判断就会出问题。我们在这里通过一个循环跳过这些字符。 % \begin{macrocode} \cs_new_protected:Npn \@@_listings_peek_active_loop:TF #1#2#3 @@ -10624,7 +10692,7 @@ Copyright and Licence \tl_put_right:No \lst@arg { \l_@@_tmp_tl } } \cs_set_eq:NN \lst@InsideConvert@ \@@_listings_inside_convert:nw -\cs_new_protected_nopar:Npn \@@_listings_inline_group:w +\cs_new_protected:Npn \@@_listings_inline_group:w { \exp_after:wN \@@_listings_inline_group:n \exp_after:wN { \if_int_compare:w `} = \c_zero_int \fi: @@ -10646,7 +10714,7 @@ Copyright and Licence \cs_set:Npn \@@_tmp:w #1 { \group_end: - \cs_new_protected_nopar:Npn \@@_listings_set_escape: + \cs_new_protected:Npn \@@_listings_set_escape: { \xeCJK_swap_cs:NN #1 \@@_listings_escape:N } \cs_new_protected:Npn \@@_listings_escape:N ##1 { \cs_if_eq:NNTF #1 ##1 { \@@_listings_escape:N } {##1} } @@ -10665,7 +10733,7 @@ Copyright and Licence % \begin{macro}{\@@_listings_escape_backslash:} % \tn{catcode} 为 $12$ 的 |\| 需要双写转义。 % \begin{macrocode} -\cs_new_protected_nopar:Npx \@@_listings_escape_backslash: +\cs_new_protected:Npx \@@_listings_escape_backslash: { \tl_replace_all:Nnn \exp_not:N \l_@@_tmp_tl { \c_backslash_str } @@ -10834,12 +10902,12 @@ Copyright and Licence \bool_set_true:N \l_@@_math_as_UTF_text_bool } \@onlypreamble \UseMathAsText -\cs_new_protected_nopar:Npn \@@_declare_math_as_UTF_text:n #1 +\cs_new_protected:Npn \@@_declare_math_as_UTF_text:n #1 { \cs_if_exist:cTF {#1} { \cs_new_eq:cc { keepmathUTF #1 } {#1} - \cs_gset_protected_nopar:cpx {#1} + \cs_gset_protected:cpx {#1} { \exp_not:N \mode_if_math:TF { \exp_not:c { keepmathUTF #1 } } @@ -10848,7 +10916,7 @@ Copyright and Licence \tl_put_right:Nx \l_@@_hyperref_hook_tl { \cs_set_eq:NN \exp_not:c {#1} \exp_not:c { text #1 } } } - { \cs_new_nopar:cpx {#1} { \exp_not:c { text #1 } } } + { \cs_new:cpx {#1} { \exp_not:c { text #1 } } } } \tl_new:N \l_@@_hyperref_hook_tl \AtBeginDocument @@ -10950,20 +11018,20 @@ Copyright and Licence % \begin{macro}{\@@_restore_cmd:N} % 恢复 \tn{hbar} 和 \tn{nobreakspace} 为原本定义。 % \begin{macrocode} -\cs_new_protected_nopar:cpn +\cs_new_protected:cpn { @@_restore_ \tl_to_str:n { \hbar } : } { \@@_restore_cmd:N \hbar } -\cs_new_protected_nopar:cpn +\cs_new_protected:cpn { @@_restore_ \tl_to_str:n { \nobreakspace } : } { \@@_restore_cmd:N \nobreakspace } -\cs_new_protected_nopar:Npn \@@_restore_cmd:N #1 +\cs_new_protected:Npn \@@_restore_cmd:N #1 { \@@_restore_cmd:Nx #1 { ? - \token_to_str:N #1 } } -\cs_new_protected_nopar:Npn \@@_restore_cmd:Nn #1#2 +\cs_new_protected:Npn \@@_restore_cmd:Nn #1#2 { \cs_if_free:cF {#2} { \@@_restore_cmd:Nc #1 {#2} } } -\cs_new_protected_nopar:Npn \@@_restore_cmd:NN #1#2 +\cs_new_protected:Npn \@@_restore_cmd:NN #1#2 { \cs_gset_eq:NN #1 #2 \cs_undefine:N #2 @@ -11059,7 +11127,7 @@ Copyright and Licence % \begin{macro}{\@@_check_slot:n} % \pkg{xunicode} 中使用的 Unicode 格式是诸如 |x0022| 的形式,这就需要一些转换。 % \begin{macrocode} -\cs_new_nopar:Npn \@@_check_slot:n #1 +\cs_new:Npn \@@_check_slot:n #1 { \int_eval:n { @@ -11455,7 +11523,7 @@ Copyright and Licence % \end{macro} % % \begin{macro}{\@@_add_double_symbol:nN} -% 如果参数的第一个记号是字母类、其它符号类或者由 \tn{chardef} 定义,则将组合符号 +% 如果参数的第一个记号是字母类、其他符号类或者由 \tn{chardef} 定义,则将组合符号 % 放在它的右边,否则不作处理。 % \begin{macrocode} \cs_new_protected:Npn \@@_add_double_symbol:nN #1#2 @@ -11515,17 +11583,17 @@ Copyright and Licence % % \begin{macro}[int]{\xunadd_set_begin_hook:n,\xunadd_set_end_hook:n} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xunadd_set_begin_hook:n +\cs_new_protected:Npn \xunadd_set_begin_hook:n { \tl_set:Nn \l_@@_begin_hook_tl } -\cs_new_protected_nopar:Npn \xunadd_append_begin_hook:n +\cs_new_protected:Npn \xunadd_append_begin_hook:n { \tl_put_right:Nn \l_@@_begin_hook_tl } -\cs_new_protected_nopar:Npn \xunadd_set_end_hook:n +\cs_new_protected:Npn \xunadd_set_end_hook:n { \tl_set:Nn \l_@@_end_hook_tl } -\cs_new_protected_nopar:Npn \xunadd_append_end_hook:n +\cs_new_protected:Npn \xunadd_append_end_hook:n { \tl_put_right:Nn \l_@@_end_hook_tl } -\cs_new_protected_nopar:Npn \xunadd_set_begin_hook:nn +\cs_new_protected:Npn \xunadd_set_begin_hook:nn { \@@_set_cmd_hook:nnn { begin } } -\cs_new_protected_nopar:Npn \xunadd_set_end_hook:nn +\cs_new_protected:Npn \xunadd_set_end_hook:nn { \@@_set_cmd_hook:nnn { end } } \cs_new_protected:Npn \@@_set_cmd_hook:nnn #1#2#3 { @@ -11539,8 +11607,8 @@ Copyright and Licence } \cs_new:Npn \@@_set_cmd_hook_aux:Nnwn #1#2 \q_stop #3 { \use:c { @@_#3_csname:n } { \token_to_str:N #1 - \tl_to_str:n {#2} } } -\cs_new_nopar:Npn \@@_begin_csname:n #1 { @@_begin_#1_hook:n } -\cs_new_nopar:Npn \@@_end_csname:n #1 { @@_end_#1_hook:n } +\cs_new:Npn \@@_begin_csname:n #1 { @@_begin_#1_hook:n } +\cs_new:Npn \@@_end_csname:n #1 { @@_end_#1_hook:n } \tl_new:N \l_@@_begin_hook_tl \tl_new:N \l_@@_end_hook_tl % \end{macrocode} @@ -11651,7 +11719,7 @@ Copyright and Licence % \begin{macro}[int]{\xunadd@microtype@is@charx} % \pkg{microtype} 宏包中使用的函数,我们通过对 \tn{MT@is@charx} 打补丁来实现功能。 % \begin{macrocode} -\cs_new_protected:Npn \xunadd@microtype@is@charx #1 \relax +\cs_new_protected_nopar:Npn \xunadd@microtype@is@charx #1 \relax { \use:x { \xunadd_get_slot:nn { \MT@encoding } { \tex_the:D \MT@toks } } @@ -11662,7 +11730,7 @@ Copyright and Licence \bool_if:NT \l_xunadd_rest_bool { \MT@norestfalse } } } -\AtBeginDocument +\cs_new_protected_nopar:Npn \xunadd@microtype@hook { \cs_if_free:NF \MT@is@charx { @@ -11671,6 +11739,9 @@ Copyright and Licence \cs_set_eq:NN \MT@warn@unknown@once \use_none:n } } +\@ifpackageloaded { microtype } + { \use:n } { \AtBeginDocument } + { \xunadd@microtype@hook } % \end{macrocode} % \end{macro} % @@ -13801,7 +13872,7 @@ int main() [ #1 , Color = \test_color:n {#1} , BoldFont = SimHei ] { SimSun } \setCJKmonofont [ #1 ] { KaiTi } } -\cs_new_protected_nopar:Npn \TEST +\cs_new_protected:Npn \TEST { \exp_args:No \path { \c_test_text_tl } \par \c_test_text_tl \par @@ -13847,7 +13918,7 @@ int main() \makeatletter \ExplSyntaxOn -\cs_new_protected_nopar:Npx \@@_restore_catcode: +\cs_new_protected:Npx \@@_restore_catcode: { \char_set_catcode:nn { 0 } { \char_value_catcode:n { 0 } } } \file_if_exist:nTF { xunicode-commands.tex } { \char_set_catcode_comment:n { 0 } } @@ -13860,7 +13931,7 @@ int main() ^^@ \prop_new:N \l_@@_command_prop ^^@ \prop_new:N \l_@@_combine_mark_prop ^^@ \prop_new:N \l_@@_combine_marks_prop -^^@ \cs_new_protected_nopar:Npn \SaveUTFCommands +^^@ \cs_new_protected:Npn \SaveUTFCommands ^^@ { ^^@ \group_begin: ^^@ \@@_restore_catcode: @@ -13980,7 +14051,7 @@ int main() \int_gincr:N \g_@@_table_int \exp_args:Nx \@@_make_table:nnn { UTFTABLE - \int_use:N \g_@@_table_int } {#1} {#2} } -\cs_new_protected_nopar:Npn \@@_make_table:nnn #1#2#3 +\cs_new_protected:Npn \@@_make_table:nnn #1#2#3 { \section{#2~(\zref@extractdefault{#1}{default}{0})} \zref@refused{#1} diff --git a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins new file mode 100644 index 00000000000..8a4ca99f422 --- /dev/null +++ b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins @@ -0,0 +1,160 @@ +%% +%% This is file `xeCJK.ins', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xeCJK.dtx (with options: `install') +%% +%% Copyright (C) 2007--2010 by Wenchang Sun +%% Copyright (C) 2009--2020 by Leo Liu +%% Copyright (C) 2012--2020 by Qing Lee +%% ---------------------------------------------------------------------- +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainers of this work are Leo Liu and Qing Lee. +%% +%% ---------------------------------------------------------------------- +%% + +\input ctxdocstrip % + +\preamble + + Copyright (C) 2007--2010 by Wenchang Sun + Copyright (C) 2009--2020 by Leo Liu + Copyright (C) 2012--2020 by Qing Lee +---------------------------------------------------------------------- + + This work may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either + version 1.3c of this license or (at your option) any later + version. This version of this license is in + http://www.latex-project.org/lppl/lppl-1-3c.txt + and the latest version of this license is in + http://www.latex-project.org/lppl.txt + and version 1.3 or later is part of all distributions of + LaTeX version 2005/12/01 or later. + + This work has the LPPL maintenance status "maintained". + + The Current Maintainers of this work are Leo Liu and Qing Lee. + +---------------------------------------------------------------------- + +\endpreamble +\postamble + + This package consists of the files xeCJK.dtx, + full-stop.map, + fullwidth-stop.map, + han-simp.map, + han-trad.map, + and the derived files xeCJK.pdf, + xeCJK.sty, + xeCJK.cfg, + xeCJK.ins, + xeCJKfntef.sty, + xeCJK-listings.sty, + xunicode-addon.sty, + xunicode-extra.def, + xeCJK-example-autofake.tex, + xeCJK-example-fallback.tex, + xeCJK-example-subCJKblock.tex, + xeCJK-example-CJKecglue.tex, + xeCJK-example-checksingle.tex, + xeCJK-example-CJKfntef.tex, + xeCJK-example-punctstyle.tex, + xeCJK-example-verbatim.tex, + xeCJK-example-CM.tex, + xeCJK-example-listings.tex, + xeCJK-example-mathblock.tex, + xunicode-symbols.tex, + xunicode-commands.tex, + xunicode-combine-marks.tex, + xunicode-symbols.pdf, + full-stop.tec, + fullwidth-stop.tec, + han-simp.tec, + han-trad.tec, and + README.md. +\endpostamble + +\generate + { + \usedir{tex/xelatex/xecjk} + \file{xeCJK.sty} {\from{\jobname.dtx}{package}} + \file{xeCJKfntef.sty} {\from{\jobname.dtx}{fntef}} + \file{xeCJK-listings.sty} {\from{\jobname.dtx}{listings}} + \file{xunicode-addon.sty} {\from{\jobname.dtx}{xunicode}} + \file{xunicode-extra.def} {\from{\jobname.dtx}{xunextra}} + \usepreamble\emptypreamble + \usepostamble\emptypostamble + \usedir{tex/xelatex/xecjk/config} + \file{xeCJK.cfg} {\from{\jobname.dtx}{config}} + \usedir{doc/xelatex/xecjk/example} + \file{xeCJK-example-autofake.tex} {\from{\jobname.dtx}{ex-autofake}} + \file{xeCJK-example-fallback.tex} {\from{\jobname.dtx}{ex-fallback}} + \file{xeCJK-example-subCJKblock.tex} {\from{\jobname.dtx}{ex-block}} + \file{xeCJK-example-CJKecglue.tex} {\from{\jobname.dtx}{ex-ecglue}} + \file{xeCJK-example-checksingle.tex} {\from{\jobname.dtx}{ex-single}} + \file{xeCJK-example-CJKfntef.tex} {\from{\jobname.dtx}{ex-fntef}} + \file{xeCJK-example-punctstyle.tex} {\from{\jobname.dtx}{ex-punctstyle}} + \file{xeCJK-example-verbatim.tex} {\from{\jobname.dtx}{ex-verb}} + \file{xeCJK-example-CM.tex} {\from{\jobname.dtx}{ex-cm}} + \file{xeCJK-example-listings.tex} {\from{\jobname.dtx}{ex-listings}} + \file{xeCJK-example-mathblock.tex} {\from{\jobname.dtx}{ex-mathblock}} + \file{xunicode-symbols.tex} {\from{\jobname.dtx}{xunicode-symbols}} + \nopreamble\nopostamble + \usedir{doc/xelatex/xecjk} + \file{README.md} {\from{\jobname.dtx}{readme}} + } + +\endbatchfile +%% +%% This package consists of the files xeCJK.dtx, +%% full-stop.map, +%% fullwidth-stop.map, +%% han-simp.map, +%% han-trad.map, +%% and the derived files xeCJK.pdf, +%% xeCJK.sty, +%% xeCJK.cfg, +%% xeCJK.ins, +%% xeCJKfntef.sty, +%% xeCJK-listings.sty, +%% xunicode-addon.sty, +%% xunicode-extra.def, +%% xeCJK-example-autofake.tex, +%% xeCJK-example-fallback.tex, +%% xeCJK-example-subCJKblock.tex, +%% xeCJK-example-CJKecglue.tex, +%% xeCJK-example-checksingle.tex, +%% xeCJK-example-CJKfntef.tex, +%% xeCJK-example-punctstyle.tex, +%% xeCJK-example-verbatim.tex, +%% xeCJK-example-CM.tex, +%% xeCJK-example-listings.tex, +%% xeCJK-example-mathblock.tex, +%% xunicode-symbols.tex, +%% xunicode-commands.tex, +%% xunicode-combine-marks.tex, +%% xunicode-symbols.pdf, +%% full-stop.tec, +%% fullwidth-stop.tec, +%% han-simp.tec, +%% han-trad.tec, and +%% README.md. +%% +%% End of file `xeCJK.ins'. -- cgit v1.2.3