summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-05-01 21:29:24 +0000
committerKarl Berry <karl@freefriends.org>2020-05-01 21:29:24 +0000
commite82dc2952cd2f17091b636be166cf6d74c1527f5 (patch)
tree1260ed737c85e0fbf54c6511dfa6b9efd9a32581 /Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
parenteff1c7554f6af49ce3d63fff7f6fa810490214a9 (diff)
xecjk (1may20)
git-svn-id: svn://tug.org/texlive/trunk@54961 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty')
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty807
1 files changed, 417 insertions, 390 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
index ebe14f52b9a..6b75e14ae19 100644
--- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
+++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
@@ -21,7 +21,7 @@
%% 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.
%%
@@ -29,10 +29,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: xeCJK.dtx 165cecc 2020-02-18 20:38:34 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: xeCJK.dtx b971c22 2020-05-01 21:10:43 +0800 Qing Lee <sobenlee@gmail.com> $
{Typesetting CJK scripts with XeLaTeX}
\ProvidesExplPackage{\ExplFileName}
- {\ExplFileDate}{3.8.2}{\ExplFileDescription}
+ {\ExplFileDate}{3.8.3}{\ExplFileDescription}
\msg_new:nnn { xeCJK } { Require-XeTeX }
{
The~xeCJK~package~requires~XeTeX~to~function.\\\\
@@ -87,51 +87,44 @@
\bool_new:N \l__xeCJK_tmp_bool
\skip_new:N \l__xeCJK_tmp_skip
\clist_new:N \l__xeCJK_tmp_clist
-\cs_new_protected_nopar:Npn \__xeCJK_msg_new:nn { \msg_new:nnn { xeCJK } }
-\cs_new_protected_nopar:Npn \__xeCJK_msg_new:nnn { \msg_new:nnnn { xeCJK } }
-\cs_new_protected_nopar:Npn \__xeCJK_error:n { \msg_error:nn { xeCJK } }
-\cs_new_protected_nopar:Npn \__xeCJK_error:nx { \msg_error:nnx { xeCJK } }
-\cs_new_protected_nopar:Npn \__xeCJK_warning:n { \msg_warning:nn { xeCJK } }
-\cs_new_protected_nopar:Npn \__xeCJK_warning:nx { \msg_warning:nnx { xeCJK } }
-\cs_new_protected_nopar:Npn \__xeCJK_warning:nxx { \msg_warning:nnxx { xeCJK } }
-\cs_new_protected_nopar:Npn \__xeCJK_warning:nxxx { \msg_warning:nnxxx { xeCJK } }
-\cs_new_protected_nopar:Npn \__xeCJK_info:nxx { \msg_info:nnxx { xeCJK } }
-\cs_new_protected_nopar:Npn \xeCJK_allow_break:
+\cs_new_protected:Npn \__xeCJK_msg_new:nn { \msg_new:nnn { xeCJK } }
+\cs_new_protected:Npn \__xeCJK_msg_new:nnn { \msg_new:nnnn { xeCJK } }
+\cs_new_protected:Npn \__xeCJK_error:n { \msg_error:nn { xeCJK } }
+\cs_new_protected:Npn \__xeCJK_error:nx { \msg_error:nnx { xeCJK } }
+\cs_new_protected:Npn \__xeCJK_warning:n { \msg_warning:nn { xeCJK } }
+\cs_new_protected:Npn \__xeCJK_warning:nx { \msg_warning:nnx { xeCJK } }
+\cs_new_protected:Npn \__xeCJK_warning:nxx { \msg_warning:nnxx { xeCJK } }
+\cs_new_protected:Npn \__xeCJK_warning:nxxx { \msg_warning:nnxxx { xeCJK } }
+\cs_new_protected:Npn \__xeCJK_info:nxx { \msg_info:nnxx { xeCJK } }
+\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__xeCJK_nobreak_penalty_int }
\int_const:Nn \c__xeCJK_nobreak_penalty_int { 10 000 }
+\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__xeCJK_after_preamble_hook_tl }
+\cs_new_protected:Npn \xeCJK@document@left@hook
+ { \tl_use:N \g__xeCJK_at_end_preamble_hook_tl }
+\cs_new_protected:Npn \xeCJK@document@right@hook
+ { \tl_use:N \g__xeCJK_after_end_preamble_hook_tl }
+\cs_new_protected:Npn \__xeCJK_at_end_preamble:n
+ { \tl_gput_right:Nn \g__xeCJK_at_end_preamble_hook_tl }
+\cs_new_protected:Npn \__xeCJK_after_preamble:n
+ { \tl_gput_right:Nn \g__xeCJK_after_preamble_hook_tl }
+\cs_new_protected:Npn \__xeCJK_after_end_preamble:n
+ { \tl_gput_right:Nn \g__xeCJK_after_end_preamble_hook_tl }
+\cs_new_protected:Npn \__xeCJK_package_hook:nn
+ { \ctex_at_end_package:nn }
\tl_new:N \g__xeCJK_at_end_preamble_hook_tl
\tl_new:N \g__xeCJK_after_preamble_hook_tl
\tl_new:N \g__xeCJK_after_end_preamble_hook_tl
-\cs_new_protected:Npn \__xeCJK_at_end_preamble:n #1
- { \tl_gput_right:Nn \g__xeCJK_at_end_preamble_hook_tl {#1} }
-\cs_new_protected:Npn \__xeCJK_after_preamble:n #1
- { \tl_gput_right:Nn \g__xeCJK_after_preamble_hook_tl {#1} }
-\cs_new_protected:Npn \__xeCJK_after_end_preamble:n #1
- { \tl_gput_right:Nn \g__xeCJK_after_end_preamble_hook_tl {#1} }
-\xeCJK_if_package_loaded:nTF { etoolbox }
- {
- \AtEndPreamble { \g__xeCJK_at_end_preamble_hook_tl }
- \AfterPreamble { \g__xeCJK_after_preamble_hook_tl }
- \AfterEndPreamble { \g__xeCJK_after_end_preamble_hook_tl }
- }
- {
- \AtBeginDocument { \g__xeCJK_after_preamble_hook_tl }
- \cs_new_protected_nopar:Npn \xeCJK@document@left@hook
- { \group_end: \g__xeCJK_at_end_preamble_hook_tl \group_begin: }
- \cs_new_protected_nopar:Npn \xeCJK@document@right@hook
- { \scan_stop: \g__xeCJK_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
- }
- }
\__xeCJK_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
@@ -151,7 +144,7 @@
{ \tl_put_right:Nn \l__xeCJK_shipout_hook_tl }
\tl_new:N \l__xeCJK_shipout_hook_tl
\bool_new:N \l__xeCJK_shipout_hook_bool
-\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
{
@@ -180,7 +173,7 @@
\cs_set_eq:NN #2 \__xeCJK_swap_cs_aux:w
\cs_undefine:N \__xeCJK_swap_cs_aux:w
}
-\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 }
\prg_new_conditional:Npnn \xeCJK_glyph_if_exist:N #1 { p , T , F , TF }
@@ -241,7 +234,7 @@
}
}
}
-\cs_new_nopar:Npn \__xeCJK_space_skip_scale:nnn #1#2#3
+\cs_new:Npn \__xeCJK_space_skip_scale:nnn #1#2#3
{
\dim_eval:n {#1}
plus \fp_eval:n { \g__xeCJK_space_factor_int / 1000 } #2
@@ -250,8 +243,10 @@
{ 1000 * \int_value:w #3 } { \g__xeCJK_space_factor_int } sp
}
\int_new:N \g__xeCJK_space_factor_int
-\int_gset:Nn \g__xeCJK_space_factor_int { 1000 }
-\cs_new_protected_nopar:Npn \xeCJK_glue_to_skip:nN #1#2
+\cs_new_protected:Npn \xeCJK_reset_space_factor:
+ { \int_gset:Nn \g__xeCJK_space_factor_int { 1000 } }
+\xeCJK_reset_space_factor:
+\cs_new_protected:Npn \xeCJK_glue_to_skip:nN #1#2
{
\group_begin:
\hbox_set:Nw \l__xeCJK_tmp_box #1 \scan_stop:
@@ -296,7 +291,7 @@
\group_align_safe_begin:
\peek_after:Nw \__xeCJK_peek_catcode_ignore_spaces_branches:w
}
-\cs_new_protected_nopar:Npn \__xeCJK_peek_catcode_ignore_spaces_branches:w
+\cs_new_protected:Npn \__xeCJK_peek_catcode_ignore_spaces_branches:w
{
\if_meaning:w \l_peek_token \c_space_token
\bool_set_true:N \l__xeCJK_peek_ignore_spaces_bool
@@ -318,22 +313,22 @@
\cs_new_eq:NN \__xeCJK_peek_catcode_true:w \prg_do_nothing:
\cs_new_eq:NN \__xeCJK_peek_catcode_false:w \prg_do_nothing:
\bool_new:N \l__xeCJK_peek_ignore_spaces_bool
-\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 }
-\cs_new_nopar:Npn \xeCJK_token_value_charcode:N #1
+\cs_new:Npn \xeCJK_token_value_charcode:N #1
{ \exp_after:wN \__xeCJK_get_charcode:w \token_to_meaning:N #1 \q_stop }
\group_begin:
\cs_set:Npn \__xeCJK_tmp:w #1 ~ #2 ~ #3#4#5 \q_stop
{
\tl_if_empty:nTF { #4#5 }
{
- \cs_new_nopar:Npn \__xeCJK_get_charcode:w ##1 ~ ##2 ~ ##3 \q_stop
+ \cs_new:Npn \__xeCJK_get_charcode:w ##1 ~ ##2 ~ ##3 \q_stop
{ \int_eval:n { `##3 } }
}
{
\tl_if_empty:nTF {#5}
{
- \cs_new_nopar:Npn \__xeCJK_get_charcode:w ##1 ~ ##2 ~ ##3##4 \q_stop
+ \cs_new:Npn \__xeCJK_get_charcode:w ##1 ~ ##2 ~ ##3##4 \q_stop
{
\int_eval:n
{
@@ -344,7 +339,7 @@
}
}
{
- \cs_new_nopar:Npn \__xeCJK_get_charcode:w ##1 ~ ##2 ~ ##3##4 \q_stop
+ \cs_new:Npn \__xeCJK_get_charcode:w ##1 ~ ##2 ~ ##3##4 \q_stop
{ \int_eval:n { \tl_if_empty:nTF { ##4 } { `##3 } { "20000 } } }
}
}
@@ -358,7 +353,7 @@
\cs_end:
\prg_return_true: \else: \prg_return_false: \fi:
}
-\cs_new_nopar:Npn \__xeCJK_CJK_class_tl:n #1
+\cs_new:Npn \__xeCJK_CJK_class_tl:n #1
{ c__xeCJK_CJK_class_ \int_eval:n {#1} _tl }
\prg_new_conditional:Npnn \xeCJK_if_same_class:NN #1#2 { p , T , F , TF }
{
@@ -366,7 +361,7 @@
\xeCJK_token_value_class:N #2 \exp_stop_f:
\prg_return_true: \else: \prg_return_false: \fi:
}
-\cs_new_protected_nopar:Npn \xeCJK_make_boundary:
+\cs_new_protected:Npn \xeCJK_make_boundary:
{ \bool_if:NT \l__xeCJK_CJK_group_bool { \scan_stop: } }
\keys_define:nn { xeCJK / options }
{
@@ -382,7 +377,7 @@
\char_set_catcode_ignore:n { "FEFF }
\seq_new:N \g__xeCJK_class_seq
\seq_new:N \g__xeCJK_new_class_seq
-\cs_new_protected_nopar:Npn \xeCJK_new_class:n #1
+\cs_new_protected:Npn \xeCJK_new_class:n #1
{
\int_if_exist:cTF { \__xeCJK_class_csname:n {#1} }
{ \__xeCJK_error:nx { class-already-defined } {#1} }
@@ -395,7 +390,7 @@
{ \__xeCJK_class_csname:n {#1} }
}
}
-\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 { \__xeCJK_class_csname:n {#1} }
{ \__xeCJK_error:nx { class-already-defined } {#1} }
@@ -405,7 +400,7 @@
\seq_gput_right:Nn \g__xeCJK_class_seq {#1}
}
}
-\cs_new_nopar:Npn \__xeCJK_class_csname:n #1 { c__xeCJK_#1_class_int }
+\cs_new:Npn \__xeCJK_class_csname:n #1 { c__xeCJK_#1_class_int }
\cs_new_eq:cN { \__xeCJK_class_csname:n { Others } } \l__xeCJK_tmp_int
\__xeCJK_msg_new:nn { class-already-defined }
{
@@ -505,6 +500,7 @@
}
\clist_const:Nn \c__xeCJK_CJK_chars_clist
{
+ "02EA -> "02EB ,
"2E80 -> "2EFF ,
"2F00 -> "2FDF ,
"2FF0 -> "2FFF ,
@@ -532,6 +528,8 @@
"16FE0 -> "16FFF ,
"17000 -> "187FF ,
"18800 -> "18AFF ,
+ "18B00 -> "18CFF ,
+ "18D00 -> "18D8F ,
"1B000 -> "1B0FF ,
"1B100 -> "1B12F ,
"1B130 -> "1B16F ,
@@ -541,7 +539,8 @@
"2B740 -> "2B81F ,
"2B820 -> "2CEAF ,
"2CEB0 -> "2EBEF ,
- "2F800 -> "2FA1F
+ "2F800 -> "2FA1F ,
+ "30000 -> "3134F
}
\clist_const:Nn \c__xeCJK_CM_chars_clist
{
@@ -556,19 +555,19 @@
"A960 -> "A97F ,
"D7B0 -> "D7FF
}
-\cs_new_nopar:Npn \xeCJK_class_num:n #1
+\cs_new:Npn \xeCJK_class_num:n #1
{ \use:c { \__xeCJK_class_csname:n {#1} } }
\NewDocumentCommand \xeCJKDeclareCharClass { s > { \TrimSpaces } m m }
{
\xeCJK_declare_char_class:nn {#2} {#3}
\IfBooleanT {#1} { \xeCJKResetPunctClass }
}
-\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__xeCJK_tmp_clist {#2}
\xeCJK_declare_char_class:nN {#1} \l__xeCJK_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__xeCJK_#1_range_clist } { g__xeCJK_#1_range_clist } #2
@@ -585,7 +584,7 @@
\NewDocumentCommand \__xeCJK_set_char_class_aux:Nnw
{ m > { \SplitArgument { 1 } { -> } } m } { #1 #2 }
\cs_generate_variant:Nn \clist_gconcat:NNN { cc }
-\cs_new_protected_nopar:Npn \__xeCJK_check_num_range:nnNN #1#2#3#4
+\cs_new_protected:Npn \__xeCJK_check_num_range:nnNN #1#2#3#4
{
\bool_lazy_or:nnTF
{ \xeCJK_if_blank_x_p:n {#1} }
@@ -609,7 +608,7 @@
\int_incr:N \l__xeCJK_begin_int
}
}
-\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
{
\__xeCJK_check_num_range:nnNN {#1} {#2} \l__xeCJK_begin_int \l__xeCJK_end_int
\int_set:Nn \l__xeCJK_tmp_int {#3}
@@ -619,7 +618,7 @@
\int_incr:N \l__xeCJK_begin_int
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_set_char_class_eq:nn #1#2
+\cs_new_protected:Npn \__xeCJK_set_char_class_eq:nn #1#2
{
\int_set:Nn \l__xeCJK_tmp_int { \xeCJK_class_num:n {#2} }
\clist_map_inline:cn { c__xeCJK_#1_chars_clist }
@@ -654,32 +653,32 @@
\xeCJKResetPunctClass
}
\xeCJKResetCharClass
-\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}
}
\cs_generate_variant:Nn \xeCJK_inter_class_toks:nnn { nnx }
-\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}
}
-\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: } }
-\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} }
}
\cs_generate_variant:Nn \xeCJK_pre_inter_class_toks:nnn { nnx }
-\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} }
}
\cs_generate_variant:Nn \xeCJK_app_inter_class_toks:nnn { nnx }
-\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__xeCJK_tmp_tl
{ \xeCJK_get_inter_class_toks:nn {#3} {#4} }
@@ -692,7 +691,7 @@
}
{ \xeCJK_inter_class_toks:nnx {#1} {#2} { \exp_not:o \l__xeCJK_tmp_tl } }
}
-\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__xeCJK_tmp_tl
{ \xeCJK_get_inter_class_toks:nn {#1} {#2} }
@@ -703,11 +702,11 @@
{ \exp_not:o \l__xeCJK_tmp_tl }
}
}
-\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 \__xeCJK_update_clear_toks:n #1
+\cs_new_protected:Npn \__xeCJK_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
@@ -721,7 +720,7 @@
\seq_gset_from_clist:Nn \g__xeCJK_non_CJK_class_seq
{ Default , HalfLeft , HalfRight , NormalSpace , Boundary }
\seq_new:N \g__xeCJK_CJK_class_seq
-\cs_new_protected_nopar:Npn \__xeCJK_save_CJK_class:n #1
+\cs_new_protected:Npn \__xeCJK_save_CJK_class:n #1
{
\seq_gput_right:Nn \g__xeCJK_CJK_class_seq {#1}
\tl_const:cn
@@ -731,11 +730,11 @@
}
\clist_map_function:nN
{ CJK , FullLeft , FullRight , CM , HangulJamo } \__xeCJK_save_CJK_class:n
-\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__xeCJK_CJK_group_bool
- \int_gset:Nn \g__xeCJK_space_factor_int { 1000 }
+ \xeCJK_reset_space_factor:
\int_zero:N \tex_XeTeXdashbreakstate:D
}
\bool_new:N \l__xeCJK_CJK_group_bool
@@ -783,15 +782,15 @@
\xeCJK_app_inter_class_toks:nnn { CJK } {#1}
{ \CJKecglue }
}
-\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 \__xeCJK_check_for_xecglue:
+\cs_new_protected:Npn \__xeCJK_check_for_xecglue:
{
\int_compare:nNnTF \tex_lastnodetype:D = { 11 }
{ \__xeCJK_replace_space: }
{ \__xeCJK_check_for_ecglue: }
}
-\cs_new_protected_nopar:Npn \__xeCJK_check_for_ecglue:
+\cs_new_protected:Npn \__xeCJK_check_for_ecglue:
{
\xeCJK_if_last_node:nTF { CJK }
{ \use_i:nn }
@@ -803,7 +802,7 @@
}
}
\cs_new_eq:NN \xeCJK_check_for_ecglue: \__xeCJK_check_for_ecglue:
-\cs_new_protected_nopar:Npn \__xeCJK_replace_space:
+\cs_new_protected:Npn \__xeCJK_replace_space:
{
\skip_set_eq:NN \l__xeCJK_last_skip \tex_lastskip:D
\tex_unskip:D
@@ -842,15 +841,15 @@
}
\xeCJK_inter_class_toks:nnn { Boundary } { NormalSpace }
{ \xeCJK_Boundary_and_NormalSp: }
-\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 \__xeCJK_check_for_xecglue_normalsp:
+\cs_new_protected:Npn \__xeCJK_check_for_xecglue_normalsp:
{
\int_compare:nNnTF \tex_lastnodetype:D = { 11 }
{ \__xeCJK_replace_space: }
{ \__xeCJK_check_for_ecglue_normalsp: }
}
-\cs_new_protected_nopar:Npn \__xeCJK_check_for_ecglue_normalsp:
+\cs_new_protected:Npn \__xeCJK_check_for_ecglue_normalsp:
{
\xeCJK_if_last_node:nT { CJK-space }
{ \xeCJK_remove_node: \xeCJK_space_or_xecglue: }
@@ -879,7 +878,7 @@
\xeCJK_select_font:
\CJKsymbol
}
-\cs_new_protected_nopar:Npn \xeCJK_check_for_glue:
+\cs_new_protected:Npn \xeCJK_check_for_glue:
{
\int_compare:nNnTF \tex_lastnodetype:D = { 12 }
{ \__xeCJK_check_for_glue_auxi: }
@@ -889,7 +888,7 @@
{ \__xeCJK_check_for_glue_auxii: }
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_check_for_glue_auxi:
+\cs_new_protected:Npn \__xeCJK_check_for_glue_auxi:
{
\dim_case:nn { \tex_lastkern:D }
{
@@ -903,13 +902,13 @@
{ \xeCJK_remove_node: \CJKecglue }
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_check_for_glue_auxii:
+\cs_new_protected:Npn \__xeCJK_check_for_glue_auxii:
{
\xeCJK_if_last_punct:TF
{ \__xeCJK_check_for_glue_auxiii: }
{ \xeCJK_check_for_xglue: }
}
-\cs_new_protected_nopar:Npn \__xeCJK_check_for_glue_auxiii:
+\cs_new_protected:Npn \__xeCJK_check_for_glue_auxiii:
{
\bool_if:NT \l__xeCJK_last_penalty_bool
{ \tex_penalty:D \l__xeCJK_last_penalty_int }
@@ -917,7 +916,7 @@
\tl_if_eq:NNF \l__xeCJK_aligni_tl \c__xeCJK_left_tl { \CJKglue }
}
\cs_new_eq:NN \xeCJK_check_for_xglue: \prg_do_nothing:
-\cs_new_protected_nopar:Npn \__xeCJK_check_for_xglue:
+\cs_new_protected:Npn \__xeCJK_check_for_xglue:
{
\int_compare:nNnT \tex_lastnodetype:D = { 11 }
{
@@ -932,7 +931,7 @@
}
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_check_for_xglue_aux:
+\cs_new_protected:Npn \__xeCJK_check_for_xglue_aux:
{
\skip_if_eq:nnTF
{ \l__xeCJK_last_skip }
@@ -952,14 +951,14 @@
}
{ \skip_horizontal:N \l__xeCJK_last_skip }
}
-\cs_new_protected_nopar:Npn \__xeCJK_ccglue_or_space:
+\cs_new_protected:Npn \__xeCJK_ccglue_or_space:
{ \CJKglue }
\prg_new_conditional:Npnn \xeCJK_if_last_node:n #1 { p , T , F , TF }
{
\if_dim:w \use:c { c__xeCJK_#1_node_dim } = \tex_lastkern:D
\prg_return_true: \else: \prg_return_false: \fi:
}
-\cs_new_protected_nopar:Npn \xeCJK_declare_node:n #1
+\cs_new_protected:Npn \xeCJK_declare_node:n #1
{
\int_gincr:N \g__xeCJK_node_int
\dim_if_exist:cTF { c__xeCJK_#1_node_dim }
@@ -968,16 +967,16 @@
}
\int_new:N \g__xeCJK_node_int
\int_gset:Nn \g__xeCJK_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 \__xeCJK_make_node:N { c__xeCJK_#1_node_dim } }
-\cs_new_nopar:Npn \__xeCJK_node:n #1
+\cs_new:Npn \__xeCJK_node:n #1
{ \use:c { c__xeCJK_#1_node_dim } }
-\cs_new_protected_nopar:Npn \__xeCJK_make_node:N #1
+\cs_new_protected:Npn \__xeCJK_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 }
@@ -989,7 +988,7 @@
{
CJKglue .code:n =
{
- \cs_set_protected_nopar:Npn \CJKglue {#1}
+ \cs_set_protected:Npn \CJKglue {#1}
\xeCJK_glue_to_skip:nN {#1} \l__xeCJK_ccglue_skip
}
}
@@ -998,7 +997,7 @@
{
CJKecglue .code:n =
{
- \cs_set_protected_nopar:Npn \CJKecglue {#1}
+ \cs_set_protected:Npn \CJKecglue {#1}
\xeCJK_glue_to_skip:nN {#1} \l__xeCJK_ecglue_skip
} ,
xCJKecglue .choice: ,
@@ -1025,7 +1024,7 @@
xCJKecglue / unknown .code:n =
{
\bool_set_true:N \l__xeCJK_xecglue_bool
- \cs_set_protected_nopar:Npn \CJKecglue {#1}
+ \cs_set_protected:Npn \CJKecglue {#1}
\xeCJK_glue_to_skip:nN {#1} \l__xeCJK_ecglue_skip
\cs_set_eq:NN \xeCJK_space_or_xecglue: \CJKecglue
\cs_set_eq:NN \xeCJK_check_for_xglue: \__xeCJK_check_for_xglue:
@@ -1045,13 +1044,13 @@
CJKspace / true .code:n =
{
\bool_set_true:N \l__xeCJK_reserve_space_bool
- \cs_set_protected_nopar:Npn \__xeCJK_ccglue_or_space:
+ \cs_set_protected:Npn \__xeCJK_ccglue_or_space:
{ \xeCJK_space_glue: }
} ,
CJKspace / false .code:n =
{
\bool_set_false:N \l__xeCJK_reserve_space_bool
- \cs_set_protected_nopar:Npn \__xeCJK_ccglue_or_space:
+ \cs_set_protected:Npn \__xeCJK_ccglue_or_space:
{ \CJKglue }
} ,
CJKspace .default:n = { true } ,
@@ -1060,7 +1059,7 @@
}
\bool_new:N \l__xeCJK_reserve_space_bool
\xeCJK_inter_class_toks:nnn { CJK } { Boundary } { \xeCJK_CJK_and_Boundary:w }
-\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
{
@@ -1083,7 +1082,7 @@
}
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_boundary_reserve_space:
+\cs_new_protected:Npn \__xeCJK_boundary_reserve_space:
{
\__xeCJK_boundary_group_end:n { CJK-space }
\xeCJK_space_or_xecglue:
@@ -1094,13 +1093,13 @@
\token_if_eq_meaning:NNTF #1 \scan_stop:
{#1} { \cs_set_eq:NN #1 \scan_stop: #1 }
}
-\cs_new_protected_nopar:Npn \__xeCJK_boundary_group_end:n #1
+\cs_new_protected:Npn \__xeCJK_boundary_group_end:n #1
{
\group_align_safe_end:
\xeCJK_class_group_end:
{ \xeCJK_make_node:n {#1} }
}
-\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
{
@@ -1124,14 +1123,14 @@
}
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_reserve_space_aux:
+\cs_new_protected:Npn \__xeCJK_reserve_space_aux:
{
\group_align_safe_end:
\xeCJK_space_or_xecglue:
}
\xeCJK_inter_class_toks:nnn { CJK } { CJK }
{ \xeCJK_CJK_and_CJK:N }
-\cs_new_protected_nopar:Npn \xeCJK_CJK_and_CJK:N
+\cs_new_protected:Npn \xeCJK_CJK_and_CJK:N
{ \CJKglue \CJKsymbol }
\xeCJK_inter_class_toks:nnn { FullLeft } { CJK }
{ \xeCJK_FullLeft_and_CJK: \CJKsymbol }
@@ -1155,7 +1154,7 @@
{ \xeCJK_FullLeft_and_Boundary: }
\xeCJK_inter_class_toks:nnn { FullRight } { Boundary }
{ \xeCJK_FullRight_and_Boundary: }
-\cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_Boundary:
+\cs_new_protected:Npn \xeCJK_FullLeft_and_Boundary:
{
\__xeCJK_punct_if_middle:NTF \g__xeCJK_last_punct_tl
{
@@ -1172,7 +1171,7 @@
}
\tex_ignorespaces:D
}
-\cs_new_protected_nopar:Npn \xeCJK_FullRight_and_Boundary:
+\cs_new_protected:Npn \xeCJK_FullRight_and_Boundary:
{
\__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\xeCJK_class_group_end:
@@ -1180,14 +1179,14 @@
\__xeCJK_punct_glue:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\tex_ignorespaces:D
}
-\cs_new_protected_nopar:Npn \xeCJK_punct_node:N #1
+\cs_new_protected:Npn \xeCJK_punct_node:N #1
{
\__xeCJK_punct_bound_unitization:NN #1 \l__xeCJK_tmp_dim
\__xeCJK_make_node:N \l__xeCJK_tmp_dim
\dim_set:Nn \l__xeCJK_tmp_dim { `#1 sp }
\__xeCJK_make_node:N \l__xeCJK_tmp_dim
}
-\cs_new_protected_nopar:Npn \__xeCJK_punct_bound_unitization:NN #1#2
+\cs_new_protected:Npn \__xeCJK_punct_bound_unitization:NN #1#2
{
\dim_set:Nn #2
{
@@ -1198,12 +1197,12 @@
\dim_compare:nNnF {#2} < { 1pt }
{ \dim_set:Nn #2 { -1pt * \dim_ratio:nn {#2} { \c_max_dim } } }
}
-\cs_new_protected_nopar:Npn \xeCJK_punct_bound_kern:N #1
+\cs_new_protected:Npn \xeCJK_punct_bound_kern:N #1
{
\exp_after:wN \__xeCJK_punct_bound_kern:NN
\g__xeCJK_last_punct_tl #1
}
-\cs_new_protected_nopar:Npn \__xeCJK_punct_bound_kern:NN #1#2
+\cs_new_protected:Npn \__xeCJK_punct_bound_kern:NN #1#2
{
\xeCJK_get_punct_bounds:NN \l__xeCJK_aligni_tl #1
\xeCJK_get_punct_kerning:NN #1 #2
@@ -1221,7 +1220,7 @@
\l__xeCJK_punct_kern_skip
}
\skip_new:N \l__xeCJK_punct_kern_skip
-\cs_new_protected_nopar:Npn \__xeCJK_punct_bound_kern_ratio:NN #1#2
+\cs_new_protected:Npn \__xeCJK_punct_bound_kern_ratio:NN #1#2
{
\dim_set:Nn \l__xeCJK_bound_dim
{ \__xeCJK_use_punct_dim:nNN { bound_width } #1 #2 }
@@ -1238,7 +1237,7 @@
\__xeCJK_punct_bound_kern_ratio_aux:N #2
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_punct_bound_kern_ratio_aux:N #1
+\cs_new_protected:Npn \__xeCJK_punct_bound_kern_ratio_aux:N #1
{
\skip_set:Nn \l__xeCJK_punct_kern_skip
{
@@ -1251,12 +1250,12 @@
{ \l__xeCJK_bound_dim }
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_nobreak_hskip:N
+\cs_new_protected:Npn \__xeCJK_nobreak_hskip:N
{ \xeCJK_no_break: \skip_horizontal:N }
-\cs_new_protected_nopar:Npn \__xeCJK_nobreak_hskip:n
+\cs_new_protected:Npn \__xeCJK_nobreak_hskip:n
{ \xeCJK_no_break: \skip_horizontal:n }
\cs_new_eq:NN \__xeCJK_punct_bound_kern:N \__xeCJK_nobreak_hskip:N
-\cs_new_protected_nopar:Npn \__xeCJK_punct_bound_breakable_kern:N
+\cs_new_protected:Npn \__xeCJK_punct_bound_breakable_kern:N
{
\tl_if_eq:NNTF \l__xeCJK_aligni_tl \c__xeCJK_right_tl
{
@@ -1266,7 +1265,7 @@
}
{ \__xeCJK_nobreak_hskip:N }
}
-\cs_new_protected_nopar:Npn \__xeCJK_punct_bound_kern_aux:NNN #1#2
+\cs_new_protected:Npn \__xeCJK_punct_bound_kern_aux:NNN #1#2
{
\str_if_eq:nnTF {#1} {#2}
{ \__xeCJK_nobreak_hskip:N }
@@ -1288,24 +1287,24 @@
{ \exp_not:c { xeCJK_#1_and_##1:N } }
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_punct_bound_rule:NN #1#2
+\cs_new_protected:Npn \__xeCJK_punct_bound_rule:NN #1#2
{
\tex_vrule:D
width - \__xeCJK_use_punct_dim:nNN { bound } #1 #2 ~
depth \c_zero_dim
height \c_zero_dim \scan_stop:
}
-\cs_new_protected_nopar:Npn \__xeCJK_punct_rule:NN #1#2
+\cs_new_protected:Npn \__xeCJK_punct_rule:NN #1#2
{
\tex_vrule:D
width \__xeCJK_use_punct_dim:nNN { rule } #1 #2 ~
depth \c_zero_dim
height \c_zero_dim \scan_stop:
}
-\cs_new_protected_nopar:Npn \__xeCJK_punct_glue:NN #1#2
+\cs_new_protected:Npn \__xeCJK_punct_glue:NN #1#2
{ \__xeCJK_punct_hskip:n { \__xeCJK_use_dim_or_skip:nNN { glue } #1 #2 } }
\cs_new_eq:NN \__xeCJK_punct_hskip:n \skip_horizontal:n
-\cs_new_protected_nopar:Npn \__xeCJK_punct_kern:NN #1#2
+\cs_new_protected:Npn \__xeCJK_punct_kern:NN #1#2
{
\str_if_eq:eeTF {#1} {#2}
{ \__xeCJK_punct_nobreak_kern:NN }
@@ -1321,9 +1320,9 @@
#1 #2
}
\cs_new_eq:NN \xeCJK_punct_kern:NN \__xeCJK_punct_kern:NN
-\cs_new_protected_nopar:Npn \__xeCJK_punct_nobreak_kern:NN #1#2
+\cs_new_protected:Npn \__xeCJK_punct_nobreak_kern:NN #1#2
{ \__xeCJK_nobreak_hskip:n { \__xeCJK_use_dim_or_skip:nNN { kern } #1 #2 } }
-\cs_new_protected_nopar:Npn \__xeCJK_punct_breakable_kern:NN #1#2
+\cs_new_protected:Npn \__xeCJK_punct_breakable_kern:NN #1#2
{
\exp_after:wN \__xeCJK_punct_if_right:NT #1
{ \__xeCJK_punct_rule:NN \c__xeCJK_right_tl #1 }
@@ -1334,7 +1333,7 @@
}
\cs_new_eq:NN \__xeCJK_punct_breakable_kern:n \skip_horizontal:n
\tl_new:N \g__xeCJK_last_punct_tl
-\cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_CJK:
+\cs_new_protected:Npn \xeCJK_FullLeft_and_CJK:
{
\__xeCJK_punct_if_middle:NTF \g__xeCJK_last_punct_tl
{
@@ -1345,7 +1344,7 @@
{ }
\__xeCJK_select_font:
}
-\cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_Default:
+\cs_new_protected:Npn \xeCJK_FullLeft_and_Default:
{
\__xeCJK_punct_if_middle:NTF \g__xeCJK_last_punct_tl
{
@@ -1358,27 +1357,27 @@
\__xeCJK_nobreak_zero_glue:
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_nobreak_zero_glue:
+\cs_new_protected:Npn \__xeCJK_nobreak_zero_glue:
{
\tex_penalty:D \c__xeCJK_nobreak_penalty_int
\skip_horizontal:N \c_zero_skip
}
-\cs_new_protected_nopar:Npn \__xeCJK_zero_glue:
+\cs_new_protected:Npn \__xeCJK_zero_glue:
{ \skip_horizontal:N \c_zero_skip }
-\cs_new_protected_nopar:Npn \xeCJK_FullRight_and_CJK:
+\cs_new_protected:Npn \xeCJK_FullRight_and_CJK:
{
\__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\__xeCJK_punct_glue:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\__xeCJK_select_font:
\CJKglue
}
-\cs_new_protected_nopar:Npn \xeCJK_FullRight_and_Default:
+\cs_new_protected:Npn \xeCJK_FullRight_and_Default:
{
\__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\xeCJK_class_group_end:
\__xeCJK_punct_glue:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
}
-\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__xeCJK_left_tl #2
\__xeCJK_Default_and_FullLeft_glue:N #2
@@ -1390,9 +1389,9 @@
\__xeCJK_punct_rule:NN \c__xeCJK_left_tl #2
\CJKpunctsymbol #2
}
-\cs_new_protected_nopar:Npn \__xeCJK_Default_and_FullLeft_glue:N #1
+\cs_new_protected:Npn \__xeCJK_Default_and_FullLeft_glue:N #1
{ \__xeCJK_punct_glue:NN \c__xeCJK_left_tl #1 }
-\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__xeCJK_left_tl #1
\__xeCJK_CJK_and_FullLeft_glue:N #1
@@ -1401,12 +1400,12 @@
\__xeCJK_select_punct_font:
\CJKpunctsymbol #1
}
-\cs_new_protected_nopar:Npn \__xeCJK_CJK_and_FullLeft_glue:N #1
+\cs_new_protected:Npn \__xeCJK_CJK_and_FullLeft_glue:N #1
{
\CJKglue
\__xeCJK_punct_glue:NN \c__xeCJK_left_tl #1
}
-\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__xeCJK_left_tl #1
\__xeCJK_Boundary_and_FullLeft_glue:N #1
@@ -1417,7 +1416,7 @@
\__xeCJK_punct_rule:NN \c__xeCJK_left_tl #1
\CJKpunctsymbol #1
}
-\cs_new_protected_nopar:Npn \__xeCJK_Boundary_and_FullLeft_glue:N #1
+\cs_new_protected:Npn \__xeCJK_Boundary_and_FullLeft_glue:N #1
{
\tl_set_eq:NN \l__xeCJK_alignii_tl \c__xeCJK_left_tl
\group_begin: \exp_args:NNc \group_end: \cs_if_exist_use:NTF
@@ -1427,9 +1426,9 @@
{ \__xeCJK_punct_glue:NN \c__xeCJK_left_tl #1 }
}
\tl_new:N \c__xeCJK_alignii_tl
-\cs_new_protected_nopar:cpn { __xeCJK_bound_type_ -1 _glue:Nn } #1#2
+\cs_new_protected:cpn { __xeCJK_bound_type_ -1 _glue:Nn } #1#2
{ \__xeCJK_zero_glue: }
-\cs_new_protected_nopar:cpn { __xeCJK_bound_type_ 1 _glue:Nn } #1#2
+\cs_new_protected:cpn { __xeCJK_bound_type_ 1 _glue:Nn } #1#2
{
\box_set_to_last:N \l__xeCJK_tmp_box
\int_compare:nNnTF \tex_lastnodetype:D = { -1 }
@@ -1441,19 +1440,19 @@
}
{ \box_use_drop:N \l__xeCJK_tmp_box #2 }
}
-\cs_new_protected_nopar:cpn { __xeCJK_bound_type_ 11 _glue:Nn } #1#2
+\cs_new_protected:cpn { __xeCJK_bound_type_ 11 _glue:Nn } #1#2
{
\skip_if_finite:nTF { \tex_lastskip:D }
{ \__xeCJK_bound_glue_auxi:Nn #1 {#2} }
{ \__xeCJK_zero_glue: }
}
-\cs_new_protected_nopar:Npn \__xeCJK_bound_glue_auxi:Nn #1#2
+\cs_new_protected:Npn \__xeCJK_bound_glue_auxi:Nn #1#2
{
\__xeCJK_if_last_punct_glue:TF
{ \xeCJK_punct_bound_kern:N #1 }
{ \__xeCJK_bound_glue_auxii:n {#2} }
}
-\cs_new_protected_nopar:Npn \__xeCJK_bound_glue_auxii:n #1
+\cs_new_protected:Npn \__xeCJK_bound_glue_auxii:n #1
{
\skip_set_eq:NN \l__xeCJK_last_skip \tex_lastskip:D
\skip_if_eq:nnTF { \l__xeCJK_last_skip } { 1sp }
@@ -1473,14 +1472,14 @@
{#1}
}
}
-\cs_new_protected_nopar:cpn { __xeCJK_bound_type_ 12 _glue:Nn } #1#2
+\cs_new_protected:cpn { __xeCJK_bound_type_ 12 _glue:Nn } #1#2
{
\xeCJK_if_last_node:nF { CJK }
{ \xeCJK_if_last_node:nF { CJK-space } { \use_none:nn } }
\xeCJK_remove_node: \CJKglue
#2
}
-\cs_new_protected_nopar:cpn { __xeCJK_bound_type_ 13 _glue:Nn } #1#2
+\cs_new_protected:cpn { __xeCJK_bound_type_ 13 _glue:Nn } #1#2
{
\__xeCJK_if_last_punct_penalty:TF
{ \xeCJK_punct_bound_kern:N #1 }
@@ -1495,7 +1494,7 @@
{#2}
}
}
-\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__xeCJK_right_tl #2
\__xeCJK_Default_and_FullRight_glue:N #2
@@ -1506,7 +1505,7 @@
\tl_gset:Nn \g__xeCJK_last_punct_tl {#2}
\xeCJK_FullRight_symbol:N #2
}
-\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__xeCJK_right_tl #1
\xeCJK_if_last_punct:TF
@@ -1522,7 +1521,7 @@
\tl_gset:Nn \g__xeCJK_last_punct_tl {#1}
\xeCJK_FullRight_symbol:N #1
}
-\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__xeCJK_right_tl #1
\__xeCJK_CJK_and_FullRight_glue:N #1
@@ -1530,7 +1529,7 @@
\__xeCJK_select_punct_font:
\xeCJK_FullRight_symbol:N #1
}
-\cs_new_protected_nopar:Npn \xeCJK_if_last_punct:TF
+\cs_new_protected:Npn \xeCJK_if_last_punct:TF
{
\bool_set_false:N \l__xeCJK_last_penalty_bool
\int_compare:nNnTF \tex_lastnodetype:D = { 11 }
@@ -1541,14 +1540,14 @@
{ \use_ii:nn }
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_if_last_punct_glue:TF
+\cs_new_protected:Npn \__xeCJK_if_last_punct_glue:TF
{
\prop_get:NoNTF \g__xeCJK_punct_skip_prop
{ \skip_use:N \tex_lastskip:D } \l__xeCJK_tmp_tl
{ \__xeCJK_if_last_punct_glue_auxi:TF }
{ \__xeCJK_if_last_punct_glue_auxii:TF }
}
-\cs_new_protected_nopar:Npn \__xeCJK_if_last_punct_glue_auxi:TF
+\cs_new_protected:Npn \__xeCJK_if_last_punct_glue_auxi:TF
{
\skip_set_eq:NN \l__xeCJK_last_skip \tex_lastskip:D
\tex_unskip:D
@@ -1561,14 +1560,15 @@
}
{ \skip_horizontal:N \l__xeCJK_last_skip \use_ii:nn }
}
-\cs_new_protected_nopar:Npn \__xeCJK_if_last_punct_glue_auxii:TF
+\cs_new_protected:Npn \__xeCJK_if_last_punct_glue_auxii:TF
{
- \int_gset_eq:NN \g__xeCJK_space_factor_int \tex_spacefactor:D
- \skip_if_eq:nnTF { \tex_lastskip:D } { \c_xeCJK_space_skip_tl }
- { \__xeCJK_if_last_punct_glue_auxiii:TF }
- { \use_ii:nn }
+ \group_begin:
+ \g__xeCJK_space_factor_int \tex_spacefactor:D
+ \skip_if_eq:nnTF { \tex_lastskip:D } { \c_xeCJK_space_skip_tl }
+ { \group_end: \__xeCJK_if_last_punct_glue_auxiii:TF }
+ { \group_end: \use_ii:nn }
}
-\cs_new_protected_nopar:Npn \__xeCJK_if_last_punct_glue_auxiii:TF
+\cs_new_protected:Npn \__xeCJK_if_last_punct_glue_auxiii:TF
{
\skip_set_eq:NN \l__xeCJK_tmp_skip \tex_lastskip:D
\tex_unskip:D
@@ -1582,7 +1582,7 @@
{ \use:n }
{ \skip_horizontal:N \l__xeCJK_tmp_skip \use_ii:nn }
}
-\cs_new_protected_nopar:Npn \__xeCJK_if_last_punct_penalty:TF
+\cs_new_protected:Npn \__xeCJK_if_last_punct_penalty:TF
{
\int_set_eq:NN \l__xeCJK_last_penalty_int \tex_lastpenalty:D
\tex_unpenalty:D
@@ -1592,7 +1592,7 @@
{ \use:n }
{ \tex_penalty:D \l__xeCJK_last_penalty_int \use_ii:nn }
}
-\cs_new_protected_nopar:Npn \__xeCJK_if_last_punct_auxi:TF
+\cs_new_protected:Npn \__xeCJK_if_last_punct_auxi:TF
{
\tex_unpenalty:D
\bool_if:NF \l__xeCJK_last_penalty_bool
@@ -1605,13 +1605,13 @@
{ \use:n }
{ \xeCJK_no_break: \use_ii:nn }
}
-\cs_new_protected_nopar:Npn \__xeCJK_if_last_punct_auxii:TF
+\cs_new_protected:Npn \__xeCJK_if_last_punct_auxii:TF
{
\dim_compare:nNnTF \l__xeCJK_last_kern_dim > \c_zero_dim
{ \__xeCJK_if_last_punct_auxiii:TF }
{ \__xeCJK_make_node:N \l__xeCJK_last_kern_dim \use_ii:nn }
}
-\cs_new_protected_nopar:Npn \__xeCJK_if_last_punct_auxiii:TF
+\cs_new_protected:Npn \__xeCJK_if_last_punct_auxiii:TF
{
\int_case:nnTF { \tex_XeTeXcharclass:D \l__xeCJK_last_kern_dim }
{
@@ -1623,7 +1623,7 @@
{ \__xeCJK_if_last_punct_auxiv:TF }
{ \use_ii:nn }
}
-\cs_new_protected_nopar:Npn \__xeCJK_if_last_punct_auxiv:TF
+\cs_new_protected:Npn \__xeCJK_if_last_punct_auxiv:TF
{
\dim_set_eq:NN \l__xeCJK_tmp_dim \l__xeCJK_last_kern_dim
\xeCJK_if_last_node:TF
@@ -1657,7 +1657,7 @@
{#2}
}
\dim_new:N \l__xeCJK_last_kern_dim
-\cs_new_protected_nopar:Npn \__xeCJK_CJK_and_FullRight_glue:N #1
+\cs_new_protected:Npn \__xeCJK_CJK_and_FullRight_glue:N #1
{
\__xeCJK_punct_if_long:NTF #1
{ \xeCJK_allow_break: }
@@ -1669,7 +1669,7 @@
\__xeCJK_punct_bound_rule:NN \c__xeCJK_left_tl #1
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_Default_and_FullRight_glue:N #1
+\cs_new_protected:Npn \__xeCJK_Default_and_FullRight_glue:N #1
{
\__xeCJK_punct_if_long:NTF #1
{ \xeCJK_allow_break: }
@@ -1680,7 +1680,7 @@
\__xeCJK_punct_bound_rule:NN \c__xeCJK_left_tl #1
}
}
-\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__xeCJK_left_tl #1
\xeCJK_get_punct_kerning:oN \g__xeCJK_last_punct_tl #1
@@ -1688,7 +1688,7 @@
\tl_gset:Nn \g__xeCJK_last_punct_tl {#1}
\CJKpunctsymbol #1
}
-\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__xeCJK_right_tl #1
\xeCJK_get_punct_kerning:oN \g__xeCJK_last_punct_tl #1
@@ -1696,7 +1696,7 @@
\tl_gset:Nn \g__xeCJK_last_punct_tl {#1}
\xeCJK_FullRight_symbol:N #1
}
-\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__xeCJK_left_tl #1
\xeCJK_get_punct_kerning:oN \g__xeCJK_last_punct_tl #1
@@ -1704,7 +1704,7 @@
\tl_gset:Nn \g__xeCJK_last_punct_tl {#1}
\CJKpunctsymbol #1
}
-\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__xeCJK_right_tl #1
\xeCJK_get_punct_kerning:oN \g__xeCJK_last_punct_tl #1
@@ -1741,8 +1741,8 @@
} ,
CheckFullRight .default:n = { true }
}
-\cs_new_nopar:Npn \xeCJK_FullRight_symbol:N { \CJKpunctsymbol }
-\cs_new_protected_nopar:Npn \xeCJK_check_FullRight:
+\cs_new:Npn \xeCJK_FullRight_symbol:N { \CJKpunctsymbol }
+\cs_new_protected:Npn \xeCJK_check_FullRight:
{
\xeCJK_get_punct_bounds:No \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
@@ -1760,7 +1760,7 @@
\__xeCJK_punct_glue:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
}
\prg_generate_conditional_variant:Nnn \tl_case:Nn { No } { TF , F }
-\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 { \__xeCJK_save_FullRight_symbol:N #1 } }
\cs_new_protected:Npn \xeCJK_cs_case_keys_define:nNNnn #1#2#3#4#5
{
@@ -1851,9 +1851,9 @@
WidowPenalty .int_set:N = \l__xeCJK_widow_penalty_int ,
WidowPenalty .default:n = { 10 000 }
}
-\cs_new_protected_nopar:Npn \xeCJK_widow_penalty:
+\cs_new_protected:Npn \xeCJK_widow_penalty:
{ \tex_penalty:D \l__xeCJK_widow_penalty_int }
-\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
@@ -1865,12 +1865,12 @@
#1
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_check_single_end:N
+\cs_new_protected:Npn \__xeCJK_check_single_end:N
{
\group_align_safe_end:
\__xeCJK_check_single_save:N
}
-\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
{
@@ -1897,17 +1897,17 @@
#1 #2
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_check_single_aux:nNNw #1#2#3
+\cs_new_protected:Npn \__xeCJK_check_single_aux:nNNw #1#2#3
{
\token_if_cs:NTF \l_peek_token
{ \xeCJK_check_single_cs:NNn }
{ \xeCJK_check_single_end:NNnw }
#2 #3 {#1}
}
-\cs_new_protected_nopar:Npn \__xeCJK_check_single_end_aux:NNn #1#2#3
+\cs_new_protected:Npn \__xeCJK_check_single_end_aux:NNn #1#2#3
{ \__xeCJK_check_single_end:N #1 #2 #3 }
\cs_new_eq:NN \xeCJK_check_single_end:NNnw \__xeCJK_check_single_end_aux:NNn
-\cs_new_protected_nopar:Npn \__xeCJK_check_single_end_equation:NNnw
+\cs_new_protected:Npn \__xeCJK_check_single_end_equation:NNnw
{
\token_if_math_toggle:NTF \l_peek_token
{ \xeCJK_check_single_equation:NNnNw }
@@ -1928,7 +1928,7 @@
} ,
PlainEquation .default:n = { true } ,
}
-\cs_new_protected_nopar:Npn \__xeCJK_check_single_space:NN #1#2
+\cs_new_protected:Npn \__xeCJK_check_single_space:NN #1#2
{
\xeCJK_if_CJK_class:NTF #2
{
@@ -1938,7 +1938,7 @@
}
{ \__xeCJK_check_single_end:N #1 #2 ~ }
}
-\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
{
@@ -1947,7 +1947,7 @@
}
{ \__xeCJK_check_single_end:N #1 #2#3#4 }
}
-\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__xeCJK_check_single_cs_case_tl }
@@ -1961,7 +1961,7 @@
{ \__xeCJK_check_single_end:N #1 #2#3 }
}
\tl_new:N \l__xeCJK_check_single_cs_case_tl
-\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__xeCJK_inline_env_case_tl }
@@ -2042,7 +2042,7 @@
\IfBooleanT {#1} { \xeCJKResetPunctClass }
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_sub_restore_or_cancel:n #1
+\cs_new_protected:Npn \__xeCJK_sub_restore_or_cancel:n #1
{
\clist_map_inline:nn {#1}
{
@@ -2062,7 +2062,7 @@
Try~to~use~\token_to_str:N \xeCJKDeclareSubCJKBlock \
to~declare~it.
}
-\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 { \__xeCJK_class_csname:n { #1/#2 } }
{
@@ -2073,7 +2073,7 @@
\xeCJK_declare_char_class:nn { #1/#2 } {#3}
}
\cs_generate_variant:Nn \xeCJK_declare_sub_char_class:nnn { nx }
-\cs_new_protected_nopar:Npn \__xeCJK_set_sub_class_toks:nn #1#2
+\cs_new_protected:Npn \__xeCJK_set_sub_class_toks:nn #1#2
{
\seq_map_inline:Nn \g__xeCJK_base_class_seq
{
@@ -2121,11 +2121,11 @@
{
\keys_define:nn { xeCJK / options }
{
- PunctStyle / unknown .code:n =
- { \__xeCJK_error:nx { punct-style-unknown } { \l_keys_value_tl } }
+ PunctStyle .code:n =
+ { \__xeCJK_error:nx { punct-style-unknown } {#1} }
}
\seq_gclear:N \g__xeCJK_punct_style_seq
- \keys_set:nn { xeCJK / options } { PunctStyle = plain }
+ \__xeCJK_set_punct_style:n { plain }
}
}
\NewDocumentCommand \xeCJKsetwidth { s m m }
@@ -2192,11 +2192,11 @@
\bool_new:N \l__xeCJK_punct_breakable_bool
\clist_new:N \g__xeCJK_special_punct_clist
\clist_gset:Nn \g__xeCJK_special_punct_clist { mixed_width , long , middle }
-\cs_new_nopar:Npn \__xeCJK_special_punct_seq:n #1 { g__xeCJK_special_punct_#1_seq }
-\cs_new_nopar:Npn \__xeCJK_special_punct_tl:nN #1#2 { g__xeCJK_special_punct_#1_#2_tl }
+\cs_new:Npn \__xeCJK_special_punct_seq:n #1 { g__xeCJK_special_punct_#1_seq }
+\cs_new:Npn \__xeCJK_special_punct_tl:nN #1#2 { g__xeCJK_special_punct_#1_#2_tl }
\clist_map_inline:Nn \g__xeCJK_special_punct_clist
{ \seq_new:c { \__xeCJK_special_punct_seq:n {#1} } }
-\cs_new_protected_nopar:Npn \__xeCJK_set_special_punct:nn #1#2
+\cs_new_protected:Npn \__xeCJK_set_special_punct:nn #1#2
{
\seq_map_inline:cn { \__xeCJK_special_punct_seq:n {#1} }
{ \cs_undefine:c { \__xeCJK_special_punct_tl:nN {#1} {##1} } }
@@ -2207,7 +2207,7 @@
\seq_gput_right:cn { \__xeCJK_special_punct_seq:n {#1} } {##1}
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_add_special_punct:nn #1#2
+\cs_new_protected:Npn \__xeCJK_add_special_punct:nn #1#2
{
\tl_map_inline:xn {#2}
{
@@ -2218,7 +2218,7 @@
}
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_sub_special_punct:nn #1#2
+\cs_new_protected:Npn \__xeCJK_sub_special_punct:nn #1#2
{
\tl_map_inline:xn {#2}
{
@@ -2373,20 +2373,20 @@
kerning-margin-minimum = \l__xeCJK_kerning_margin_minimum_dim
}
{ \AssignTemplateKeys }
-\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 { \__xeCJK_punct_csname:n { dim/glue/#1/#2 } }
{ \__xeCJK_get_punct_bounds_aux:NN #1 #2 }
}
-\cs_new_protected_nopar:Npn \__xeCJK_get_punct_bounds_aux:NN
+\cs_new_protected:Npn \__xeCJK_get_punct_bounds_aux:NN
{
\tl_if_eq:NNTF \l_xeCJK_punct_style_tl \c__xeCJK_punct_style_plain_tl
{ \__xeCJK_save_punct_margin_plain:NN }
{ \__xeCJK_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 \__xeCJK_save_punct_margin_plain:NN #1#2
+\cs_new_protected:Npn \__xeCJK_save_punct_margin_plain:NN #1#2
{
\__xeCJK_save_punct_dim:nNNn { rule } #1 #2 { \c_zero_dim }
\__xeCJK_save_punct_dim:nNNn { glue } #1 #2 { \c_zero_dim }
@@ -2396,7 +2396,7 @@
\__xeCJK_save_punct_dim:nNNn { bound } \c__xeCJK_right_tl {#2} { \c_zero_dim }
\__xeCJK_save_punct_skip:nNNn { glue } #1 #2 { \c_zero_skip }
}
-\cs_new_protected_nopar:Npn \__xeCJK_save_punct_margin:NN #1#2
+\cs_new_protected:Npn \__xeCJK_save_punct_margin:NN #1#2
{
\group_begin:
\xeCJK_select_punct_font:
@@ -2419,7 +2419,7 @@
}
\dim_new:N \l__xeCJK_bound_dim
\dim_new:N \l__xeCJK_reverse_bound_dim
-\cs_new_protected_nopar:Npn \__xeCJK_long_punct_kerning:N #1
+\cs_new_protected:Npn \__xeCJK_long_punct_kerning:N #1
{
\dim_set:Nn \l__xeCJK_tmp_dim
{
@@ -2442,7 +2442,7 @@
\__xeCJK_save_punct_dim:nNNn { bound_kern } #1 #1 { \l__xeCJK_tmp_dim }
\__xeCJK_save_punct_skip:nNNn { bound_kern } #1 #1 { \l__xeCJK_tmp_dim }
}
-\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 { \__xeCJK_punct_csname:n { dim/kern/#1/#2 } }
{
@@ -2452,9 +2452,9 @@
#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 \__xeCJK_save_punct_kerning_plain:NN #1#2
+\cs_new_protected:Npn \__xeCJK_save_punct_kerning_plain:NN #1#2
{
\__xeCJK_save_punct_dim:nNNn { kern } #1 #2 { \c_zero_dim }
\__xeCJK_save_punct_dim:nNNn { bound_kern } #1 #2 { \c_zero_dim }
@@ -2462,12 +2462,12 @@
\__xeCJK_save_punct_skip:nNNn { kern } #1 #2 { \c_zero_skip }
\__xeCJK_save_punct_skip:nNNn { bound_kern } #1 #2 { \c_zero_skip }
}
-\cs_new_protected_nopar:Npn \__xeCJK_save_punct_kerning:NN
+\cs_new_protected:Npn \__xeCJK_save_punct_kerning:NN
{
\UseInstance { xeCJK / punctuation } { \l_xeCJK_punct_style_tl }
\xeCJK_punct_kerning_process:NN
}
-\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__xeCJK_tmp_dim
{
@@ -2524,7 +2524,7 @@
\__xeCJK_save_punct_dim:nNNn { margin } #1 #2 { \l__xeCJK_margin_dim }
}
\dim_new:N \l__xeCJK_margin_dim
-\cs_new_nopar:Npn \__xeCJK_calc_punct_width:N #1
+\cs_new:Npn \__xeCJK_calc_punct_width:N #1
{
\__xeCJK_punct_if_middle:NTF #1
{ \__xeCJK_punct_width_or_ratio:nN { middle } }
@@ -2535,7 +2535,7 @@
}
#1
}
-\cs_new_nopar:Npn \__xeCJK_calc_margin_width:N #1
+\cs_new:Npn \__xeCJK_calc_margin_width:N #1
{
\__xeCJK_punct_if_middle:NTF #1
{
@@ -2554,7 +2554,7 @@
{ \__xeCJK_margin_width_or_ratio:n { fixed } }
}
}
-\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__xeCJK_tmp_dim
{
@@ -2620,7 +2620,7 @@
{ \l__xeCJK_margin_dim - \l__xeCJK_reverse_bound_dim }
}
}
-\cs_new_nopar:Npn \__xeCJK_punct_width_or_ratio:nN #1#2
+\cs_new:Npn \__xeCJK_punct_width_or_ratio:nN #1#2
{
\dim_compare:nNnTF { \use:c { l__xeCJK_#1_punct_width_dim } } < \c_max_dim
{ \use:c { l__xeCJK_#1_punct_width_dim } }
@@ -2633,7 +2633,7 @@
}
}
}
-\cs_new_nopar:Npn \__xeCJK_margin_width_or_ratio:n #1
+\cs_new:Npn \__xeCJK_margin_width_or_ratio:n #1
{
\dim_compare:nNnTF { \use:c { l__xeCJK_#1_margin_width_dim } } < \c_max_dim
{ \use:c { l__xeCJK_#1_margin_width_dim } }
@@ -2644,7 +2644,7 @@
\bool_if:NT \l__xeCJK_add_min_bound_to_margin_bool
{ + \dim_min:nn \l__xeCJK_bound_dim \l__xeCJK_reverse_bound_dim }
}
-\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__xeCJK_margin_dim
{ \__xeCJK_original_kerning_margin:NN #1 #2 }
@@ -2681,7 +2681,7 @@
}
#1 #2
}
-\cs_new_nopar:Npn \__xeCJK_punct_kerning_process_aux:NN #1#2
+\cs_new:Npn \__xeCJK_punct_kerning_process_aux:NN #1#2
{
\bool_if:NTF \l__xeCJK_enabled_kerning_bool
{ \__xeCJK_calc_kerning_margin:NN #1 #2 }
@@ -2689,9 +2689,9 @@
}
\dim_new:N \l__xeCJK_minimum_bound_dim
\dim_new:N \l__xeCJK_kerning_margin_dim
-\cs_new_protected_nopar:Npn \__xeCJK_save_kerning:nnNN #1#2
+\cs_new_protected:Npn \__xeCJK_save_kerning:nnNN #1#2
{ \__xeCJK_save_kerning:nnnNN {#1} {#2} {#2} }
-\cs_new_protected_nopar:Npn \__xeCJK_save_kerning:nnnNN #1#2#3#4#5
+\cs_new_protected:Npn \__xeCJK_save_kerning:nnnNN #1#2#3#4#5
{
\dim_set:Nn \l__xeCJK_tmp_dim
{
@@ -2705,7 +2705,7 @@
{ \l__xeCJK_margin_dim - \l__xeCJK_kerning_margin_dim }
{ \l__xeCJK_kerning_margin_dim - \l__xeCJK_minimum_bound_dim }
}
-\cs_new_nopar:Npn \__xeCJK_original_kerning_margin:NN #1#2
+\cs_new:Npn \__xeCJK_original_kerning_margin:NN #1#2
{
\dim_eval:n
{
@@ -2716,7 +2716,7 @@
{ \__xeCJK_punct_if_right:NTF #2 { bound } { margin } } \c__xeCJK_left_tl #2
}
}
-\cs_new_nopar:Npn \__xeCJK_calc_kerning_margin:NN #1#2
+\cs_new:Npn \__xeCJK_calc_kerning_margin:NN #1#2
{
\dim_max:nn
{ \l__xeCJK_kerning_margin_minimum_dim }
@@ -2731,7 +2731,7 @@
}
}
}
-\cs_new_nopar:Npn \__xeCJK_calc_kerning_margin_aux:NN #1#2
+\cs_new:Npn \__xeCJK_calc_kerning_margin_aux:NN #1#2
{
\dim_compare:nNnTF \l__xeCJK_kerning_total_width_dim < \c_max_dim
{ \__xeCJK_calc_kerning_margin:nNN \l__xeCJK_kerning_total_width_dim }
@@ -2755,7 +2755,7 @@
}
#1 #2
}
-\cs_new_nopar:Npn \__xeCJK_kerning_width_or_ratio:nNN #1#2#3
+\cs_new:Npn \__xeCJK_kerning_width_or_ratio:nNN #1#2#3
{
\dim_compare:nNnTF { \use:c { l__xeCJK_#1_align_margin_dim } } < \c_max_dim
{ \use:c { l__xeCJK_#1_align_margin_dim } }
@@ -2770,7 +2770,7 @@
{ \l__xeCJK_margin_dim }
}
}
-\cs_new_nopar:Npn \__xeCJK_punct_min_bound:NN #1#2
+\cs_new:Npn \__xeCJK_punct_min_bound:NN #1#2
{
\dim_max:nn
{
@@ -2784,7 +2784,7 @@
{ \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_right_tl #2 }
}
}
-\cs_new_nopar:Npn \__xeCJK_calc_kerning_margin:nNN #1#2#3
+\cs_new:Npn \__xeCJK_calc_kerning_margin:nNN #1#2#3
{
\dim_eval:n
{
@@ -2799,7 +2799,7 @@
- ( \__xeCJK_use_punct_dim:nN { dimen } #3 )
}
}
-\cs_new_protected_nopar:Npn \xeCJK_calc_punct_dimen:N #1
+\cs_new_protected:Npn \xeCJK_calc_punct_dimen:N #1
{
\__xeCJK_save_punct_dim:nNNn { bound } \c__xeCJK_left_tl #1
{ \xeCJK_glyph_bounds:NN 1 #1 }
@@ -2814,39 +2814,49 @@
( \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_right_tl #1 )
}
}
-\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: }
\keys_define:nn { xeCJK / options }
+ { PunctStyle .code:n = \exp_args:Nx \__xeCJK_set_punct_style:n {#1} }
+\cs_new_protected:Npn \__xeCJK_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__xeCJK_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 } }
- { \__xeCJK_error:nx { punct-style-unknown } { \l_keys_value_tl } }
+ \prop_get:NnNF \c__xeCJK_punct_style_alias_prop
+ {#1} \l_xeCJK_punct_style_tl
+ { \__xeCJK_error:nx { punct-style-unknown } {#1} }
}
}
+\prop_const_from_keyval:Nn \c__xeCJK_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__xeCJK_punct_style_plain_tl { plain }
\__xeCJK_msg_new:nn { punct-style-unknown }
{
Punctuation~style~"#1"~is~unknown. \\\\
The~available~styles~are~listed~as~follow.\\\\
- "plain,~\seq_use:Nnnn \g__xeCJK_punct_style_seq { ~and~ } { ,~ } { ,~and~ }".\\
+ "plain,~\seq_use:Nnnn \g__xeCJK_punct_style_seq
+ { ~and~ } { ,~ } { ,~and~ }".\\
}
-\NewDocumentCommand \xeCJKDeclarePunctStyle { > { \TrimSpaces } m m }
+\cs_new_protected:Npn \__xeCJK_trim_spaces:n #1
+ {
+ \tl_set:Nx \ProcessedArgument
+ { \exp_args:Ne \tl_trim_spaces:n {#1} }
+ }
+\NewDocumentCommand \xeCJKDeclarePunctStyle
+ { > { \__xeCJK_trim_spaces:n } m m }
{
\IfInstanceExistTF { xeCJK / punctuation } {#1}
{ \__xeCJK_warning:nx { punct-style-already-defined } {#1} }
- { \seq_gput_right:Nx \g__xeCJK_punct_style_seq {#1} }
- \exp_args:Nnx \DeclareInstance { xeCJK / punctuation } {#1} { basic } {#2}
+ { \seq_gput_right:Nn \g__xeCJK_punct_style_seq {#1} }
+ \DeclareInstance { xeCJK / punctuation } {#1} { basic } {#2}
}
\seq_new:N \g__xeCJK_punct_style_seq
\__xeCJK_msg_new:nn { punct-style-already-defined }
@@ -2855,10 +2865,11 @@
The~existing~style~of~"#1"~will~be~overwritten.\\
}
\@onlypreamble \xeCJKDeclarePunctStyle
-\NewDocumentCommand \xeCJKEditPunctStyle { > { \TrimSpaces } m m }
+\NewDocumentCommand \xeCJKEditPunctStyle
+ { > { \__xeCJK_trim_spaces:n } m m }
{
\IfInstanceExistTF { xeCJK / punctuation } {#1}
- { \exp_args:Nnx \EditInstance { xeCJK / punctuation } {#1} {#2} }
+ { \EditInstance { xeCJK / punctuation } {#1} {#2} }
{ \__xeCJK_error:nx { punct-style-unknown } {#1} }
}
\@onlypreamble \xeCJKEditPunctStyle
@@ -2905,7 +2916,7 @@
AutoFallBack .default:n = { true } ,
fallback .meta:n = { AutoFallBack = true }
}
-\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
{ \__xeCJK_fallback_save_CJKsymbol:N #1 }
@@ -2917,7 +2928,7 @@
\group_end:
}
}
-\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__xeCJK_tmp_tl
{ \tex_the:D \tex_XeTeXcharclass:D `#1 ~ \xeCJK_class_num:n { Boundary } }
@@ -2927,7 +2938,7 @@
\group_insert_after:N \g__xeCJK_aftergroup_Boundary_tl
}
\tl_new:N \g__xeCJK_aftergroup_Boundary_tl
-\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}
{
@@ -2965,7 +2976,7 @@
{ \xeCJK_set_family_fallback:nnn {#1} } {#2} {#3}
{ }
}
-\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__xeCJK_fallback_family_tl {#1}
@@ -3013,7 +3024,7 @@
slantfont .meta:n = { AutoFakeSlant = true }
}
\seq_new:N \g__xeCJK_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__xeCJK_sub_key_seq {#1}
\keys_define:nn { xeCJK / features }
@@ -3037,7 +3048,7 @@
#1 .default:n = { }
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_get_sub_features:nn #1#2
+\cs_new_protected:Npn \__xeCJK_get_sub_features:nn #1#2
{
\tl_set:Nx \l__xeCJK_tmp_tl { \xeCJK_tl_remove_outer_braces:n {#2} }
\clist_clear:N \l__xeCJK_sub_font_options_clist
@@ -3052,7 +3063,7 @@
{ \exp_not:V \l__xeCJK_sub_font_name_tl }
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_get_sub_features:w #1 [#2] #3 \q_mark #4 \q_stop
+\cs_new_protected:Npn \__xeCJK_get_sub_features:w #1 [#2] #3 \q_mark #4 \q_stop
{
\quark_if_nil:nTF {#2}
{ \tl_set_eq:NN \l__xeCJK_sub_font_name_tl \l__xeCJK_tmp_tl }
@@ -3106,7 +3117,7 @@
} ,
AutoFakeSlant .default:n = { true }
}
-\cs_new_protected_nopar:Npn \__xeCJK_set_family_initial:
+\cs_new_protected:Npn \__xeCJK_set_family_initial:
{
\int_gincr:N \g__xeCJK_family_int
\prop_clear:N \l__xeCJK_sub_key_prop
@@ -3126,7 +3137,7 @@
\bool_new:N \l__xeCJK_auto_fake_slant_bool
\fp_new:N \l__xeCJK_embolden_factor_fp
\fp_new:N \l__xeCJK_slant_factor_fp
-\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:
\__xeCJK_set_family_initial:
@@ -3149,14 +3160,14 @@
\tl_new:N \l__xeCJK_font_name_tl
\clist_new:N \l__xeCJK_font_options_clist
\cs_generate_variant:Nn \xeCJK_set_family:nnn { x , VVV , Voo }
-\cs_new_protected_nopar:Npn \__xeCJK_binding_sub_family:
+\cs_new_protected:Npn \__xeCJK_binding_sub_family:
{
\tl_if_empty:NF \l__xeCJK_sub_family_name_tl
{ \tl_set_eq:NN \l__xeCJK_family_name_tl \l__xeCJK_sub_family_name_tl }
}
-\cs_new_protected_nopar:Npn \__xeCJK_gset_family_cs:x #1
+\cs_new_protected:Npn \__xeCJK_gset_family_cs:x #1
{
- \cs_gset_protected_nopar:cpx { \__xeCJK_family_csname:n {#1} }
+ \cs_gset_protected:cpx { \__xeCJK_family_csname:n {#1} }
{
\group_begin:
\exp_not:n { \cs_set_eq:NN \xeCJK@fontfamily \use_none:n }
@@ -3172,7 +3183,7 @@
}
\tl_new:N \g__xeCJK_fontspec_family_tl
\tl_new:N \l__xeCJK_fontspec_family_tl
-\cs_new_protected_nopar:Npn \__xeCJK_check_family:n #1
+\cs_new_protected:Npn \__xeCJK_check_family:n #1
{
\prop_gpop:NnNT \g__xeCJK_family_font_name_prop {#1} \l__xeCJK_tmp_tl
{
@@ -3187,7 +3198,7 @@
\cs_generate_variant:Nn \__xeCJK_check_family:n { V }
\__xeCJK_msg_new:nn { CJKfamily-redef }
{ Redefining~CJKfamily~`\__xeCJK_msg_family_map:n {#1}'~(#2). }
-\cs_new_protected_nopar:Npn \__xeCJK_parse_font_shape:
+\cs_new_protected:Npn \__xeCJK_parse_font_shape:
{
\tl_if_blank:VTF \l__xeCJK_font_name_bf_tl
{
@@ -3217,14 +3228,14 @@
\prop_new:N \g__xeCJK_family_name_prop
\prop_new:N \g__xeCJK_family_font_name_prop
\prop_new:N \g__xeCJK_family_font_options_prop
-\cs_new_protected_nopar:Npn \__xeCJK_save_family_info:
+\cs_new_protected:Npn \__xeCJK_save_family_info:
{
\prop_gput:NVV \g__xeCJK_family_font_name_prop
\l__xeCJK_family_name_tl \l__xeCJK_font_name_tl
\prop_gput:NVV \g__xeCJK_family_font_options_prop
\l__xeCJK_family_name_tl \l__xeCJK_font_options_clist
}
-\cs_new_protected_nopar:Npn \__xeCJK_set_sub_block_family:
+\cs_new_protected:Npn \__xeCJK_set_sub_block_family:
{
\prop_map_inline:Nn \l__xeCJK_sub_key_prop
{
@@ -3237,7 +3248,7 @@
}
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_copy_sub_family:n #1
+\cs_new_protected:Npn \__xeCJK_copy_sub_family:n #1
{
\__xeCJK_check_family:V \l__xeCJK_sub_family_name_tl
\prop_get:NoNT \g__xeCJK_family_font_name_prop
@@ -3253,7 +3264,7 @@
\prop_gput:NVV \g__xeCJK_family_font_options_prop
\l__xeCJK_sub_family_name_tl \l__xeCJK_sub_font_options_clist
}
- \cs_gset_protected_nopar:cpx
+ \cs_gset_protected:cpx
{ \__xeCJK_family_csname:n { \l__xeCJK_sub_family_name_tl } }
{
\xeCJK_family_if_exist:xT { \l__xeCJK_family_name_tl }
@@ -3264,7 +3275,7 @@
}
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_copy_family:nn #1#2
+\cs_new_protected:Npn \__xeCJK_copy_family:nn #1#2
{
\xeCJK_family_if_exist:nT {#2}
{
@@ -3284,20 +3295,20 @@
{ \__xeCJK_family_nfss_csname:n {#2} }
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_copy_family:xx #1#2
+\cs_new_protected:Npn \__xeCJK_copy_family:xx #1#2
{ \use:x { \__xeCJK_copy_family:nn {#1} {#2} } }
-\cs_new_nopar:Npn \__xeCJK_font_csname:n #1
+\cs_new:Npn \__xeCJK_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
{ \__xeCJK_font_csname:n { \CJK@family } }
-\cs_new_protected_nopar:Npn \xeCJK_select_font:
+\cs_new_protected:Npn \xeCJK_select_font:
{
\__xeCJK_select_font:cn
{ \l_xeCJK_current_font_tl }
{ \l_xeCJK_family_tl }
}
-\cs_new_protected_nopar:Npn \__xeCJK_select_font:Nn #1#2
+\cs_new_protected:Npn \__xeCJK_select_font:Nn #1#2
{
\cs_if_exist:NF #1 { \__xeCJK_font_initial:Nn #1 {#2} }
#1
@@ -3305,7 +3316,7 @@
\cs_generate_variant:Nn \__xeCJK_select_font:Nn { c }
\tl_new:N \l__xeCJK_current_coor_tl
\cs_new_eq:NN \xeCJK@setfont \xeCJK_select_font:
-\cs_new_protected_nopar:Npn \__xeCJK_font_initial:Nn #1#2
+\cs_new_protected:Npn \__xeCJK_font_initial:Nn #1#2
{
\group_begin:
\__xeCJK_family_use:n {#2}
@@ -3313,7 +3324,7 @@
\group_end:
}
\cs_new_eq:NN \xeCJK_select_punct_font: \xeCJK_select_font:
-\cs_new_protected_nopar:Npn \__xeCJK_select_punct_font_aux:
+\cs_new_protected:Npn \__xeCJK_select_punct_font_aux:
{
\__xeCJK_select_font:cn
{ \l_xeCJK_current_punct_font_tl }
@@ -3326,7 +3337,7 @@
{ \__xeCJK_font_csname:n { \CJK@punctfamily } }
\cs_new_eq:NN \__xeCJK_select_font: \prg_do_nothing:
\cs_new_eq:NN \__xeCJK_select_punct_font: \prg_do_nothing:
-\cs_new_protected_nopar:Npn \__xeCJK_switch_font:nn #1#2
+\cs_new_protected:Npn \__xeCJK_switch_font:nn #1#2
{
\str_if_eq:nnF {#1} {#2}
{
@@ -3337,26 +3348,26 @@
}
}
\__xeCJK_msg_new:nn { CJK-block } { Switch~from~block~`#1'~to~`#2'. }
-\cs_new_protected_nopar:Npn \xeCJK_select_font:n #1
+\cs_new_protected:Npn \xeCJK_select_font:n #1
{
\__xeCJK_select_font:cnn
{ \__xeCJK_font_csname:n { \CJK@family/#1 } }
{ \l_xeCJK_family_tl }
{#1}
}
-\cs_new_protected_nopar:Npn \__xeCJK_select_font:Nnn #1#2#3
+\cs_new_protected:Npn \__xeCJK_select_font:Nnn #1#2#3
{
\cs_if_exist:NF #1
{ \__xeCJK_block_font_initial:Nnn #1 {#2} {#3} }
#1
}
\cs_generate_variant:Nn \__xeCJK_select_font:Nnn { c }
-\cs_new_protected_nopar:Npn \__xeCJK_block_font_initial:Nnn #1#2#3
+\cs_new_protected:Npn \__xeCJK_block_font_initial:Nnn #1#2#3
{
\xeCJK_block_family:nn {#2} {#3}
\__xeCJK_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 }
{
@@ -3368,23 +3379,23 @@
}
}
}
-\cs_new_nopar:Npn \__xeCJK_family_csname:n #1
+\cs_new:Npn \__xeCJK_family_csname:n #1
{ xeCJK/family/#1 }
-\cs_new_nopar:Npn \__xeCJK_family_nfss_csname:n #1
+\cs_new:Npn \__xeCJK_family_nfss_csname:n #1
{ xeCJK/family/nfss/#1 }
-\cs_new_protected_nopar:Npn \__xeCJK_family_use:n #1
+\cs_new_protected:Npn \__xeCJK_family_use:n #1
{ \use:c { \__xeCJK_family_nfss_csname:n {#1} } }
-\cs_new_protected_nopar:Npn \__xeCJK_gset_family_nfss_cs:nn #1#2
+\cs_new_protected:Npn \__xeCJK_gset_family_nfss_cs:nn #1#2
{
\prop_gput:Nnn \g__xeCJK_family_name_prop {#1} {#2}
- \cs_gset_protected_nopar:cpx
+ \cs_gset_protected:cpx
{ \__xeCJK_family_nfss_csname:n {#1} }
{ \__xeCJK_nfss_family:nn { \c__xeCJK_encoding_tl } {#2} }
}
\cs_generate_variant:Nn \__xeCJK_gset_family_nfss_cs:nn { xx }
\cs_if_exist:NTF \fontseriesforce
{
- \cs_new_protected_nopar:Npn \__xeCJK_nfss_family:nn #1#2
+ \cs_new_protected:Npn \__xeCJK_nfss_family:nn #1#2
{
\fontencoding {#1}
\str_if_eq:eeF { \f@series } { \bfdefault }
@@ -3399,14 +3410,14 @@
\fontfamily {#2}
\selectfont
}
- \cs_new_protected_nopar:Npn \__xeCJK_nfss_series:n #1
+ \cs_new_protected:Npn \__xeCJK_nfss_series:n #1
{
\str_if_eq:eeT { \f@series } { \use:c { bfseries@#1 } }
{ \fontseriesforce { \bfdefault } }
}
}
{
- \cs_new_protected_nopar:Npn \__xeCJK_nfss_family:nn #1#2
+ \cs_new_protected:Npn \__xeCJK_nfss_family:nn #1#2
{
\fontencoding {#1}
\tl_set:Nn \f@family {#2}
@@ -3430,7 +3441,7 @@
\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}
{
@@ -3452,7 +3463,7 @@
}
}
\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}
{
@@ -3477,7 +3488,7 @@
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}
{
@@ -3492,17 +3503,17 @@
\cs_generate_variant:Nn \xeCJK_punct_family:n { x }
\tl_new:N \l_xeCJK_family_tl
\tl_new:N \CJK@family
-\cs_new_protected_nopar:Npn \__xeCJK_gobble_CJKfamily:
+\cs_new_protected:Npn \__xeCJK_gobble_CJKfamily:
{ \cs_set_eq:NN \CJKfamily \__xeCJK_gobble_CJKfamily:wn }
\NewExpandableDocumentCommand \__xeCJK_gobble_CJKfamily:wn { t+ t- m } { }
-\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}
{ \__xeCJK_family_use:n {#1} }
{ \__xeCJK_family_unknown_warning:n {#1} }
}
\cs_generate_variant:Nn \xeCJK_family_if_exist_use:n { x }
-\cs_new_protected_nopar:Npn \__xeCJK_family_unknown_warning:n #1
+\cs_new_protected:Npn \__xeCJK_family_unknown_warning:n #1
{
\prop_if_empty:NF \g__xeCJK_family_font_name_prop
{
@@ -3520,7 +3531,7 @@
Unknown~CJK~family~`\__xeCJK_msg_family_map:n {#1}'~is~being~ignored.\\\\
Try~to~use~`\__xeCJK_msg_def_family_map:n {#1}'~to~define~it.
}
-\cs_new_nopar:Npn \__xeCJK_msg_def_family_map:n #1
+\cs_new:Npn \__xeCJK_msg_def_family_map:n #1
{
\str_case_e:nnF {#1}
{
@@ -3531,7 +3542,7 @@
{ \token_to_str:N \setCJKfamilyfont \{ #1 \} }
[...]\{...\}
}
-\cs_new_nopar:Npn \__xeCJK_msg_family_map:n #1
+\cs_new:Npn \__xeCJK_msg_family_map:n #1
{
\str_case_e:nnF {#1}
{
@@ -3579,7 +3590,7 @@
\@onlypreamble \setCJKsansfont
\@onlypreamble \setCJKmonofont
\@onlypreamble \setCJKromanfont
-\cs_new_protected_nopar:Npn \__xeCJK_preamble_family:n #1
+\cs_new_protected:Npn \__xeCJK_preamble_family:n #1
{ \str_if_eq:eeT {#1} { \CJKfamilydefault } { \normalfont } }
\NewDocumentCommand \setCJKfamilyfont { m o m }
{
@@ -3591,7 +3602,7 @@
{
\tl_set:Nx \l__xeCJK_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__xeCJK_tmp_tl } }
\__xeCJK_pass_args:nnnn
{ \xeCJK_set_family:nnn { \l__xeCJK_tmp_tl } } {#3} {#4}
@@ -3603,7 +3614,7 @@
{ \xeCJK_fontspec:nn } {#1} {#2}
{ \tex_ignorespaces:D }
}
-\cs_new_protected_nopar:Npn \xeCJK_fontspec:nn #1#2
+\cs_new_protected:Npn \xeCJK_fontspec:nn #1#2
{
\prop_get:NnNTF \g__xeCJK_fontspec_prop
{ CJKfontspec/#1/#2/id } \l_xeCJK_family_tl
@@ -3614,7 +3625,7 @@
{#1} {#2}
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_fontspec:nnn #1#2#3
+\cs_new_protected:Npn \__xeCJK_fontspec:nnn #1#2#3
{
\prop_gput:Nnn \g__xeCJK_fontspec_prop { CJKfontspec/#2/#3/id } {#1}
\xeCJK_set_family:nnn {#1} {#2} {#3}
@@ -3633,7 +3644,7 @@
\tex_ignorespaces:D
}
\cs_new_eq:NN \addCJKfontfeature \addCJKfontfeatures
-\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__xeCJK_family_font_name_prop
\l_xeCJK_family_tl \l__xeCJK_font_name_tl
@@ -3684,7 +3695,7 @@
\token_to_str:N \addCJKfontfeature (s)~ignored.\\\\
It~cannot~be~used~with~a~font~that~wasn't~selected~by~xeCJK.
}
-\cs_new_protected_nopar:Npn \__xeCJK_add_sub_class_features:n #1
+\cs_new_protected:Npn \__xeCJK_add_sub_class_features:n #1
{
\prop_get:NoNTF \g__xeCJK_family_font_name_prop
{ \l_xeCJK_family_tl/#1 } \l__xeCJK_sub_font_name_tl
@@ -3720,7 +3731,7 @@
\prg_generate_conditional_variant:Nnn \prop_get:NnN { Nx } { TF }
\keys_define:nn { xeCJK / options }
{ LoadFandol .bool_gset:N = \g__xeCJK_fandol_bool }
-\cs_new_protected_nopar:Npn \__xeCJK_load_fandol:
+\cs_new_protected:Npn \__xeCJK_load_fandol:
{
\xeCJK_set_family:xnn { \CJKrmdefault }
{ Extension = .otf , BoldFont = FandolSong-Bold , ItalicFont = FandolKai-Regular }
@@ -3760,7 +3771,7 @@
}
{ \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 }
{
@@ -3810,8 +3821,9 @@
{ }
}
\tl_const:Nn \c__xeCJK_math_tl { CJKmath }
-\cs_new_protected_nopar:Npn \xeCJK_set_mathfont:
+\cs_new_protected:Npn \xeCJK_set_mathfont:
{
+ \cs_if_exist_use:N \__xeCJK_save_um_char:
\xeCJK_family_if_exist:xTF { \c__xeCJK_math_tl }
{ \__xeCJK_set_mathfont_aux: }
{
@@ -3821,8 +3833,9 @@
\__xeCJK_set_mathfont_aux:
}
}
+ \cs_if_exist_use:N \__xeCJK_restore_um_char:
}
-\cs_new_protected_nopar:Npn \__xeCJK_set_mathfont_aux:
+\cs_new_protected:Npn \__xeCJK_set_mathfont_aux:
{
\tl_const:Nx \c__xeCJK_math_family_tl
{ \l__xeCJK_fontspec_family_tl }
@@ -3841,7 +3854,7 @@
}
\clist_new:N \g__xeCJK_math_chars_clist
\prop_new:N \g__xeCJK_fam_prop
-\cs_new_protected_nopar:Npn \xeCJK_set_mathfont_block:
+\cs_new_protected:Npn \xeCJK_set_mathfont_block:
{
\seq_if_empty:NF \g__xeCJK_CJK_sub_class_seq
{
@@ -3850,7 +3863,7 @@
\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__xeCJK_math_tl } {#1}
\prop_get:NoNTF \g__xeCJK_fam_prop
@@ -3865,7 +3878,7 @@
}
\xeCJK_gset_mathcode:cn { g__xeCJK_CJK/#1_range_clist } { \l__xeCJK_fam_int }
}
-\cs_new_protected_nopar:Npn \__xeCJK_set_mathfont_block_aux:Nn #1#2
+\cs_new_protected:Npn \__xeCJK_set_mathfont_block_aux:Nn #1#2
{
\int_set_eq:NN \l__xeCJK_fam_int #1
\prop_gput:Nnn \g__xeCJK_block_fam_prop {#2} {#1}
@@ -3873,7 +3886,7 @@
\int_new:N \l__xeCJK_fam_int
\prop_new:N \g__xeCJK_block_fam_prop
\cs_generate_variant:Nn \__xeCJK_set_mathfont_block_aux:Nn { c }
-\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__xeCJK_encoding_tl }
{#2} { \mddefault } { \shapedefault }
@@ -3921,12 +3934,12 @@
\cs_new_protected:Npn \__xeCJK_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
}
\cs_generate_variant:Nn \__xeCJK_new_symbol_font:NN { Nc }
-\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
{
@@ -3935,7 +3948,7 @@
}
}
\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
{
\__xeCJK_check_num_range:nnNN {#1} {#2} \l__xeCJK_begin_int \l__xeCJK_end_int
\xeCJK_int_until_do:nn { \l__xeCJK_begin_int > \l__xeCJK_end_int }
@@ -3944,7 +3957,7 @@
\int_incr:N \l__xeCJK_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 }
\int_new:N \l__xeCJK_verb_case_int
\keys_define:nn { xeCJK / options }
@@ -3954,7 +3967,7 @@
{ \int_set_eq:NN \l__xeCJK_verb_case_int \l_keys_choice_int } ,
Verb .default:n = { env }
}
-\cs_new_protected_nopar:Npn \__xeCJK_verb_font_hook:
+\cs_new_protected:Npn \__xeCJK_verb_font_hook:
{
\if_case:w \l__xeCJK_verb_case_int
\or:
@@ -3971,10 +3984,10 @@
}
\__xeCJK_after_preamble:n
{
- \cs_set_protected_nopar:Npx \verbatim@font
+ \cs_set_protected:Npx \verbatim@font
{ \exp_not:o { \verbatim@font } \__xeCJK_verb_font_hook: }
}
-\cs_new_protected_nopar:Npn \__xeCJK_nobreak_skip_zero:
+\cs_new_protected:Npn \__xeCJK_nobreak_skip_zero:
{
\__xeCJK_reset_shipout_skip:
\cs_set_eq:NN \__xeCJK_shipout_check_for_glue: \xeCJK_check_for_glue:
@@ -3991,7 +4004,7 @@
\cs_set_eq:NN \__xeCJK_punct_hskip:n \__xeCJK_nobreak_hskip:n
\cs_set_eq:NN \__xeCJK_punct_breakable_kern:n \__xeCJK_nobreak_hskip:n
}
-\cs_new_protected_nopar:Npn \__xeCJK_nobreak_skip:
+\cs_new_protected:Npn \__xeCJK_nobreak_skip:
{
\__xeCJK_reset_shipout_skip:
\xeCJK_glue_to_skip:nN { \CJKglue } \l__xeCJK_ccglue_skip
@@ -4005,11 +4018,11 @@
\cs_set_eq:NN \__xeCJK_punct_hskip:n \__xeCJK_nobreak_hskip:n
\cs_set_eq:NN \__xeCJK_punct_breakable_kern:n \__xeCJK_nobreak_hskip:n
}
-\cs_new_protected_nopar:Npn \__xeCJK_nobreak_ccglue:
+\cs_new_protected:Npn \__xeCJK_nobreak_ccglue:
{ \xeCJK_no_break: \skip_horizontal:N \l__xeCJK_ccglue_skip }
-\cs_new_protected_nopar:Npn \__xeCJK_nobreak_ecglue:
+\cs_new_protected:Npn \__xeCJK_nobreak_ecglue:
{ \xeCJK_no_break: \skip_horizontal:N \l__xeCJK_ecglue_skip }
-\cs_new_protected_nopar:Npn \__xeCJK_reset_shipout_skip:
+\cs_new_protected:Npn \__xeCJK_reset_shipout_skip:
{
\cs_set_eq:NN \__xeCJK_shipout_CJKglue: \CJKglue
\cs_set_eq:NN \__xeCJK_shipout_CJKecglue: \CJKecglue
@@ -4061,7 +4074,7 @@
\NewDocumentCommand \xeCJKOffVerbAddon { }
{ \tl_use:N \l__xeCJK_off_verb_addon_tl }
\tl_new:N \l__xeCJK_off_verb_addon_tl
-\cs_new_protected_nopar:Npn \__xeCJK_verb_addon:
+\cs_new_protected:Npn \__xeCJK_verb_addon:
{
\bool_if:NF \l__xeCJK_verb_addon_bool
{
@@ -4075,7 +4088,7 @@
\cs_set_eq:NN \__xeCJK_shipout_CJKecglue: \CJKecglue
\cs_set_eq:NN \__xeCJK_shipout_check_for_glue: \xeCJK_check_for_glue:
\cs_set_eq:NN \__xeCJK_shipout_boundary:w \xeCJK_CJK_and_Boundary:w
- \cs_set_protected_nopar:Npx \xeCJKOffVerbAddon
+ \cs_set_protected:Npx \xeCJKOffVerbAddon
{
\__xeCJK_reset_char_class:n { FullLeft }
\__xeCJK_reset_char_class:n { FullRight }
@@ -4110,9 +4123,9 @@
\cs_set_eq:NN \xeCJK_check_for_glue: \CJKecglue
\cs_set_eq:NN \xeCJK_CJK_and_Boundary:w \__xeCJK_verb_CJK_and_Boundary:w
}
-\cs_new_protected_nopar:Npn \__xeCJK_verb_CJK_and_Boundary:w
+\cs_new_protected:Npn \__xeCJK_verb_CJK_and_Boundary:w
{ \xeCJK_class_group_end: \CJKecglue }
-\cs_new_protected_nopar:Npn \__xeCJK_reset_char_class:n #1
+\cs_new_protected:Npn \__xeCJK_reset_char_class:n #1
{
\int_set:Nn \l__xeCJK_tmp_int { \xeCJK_class_num:n {#1} }
\clist_map_inline:cn { c__xeCJK_#1_chars_clist }
@@ -4120,7 +4133,7 @@
}
\bool_new:N \l__xeCJK_verb_addon_bool
\cs_new_eq:NN \CJKfixedspacing \xeCJKVerbAddon
-\cs_new_protected_nopar:Npn \__xeCJK_set_verb_exspace:
+\cs_new_protected:Npn \__xeCJK_set_verb_exspace:
{
\tl_if_exist:cTF { xeCJK/verb/\CJK@family/\curr@fontshape/\f@size }
{
@@ -4143,7 +4156,7 @@
}
}
\skip_new:N \l__xeCJK_verb_exspace_skip
-\cs_new_protected_nopar:Npn \__xeCJK_set_verb_exspace:n #1
+\cs_new_protected:Npn \__xeCJK_set_verb_exspace:n #1
{
\skip_set:Nn \l__xeCJK_verb_exspace_skip
{ 2 \tex_fontdimen:D 2 ~ \tex_font:D - #1 }
@@ -4162,7 +4175,7 @@
{ \skip_use:N \l__xeCJK_verb_exspace_skip }
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_set_verb_scale:nn #1#2
+\cs_new_protected:Npn \__xeCJK_set_verb_scale:nn #1#2
{
\fp_set:Nn \l__xeCJK_scale_factor_fp { #1 / #2 }
\__xeCJK_warning:nxx { scale-factor }
@@ -4184,7 +4197,7 @@
}
\fp_new:N \l__xeCJK_scale_factor_fp
\prop_new:N \g__xeCJK_scale_family_prop
-\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 }
@@ -4205,27 +4218,27 @@
}
\tl_new:N \l__xeCJK_visible_space_tl
\cs_set_eq:NN \@setupverbvisiblespace \xeCJK_setup_visible_space:
-\cs_new_protected_nopar:Npn \__xeCJK_visible_space_fallback:
+\cs_new_protected:Npn \__xeCJK_visible_space_fallback:
{
\exp_args:Nc \__xeCJK_visible_space_fallback_auxi:N
{ xeCJK/space/\curr@fontshape/\f@size }
}
-\cs_new_protected_nopar:Npn \__xeCJK_visible_space_fallback_auxi:N #1
+\cs_new_protected:Npn \__xeCJK_visible_space_fallback_auxi:N #1
{
\cs_if_exist:NF #1
{ \__xeCJK_visible_space_fallback_auxii:N #1 }
\tl_set:Nn \l__xeCJK_visible_space_tl {#1}
}
-\cs_new_protected_nopar:Npn \__xeCJK_visible_space_fallback_auxii:N #1
+\cs_new_protected:Npn \__xeCJK_visible_space_fallback_auxii:N #1
{
\group_begin:
\exp_args:No \__xeCJK_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 \__xeCJK_set_visible_space_size:n #1
+\cs_new_protected:Npn \__xeCJK_set_visible_space_size:n #1
{
\fontencoding { \UnicodeEncodingName }
\tl_set:Nn \f@family { lmtt }
@@ -4306,8 +4319,8 @@
Sorry,~but~xeCJK/options~does~not~have~a~key~called~`#1'.\\\\
The~key~`#1'~is~being~ignored.
}
-\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}
\keys_set:nn { xeCJK / options }
{
CJKglue = { \skip_horizontal:n { \c_zero_dim plus 0.08 \tex_baselineskip:D } } ,
@@ -4394,7 +4407,7 @@
\xeCJK_set_char_class:nnn {#1} {#2} {#3}
\xeCJKResetPunctClass
}
-\cs_new_protected_nopar:Npn \xeCJK@update@fam
+\cs_new_protected:Npn \xeCJK@update@fam
{
\addto@hook \everymath
{
@@ -4402,14 +4415,14 @@
\__xeCJK_update_block_fam:
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_update_main_fam:
+\cs_new_protected:Npn \__xeCJK_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 \__xeCJK_update_block_fam:
+\cs_new_protected:Npn \__xeCJK_update_block_fam:
{
\prop_if_empty:NF \g__xeCJK_block_fam_prop
{
@@ -4418,7 +4431,7 @@
\__xeCJK_update_block_fam:nn
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_update_block_fam:nn #1#2
+\cs_new_protected:Npn \__xeCJK_update_block_fam:nn #1#2
{
\int_set:Nn \l__xeCJK_fam_int {#2}
\group_begin:
@@ -4433,12 +4446,12 @@
{ \cs_if_exist_p:N \Url@MathSetup }
{ \tl_put_right:Nn \Url@MathSetup { \xeCJK@update@fam } }
}
-\cs_new_protected_nopar:Npn \__xeCJK_math_robust:N #1
+\cs_new_protected:Npn \__xeCJK_math_robust:N #1
{
\group_begin: \exp_args:NcNc \group_end:
{ __xeCJK_math_robust_aux:NN } #1 { \cs_to_str:N #1 ~ }
}
-\cs_new_protected_nopar:Npn \__xeCJK_math_robust_aux:NN #1#2
+\cs_new_protected:Npn \__xeCJK_math_robust_aux:NN #1#2
{
\exp_args:Nx \str_case:nnTF { \cs_replacement_spec:N #1 }
{
@@ -4448,19 +4461,19 @@
{ \__xeCJK_math_robust:NN #1#2 }
{ \__xeCJK_math_robust:NN #1#1 }
}
-\cs_new_protected_nopar:Npn \__xeCJK_math_robust:NN #1#2
+\cs_new_protected:Npn \__xeCJK_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} }
}
{
@@ -4518,13 +4531,13 @@
\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 } }
{ \__xeCJK_update_family_aux: }
}
- \cs_new_protected_nopar:Npn \__xeCJK_update_family_aux:
+ \cs_new_protected:Npn \__xeCJK_update_family_aux:
{
\str_case_e:nn { \f@family }
{
@@ -4538,18 +4551,18 @@
\cs_new_eq:NN \xeCJK@fix@penalty \fix@penalty
\tl_replace_once:Nnn \xeCJK@fix@penalty { \@@italiccorr } { \xeCJK@italiccorr }
\tl_replace_once:Nnn \sw@slant { \fix@penalty } { \xeCJK@fix@penalty }
-\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: }
{ \@@italiccorr }
}
-\cs_new_protected_nopar:Npn \xeCJK_italic_correction:
+\cs_new_protected:Npn \xeCJK_italic_correction:
{
\int_compare:nNnT \tex_lastnodetype:D = { 12 }
{ \__xeCJK_italic_correction: }
}
-\cs_new_protected_nopar:Npn \__xeCJK_italic_correction:
+\cs_new_protected:Npn \__xeCJK_italic_correction:
{
\dim_case:nnF { \tex_lastkern:D }
{
@@ -4573,7 +4586,7 @@
}
{ \tex_italiccorrection:D }
}
-\cs_new_protected_nopar:Npn \__xeCJK_italic_correction_aux:
+\cs_new_protected:Npn \__xeCJK_italic_correction_aux:
{
\exp_after:wN \exp_after:wN \exp_after:wN
\exp_after:wN \exp_after:wN \exp_after:wN \exp_after:wN
@@ -4597,7 +4610,7 @@
}
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_set_others_toks:n #1
+\cs_new_protected:Npn \__xeCJK_set_others_toks:n #1
{
\int_set:cn { \__xeCJK_class_csname:n { Others } } {#1}
\seq_map_inline:Nn \g__xeCJK_CJK_class_seq
@@ -4622,7 +4635,7 @@
}
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_inactive_group_begin:
+\cs_new_protected:Npn \__xeCJK_inactive_group_begin:
{ \group_begin: \makexeCJKinactive }
\cs_new_eq:NN \__xeCJK_inactive_group_end: \group_end:
\prop_const_from_keyval:Nn \c__xeCJK_ambiguous_char_prop
@@ -4640,7 +4653,7 @@
"2E3A = \texttwoemdash
}
\__xeCJK_at_end_preamble:n { \__xeCJK_patch_text_command: }
-\cs_new_protected_nopar:Npn \__xeCJK_patch_text_command:
+\cs_new_protected:Npn \__xeCJK_patch_text_command:
{
\xeCJK_if_package_loaded:nTF { xunicode }
{ \__xeCJK_patch_xunicode_ambiguous_char: }
@@ -4651,7 +4664,7 @@
\__xeCJK_patch_tuenc_composite:
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_patch_xunicode_ambiguous_char:
+\cs_new_protected:Npn \__xeCJK_patch_xunicode_ambiguous_char:
{
\RequirePackage { xunicode-addon }
\prop_map_inline:Nn \c__xeCJK_ambiguous_char_prop
@@ -4666,7 +4679,7 @@
}
\xunadd_append_begin_hook:n { \xeCJK_make_boundary: }
}
-\cs_new_protected_nopar:Npn \__xeCJK_patch_tuenc_ambiguous_char:n #1
+\cs_new_protected:Npn \__xeCJK_patch_tuenc_ambiguous_char:n #1
{
\prop_map_inline:Nn \c__xeCJK_ambiguous_char_prop
{
@@ -4678,13 +4691,13 @@
}
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_patch_ambiguous_char:nN #1#2
+\cs_new_protected:Npn \__xeCJK_patch_ambiguous_char:nN #1#2
{
\exp_args:Nx \__xeCJK_patch_ambiguous_char:nn
{ #1 \token_to_str:N #2 }
{ #1 - #2 }
}
-\cs_new_protected_nopar:Npx \__xeCJK_patch_ambiguous_char:nNn #1#2#3
+\cs_new_protected:Npx \__xeCJK_patch_ambiguous_char:nNn #1#2#3
{
\exp_args:Nx \exp_not:N \__xeCJK_patch_ambiguous_char:nn
{
@@ -4694,40 +4707,40 @@
}
{ #1 - #2#3 }
}
-\cs_new_protected_nopar:Npn \__xeCJK_patch_ambiguous_char:nn #1#2
+\cs_new_protected:Npn \__xeCJK_patch_ambiguous_char:nn #1#2
{
\cs_if_free:cF {#1}
{ \exp_args:Nc \__xeCJK_patch_ambiguous_char:Nn {#1} {#2} }
}
-\cs_new_protected_nopar:Npn \__xeCJK_patch_ambiguous_char:Nn #1#2
+\cs_new_protected:Npn \__xeCJK_patch_ambiguous_char:Nn #1#2
{
\token_if_chardef:NTF #1
{
\prop_gput:Nnx \c__xeCJK_ambiguous_slot_prop {#2}
{ \int_eval:n {#1} }
- \cs_set_protected_nopar:Npx #1
+ \cs_set_protected:Npx #1
{ \__xeCJK_ambiguous_char:n { \tex_Uchar:D #1 } }
}
{
\prop_gput:Nnx \c__xeCJK_ambiguous_slot_prop {#2}
{ \int_eval:n { \exp_after:wN ` #1 } }
- \cs_set_protected_nopar:Npx #1
+ \cs_set_protected:Npx #1
{ \__xeCJK_ambiguous_char:n { \exp_not:o {#1} } }
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_ambiguous_char:n #1
+\cs_new_protected:Npn \__xeCJK_ambiguous_char:n #1
{
\int_compare:nNnTF \tex_XeTeXinterchartokenstate:D > \c_zero_int
{ \__xeCJK_inactive_group_begin: #1 \__xeCJK_inactive_group_end: }
{#1}
}
\prop_new:N \c__xeCJK_ambiguous_slot_prop
-\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: }
}
-\cs_new_protected_nopar:Npn \__xeCJK_patch_tuenc_composite:
+\cs_new_protected:Npn \__xeCJK_patch_tuenc_composite:
{
\cs_set_nopar:Npn \@text@composite@x
{
@@ -4737,7 +4750,7 @@
}
\group_begin:
\char_set_catcode_other:n { "A0 }
-\cs_new_protected_nopar:Npn \__xeCJK_patch_tuenc_accent:
+\cs_new_protected:Npn \__xeCJK_patch_tuenc_accent:
{
\cs_set_protected_nopar:Npn \add@unicode@accent ##1 ##2
{
@@ -4759,32 +4772,59 @@
T5 = \` \ecircumflex
}
\__xeCJK_at_end_preamble:n { \__xeCJK_patch_middle_dot: }
-\cs_new_protected_nopar:Npn \__xeCJK_patch_middle_dot:
+\cs_new_protected:Npn \__xeCJK_patch_middle_dot:
{
\prop_map_inline:Nn \c__xeCJK_middle_dot_prop
{ \__xeCJK_patch_middle_dot:nw { ##1 } ##2 \q_stop }
\__xeCJK_patch_ambiguous_char:nNn { T5 } \` { \^ - e }
}
-\cs_new_protected_nopar:Npn \__xeCJK_patch_middle_dot:nw #1#2#3 \q_stop
+\cs_new_protected:Npn \__xeCJK_patch_middle_dot:nw #1#2#3 \q_stop
{
\tl_if_empty:nTF {#3}
{ \__xeCJK_patch_ambiguous_char:nN {#1} #2 }
{ \__xeCJK_patch_ambiguous_char:nNn {#1} #2 {#3} }
}
-\__xeCJK_after_end_preamble:n
+\__xeCJK_package_hook:nn { pifont }
{
- \xeCJK_if_package_loaded:nT { pifont }
+ \RenewDocumentCommand \Pifont { m }
+ { \makexeCJKinactive \usefont { U } {#1} { m } { n } }
+ }
+\__xeCJK_package_hook:nn { unicode-math }
+ {
+ \prop_const_from_keyval:Nn \c__xeCJK_um_ambiguous_char_prop
{
- \RenewDocumentCommand \Pifont { m }
- { \makexeCJKinactive \usefont { U } {#1} { m } { n } }
+ "00B7 = \cdotp ,
+ "2025 = \enleadertwodots ,
+ "2026 = \unicodeellipsis
+ }
+ \cs_new_protected:Npn \__xeCJK_save_um_char:
+ {
+ \cs_set_protected:Npx \__xeCJK_restore_um_char:
+ {
+ \prop_map_function:NN
+ \c__xeCJK_um_ambiguous_char_prop
+ \__xeCJK_restore_um_char_aux:nn
+ }
+ }
+ \cs_new_eq:NN \__xeCJK_restore_um_char: \prg_do_nothing:
+ \cs_new:Npn \__xeCJK_restore_um_char_aux:nn #1#2
+ {
+ \__xeCJK_gset_mathcodenum:nn
+ { \int_value:w #1 }
+ { \int_value:w \tex_Umathcodenum:D #1 }
+ }
+ \cs_new_protected:Npn \__xeCJK_gset_mathcodenum:nn #1#2
+ {
+ \int_compare:nNnF { \tex_Umathcodenum:D #1 } = {#2}
+ { \tex_global:D \tex_Umathcodenum:D #1 = #2 ~ }
}
}
-\__xeCJK_at_end_preamble:n
+\__xeCJK_package_hook:nn { microtype }
{
\cs_if_free:NF \MT@get@slot@
{ \__xeCJK_patch_microtype_get_slot: }
}
-\cs_new_protected_nopar:Npn \__xeCJK_patch_microtype_get_slot:
+\cs_new_protected:Npn \__xeCJK_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
@@ -4796,47 +4836,34 @@
{ \__xeCJK_get_ambiguous_slot: }
\xeCJK@original@get@slot
}
-\cs_new_protected_nopar:Npn \__xeCJK_get_ambiguous_slot:
+\cs_new_protected:Npn \__xeCJK_get_ambiguous_slot:
{
\exp_args:NNx \prop_get:NnNT \c__xeCJK_ambiguous_slot_prop
{ \MT@encoding - \tex_the:D \MT@toks } \l__xeCJK_tmp_tl
{ \cs_set_eq:NN \MT@char \l__xeCJK_tmp_tl }
}
-\__xeCJK_after_end_preamble:n
+\__xeCJK_package_hook:nn { hyperref }
{
- \cs_if_exist_use:NT \pdfstringdefDisableCommands
+ \pdfstringdefDisableCommands
{
- {
- \__xeCJK_gobble_CJKfamily:
- \xeCJK_cs_clear:N \__xeCJK_inactive_group_begin:
- \xeCJK_cs_clear:N \__xeCJK_inactive_group_end:
- \xeCJK_cs_clear:N \makexeCJKinactive
- \xeCJK_cs_clear:N \xeCJK@composite@patch
- }
+ \__xeCJK_gobble_CJKfamily:
+ \xeCJK_cs_clear:N \__xeCJK_inactive_group_begin:
+ \xeCJK_cs_clear:N \__xeCJK_inactive_group_end:
+ \xeCJK_cs_clear:N \makexeCJKinactive
+ \xeCJK_cs_clear:N \xeCJK@composite@patch
}
}
-\__xeCJK_after_end_preamble:n
+\__xeCJK_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 }
}
-\__xeCJK_at_end_preamble:n
- {
- \xeCJK_if_package_loaded:nT { listings }
- { \RequirePackage { xeCJK-listings } }
- }
-\__xeCJK_at_end_preamble:n
+\__xeCJK_package_hook:nn { listings }
+ { \RequirePackage { xeCJK-listings } }
+\clist_map_inline:nn { everysel , microtype }
{
- \clist_map_inline:nn { everysel , microtype }
- {
- \xeCJK_if_package_loaded:nT {#1}
- {
- \cs_undefine:c { ver@CJK . \c__xeCJK_package_ext_tl }
- \clist_map_break:
- }
- }
+ \__xeCJK_package_hook:nn {#1}
+ { \cs_undefine:c { ver@CJK . \c__xeCJK_package_ext_tl } }
}
\cs_new_protected:Npn \CJKaddEncHook #1#2
{
@@ -4855,7 +4882,7 @@
{ \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: }
\bool_if:NT \g__xeCJK_config_bool
{