From bc4c88bdc361d0d84a2c28a7d78467ecaa072e25 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 27 Feb 2018 20:36:43 +0000 Subject: xecjk (27feb18) git-svn-id: svn://tug.org/texlive/trunk@46756 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/xelatex/xecjk/xeCJK.pdf | Bin 1272830 -> 1277907 bytes .../doc/xelatex/xecjk/xunicode-symbols.pdf | Bin 293121 -> 351803 bytes Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx | 223 ++++++++++++--------- .../tex/xelatex/xecjk/xeCJK-listings.sty | 20 +- Master/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg | 4 +- Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty | 171 +++++++++------- Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty | 4 +- .../tex/xelatex/xecjk/xunicode-addon.sty | 36 ++-- .../tex/xelatex/xecjk/xunicode-extra.def | 4 +- 9 files changed, 253 insertions(+), 209 deletions(-) diff --git a/Master/texmf-dist/doc/xelatex/xecjk/xeCJK.pdf b/Master/texmf-dist/doc/xelatex/xecjk/xeCJK.pdf index 5d586879905..ba364570a49 100644 Binary files a/Master/texmf-dist/doc/xelatex/xecjk/xeCJK.pdf and b/Master/texmf-dist/doc/xelatex/xecjk/xeCJK.pdf differ diff --git a/Master/texmf-dist/doc/xelatex/xecjk/xunicode-symbols.pdf b/Master/texmf-dist/doc/xelatex/xecjk/xunicode-symbols.pdf index b6fe80f4bb1..fb3dc2a8fd0 100644 Binary files a/Master/texmf-dist/doc/xelatex/xecjk/xunicode-symbols.pdf and b/Master/texmf-dist/doc/xelatex/xecjk/xunicode-symbols.pdf differ diff --git a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx index 45161aaa47c..47ffa072f5a 100644 --- a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx +++ b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx @@ -194,7 +194,7 @@ Copyright and Licence %<*package|config|fntef|listings|xunicode|xunextra> %\NeedsTeXFormat{LaTeX2e} %\RequirePackage{expl3} -%<+!driver>\GetIdInfo$Id: xeCJK.dtx 54327e6 2018-01-28 19:10:14 +0800 Qing Lee $ +%<+!driver>\GetIdInfo$Id: xeCJK.dtx 25e85c2 2018-02-27 02:44:39 +0800 Qing Lee $ % {Typesetting CJK scripts with XeLaTeX} % {Configuration file for xeCJK package} % {xeCJK font effect} @@ -207,7 +207,7 @@ Copyright and Licence %\ProvidesExplPackage{xeCJK-listings} %\ProvidesExplPackage{xunicode-addon} %\ProvidesExplFile{xunicode-extra.def} -% {\ExplFileDate}{3.6.0}{\ExplFileDescription} +% {\ExplFileDate}{3.6.1}{\ExplFileDescription} % %<*driver> \documentclass{ctxdoc} @@ -278,8 +278,9 @@ Copyright and Licence % \changes{v3.5.0}{2017/07/22}{使用 \texttt{lazy} 函数对 Boolean 表达式 % 进行最小化运算(\LaTeXiii{} 2017/07/19)。} % \changes{v3.6.0}{2018/01/13}{同步 \LaTeXiii{} 2017/12/16。} +% \changes{v3.6.1}{2018/02/27}{减少 \texttt{bool} 运算。} % -% \CheckSum{10769} +% \CheckSum{10801} % \GetFileId{xeCJK.sty} % % \title{\bfseries\pkg{xeCJK} 宏包} @@ -1781,7 +1782,7 @@ Copyright and Licence % 去掉 |#1| 外层的分组括号。 % \begin{macrocode} \cs_new_protected_nopar:Npn \xeCJK_tl_remove_outer_braces:N #1 - { \tl_set:Nx #1 { \exp_args:NV \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 { \exp_last_unbraced:Nf @@ -1789,11 +1790,14 @@ Copyright and Licence } \cs_new:Npn \@@_tl_remove_outer_braces:w #1 \s__stop { - \bool_lazy_and:nnTF - { \tl_if_single_p:n {#1} } - { ! ( \tl_if_head_is_N_type_p:n {#1} ) } - { \xeCJK_tl_remove_outer_braces:n {#1} } - { \tl_trim_spaces:n {#1} } + \tl_if_single:nTF {#1} + { + \tl_if_head_is_N_type:nTF {#1} + { \tl_trim_spaces:n } + { \xeCJK_tl_remove_outer_braces:n } + } + { \tl_trim_spaces:n } + {#1} } % \end{macrocode} % \end{macro} @@ -3185,9 +3189,9 @@ Copyright and Licence } \cs_new_protected_nopar:Npn \@@_check_for_ecglue: { - \bool_lazy_or:nnTF - { \xeCJK_if_last_node_p:n { CJK } } - { \xeCJK_if_last_node_p:n { CJK-widow } } + \xeCJK_if_last_node:nTF { CJK } + { \use_i:nn } + { \xeCJK_if_last_node:nTF { CJK-widow } } { \xeCJK_remove_node: \CJKecglue } { \xeCJK_if_last_node:nT { CJK-space } @@ -4175,6 +4179,7 @@ Copyright and Licence } \cs_new_protected_nopar:Npn \@@_bound_glue_auxii:n #1 { + \skip_set_eq:NN \l_@@_last_skip \tex_lastskip:D \skip_if_eq:nnTF { \l_@@_last_skip } { 1sp } { \@@_zero_glue: } { @@ -4284,6 +4289,7 @@ Copyright and Licence % \changes{v3.6.0}{2018/01/23}{解决标点中间被隔开的禁则与压缩问题。} % % \begin{macro}{\xeCJK_if_last_punct:TF} +% \changes{v3.6.1}{2018/02/25}{细化判断。} % 判断之前是否是一个标点符号。 % \begin{macrocode} \cs_new_protected_nopar:Npn \xeCJK_if_last_punct:TF @@ -4297,34 +4303,58 @@ Copyright and Licence { \use_ii:nn } } } -\cs_new_protected:Npn \@@_if_last_punct_glue:TF #1#2 +\cs_new_protected_nopar:Npn \@@_if_last_punct_glue:TF + { + \prop_get:NoNTF \g_@@_punct_skip_prop + { \skip_use:N \tex_lastskip:D } \l_@@_tmp_tl + { \@@_if_last_punct_glue_auxi:TF } + { \@@_if_last_punct_glue_auxii:TF } + } +\cs_new_protected_nopar:Npn \@@_if_last_punct_glue_auxi:TF { \skip_set_eq:NN \l_@@_last_skip \tex_lastskip:D \tex_unskip:D \int_compare:nNnTF \tex_lastpenalty:D = \c_ten_thousand - { \@@_if_last_punct_auxi:TF } + { \@@_if_last_punct_auxi:TF { \use_i:nn } } { \xeCJK_if_last_node:TF - { \@@_if_last_punct_auxii:TF } - { \@@_if_last_punct_auxiii:TF } + { \@@_if_last_punct_auxii:TF { \use_i:nn } } + { \use:n } } - {#1} - { \skip_horizontal:N \l_@@_last_skip #2 } + { \skip_horizontal:N \l_@@_last_skip \use_ii:nn } + } +\cs_new_protected_nopar:Npn \@@_if_last_punct_glue_auxii:TF + { + \int_gset_eq:NN \g_@@_space_factor_int \tex_spacefactor:D + \skip_if_eq:nnTF { \tex_lastskip:D } { \c_xeCJK_space_skip_tl } + { \@@_if_last_punct_glue_auxiii:TF } + { \use_ii:nn } + } +\cs_new_protected_nopar:Npn \@@_if_last_punct_glue_auxiii:TF + { + \skip_set_eq:NN \l_@@_tmp_skip \tex_lastskip:D + \tex_unskip:D + \int_compare:nNnTF \etex_lastnodetype:D = \c_eleven + { + \prop_get:NoNTF \g_@@_punct_skip_prop + { \skip_use:N \tex_lastskip:D } \l_@@_tmp_tl + { \@@_if_last_punct_glue_auxi:TF { \use_i:nn } } + { \use:n } + } + { \use:n } + { \skip_horizontal:N \l_@@_tmp_skip \use_ii:nn } } -\cs_new_protected:Npn \@@_if_last_punct_penalty:TF #1#2 +\cs_new_protected_nopar:Npn \@@_if_last_punct_penalty:TF { \int_set_eq:NN \l_@@_last_penalty_int \tex_lastpenalty:D \tex_unpenalty:D \bool_set_true:N \l_@@_last_penalty_bool \int_compare:nNnTF \etex_lastnodetype:D = \c_eleven - { - \@@_if_last_punct_glue:TF - {#1} - { \tex_penalty:D \l_@@_last_penalty_int #2 } - } - { \tex_penalty:D \l_@@_last_penalty_int #2 } + { \@@_if_last_punct_glue:TF { \use_i:nn } } + { \use:n } + { \tex_penalty:D \l_@@_last_penalty_int \use_ii:nn } } -\cs_new_protected:Npn \@@_if_last_punct_auxi:TF #1#2 +\cs_new_protected_nopar:Npn \@@_if_last_punct_auxi:TF { \tex_unpenalty:D \bool_if:NF \l_@@_last_penalty_bool @@ -4332,11 +4362,18 @@ Copyright and Licence \bool_set_true:N \l_@@_last_penalty_bool \int_set_eq:NN \l_@@_last_penalty_int \c_ten_thousand } - \@@_if_last_punct_auxiv:TF - {#1} - { \xeCJK_no_break: #2 } + \xeCJK_if_last_node:TF + { \@@_if_last_punct_auxii:TF { \use_i:nn } } + { \use:n } + { \xeCJK_no_break: \use_ii:nn } } -\cs_new_protected:Npn \@@_if_last_punct_auxii:TF #1#2 +\cs_new_protected_nopar:Npn \@@_if_last_punct_auxii:TF + { + \dim_compare:nNnTF \l_@@_last_kern_dim > \c_zero_dim + { \@@_if_last_punct_auxiii:TF } + { \@@_make_node:N \l_@@_last_kern_dim \use_ii:nn } + } +\cs_new_protected_nopar:Npn \@@_if_last_punct_auxiii:TF { \int_case:nnTF { \xetex_charclass:D \l_@@_last_kern_dim } { @@ -4345,22 +4382,10 @@ Copyright and Licence { \xeCJK_class_num:n { FullLeft } } { \tl_set_eq:NN \l_@@_aligni_tl \c_@@_left_tl } } - { \@@_if_last_punct_auxv:TF {#1} {#2} } - { \@@_make_node:N \l_@@_last_kern_dim #2 } - } -\cs_new_protected_nopar:Npn \@@_if_last_punct_auxiii:TF - { - \int_compare:nNnTF \etex_lastnodetype:D = \c_eleven - { \@@_if_last_punct_auxvi:TF } + { \@@_if_last_punct_auxiv:TF } { \use_ii:nn } } \cs_new_protected_nopar:Npn \@@_if_last_punct_auxiv:TF - { - \xeCJK_if_last_node:TF - { \@@_if_last_punct_auxii:TF } - { \use_ii:nn } - } -\cs_new_protected:Npn \@@_if_last_punct_auxv:TF #1#2 { \dim_set_eq:NN \l_@@_tmp_dim \l_@@_last_kern_dim \xeCJK_if_last_node:TF @@ -4368,26 +4393,9 @@ Copyright and Licence \tl_gset:Nx \g_@@_last_punct_tl { \utex_char:D \l_@@_tmp_dim } \dim_set_eq:NN \l_@@_last_bound_dim \l_@@_last_kern_dim - #1 + \use_i:nn } - { \@@_make_node:N \l_@@_tmp_dim #2 } - } -\cs_new_protected:Npn \@@_if_last_punct_auxvi:TF #1#2 - { - \int_gset_eq:NN \g_@@_space_factor_int \tex_spacefactor:D - \skip_if_eq:nnTF - { \l_@@_last_skip } - { \c_xeCJK_space_skip_tl } - { - \skip_set_eq:NN \l_@@_tmp_skip \tex_lastskip:D - \tex_unskip:D - \int_compare:nNnTF \tex_lastpenalty:D = \c_ten_thousand - { \@@_if_last_punct_auxi:TF } - { \@@_if_last_punct_auxiv:TF } - { \skip_set_eq:NN \l_@@_last_skip \l_@@_tmp_skip #1 } - { \skip_horizontal:N \l_@@_tmp_skip #2 } - } - {#2} + { \@@_make_node:N \l_@@_tmp_dim \use_ii:nn } } \tl_new:N \l_@@_aligni_tl \tl_new:N \l_@@_alignii_tl @@ -5295,39 +5303,50 @@ Copyright and Licence \cs_new:Npn \@@_use_punct_skip_minus:nNN #1#2#3 { \use:c { \@@_punct_csname:n { skip/minus/#1/#2/#3 } } } \cs_new_protected:Npn \@@_save_punct_dim:nNn #1#2 - { \@@_save_punct_width_aux:nnn { dim } { #1/#2 } } + { \@@_save_punct_width_aux:nnnn { dim } {#1} { #1/#2 } } \cs_new_protected:Npn \@@_save_punct_dim:nNNn #1#2#3 - { \@@_save_punct_width_aux:nnn { dim } { #1/#2/#3 } } + { \@@_save_punct_width_aux:nnnn { dim } {#1} { #1/#2/#3 } } \cs_new_protected:Npn \@@_save_punct_skip:nNNn #1#2#3#4 { - \@@_save_punct_width_aux:nnn { skip } { #1/#2/#3 } {#4} - \@@_save_punct_width_aux:nnn { skip } { plus/#1/#2/#3 } {#4} - \@@_save_punct_width_aux:nnn { skip } { minus/#1/#2/#3 } {#4} + \@@_save_punct_width_aux:nnnn { skip } {#1} { #1/#2/#3 } {#4} + \@@_save_punct_width_aux:nnnn { skip } {#1} { plus/#1/#2/#3 } {#4} + \@@_save_punct_width_aux:nnnn { skip } {#1} { minus/#1/#2/#3 } {#4} } \cs_new_protected:Npn \@@_save_punct_skip:nNNnnn #1#2#3#4#5#6 { \use:x { - \@@_save_punct_skip_aux:nnnn { #1/#2/#3 } + \@@_save_punct_skip_aux:nnnnn {#1} { #1/#2/#3 } { \dim_eval:n {#4} } { \dim_max:nn { \c_zero_dim } {#5} } { \dim_max:nn { \c_zero_dim } {#6} } } } -\cs_new_protected:Npn \@@_save_punct_skip_aux:nnnn #1#2#3#4 +\cs_new_protected:Npn \@@_save_punct_skip_aux:nnnnn #1#2#3#4#5 + { + \@@_save_punct_width_aux:nnnn { skip } {#1} + {#2} { #3 ~ plus ~ #4 ~ minus ~ #5 ~ } + \@@_save_punct_width_aux:nnnn { skip } {#1} + { plus/#2 } { #3 ~ plus ~ #4 ~ } + \@@_save_punct_width_aux:nnnn { skip } {#1} + { minus/#2 } { #3 ~ minus ~ #5 ~ } + } +\cs_new_protected:Npn \@@_save_punct_width_aux:nnnn #1#2#3#4 { - \@@_save_punct_width_aux:nnn { skip } - {#1} { #2 ~ plus ~ #3 ~ minus ~ #4 ~ } - \@@_save_punct_width_aux:nnn { skip } - { plus/#1 } { #2 ~ plus ~ #3 ~ } - \@@_save_punct_width_aux:nnn { skip } - { minus/#1 } { #2 ~ minus ~ #4 ~ } + \@@_save_punct_width_aux:cxn + { \@@_punct_csname:n { #1/#3 } } + { \use:c { #1_eval:n } {#4} } + {#2} } -\cs_new_protected:Npn \@@_save_punct_width_aux:nnn #1#2#3 +\cs_new_protected:Npn \@@_save_punct_width_aux:Nnn #1#2#3 { - \tl_const:cx { \@@_punct_csname:n { #1/#2 } } - { \use:c { #1_eval:n } {#3} } + \tl_const:Nn #1 {#2} + \str_if_eq:nnT {#3} { glue } + { \prop_gput:Nnn \g_@@_punct_skip_prop {#2} { } } } +\prop_new:N \g_@@_punct_skip_prop +\prop_gput:Non \g_@@_punct_skip_prop { \skip_use:N \c_zero_skip } { } +\cs_generate_variant:Nn \@@_save_punct_width_aux:Nnn { cx } \cs_new_eq:NN \@@_use_dim_or_skip:nNN \@@_use_punct_skip:nNN % \end{macrocode} % @@ -10472,14 +10491,12 @@ Copyright and Licence \lst@whitespacefalse \bool_if:NTF \l_@@_listings_letter_bool { - \bool_lazy_or:nnF - { \int_compare_p:nNn \l_@@_listings_flag_int = \c_two } + \int_compare:nNnF \l_@@_listings_flag_int = \c_two { - \bool_lazy_and_p:nn - { \int_compare_p:nNn \l_@@_listings_flag_int = \c_three } - { ! \l_@@_punct_breakable_bool } + \int_compare:nNnTF \l_@@_listings_flag_int = \c_three + { \bool_if:NT \l_@@_punct_breakable_bool { \lst@Output } } + { \lst@Output } } - { \lst@Output } \lst@lettertrue } { @@ -10494,10 +10511,8 @@ Copyright and Licence \lst@whitespacefalse \bool_if:NTF \l_@@_listings_letter_bool { - \bool_lazy_and:nnT - { \int_compare_p:nNn \l_@@_listings_flag_int < \c_two } - { \@@_punct_if_long_p:N #2 } - { \lst@Output } + \int_compare:nNnT \l_@@_listings_flag_int < \c_two + { \@@_punct_if_long:NT #2 { \lst@Output } } \lst@lettertrue } { @@ -10890,9 +10905,9 @@ Copyright and Licence % \begin{macro}{\@@_composite_cs:Nnn,\@@_composite_cs:nnn} % \begin{macrocode} \cs_new:Npx \@@_composite_cs:Nnn #1#2#3 - { \cs_to_str:N \\ #2 \exp_not:N \token_to_str:N #1 - \exp_not:N \tl_to_str:n {#3} } + { \c_backslash_str #2 \exp_not:N \token_to_str:N #1 - \exp_not:N \tl_to_str:n {#3} } \cs_new:Npx \@@_composite_cs:nnn #1#2#3 - { \cs_to_str:N \\ #2 #1 - \exp_not:N \tl_to_str:n {#3} } + { \c_backslash_str #2 #1 - \exp_not:N \tl_to_str:n {#3} } % \end{macrocode} % \end{macro} % @@ -10906,9 +10921,13 @@ Copyright and Licence { \tl_if_single_token:nTF {#1} { - \if_predicate:w - \bool_if_p:n { \token_if_cs_p:N #1 || \token_if_active_p:N #1 } - \prg_return_true: \else: \prg_return_false: \fi: + \token_if_cs:NTF #1 + { \prg_return_true: } + { + \token_if_active:NTF #1 + { \prg_return_true: } + { \prg_return_false: } + } } { \prg_return_false: } } @@ -11007,10 +11026,14 @@ Copyright and Licence % \begin{macrocode} \cs_new_protected:Npn \@@_provide_text_command_default:N #1 { - \bool_lazy_or:nnF - { \cs_if_exist_p:c { ? \token_to_str:N #1 } } - { \cs_if_free_p:c { ? - \token_to_str:N #1 } } - { \exp_args:NNv \ProvideTextCommandDefault #1 { ? - \token_to_str:N #1 } } + \cs_if_exist:cF { ? \token_to_str:N #1 } + { + \cs_if_free:cF { ? - \token_to_str:N #1 } + { + \exp_args:NNv \ProvideTextCommandDefault #1 + { ? - \token_to_str:N #1 } + } + } } % \end{macrocode} % \end{macro} @@ -11321,9 +11344,9 @@ Copyright and Licence \tl_if_blank:nTF {#1} { \cs_if_exist_use:cTF { ? #2 } { {#1} } {#1} } { - \bool_lazy_and:nnTF - { \@@_glyph_if_exist_p:n { `#3 } } - { \@@_glyph_if_exist_p:n { `#4 } } + \@@_glyph_if_exist:nTF { `#3 } + { \@@_glyph_if_exist:nTF { `#4 } } + { \use_ii:nn } { #1#3#4 } { \cs_if_exist_use:cTF { ? #2 } { {#1} } { #1#3#4 } } } diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty index b19c1a82f24..8b2070d3e4c 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty +++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty @@ -29,10 +29,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 54327e6 2018-01-28 19:10:14 +0800 Qing Lee $ +\GetIdInfo$Id: xeCJK.dtx 25e85c2 2018-02-27 02:44:39 +0800 Qing Lee $ {xeCJK patch file for listings} \ProvidesExplPackage{xeCJK-listings} - {\ExplFileDate}{3.6.0}{\ExplFileDescription} + {\ExplFileDate}{3.6.1}{\ExplFileDescription} \DeclareOption* { \PassOptionsToPackage { \CurrentOption } { xeCJK } } \ProcessOptions \scan_stop: \RequirePackage { xeCJK } @@ -201,14 +201,12 @@ \lst@whitespacefalse \bool_if:NTF \l__xeCJK_listings_letter_bool { - \bool_lazy_or:nnF - { \int_compare_p:nNn \l__xeCJK_listings_flag_int = \c_two } + \int_compare:nNnF \l__xeCJK_listings_flag_int = \c_two { - \bool_lazy_and_p:nn - { \int_compare_p:nNn \l__xeCJK_listings_flag_int = \c_three } - { ! \l__xeCJK_punct_breakable_bool } + \int_compare:nNnTF \l__xeCJK_listings_flag_int = \c_three + { \bool_if:NT \l__xeCJK_punct_breakable_bool { \lst@Output } } + { \lst@Output } } - { \lst@Output } \lst@lettertrue } { @@ -223,10 +221,8 @@ \lst@whitespacefalse \bool_if:NTF \l__xeCJK_listings_letter_bool { - \bool_lazy_and:nnT - { \int_compare_p:nNn \l__xeCJK_listings_flag_int < \c_two } - { \__xeCJK_punct_if_long_p:N #2 } - { \lst@Output } + \int_compare:nNnT \l__xeCJK_listings_flag_int < \c_two + { \__xeCJK_punct_if_long:NT #2 { \lst@Output } } \lst@lettertrue } { diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg index 3101a8568ac..e2cda61d1df 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg +++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg @@ -6,10 +6,10 @@ %% %% xeCJK.dtx (with options: `config') %% -\GetIdInfo$Id: xeCJK.dtx 54327e6 2018-01-28 19:10:14 +0800 Qing Lee $ +\GetIdInfo$Id: xeCJK.dtx 25e85c2 2018-02-27 02:44:39 +0800 Qing Lee $ {Configuration file for xeCJK package} \ProvidesExplFile{\ExplFileName.cfg} - {\ExplFileDate}{3.6.0}{\ExplFileDescription} + {\ExplFileDate}{3.6.1}{\ExplFileDescription} %% %% diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty index 22598d0c915..69bea63c023 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty +++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty @@ -29,10 +29,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 54327e6 2018-01-28 19:10:14 +0800 Qing Lee $ +\GetIdInfo$Id: xeCJK.dtx 25e85c2 2018-02-27 02:44:39 +0800 Qing Lee $ {Typesetting CJK scripts with XeLaTeX} \ProvidesExplPackage{\ExplFileName} - {\ExplFileDate}{3.6.0}{\ExplFileDescription} + {\ExplFileDate}{3.6.1}{\ExplFileDescription} \msg_new:nnn { xeCJK } { Require-XeTeX } { The~xeCJK~package~requires~XeTeX~to~function.\\\\ @@ -153,7 +153,7 @@ \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 - { \tl_set:Nx #1 { \exp_args:NV \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 { \exp_last_unbraced:Nf @@ -161,11 +161,14 @@ } \cs_new:Npn \__xeCJK_tl_remove_outer_braces:w #1 \s__stop { - \bool_lazy_and:nnTF - { \tl_if_single_p:n {#1} } - { ! ( \tl_if_head_is_N_type_p:n {#1} ) } - { \xeCJK_tl_remove_outer_braces:n {#1} } - { \tl_trim_spaces:n {#1} } + \tl_if_single:nTF {#1} + { + \tl_if_head_is_N_type:nTF {#1} + { \tl_trim_spaces:n } + { \xeCJK_tl_remove_outer_braces:n } + } + { \tl_trim_spaces:n } + {#1} } \cs_new_protected:Npn \xeCJK_cs_clear:N #1 { \cs_set_eq:NN #1 \prg_do_nothing: } @@ -803,9 +806,9 @@ } \cs_new_protected_nopar:Npn \__xeCJK_check_for_ecglue: { - \bool_lazy_or:nnTF - { \xeCJK_if_last_node_p:n { CJK } } - { \xeCJK_if_last_node_p:n { CJK-widow } } + \xeCJK_if_last_node:nTF { CJK } + { \use_i:nn } + { \xeCJK_if_last_node:nTF { CJK-widow } } { \xeCJK_remove_node: \CJKecglue } { \xeCJK_if_last_node:nT { CJK-space } @@ -1506,6 +1509,7 @@ } \cs_new_protected_nopar: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 } { \__xeCJK_zero_glue: } { @@ -1591,34 +1595,58 @@ { \use_ii:nn } } } -\cs_new_protected:Npn \__xeCJK_if_last_punct_glue:TF #1#2 +\cs_new_protected_nopar: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 { \skip_set_eq:NN \l__xeCJK_last_skip \tex_lastskip:D \tex_unskip:D \int_compare:nNnTF \tex_lastpenalty:D = \c_ten_thousand - { \__xeCJK_if_last_punct_auxi:TF } + { \__xeCJK_if_last_punct_auxi:TF { \use_i:nn } } { \xeCJK_if_last_node:TF - { \__xeCJK_if_last_punct_auxii:TF } - { \__xeCJK_if_last_punct_auxiii:TF } + { \__xeCJK_if_last_punct_auxii:TF { \use_i:nn } } + { \use:n } } - {#1} - { \skip_horizontal:N \l__xeCJK_last_skip #2 } + { \skip_horizontal:N \l__xeCJK_last_skip \use_ii:nn } } -\cs_new_protected:Npn \__xeCJK_if_last_punct_penalty:TF #1#2 +\cs_new_protected_nopar: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 } + } +\cs_new_protected_nopar:Npn \__xeCJK_if_last_punct_glue_auxiii:TF + { + \skip_set_eq:NN \l__xeCJK_tmp_skip \tex_lastskip:D + \tex_unskip:D + \int_compare:nNnTF \etex_lastnodetype:D = \c_eleven + { + \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 { \use_i:nn } } + { \use:n } + } + { \use:n } + { \skip_horizontal:N \l__xeCJK_tmp_skip \use_ii:nn } + } +\cs_new_protected_nopar:Npn \__xeCJK_if_last_punct_penalty:TF { \int_set_eq:NN \l__xeCJK_last_penalty_int \tex_lastpenalty:D \tex_unpenalty:D \bool_set_true:N \l__xeCJK_last_penalty_bool \int_compare:nNnTF \etex_lastnodetype:D = \c_eleven - { - \__xeCJK_if_last_punct_glue:TF - {#1} - { \tex_penalty:D \l__xeCJK_last_penalty_int #2 } - } - { \tex_penalty:D \l__xeCJK_last_penalty_int #2 } + { \__xeCJK_if_last_punct_glue:TF { \use_i:nn } } + { \use:n } + { \tex_penalty:D \l__xeCJK_last_penalty_int \use_ii:nn } } -\cs_new_protected:Npn \__xeCJK_if_last_punct_auxi:TF #1#2 +\cs_new_protected_nopar:Npn \__xeCJK_if_last_punct_auxi:TF { \tex_unpenalty:D \bool_if:NF \l__xeCJK_last_penalty_bool @@ -1626,11 +1654,18 @@ \bool_set_true:N \l__xeCJK_last_penalty_bool \int_set_eq:NN \l__xeCJK_last_penalty_int \c_ten_thousand } - \__xeCJK_if_last_punct_auxiv:TF - {#1} - { \xeCJK_no_break: #2 } + \xeCJK_if_last_node:TF + { \__xeCJK_if_last_punct_auxii:TF { \use_i:nn } } + { \use:n } + { \xeCJK_no_break: \use_ii:nn } + } +\cs_new_protected_nopar: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:Npn \__xeCJK_if_last_punct_auxii:TF #1#2 +\cs_new_protected_nopar:Npn \__xeCJK_if_last_punct_auxiii:TF { \int_case:nnTF { \xetex_charclass:D \l__xeCJK_last_kern_dim } { @@ -1639,22 +1674,10 @@ { \xeCJK_class_num:n { FullLeft } } { \tl_set_eq:NN \l__xeCJK_aligni_tl \c__xeCJK_left_tl } } - { \__xeCJK_if_last_punct_auxv:TF {#1} {#2} } - { \__xeCJK_make_node:N \l__xeCJK_last_kern_dim #2 } - } -\cs_new_protected_nopar:Npn \__xeCJK_if_last_punct_auxiii:TF - { - \int_compare:nNnTF \etex_lastnodetype:D = \c_eleven - { \__xeCJK_if_last_punct_auxvi:TF } + { \__xeCJK_if_last_punct_auxiv:TF } { \use_ii:nn } } \cs_new_protected_nopar:Npn \__xeCJK_if_last_punct_auxiv:TF - { - \xeCJK_if_last_node:TF - { \__xeCJK_if_last_punct_auxii:TF } - { \use_ii:nn } - } -\cs_new_protected:Npn \__xeCJK_if_last_punct_auxv:TF #1#2 { \dim_set_eq:NN \l__xeCJK_tmp_dim \l__xeCJK_last_kern_dim \xeCJK_if_last_node:TF @@ -1662,26 +1685,9 @@ \tl_gset:Nx \g__xeCJK_last_punct_tl { \utex_char:D \l__xeCJK_tmp_dim } \dim_set_eq:NN \l__xeCJK_last_bound_dim \l__xeCJK_last_kern_dim - #1 + \use_i:nn } - { \__xeCJK_make_node:N \l__xeCJK_tmp_dim #2 } - } -\cs_new_protected:Npn \__xeCJK_if_last_punct_auxvi:TF #1#2 - { - \int_gset_eq:NN \g__xeCJK_space_factor_int \tex_spacefactor:D - \skip_if_eq:nnTF - { \l__xeCJK_last_skip } - { \c_xeCJK_space_skip_tl } - { - \skip_set_eq:NN \l__xeCJK_tmp_skip \tex_lastskip:D - \tex_unskip:D - \int_compare:nNnTF \tex_lastpenalty:D = \c_ten_thousand - { \__xeCJK_if_last_punct_auxi:TF } - { \__xeCJK_if_last_punct_auxiv:TF } - { \skip_set_eq:NN \l__xeCJK_last_skip \l__xeCJK_tmp_skip #1 } - { \skip_horizontal:N \l__xeCJK_tmp_skip #2 } - } - {#2} + { \__xeCJK_make_node:N \l__xeCJK_tmp_dim \use_ii:nn } } \tl_new:N \l__xeCJK_aligni_tl \tl_new:N \l__xeCJK_alignii_tl @@ -2306,39 +2312,50 @@ \cs_new:Npn \__xeCJK_use_punct_skip_minus:nNN #1#2#3 { \use:c { \__xeCJK_punct_csname:n { skip/minus/#1/#2/#3 } } } \cs_new_protected:Npn \__xeCJK_save_punct_dim:nNn #1#2 - { \__xeCJK_save_punct_width_aux:nnn { dim } { #1/#2 } } + { \__xeCJK_save_punct_width_aux:nnnn { dim } {#1} { #1/#2 } } \cs_new_protected:Npn \__xeCJK_save_punct_dim:nNNn #1#2#3 - { \__xeCJK_save_punct_width_aux:nnn { dim } { #1/#2/#3 } } + { \__xeCJK_save_punct_width_aux:nnnn { dim } {#1} { #1/#2/#3 } } \cs_new_protected:Npn \__xeCJK_save_punct_skip:nNNn #1#2#3#4 { - \__xeCJK_save_punct_width_aux:nnn { skip } { #1/#2/#3 } {#4} - \__xeCJK_save_punct_width_aux:nnn { skip } { plus/#1/#2/#3 } {#4} - \__xeCJK_save_punct_width_aux:nnn { skip } { minus/#1/#2/#3 } {#4} + \__xeCJK_save_punct_width_aux:nnnn { skip } {#1} { #1/#2/#3 } {#4} + \__xeCJK_save_punct_width_aux:nnnn { skip } {#1} { plus/#1/#2/#3 } {#4} + \__xeCJK_save_punct_width_aux:nnnn { skip } {#1} { minus/#1/#2/#3 } {#4} } \cs_new_protected:Npn \__xeCJK_save_punct_skip:nNNnnn #1#2#3#4#5#6 { \use:x { - \__xeCJK_save_punct_skip_aux:nnnn { #1/#2/#3 } + \__xeCJK_save_punct_skip_aux:nnnnn {#1} { #1/#2/#3 } { \dim_eval:n {#4} } { \dim_max:nn { \c_zero_dim } {#5} } { \dim_max:nn { \c_zero_dim } {#6} } } } -\cs_new_protected:Npn \__xeCJK_save_punct_skip_aux:nnnn #1#2#3#4 +\cs_new_protected:Npn \__xeCJK_save_punct_skip_aux:nnnnn #1#2#3#4#5 { - \__xeCJK_save_punct_width_aux:nnn { skip } - {#1} { #2 ~ plus ~ #3 ~ minus ~ #4 ~ } - \__xeCJK_save_punct_width_aux:nnn { skip } - { plus/#1 } { #2 ~ plus ~ #3 ~ } - \__xeCJK_save_punct_width_aux:nnn { skip } - { minus/#1 } { #2 ~ minus ~ #4 ~ } + \__xeCJK_save_punct_width_aux:nnnn { skip } {#1} + {#2} { #3 ~ plus ~ #4 ~ minus ~ #5 ~ } + \__xeCJK_save_punct_width_aux:nnnn { skip } {#1} + { plus/#2 } { #3 ~ plus ~ #4 ~ } + \__xeCJK_save_punct_width_aux:nnnn { skip } {#1} + { minus/#2 } { #3 ~ minus ~ #5 ~ } + } +\cs_new_protected:Npn \__xeCJK_save_punct_width_aux:nnnn #1#2#3#4 + { + \__xeCJK_save_punct_width_aux:cxn + { \__xeCJK_punct_csname:n { #1/#3 } } + { \use:c { #1_eval:n } {#4} } + {#2} } -\cs_new_protected:Npn \__xeCJK_save_punct_width_aux:nnn #1#2#3 +\cs_new_protected:Npn \__xeCJK_save_punct_width_aux:Nnn #1#2#3 { - \tl_const:cx { \__xeCJK_punct_csname:n { #1/#2 } } - { \use:c { #1_eval:n } {#3} } + \tl_const:Nn #1 {#2} + \str_if_eq:nnT {#3} { glue } + { \prop_gput:Nnn \g__xeCJK_punct_skip_prop {#2} { } } } +\prop_new:N \g__xeCJK_punct_skip_prop +\prop_gput:Non \g__xeCJK_punct_skip_prop { \skip_use:N \c_zero_skip } { } +\cs_generate_variant:Nn \__xeCJK_save_punct_width_aux:Nnn { cx } \cs_new_eq:NN \__xeCJK_use_dim_or_skip:nNN \__xeCJK_use_punct_skip:nNN \DeclareObjectType { xeCJK / punctuation } { \c_zero } \DeclareTemplateInterface { xeCJK / punctuation } { basic } { \c_zero } diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty index f7c67505480..8949d43ddd3 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty +++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty @@ -29,10 +29,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 54327e6 2018-01-28 19:10:14 +0800 Qing Lee $ +\GetIdInfo$Id: xeCJK.dtx 25e85c2 2018-02-27 02:44:39 +0800 Qing Lee $ {xeCJK font effect} \ProvidesExplPackage{xeCJKfntef} - {\ExplFileDate}{3.6.0}{\ExplFileDescription} + {\ExplFileDate}{3.6.1}{\ExplFileDescription} \PassOptionsToPackage { normalem } { ulem } \DeclareOption* { \PassOptionsToPackage { \CurrentOption } { ulem } } \ProcessOptions \scan_stop: diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty index b23c5ffde29..e0c95aaa605 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty +++ b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty @@ -29,10 +29,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 54327e6 2018-01-28 19:10:14 +0800 Qing Lee $ +\GetIdInfo$Id: xeCJK.dtx 25e85c2 2018-02-27 02:44:39 +0800 Qing Lee $ {addon file for xunicode} \ProvidesExplPackage{xunicode-addon} - {\ExplFileDate}{3.6.0}{\ExplFileDescription} + {\ExplFileDate}{3.6.1}{\ExplFileDescription} \bool_lazy_or:nnF { \sys_if_engine_xetex_p: } { \sys_if_engine_luatex_p: } @@ -179,16 +179,20 @@ \cs_new_protected:Npn \__xunadd_undeclare_composite:Nnnn #1#2#3#4 { \cs_undefine:c { \__xunadd_composite_cs:Nnn #1 {#2} {#3} } } \cs_new:Npx \__xunadd_composite_cs:Nnn #1#2#3 - { \cs_to_str:N \\ #2 \exp_not:N \token_to_str:N #1 - \exp_not:N \tl_to_str:n {#3} } + { \c_backslash_str #2 \exp_not:N \token_to_str:N #1 - \exp_not:N \tl_to_str:n {#3} } \cs_new:Npx \__xunadd_composite_cs:nnn #1#2#3 - { \cs_to_str:N \\ #2 #1 - \exp_not:N \tl_to_str:n {#3} } + { \c_backslash_str #2 #1 - \exp_not:N \tl_to_str:n {#3} } \prg_new_conditional:Npnn \__xunadd_if_csname:n #1 { TF } { \tl_if_single_token:nTF {#1} { - \if_predicate:w - \bool_if_p:n { \token_if_cs_p:N #1 || \token_if_active_p:N #1 } - \prg_return_true: \else: \prg_return_false: \fi: + \token_if_cs:NTF #1 + { \prg_return_true: } + { + \token_if_active:NTF #1 + { \prg_return_true: } + { \prg_return_false: } + } } { \prg_return_false: } } @@ -242,10 +246,14 @@ } \cs_new_protected:Npn \__xunadd_provide_text_command_default:N #1 { - \bool_lazy_or:nnF - { \cs_if_exist_p:c { ? \token_to_str:N #1 } } - { \cs_if_free_p:c { ? - \token_to_str:N #1 } } - { \exp_args:NNv \ProvideTextCommandDefault #1 { ? - \token_to_str:N #1 } } + \cs_if_exist:cF { ? \token_to_str:N #1 } + { + \cs_if_free:cF { ? - \token_to_str:N #1 } + { + \exp_args:NNv \ProvideTextCommandDefault #1 + { ? - \token_to_str:N #1 } + } + } } \cs_new_protected:Npn \__xunadd_declare_character:NNnn #1#2#3#4 { \DeclareTextCommand #2 {#4} { \__xunadd_text_character:nN {#3} {#1} } } @@ -408,9 +416,9 @@ \tl_if_blank:nTF {#1} { \cs_if_exist_use:cTF { ? #2 } { {#1} } {#1} } { - \bool_lazy_and:nnTF - { \__xunadd_glyph_if_exist_p:n { `#3 } } - { \__xunadd_glyph_if_exist_p:n { `#4 } } + \__xunadd_glyph_if_exist:nTF { `#3 } + { \__xunadd_glyph_if_exist:nTF { `#4 } } + { \use_ii:nn } { #1#3#4 } { \cs_if_exist_use:cTF { ? #2 } { {#1} } { #1#3#4 } } } diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def index 3cfa45114c5..1195a70754e 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def +++ b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def @@ -27,10 +27,10 @@ %% %% ---------------------------------------------------------------------- %% -\GetIdInfo$Id: xeCJK.dtx 54327e6 2018-01-28 19:10:14 +0800 Qing Lee $ +\GetIdInfo$Id: xeCJK.dtx 25e85c2 2018-02-27 02:44:39 +0800 Qing Lee $ {extra definition for xunicode} \ProvidesExplFile{xunicode-extra.def} - {\ExplFileDate}{3.6.0}{\ExplFileDescription} + {\ExplFileDate}{3.6.1}{\ExplFileDescription} \DeclareUTFComposite\textsuperscript \DeclareUTFComposite\textsubscript \DeclareUTFEncodedAccent\textsbleftarrow{"20EE}{"20FF} -- cgit v1.2.3