summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/xecjk
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-08-18 23:36:18 +0000
committerKarl Berry <karl@freefriends.org>2013-08-18 23:36:18 +0000
commit63a2bf1ad66c853ca9858eec2ca115d3c2267f43 (patch)
tree4d65a306b518b02ea7566282d1b3f341481f583e /Master/texmf-dist/tex/xelatex/xecjk
parent61f0c1ea7acefd4a1ab37a9464f28c1331d1d897 (diff)
xecjk (18aug13)
git-svn-id: svn://tug.org/texlive/trunk@31466 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xecjk')
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg4
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty6
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty372
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty7
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty118
5 files changed, 283 insertions, 224 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg b/Master/texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg
index 2e32945e9bf..e8e4375851b 100644
--- a/Master/texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg
+++ b/Master/texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg
@@ -6,11 +6,11 @@
%%
%% xeCJK.dtx (with options: `config')
%%
-\GetIdInfo$Id: xeCJK.dtx 477 2013-07-25 22:15:20Z sobenlee $
+\GetIdInfo$Id: xeCJK.dtx 510 2013-08-15 23:20:17Z sobenlee $
{Configuration file for xeCJK package}
\ProvidesExplFile
{\ExplFileName.cfg}
- {\ExplFileDate}{3.2.5}{\ExplFileDescription}
+ {\ExplFileDate}{3.2.6}{\ExplFileDescription}
%%
%%
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty
index a3953c92c43..e07d41cfa1d 100644
--- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty
+++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty
@@ -6,7 +6,7 @@
%%
%% xeCJK.dtx (with options: `listings')
%%
-%% $Id: xeCJK.dtx 477 2013-07-25 22:15:20Z sobenlee $
+%% $Id: xeCJK.dtx 510 2013-08-15 23:20:17Z sobenlee $
%% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%% -----------------------------------------------------------------
%% Author:
@@ -33,11 +33,11 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: xeCJK.dtx 477 2013-07-25 22:15:20Z sobenlee $
+\GetIdInfo$Id: xeCJK.dtx 510 2013-08-15 23:20:17Z sobenlee $
{xeCJK patch file for listings}
\ProvidesExplPackage
{xeCJK-listings}
- {\ExplFileDate}{3.2.5}{\ExplFileDescription}
+ {\ExplFileDate}{3.2.6}{\ExplFileDescription}
\DeclareOption* { \PassOptionsToPackage { \CurrentOption } { xeCJK } }
\ProcessOptions \scan_stop:
\RequirePackage { xeCJK }
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
index 629aaf9d8dd..c52709f906a 100644
--- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
+++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
@@ -6,7 +6,7 @@
%%
%% xeCJK.dtx (with options: `package')
%%
-%% $Id: xeCJK.dtx 477 2013-07-25 22:15:20Z sobenlee $
+%% $Id: xeCJK.dtx 510 2013-08-15 23:20:17Z sobenlee $
%% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%% -----------------------------------------------------------------
%% Author:
@@ -33,11 +33,11 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: xeCJK.dtx 477 2013-07-25 22:15:20Z sobenlee $
+\GetIdInfo$Id: xeCJK.dtx 510 2013-08-15 23:20:17Z sobenlee $
{Typesetting CJK scripts with XeLaTeX}
\ProvidesExplPackage
{\ExplFileName}
- {\ExplFileDate}{3.2.5}{\ExplFileDescription}
+ {\ExplFileDate}{3.2.6}{\ExplFileDescription}
\msg_new:nnn { xeCJK } { Require-XeTeX }
{
The~xeCJK~package~requires~XeTeX~to~function.\\\\
@@ -81,7 +81,7 @@
using~your~TeX~package~manager~or~from~CTAN.\\
\str_if_eq:nnT {#1} { expl3 } { Loading~xeCJK~will~abort! }
}
-\@ifpackagelater { expl3 } { 2012/11/10 } { }
+\@ifpackagelater { expl3 } { 2013/07/20 } { }
{ \msg_critical:nnn { xeCJK } { l3-too-old } { expl3 } }
\RequirePackage { xtemplate }
\@ifpackagelater { xtemplate } { 2012/11/10 } { }
@@ -95,6 +95,7 @@
\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 } }
@@ -838,11 +839,43 @@
space .meta:n = { CJKspace = true } ,
nospace .meta:n = { CJKspace = false }
}
-\xeCJK_inter_class_toks:nnn { CJK } { Boundary }
+\xeCJK_inter_class_toks:nnn { CJK } { Boundary } { \xeCJK_CJK_and_Boundary:w }
+\cs_new_protected_nopar:Npn \xeCJK_CJK_and_Boundary:w
{
- \xeCJK_class_group_end:
- { \xeCJK_make_node:n { CJK } }
- \xeCJK_ignore_spaces:w
+ \xeCJK_peek_catcode_ignore_spaces:NTF \c_math_toggle_token
+ {
+ \bool_if:NTF \l__xeCJK_peek_ignore_spaces_bool
+ { \xeCJK_class_group_end: \xeCJK_space_or_xecglue: }
+ { \xeCJK_class_group_end: \CJKecglue }
+ }
+ {
+ \bool_if:NTF \l__xeCJK_peek_ignore_spaces_bool
+ {
+ \bool_if:nTF
+ {
+ \token_if_macro_p:N \l_peek_token ||
+ ( \l__xeCJK_reserve_space_bool && \token_if_letter_p:N \l_peek_token )
+ }
+ {
+ \xeCJK_class_group_end: { \xeCJK_make_node:n { CJK-space } }
+ \xeCJK_space_or_xecglue:
+ }
+ { \xeCJK_class_group_end: { \xeCJK_make_node:n { CJK-space } } }
+ }
+ {
+ \token_if_eq_meaning:NNTF \l_peek_token \scan_stop:
+ { \__xeCJK_CJK_and_Boundary_relax:N }
+ { \__xeCJK_CJK_and_Boundary_aux: }
+ }
+ }
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_CJK_and_Boundary_aux:
+ { \xeCJK_class_group_end: { \xeCJK_make_node:n { CJK } } }
+\cs_new_protected:Npn \__xeCJK_CJK_and_Boundary_relax:N #1
+ {
+ \__xeCJK_CJK_and_Boundary_aux:
+ \token_if_eq_meaning:NNTF #1 \scan_stop:
+ {#1} { \cs_set_eq:NN #1 \scan_stop: #1 }
}
\cs_new_protected_nopar:Npn \xeCJK_ignore_spaces:w
{
@@ -852,23 +885,19 @@
{ \xeCJK_space_or_xecglue: } { \CJKecglue }
}
{
- \bool_if:NTF \l__xeCJK_peek_ignore_spaces_bool
+ \bool_if:NT \l__xeCJK_peek_ignore_spaces_bool
{
- \xeCJK_remove_node:
- { \xeCJK_make_node:n { CJK-space } }
+ \xeCJK_if_last_node:nT { CJK }
+ { \xeCJK_remove_node: { \xeCJK_make_node:n { CJK-space } } }
\bool_if:nT
{
\token_if_macro_p:N \l_peek_token ||
- ( \l__xeCJK_reserve_space_bool &&
- \token_if_letter_p:N \l_peek_token )
+ ( \l__xeCJK_reserve_space_bool && \token_if_letter_p:N \l_peek_token )
}
{ \xeCJK_space_or_xecglue: }
}
- { \__xeCJK_CJK_and_Boundary_aux: }
}
}
-\cs_new_protected_nopar:Npn \__xeCJK_CJK_and_Boundary_aux:
- { \cs_if_exist:NF \l_peek_token \exp_not:N }
\xeCJK_inter_class_toks:nnn { CJK } { CJK } { \xeCJK_CJK_and_CJK:N }
\cs_new_protected_nopar:Npn \xeCJK_CJK_and_CJK:N #1 { \CJKglue \CJKsymbol {#1} }
\xeCJK_inter_class_toks:nnn { FullLeft } { CJK }
@@ -988,7 +1017,7 @@
}
\cs_new_protected_nopar:Npn \__xeCJK_Boundary_and_FullLeft_glue:N #1
{
- \int_case:nnn { \etex_lastnodetype:D }
+ \int_case:nnTF { \etex_lastnodetype:D }
{
{ \c_one }
{
@@ -1037,7 +1066,7 @@
{ \use:n }
}
}
- { \use:n }
+ { { \__xeCJK_punct_glue:NN \c__xeCJK_left_tl {#1} } }
{ \__xeCJK_punct_glue:NN \c__xeCJK_left_tl {#1} }
}
\cs_new_protected_nopar:Npn \xeCJK_Default_and_FullRight:nN #1#2
@@ -1166,11 +1195,15 @@
{
\xeCJK_get_punct_bounds:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
- \tl_case:Non \l_peek_token { \l__xeCJK_no_break_cs_case_tl } { }
+ \group_align_safe_begin:
+ \tl_case:NoTF \l_peek_token
+ { \l__xeCJK_no_break_cs_case_tl }
+ { \group_align_safe_end: \xeCJK_no_break: }
+ { \group_align_safe_end: }
\__xeCJK_punct_glue:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\xeCJK_class_group_end:
}
-\cs_generate_variant:Nn \tl_case:Nnn { No }
+\cs_generate_variant:Nn \tl_case:NnTF { No }
\cs_new_protected_nopar:Npn \xeCJK_check_FullRight_symbol:Nw #1
{ \xeCJK_peek_after_ignore_spaces:nw { \__xeCJK_save_FullRight_symbol:N {#1} } }
\cs_new_protected:Npn \xeCJK_cs_case_keys_define:nNNnn #1#2#3#4#5
@@ -1204,7 +1237,7 @@
#4
}
\xeCJK_cs_case_keys_define:nNNnn { NoBreakCS }
- \l__xeCJK_no_break_cs_case_tl \l__xeCJK_no_break_cs_seq { \xeCJK_no_break: } { }
+ \l__xeCJK_no_break_cs_case_tl \l__xeCJK_no_break_cs_seq { } { }
\NewDocumentCommand \xeCJKnobreak { }
{
\bool_set_true:N \l__xeCJK_tmp_bool
@@ -1245,12 +1278,14 @@
\peek_catcode:NTF \c_catcode_letter_token
{ \xeCJK_check_single:NNw #1 }
{
+ \group_align_safe_begin:
\token_if_other:NTF \l_peek_token
- { \xeCJK_check_single:NNw #1 }
+ { \group_align_safe_end: \xeCJK_check_single:NNw #1 }
{
+ \group_align_safe_end:
\bool_if:nTF
{
- \xeCJK_if_blank_x_p:n { \token_get_arg_spec:N \l_peek_token } &&
+ \str_if_eq_x_p:nn { \token_get_arg_spec:N \l_peek_token } { } &&
\exp_args:No \tl_if_single_token_p:n \l_peek_token &&
( \exp_after:wN \token_if_other_p:N \l_peek_token ||
\exp_after:wN \token_if_letter_p:N \l_peek_token )
@@ -1328,7 +1363,7 @@
\cs_new_protected_nopar:Npn \xeCJK_check_single_cs:NNn #1#2#3
{
\group_align_safe_begin:
- \tl_case:Non \l_peek_token
+ \tl_case:NoF \l_peek_token
{ \l__xeCJK_check_single_cs_case_tl }
{ \group_align_safe_end: \use_iii:nnn }
{ \xeCJK_check_single_env:nnNn }
@@ -1339,16 +1374,17 @@
{ \__xeCJK_check_single_save:N #1 #2#3 }
}
\tl_new:N \l__xeCJK_check_single_cs_case_tl
+\cs_generate_variant:Nn \tl_case:NnF { No }
\cs_new_protected_nopar:Npn \xeCJK_check_single_env:nnNn #1#2#3#4
{
\group_align_safe_begin:
- \str_case_x:non {#4}
+ \str_case_x:noTF {#4}
{ \l__xeCJK_inline_env_case_tl }
- { \group_align_safe_end: \use_i:nn }
- {#1} {#2}
- \scan_stop: #3 {#4}
+ { \group_align_safe_end: #2 }
+ { \group_align_safe_end: #1 }
+ #3 {#4}
}
-\cs_generate_variant:Nn \str_case_x:nnn { no }
+\cs_generate_variant:Nn \str_case_x:nnTF { no }
\xeCJK_cs_case_keys_define:nNNnn { NewLineCS }
\l__xeCJK_new_line_cs_case_tl \l__xeCJK_new_line_cs_seq
{ \group_align_safe_end: \use_ii:nnn }
@@ -1391,7 +1427,7 @@
{
\tl_clear:N \l__xeCJK_inline_env_case_tl
\seq_map_inline:Nn \l__xeCJK_inline_env_seq
- { \tl_put_right:Nn \l__xeCJK_inline_env_case_tl { {##1} { \use_ii:nn } } }
+ { \tl_put_right:Nn \l__xeCJK_inline_env_case_tl { {##1} { } } }
}
\tl_new:N \l__xeCJK_inline_env_case_tl
\keys_define:nn { xeCJK / options }
@@ -2201,23 +2237,19 @@
\cs_generate_variant:Nn \__xeCJK_get_sub_features:nn { V }
\cs_generate_variant:Nn \tl_replace_all:Nnn { NnV }
\xeCJK_new_sub_key:n { FallBack }
-\prop_new:N \g__xeCJK_features_id_prop
-\prop_put:Nnn \g__xeCJK_features_id_prop { bf } { Bold }
-\prop_put:Nnn \g__xeCJK_features_id_prop { it } { Italic }
-\prop_put:Nnn \g__xeCJK_features_id_prop { bfit } { BoldItalic }
-\prop_put:Nnn \g__xeCJK_features_id_prop { sl } { Slanted }
-\prop_put:Nnn \g__xeCJK_features_id_prop { bfsl } { BoldSlanted }
-\prop_map_inline:Nn \g__xeCJK_features_id_prop
+\keys_define:nn { xeCJK / features }
{
- \keys_define:nn { xeCJK / features }
- {
- #2Font .tl_set:c = { l__xeCJK_font_name_#1_tl } ,
- #2Features .clist_set:c = { l__xeCJK_font_feat_#1_clist }
- }
+ BoldFont .tl_set:N = \l__xeCJK_font_name_bf_tl ,
+ ItalicFont .tl_set:N = \l__xeCJK_font_name_it_tl
}
\keys_define:nn { xeCJK / features }
{
AutoFakeBold .choice: ,
+ AutoFakeBold / true .code:n =
+ {
+ \bool_set_true:N \l__xeCJK_auto_fake_bold_bool
+ \fp_set_eq:NN \l__xeCJK_embolden_factor_fp \g__xeCJK_embolden_factor_fp
+ } ,
AutoFakeBold / false .code:n =
{ \bool_set_false:N \l__xeCJK_auto_fake_bold_bool } ,
AutoFakeBold / unknown .code:n =
@@ -2225,8 +2257,13 @@
\bool_set_true:N \l__xeCJK_auto_fake_bold_bool
\fp_set:Nn \l__xeCJK_embolden_factor_fp { \l_keys_value_tl }
} ,
- AutoFakeBold .default:n = { \g__xeCJK_embolden_factor_fp } ,
+ AutoFakeBold .default:n = { true } ,
AutoFakeSlant .choice: ,
+ AutoFakeSlant / true .code:n =
+ {
+ \bool_set_true:N \l__xeCJK_auto_fake_slant_bool
+ \fp_set_eq:NN \l__xeCJK_slant_factor_fp \g__xeCJK_slant_factor_fp
+ } ,
AutoFakeSlant / false .code:n =
{ \bool_set_false:N \l__xeCJK_auto_fake_slant_bool } ,
AutoFakeSlant / unknown .code:n =
@@ -2234,26 +2271,21 @@
\bool_set_true:N \l__xeCJK_auto_fake_slant_bool
\fp_set:Nn \l__xeCJK_slant_factor_fp { \l_keys_value_tl }
} ,
- AutoFakeSlant .default:n = { \g__xeCJK_slant_factor_fp }
+ AutoFakeSlant .default:n = { true }
}
\cs_new_protected_nopar:Npn \__xeCJK_set_family_initial:
{
\int_gincr:N \g__xeCJK_family_int
- \prop_clear:N \l__xeCJK_add_font_prop
\prop_clear:N \l__xeCJK_sub_key_prop
- \prop_map_inline:Nn \g__xeCJK_features_id_prop
- {
- \tl_clear:c { l__xeCJK_font_name_##1_tl }
- \clist_clear:c { l__xeCJK_font_feat_##1_clist }
- }
+ \tl_clear:N \l__xeCJK_font_name_bf_tl
+ \tl_clear:N \l__xeCJK_font_name_it_tl
\clist_clear:N \l__xeCJK_fontspec_options_clist
- \bool_set_eq:NN \l__xeCJK_auto_fake_bold_bool \g__xeCJK_auto_fake_bold_bool
- \bool_set_eq:NN \l__xeCJK_auto_fake_slant_bool \g__xeCJK_auto_fake_slant_bool
+ \bool_set_eq:NN \l__xeCJK_auto_fake_bold_bool \g__xeCJK_auto_fake_bold_bool
+ \bool_set_eq:NN \l__xeCJK_auto_fake_slant_bool \g__xeCJK_auto_fake_slant_bool
\fp_set_eq:NN \l__xeCJK_embolden_factor_fp \g__xeCJK_embolden_factor_fp
\fp_set_eq:NN \l__xeCJK_slant_factor_fp \g__xeCJK_slant_factor_fp
}
\int_new:N \g__xeCJK_family_int
-\prop_new:N \l__xeCJK_add_font_prop
\prop_new:N \l__xeCJK_sub_key_prop
\clist_new:N \l__xeCJK_fontspec_options_clist
\bool_new:N \l__xeCJK_auto_fake_bold_bool
@@ -2272,8 +2304,7 @@
\__xeCJK_remove_duplicate_keys:N \l__xeCJK_font_options_clist
\keys_set_known:nVN { xeCJK / features }
\l__xeCJK_font_options_clist \l__xeCJK_fontspec_options_clist
- \__xeCJK_parse_features:
- \__xeCJK_pass_features:
+ \__xeCJK_parse_font_shape:
\__xeCJK_check_family:V \l__xeCJK_family_name_tl
\__xeCJK_gset_family_cs:x { \l__xeCJK_family_name_tl }
\__xeCJK_save_family_info:
@@ -2313,7 +2344,7 @@
\cs_gset_protected_nopar:cpx { \__xeCJK_family_csname:n {#1} }
{
\group_begin:
- \exp_not:n { \cs_set_eq:NN \__xeCJK_update_family:n \use_none:n }
+ \exp_not:n { \cs_set_eq:NN \__xeCJK_update_family:n \use_none:nn }
\exp_not:n { \fontspec_set_family:Nnn \l__xeCJK_fontspec_family_tl }
{ \exp_not:V \l__xeCJK_fontspec_options_clist }
{ \exp_not:V \l__xeCJK_font_name_tl }
@@ -2324,7 +2355,7 @@
\tl_new:N \l__xeCJK_fontspec_family_tl
\cs_new_protected_nopar:Npn \__xeCJK_check_family:n #1
{
- \prop_get:NnNT \g__xeCJK_family_font_name_prop {#1} \l__xeCJK_tmp_tl
+ \prop_gpop:NnNT \g__xeCJK_family_font_name_prop {#1} \l__xeCJK_tmp_tl
{
\prop_gpop:NnNT \g__xeCJK_family_name_prop {#1} \l__xeCJK_tmp_tl
{ \cs_undefine:c { \__xeCJK_family_nfss_csname:n {#1} } }
@@ -2334,124 +2365,42 @@
\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_add_font:nn #1#2
- { \prop_put:Nnn \l__xeCJK_add_font_prop { #1 Font } {#2} }
-\cs_new_protected_nopar:Npn \__xeCJK_add_font_if_new:nn #1#2
- { \prop_put_if_new:Nnn \l__xeCJK_add_font_prop { #1 Font } {#2} }
-\cs_generate_variant:Nn \__xeCJK_add_font:nn { nx , nV , nv }
-\cs_generate_variant:Nn \__xeCJK_add_font_if_new:nn { nx , nV , nv }
-\cs_new_protected_nopar:Npn \__xeCJK_add_fake_bold:n #1
- {
- \clist_put_left:cx { l__xeCJK_font_feat_#1_clist }
- { FakeBold = { \fp_use:N \l__xeCJK_embolden_factor_fp } }
- }
-\cs_new_protected_nopar:Npn \__xeCJK_add_fake_slant:n #1
- {
- \clist_put_left:cx { l__xeCJK_font_feat_#1_clist }
- { FakeSlant = { \fp_use:N \l__xeCJK_slant_factor_fp } }
- }
-\cs_new_protected_nopar:Npn \__xeCJK_parse_features:
- { \prop_map_function:NN \g__xeCJK_features_id_prop \__xeCJK_parse_features:nn }
-\cs_new_protected_nopar:Npn \__xeCJK_parse_features:nn #1#2
- {
- \__xeCJK_if_font_select:nTF {#1}
- {
- \__xeCJK_add_font:nv {#2} { l__xeCJK_font_name_#1_tl }
- \__xeCJK_if_it_or_sl:nTF {#1}
- {
- \__xeCJK_if_font_select:nF { bf #1 }
- { \__xeCJK_add_font_if_new:nv {#2} { l__xeCJK_font_name_#1_tl } }
- }
- {
- \str_if_eq:nnT {#1} { bf }
- {
- \__xeCJK_if_font_select:nF { bfit }
- { \__xeCJK_add_font:nV { BoldItalic } \l__xeCJK_font_name_bf_tl }
- \__xeCJK_if_font_select:nF { bfsl }
- { \__xeCJK_add_font:nV { BoldSlanted } \l__xeCJK_font_name_bf_tl }
- }
- }
- }
- { \__xeCJK_set_fake_font:nn {#1} {#2} }
- }
-\prg_new_conditional:Npnn \__xeCJK_if_font_select:n #1 { p , T , F , TF }
- {
- \tl_if_blank:vTF { l__xeCJK_font_name_#1_tl }
- { \prg_return_false: } { \prg_return_true: }
- }
-\prg_new_conditional:Npnn \__xeCJK_if_it_or_sl:n #1 { p , T , F , TF }
- {
- \if_predicate:w
- \bool_if_p:n { \str_if_eq_p:nn { it } {#1} || \str_if_eq_p:nn { sl } {#1} }
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\cs_generate_variant:Nn \tl_if_blank:nTF { v }
-\cs_new_protected_nopar:Npn \__xeCJK_set_fake_font:nn #1#2
+\cs_new_protected_nopar:Npn \__xeCJK_parse_font_shape:
{
- \str_if_eq:nnTF {#1} { bf }
- { \bool_if:NT \l__xeCJK_auto_fake_bold_bool { \__xeCJK_add_fake_bold:n {#1} } }
+ \tl_if_blank:VTF \l__xeCJK_font_name_bf_tl
{
- \bool_if:NTF \l__xeCJK_auto_fake_slant_bool
+ \bool_if:NT \l__xeCJK_auto_fake_bold_bool
{
- \bool_if:nT
- { \__xeCJK_if_it_or_sl_p:n {#1}
- || ( \str_if_eq_p:nn {#1} { bfit }
- && ! ( \__xeCJK_if_font_select_p:n { it } ) )
- || ( \str_if_eq_p:nn {#1} { bfsl }
- && ! ( \__xeCJK_if_font_select_p:n { sl } ) )
- }
- { \__xeCJK_add_fake_slant:n {#1} }
- }
- { \__xeCJK_if_it_or_sl:nT {#1} { \__xeCJK_map_it_sl:nn {#1} {#2} } }
- \bool_if:nT
- { \l__xeCJK_auto_fake_bold_bool
- && ! ( \__xeCJK_if_it_or_sl_p:n {#1} )
- && ! ( \__xeCJK_if_font_select_p:n { bf } )
+ \clist_put_right:Nx \l__xeCJK_fontspec_options_clist
+ { AutoFakeBold = { \fp_use:N \l__xeCJK_embolden_factor_fp } }
}
- { \__xeCJK_add_fake_bold:n {#1} }
}
- \__xeCJK_add_font_if_new:nn {#2} { * }
- }
-\cs_new_protected_nopar:Npn \__xeCJK_map_it_sl:nn #1#2
- {
- \__xeCJK_if_map_font_select:nT {#1}
{
- \__xeCJK_add_font:nx {#2} { \__xeCJK_get_map_font:n {#1} }
- \__xeCJK_if_font_select:nF { bf #1 }
- { \__xeCJK_add_font_if_new:nx { Bold #2 } { \__xeCJK_get_map_font:n {#1} } }
+ \clist_put_right:Nx \l__xeCJK_fontspec_options_clist
+ { BoldFont = { \exp_not:V \l__xeCJK_font_name_bf_tl } }
}
- }
-\cs_new_nopar:Npn \__xeCJK_get_map_font:n #1
- { \exp_not:v { l__xeCJK_font_name_ \xeCJK_reverse:nnn {#1} { it } { sl } _tl } }
-\prg_new_conditional:Npnn \__xeCJK_if_map_font_select:n #1 { p , T , F , TF }
- {
- \xeCJK_if_blank_x:nTF { \__xeCJK_get_map_font:n {#1} }
- { \prg_return_false: } { \prg_return_true: }
- }
-\cs_new_protected_nopar:Npn \__xeCJK_pass_features:
- {
- \prop_map_inline:Nn \g__xeCJK_features_id_prop
+ \tl_if_blank:VTF \l__xeCJK_font_name_it_tl
{
- \clist_if_empty:cF { l__xeCJK_font_feat_##1_clist }
+ \bool_if:NT \l__xeCJK_auto_fake_slant_bool
{
\clist_put_right:Nx \l__xeCJK_fontspec_options_clist
- { ##2Features = { \exp_not:v { l__xeCJK_font_feat_##1_clist } } }
+ { AutoFakeSlant = { \fp_use:N \l__xeCJK_slant_factor_fp } }
}
}
- \prop_map_inline:Nn \l__xeCJK_add_font_prop
- { \clist_put_right:Nn \l__xeCJK_fontspec_options_clist { ##1 = {##2} } }
+ {
+ \clist_put_right:Nx \l__xeCJK_fontspec_options_clist
+ { ItalicFont = { \exp_not:V \l__xeCJK_font_name_it_tl } }
+ }
}
\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:
{
- \group_begin:
\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
- \group_end:
}
\cs_new_protected_nopar:Npn \__xeCJK_set_sub_block_family:
{
@@ -2888,10 +2837,14 @@
\prop_get:NVNT \g__xeCJK_family_name_prop \l__xeCJK_tmp_tl \l__xeCJK_tmp_tl
{
\tl_const:Nx \c__xeCJK_math_family_tl { \l__xeCJK_tmp_tl }
- \DeclareSymbolFont \c__xeCJK_math_tl
- \c__xeCJK_encoding_tl \c__xeCJK_math_family_tl \mddefault \shapedefault
- \SetSymbolFont \c__xeCJK_math_tl { bold }
- \c__xeCJK_encoding_tl \c__xeCJK_math_family_tl \bfdefault \shapedefault
+ \DeclareSymbolFont { \c__xeCJK_math_tl } { \c__xeCJK_encoding_tl }
+ { \c__xeCJK_math_family_tl } { \mddefault } { \shapedefault }
+ \cs_if_free:cF
+ { \c__xeCJK_encoding_tl/\c__xeCJK_math_family_tl/\bfdefault/\shapedefault }
+ {
+ \SetSymbolFont { \c__xeCJK_math_tl } { bold } { \c__xeCJK_encoding_tl }
+ { \c__xeCJK_math_family_tl } { \bfdefault } { \shapedefault }
+ }
\int_const:Nn \c_xeCJK_math_fam_int { \use:c { sym \c__xeCJK_math_tl } }
\clist_concat:NNN \l__xeCJK_tmp_clist
\c__xeCJK_CJK_chars_clist \c__xeCJK_FullLeft_chars_clist
@@ -2971,7 +2924,7 @@
\cs_set_eq:NN \__xeCJK_verb_CJKglue: \CJKglue
\cs_set_eq:NN \__xeCJK_verb_CJKecglue: \CJKecglue
\cs_set_eq:NN \__xeCJK_verb_check_for_glue: \xeCJK_check_for_glue:
- \cs_set_eq:NN \__xeCJK_verb_ignore_spaces:w \xeCJK_ignore_spaces:w
+ \cs_set_eq:NN \__xeCJK_verb_boundary:w \xeCJK_CJK_and_Boundary:w
\cs_set_protected_nopar:Npx \xeCJKOffVerbAddon
{
\__xeCJK_reset_char_class:n { FullLeft }
@@ -2987,7 +2940,7 @@
\cs_set_eq:NN \CJKglue \__xeCJK_verb_CJKglue:
\cs_set_eq:NN \CJKecglue \__xeCJK_verb_CJKecglue:
\cs_set_eq:NN \xeCJK_check_for_glue: \__xeCJK_verb_check_for_glue:
- \cs_set_eq:NN \xeCJK_ignore_spaces:w \__xeCJK_verb_ignore_spaces:w
+ \cs_set_eq:NN \xeCJK_CJK_and_Boundary:w \__xeCJK_verb_boundary:w
}
}
\tex_output:D \exp_after:wN \exp_after:wN \exp_after:wN
@@ -3009,8 +2962,10 @@
\cs_set_eq:NN \CJKecglue \__xeCJK_verb_ecglue:
}
\cs_set_eq:NN \xeCJK_check_for_glue: \CJKecglue
- \cs_set_eq:NN \xeCJK_ignore_spaces:w \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
+ { \xeCJK_class_group_end: \CJKecglue }
\cs_new_protected_nopar:Npn \__xeCJK_verb_ccglue:
{ \xeCJK_no_break: \skip_horizontal:N \l__xeCJK_verb_exspace_skip }
\cs_new_protected_nopar:Npn \__xeCJK_verb_ecglue:
@@ -3219,7 +3174,7 @@
}
\defaultCJKfontfeatures { Script = CJK }
\ProcessKeysOptions { xeCJK / options }
-\RequirePackage { fontspec } [ 2011/09/13 ]
+\RequirePackage { fontspec } [ 2012/05/01 ]
\RequirePackage { xunicode-addon }
\tl_const:Nx \c__xeCJK_encoding_tl { \g_fontspec_encoding_tl }
\bool_if:NT \g__xeCJK_indent_bool { \RequirePackage { indentfirst } }
@@ -3278,22 +3233,67 @@
\xeCJK_set_char_class:nnn {#1} {#2} {#3}
\xeCJKResetPunctClass
}
+\cs_if_free:NF \fontspec_setup_maths:
+ {
+ \cs_gset_protected_nopar:Npx \fontspec_setup_maths:
+ {
+ \exp_not:o
+ {
+ \fontspec_setup_maths:
+ \tl_if_empty:NT \g_fontspec_bfmathrm_tl
+ { \DeclareSymbolFontAlphabet \mathrm { operators } }
+ }
+ }
+ }
\cs_new_protected_nopar:Npn \__xeCJK_math_robust:N #1
- { \exp_args:NNc \__xeCJK_math_robust:NN #1 { \cs_to_str:N #1 ~ } }
+ { \exp_args:NNc \__xeCJK_math_robust_aux:NN #1 { \cs_to_str:N #1 ~ } }
+\cs_new_protected_nopar:Npn \__xeCJK_math_robust_aux:NN #1#2
+ {
+ \exp_args:Nx \str_case:nnTF { \token_get_replacement_spec:N #1 }
+ {
+ { \x@protect #1 \protect #2 } { }
+ { \protect #2 } { }
+ }
+ { \__xeCJK_math_robust:NN #1#2 }
+ { \__xeCJK_math_robust:NN #1#1 }
+ }
\cs_new_protected_nopar:Npn \__xeCJK_math_robust:NN #1#2
{
- \bool_if:nT
+ \str_if_eq_x:nnTF { \token_get_arg_spec:N #2 } { }
+ {
+ \exp_args:No \tl_if_head_eq_meaning:nNTF {#2} \scan_stop:
+ {
+ \cs_gset_protected_nopar:Npx #1
+ { \scan_align_safe_stop: \tl_tail:N #2 }
+ }
+ {
+ \cs_if_eq:NNTF #1 \ensuremath
+ {
+ \cs_gset_protected_nopar:Npx #1
+ { \scan_align_safe_stop: \exp_not:o {#2} }
+ }
+ {
+ \__xeCJK_warning:nxx { robust-failure }
+ { \token_to_str:N #1 } { \token_to_meaning:N #2 }
+ }
+ }
+ }
{
- \str_if_eq_x_p:nn
- { \token_get_replacement_spec:N #1 }
- { \exp_not:n { \x@protect #1 \protect #2 } } &&
- \exp_args:Nf \tl_if_empty_p:n { \token_get_arg_spec:N #2 } &&
- \exp_args:No \tl_if_head_eq_meaning_p:nN {#2} \scan_stop:
+ \__xeCJK_warning:nxx { robust-failure }
+ { \token_to_str:N #1 } { \token_to_meaning:N #2 }
}
- { \cs_gset_protected_nopar:Npx #1 { \scan_align_safe_stop: \tl_tail:N #2 } }
+ }
+\__xeCJK_msg_new:nnn { robust-failure }
+ { xeCJK~can~not~make~`#1'~robust. }
+ {
+ The~current~meaning~of~`#1'~is:\\
+ \iow_indent:n {#2}
}
\__xeCJK_math_robust:N \(
\__xeCJK_math_robust:N \)
+\__xeCJK_math_robust:N \math
+\__xeCJK_math_robust:N \endmath
+\__xeCJK_math_robust:N \ensuremath
\bool_if:nF
{
\xeCJK_if_package_loaded_p:n { amsmath } ||
@@ -3343,19 +3343,15 @@
\RenewDocumentCommand \fontfamily { m }
{
\tl_set:Nx \f@family {#1}
- \__xeCJK_update_family:n
+ \__xeCJK_update_family:nn {#1}
{
- \str_case:nnn {#1}
- {
- { \rmdefault } { \xeCJK_switch_family:n { \CJKrmdefault } }
- { \sfdefault } { \xeCJK_switch_family:n { \CJKsfdefault } }
- { \ttdefault } { \xeCJK_switch_family:n { \CJKttdefault } }
- { \familydefault } { \xeCJK_switch_family:n { \CJKfamilydefault } }
- }
- { }
+ { \rmdefault } { \xeCJK_switch_family:n { \CJKrmdefault } }
+ { \sfdefault } { \xeCJK_switch_family:n { \CJKsfdefault } }
+ { \ttdefault } { \xeCJK_switch_family:n { \CJKttdefault } }
+ { \familydefault } { \xeCJK_switch_family:n { \CJKfamilydefault } }
}
}
-\cs_new_eq:NN \__xeCJK_update_family:n \use:n
+\cs_new_eq:NN \__xeCJK_update_family:nn \str_case:nn
\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 }
@@ -3432,17 +3428,17 @@
}
\cs_new_eq:NN \__xeCJK_group_begin: \group_begin:
\cs_new_eq:NN \__xeCJK_group_end: \group_end:
+\tl_map_inline:nn
+ {
+ \textellipsis \textemdash \textperiodcentered \textcentereddot
+ \textquoteleft \textquoteright \textquotedblleft \textquotedblright
+ }
+ {
+ \AtBeginUTFCommand [#1] { \__xeCJK_group_begin: \makexeCJKinactive }
+ \AtEndUTFCommand [#1] { \__xeCJK_group_end: }
+ }
\__xeCJK_after_preamble:n
{
- \tl_map_inline:nn
- {
- \textellipsis \textemdash \textperiodcentered \textcentereddot
- \textquoteleft \textquoteright \textquotedblleft \textquotedblright
- }
- {
- \cs_gset_protected_nopar:Npx #1
- { \__xeCJK_group_begin: \makexeCJKinactive \exp_not:o {#1} \__xeCJK_group_end: }
- }
\tl_put_left:Nn \tipaencoding { \makexeCJKinactive }
\cs_new_eq:NN \__xeCJK_aux_r:n \r
\cs_set_nopar:Npn \r #1
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty
index 13dd0469dd6..bab6a2e918d 100644
--- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty
+++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty
@@ -6,7 +6,7 @@
%%
%% xeCJK.dtx (with options: `fntef')
%%
-%% $Id: xeCJK.dtx 477 2013-07-25 22:15:20Z sobenlee $
+%% $Id: xeCJK.dtx 510 2013-08-15 23:20:17Z sobenlee $
%% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%% -----------------------------------------------------------------
%% Author:
@@ -33,11 +33,11 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: xeCJK.dtx 477 2013-07-25 22:15:20Z sobenlee $
+\GetIdInfo$Id: xeCJK.dtx 510 2013-08-15 23:20:17Z sobenlee $
{xeCJK patch file for ulem/CJKfntef}
\ProvidesExplPackage
{xeCJKfntef}
- {\ExplFileDate}{3.2.5}{\ExplFileDescription}
+ {\ExplFileDate}{3.2.6}{\ExplFileDescription}
\PassOptionsToPackage { normalem } { ulem }
\DeclareOption* { \PassOptionsToPackage { \CurrentOption } { ulem } }
\ProcessOptions \scan_stop:
@@ -162,6 +162,7 @@
{
\xeCJK_if_ulem_patch:TF
{
+ \xeCJK_class_group_end:
\UL@stop \__xeCJK_ulem_hskip:n { \c_zero_skip } \UL@start
{ \xeCJK_make_node:n { CJK } }
}
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty
index d013fea26d2..66817b79bf6 100644
--- a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty
+++ b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty
@@ -6,7 +6,7 @@
%%
%% xeCJK.dtx (with options: `xunicode')
%%
-%% $Id: xeCJK.dtx 477 2013-07-25 22:15:20Z sobenlee $
+%% $Id: xeCJK.dtx 510 2013-08-15 23:20:17Z sobenlee $
%% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%% -----------------------------------------------------------------
%% Author:
@@ -33,11 +33,11 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: xeCJK.dtx 477 2013-07-25 22:15:20Z sobenlee $
+\GetIdInfo$Id: xeCJK.dtx 510 2013-08-15 23:20:17Z sobenlee $
{addon file for xunicode}
\ProvidesExplPackage
{xunicode-addon}
- {\ExplFileDate}{3.2.5}{\ExplFileDescription}
+ {\ExplFileDate}{3.2.6}{\ExplFileDescription}
\pdftex_if_engine:T
{
\msg_new:nnnn { xunicode-addon } { cannot-use-pdftex }
@@ -147,7 +147,7 @@
{
\__xunadd_if_csname:nTF {#3}
{ \__xunadd_declare_character:Nnn #3 }
- { \exp_args:Nc \__xunadd_declare_character:Nnn { \tl_to_str:n {#3} } }
+ { \__xunadd_declare_character:cnn { \tl_to_str:n {#3} } }
{#1} {#2}
}
\cs_new_protected:Npn \__xunadd_declare_character:Nnn #1#2#3
@@ -162,6 +162,7 @@
}
#1 { \token_to_str:N #1 } {#2}
}
+\cs_generate_variant:Nn \__xunadd_declare_character:Nnn { c }
\cs_new_protected:Npn \__xunadd_provide_text_command_default:N #1
{
\bool_if:nF
@@ -175,10 +176,10 @@
{ \DeclareTextCommand #2 {#4} { \__xunadd_text_character:nN {#3} {#1} } }
\cs_new_protected:Npn \__xunadd_text_character:nN #1#2
{
- \tl_use:N \l__xunadd_begin_hook_tl
+ \__xunadd_begin_hook:nn {#1} {#2}
\__xunadd_glyph_if_exist:nTF { `#2 }
{#2} { \cs_if_exist_use:cF { ? #1 } {#2} }
- \tl_use:N \l__xunadd_end_hook_tl
+ \__xunadd_end_hook:nn {#1} {#2}
}
\cs_generate_variant:Nn \__xunadd_declare_character:NNnn { NNx }
\cs_new_nopar:Npn \__xunadd_check_slot:n #1
@@ -193,7 +194,7 @@
{
\__xunadd_if_csname:nTF {#3}
{ \__xunadd_declare_composite:Nnnn #3 }
- { \exp_args:Nc \__xunadd_declare_composite:Nnnn { \tl_to_str:n {#3} } }
+ { \__xunadd_declare_composite:cnnn { \tl_to_str:n {#3} } }
{#1} {#4} {#2}
}
\cs_new_protected:Npn \__xunadd_declare_composite:Nnnn #1#2#3#4
@@ -207,18 +208,38 @@
\cs_new_protected:Npn \__xunadd_chardef:Nn #1#2
{ \tex_chardef:D #1 = \etex_numexpr:D #2 \scan_stop: }
\cs_generate_variant:Nn \__xunadd_chardef:Nn { c }
+\cs_generate_variant:Nn \__xunadd_declare_composite:Nnnn { c }
+\AtEndOfPackage
+ {
+ \DeclareUTFCompositeCommand \tonebar { 25 } { \tonebar { 2 } \tonebar { 5 } }
+ \DeclareUTFCompositeCommand \tonebar { 52 } { \tonebar { 5 } \tonebar { 2 } }
+ }
+\NewDocumentCommand \DeclareUTFCompositeCommand { O { \UTFencname } m m m }
+ {
+ \__xunadd_if_csname:nTF {#2}
+ { \__xunadd_declare_composite_command:Nnnn #2 }
+ { \__xunadd_declare_composite_command:cnnn { \tl_to_str:n {#2} } }
+ {#1} {#3} {#4}
+ }
+\cs_new_protected:Npn \__xunadd_declare_composite_command:Nnnn #1#2#3#4
+ {
+ \cs_set_protected:cpn
+ { \token_to_str:c {#2} \token_to_str:N #1 - \tl_to_str:n {#3} }
+ {#4}
+ }
+\cs_generate_variant:Nn \__xunadd_declare_composite_command:Nnnn { c }
\RenewDocumentCommand \DeclareEncodedCompositeCharacter { m m m m }
{
\__xunadd_if_csname:nTF {#2}
{ \__xunadd_declare_accent:Nnnn #2 }
- { \exp_args:Nc \__xunadd_declare_accent:Nnnn { \tl_to_str:n {#2} } }
+ { \__xunadd_declare_accent:cnnn { \tl_to_str:n {#2} } }
{#1} {#3} {#4}
}
\RenewDocumentCommand \DeclareEncodedCompositeAccents { m m m m }
{
\__xunadd_if_csname:nTF {#2}
{ \__xunadd_declare_accent:Nnnn #2 }
- { \exp_args:Nc \__xunadd_declare_accent:Nnnn { \tl_to_str:n {#2} } }
+ { \__xunadd_declare_accent:cnnn { \tl_to_str:n {#2} } }
{#1} {#4} {#3}
}
\cs_new_protected:Npn \__xunadd_declare_accent:Nnnn #1#2#3#4
@@ -238,24 +259,29 @@
\DeclareTextCommand #3 {#6}
{ \__xunadd_text_composite:nnNNn {#4} {#5} {#1} {#2} }
}
+\cs_generate_variant:Nn \__xunadd_declare_accent:Nnnn { c }
\cs_generate_variant:Nn \__xunadd_declare_accent:NNNnnn { NNNxx }
\cs_new_protected:Npn \__xunadd_text_composite:nnNNn #1#2#3#4#5
{
- \tl_use:N \l__xunadd_begin_hook_tl
+ \__xunadd_begin_hook:nn {#2} {#5}
\cs_if_exist:cTF { #1#2 - \tl_to_str:n {#5} }
{
- \token_if_chardef:cTF { #1#2 - \tl_to_str:n {#5} }
- {
- \__xunadd_glyph_if_exist:nTF { \use:c { #1#2 - \tl_to_str:n {#5} } }
- { \use:c { #1#2 - \tl_to_str:n {#5} } }
- { \__xunadd_add_accent:nnNN {#5} {#2} #3#4 }
- }
- { \use:c { #1#2 - \tl_to_str:n {#5} } }
+ \__xunadd_text_composite_aux:cnNNn
+ { #1#2 - \tl_to_str:n {#5} } {#2} {#3} {#4} {#5}
}
- { \__xunadd_add_accent:nnNN {#5} {#2} #3#4 }
- \tl_use:N \l__xunadd_end_hook_tl
+ { \__xunadd_add_accent:nnNN {#5} {#2} {#3} {#4} }
+ \__xunadd_end_hook:nn {#2} {#5}
}
-\cs_generate_variant:Nn \token_if_chardef:NTF { c }
+\cs_new_protected:Npn \__xunadd_text_composite_aux:NnNNn #1#2#3#4#5
+ {
+ \token_if_chardef:NTF #1
+ {
+ \__xunadd_glyph_if_exist:nTF {#1}
+ {#1} { \__xunadd_add_accent:nnNN {#5} {#2} {#3} {#4} }
+ }
+ {#1}
+ }
+\cs_generate_variant:Nn \__xunadd_text_composite_aux:NnNNn { c }
\cs_new_protected:Npn \__xunadd_add_accent:nnNN #1#2#3#4
{
\tl_if_blank:nTF {#1}
@@ -280,20 +306,56 @@
}
}
}
-\NewDocumentCommand \AtBeginUTFCommand { s +m }
+\NewDocumentCommand \AtBeginUTFCommand { s O { } +m }
{
- \IfBooleanTF {#1}
- { \tl_set:Nn \l__xunadd_begin_hook_tl {#2} }
- { \tl_put_right:Nn \l__xunadd_begin_hook_tl {#2} }
+ \tl_if_blank:nTF {#2}
+ {
+ \IfBooleanTF {#1}
+ { \tl_set:Nn \l__xunadd_begin_hook_tl {#3} }
+ { \tl_put_right:Nn \l__xunadd_begin_hook_tl {#3} }
+ }
+ { \__xunadd_set_cmd_hook:nnn { begin } {#2} {#3} }
}
-\NewDocumentCommand \AtEndUTFCommand { s +m }
+\NewDocumentCommand \AtEndUTFCommand { s O { } +m }
{
- \IfBooleanTF {#1}
- { \tl_set:Nn \l__xunadd_end_hook_tl {#2} }
- { \tl_put_right:Nn \l__xunadd_end_hook_tl {#2} }
+ \tl_if_blank:nTF {#2}
+ {
+ \IfBooleanTF {#1}
+ { \tl_set:Nn \l__xunadd_end_hook_tl {#3} }
+ { \tl_put_right:Nn \l__xunadd_end_hook_tl {#3} }
+ }
+ { \__xunadd_set_cmd_hook:nnn { end } {#2} {#3} }
}
\tl_new:N \l__xunadd_begin_hook_tl
\tl_new:N \l__xunadd_end_hook_tl
+\cs_new_protected:Npn \__xunadd_set_cmd_hook:nnn #1#2#3
+ {
+ \cs_set_protected:cpn
+ {
+ \tl_if_single:nTF {#2}
+ { \use:c { __xunadd_#1_csname:n } { \token_to_str:N #2 } }
+ { \__xunadd_set_cmd_hook_aux:Nnwn #2 \q_stop {#1} }
+ } ##1
+ {#3}
+ }
+\cs_new:Npn \__xunadd_set_cmd_hook_aux:Nnwn #1#2 \q_stop #3
+ { \use:c { __xunadd_#3_csname:n } { \token_to_str:N #1 - \tl_to_str:n {#2} } }
+\cs_new_nopar:Npn \__xunadd_begin_csname:n #1 { __xunadd_begin_#1_hook:n }
+\cs_new_nopar:Npn \__xunadd_end_csname:n #1 { __xunadd_end_#1_hook:n }
+\cs_new_protected:Npn \__xunadd_begin_hook:nn #1#2
+ {
+ \tl_use:N \l__xunadd_begin_hook_tl
+ \cs_if_exist_use:cF { \__xunadd_begin_csname:n { #1 - \tl_to_str:n {#2} } }
+ { \cs_if_exist_use:cF { \__xunadd_begin_csname:n {#1} } { \use_none:n } }
+ {#2}
+ }
+\cs_new_protected:Npn \__xunadd_end_hook:nn #1#2
+ {
+ \cs_if_exist_use:cF { \__xunadd_end_csname:n { #1 - \tl_to_str:n {#2} } }
+ { \cs_if_exist_use:cF { \__xunadd_end_csname:n {#1} } { \use_none:n } }
+ {#2}
+ \tl_use:N \l__xunadd_end_hook_tl
+ }
%%
%% This package consists of the file xeCJK.dtx,
%% full-stop.map,