diff options
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty')
-rw-r--r-- | Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty | 71 |
1 files changed, 41 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty index d979e844256..3163fdb9999 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 49800bb 2022-07-14 18:54:00 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: xeCJK.dtx c4ccfae 2022-08-05 21:02:32 +0800 Qing Lee <sobenlee@gmail.com> $ {xeCJK font effect} \ProvidesExplPackage{xeCJKfntef} - {\ExplFileDate}{3.9.0}{\ExplFileDescription} + {\ExplFileDate}{3.9.1}{\ExplFileDescription} \PassOptionsToPackage { normalem } { ulem } \DeclareOption* { \PassOptionsToPackage { \CurrentOption } { ulem } } \ProcessOptions \scan_stop: @@ -101,7 +101,7 @@ \bool_new:N \l__xeCJK_ulem_hook_used_bool \cs_new_protected:Npn \xeCJK_ulem_word:nw #1 ~ { - \exp_after:wN \UL@start #1 ~ + \__xeCJK_ulem_start:w #1 ~ \exp_after:wN \if_meaning:w \exp_after:wN \UL@end #1 \exp_after:wN \__xeCJK_ulem_end: \else: @@ -129,6 +129,8 @@ \fi: \xeCJK_ulem_word:nw \prg_do_nothing: } +\cs_new_protected:Npn \__xeCJK_ulem_start:w + { \exp_after:wN \UL@start } \cs_set_eq:NN \UL@word \xeCJK_ulem_word:nw \cs_new_protected:Npn \xeCJK_ulem_left: { @@ -233,15 +235,15 @@ { \int_case:nn { \tex_lastnodetype:D } { - { 1 } { \__xeCJK_ulem_right_skip_hbox: } - { 11 } { \__xeCJK_ulem_right_skip_glue: } - { 13 } { \__xeCJK_ulem_right_skip_penalty: } + { \c__xeCJK_hlist_node } { \__xeCJK_ulem_right_skip_hbox: } + { \c__xeCJK_glue_node } { \__xeCJK_ulem_right_skip_glue: } + { \c__xeCJK_penalty_node } { \__xeCJK_ulem_right_skip_penalty: } } } \cs_new_protected:Npn \__xeCJK_ulem_right_skip_hbox: { \box_set_to_last:N \l__xeCJK_tmp_box - \int_compare:nNnTF \tex_lastnodetype:D = { 12 } + \__xeCJK_if_last_kern:TF { \__xeCJK_ulem_right_skip_kern: } { \__xeCJK_ulem_right_skip_glue: } \box_use_drop:N \l__xeCJK_tmp_box @@ -270,7 +272,7 @@ { \int_set_eq:NN \l__xeCJK_tmp_int \tex_lastpenalty:D \tex_unpenalty:D - \int_compare:nNnT \tex_lastnodetype:D = \c_one_int + \__xeCJK_if_last_hlist:T { \__xeCJK_ulem_right_skip_hbox: } \tex_penalty:D \l__xeCJK_tmp_int } @@ -360,26 +362,40 @@ \xeCJK_if_ulem_patch:TF { \xeCJK_peek_catcode_ignore_spaces:NTF \c_math_toggle_token - { - \xeCJK_class_group_end: \UL@stop - \CJKecglue - \UL@start - } + { \xeCJK_class_group_end: \CJKecglue } { \bool_if:NTF \l__xeCJK_peek_ignore_spaces_bool - { - \xeCJK_class_group_end: \UL@stop - \UL@start { \xeCJK_make_node:n { CJK-space } } - } - { - \xeCJK_class_group_end: \UL@stop - \UL@start { \xeCJK_make_node:n { CJK } } - } - \xeCJK_make_group_tag: + { \__xeCJK_ulem_peek_math:w } + { \__xeCJK_ulem_group_end:n { CJK } } } } { \__xeCJK_ulem_CJK_and_Boundary:w } } +\cs_new_protected:Npn \__xeCJK_ulem_group_end:n #1 + { + \xeCJK_class_group_end: \UL@stop + \UL@start { \xeCJK_make_node:n {#1} } + \xeCJK_make_group_tag: + } +\cs_new_protected:Npn \__xeCJK_ulem_peek_math:w + { + \cs_set_eq:NN \__xeCJK_ulem_start:w \__xeCJK_ulem_exp_stop:w + \exp_after:wN \peek_after:Nw + \exp_after:wN \__xeCJK_ulem_peek_math_branches:w + \exp:w \exp_end_continue_f:w + } +\cs_new_protected:Npn \__xeCJK_ulem_peek_math_branches:w + { + \token_if_math_toggle:NTF \l_peek_token + { \xeCJK_class_group_end: \CJKecglue } + { \__xeCJK_ulem_group_end:n { CJK-space } } + } +\cs_new_protected:Npn \__xeCJK_ulem_exp_stop:w + { + \cs_if_eq:NNTF \UL@start \@empty + { \exp_after:wN \exp_stop_f: } + { \exp_after:wN \UL@start } + } \cs_new_protected:Npn \__xeCJK_ulem_fix_penalty: { \xeCJK_if_ulem_patch:TF @@ -825,12 +841,7 @@ \cs_new_protected:Npn \xeCJK_fntef_sbox:n #1 { \hbox_set:Nn \l__xeCJK_fntef_box - { - \color_group_begin: - \color_ensure_current: - #1 - \color_group_end: - } + { \color_ensure_current: #1 } } \keys_define:nn { xeCJK / options } { @@ -1028,7 +1039,7 @@ } \NewDocumentEnvironment { CJKfilltwosides } { O { c } m } { - \use:x { \exp_not:N \minipage [#1] { \dim_eval:n {#2} } } + \use:e { \exp_not:N \minipage [#1] { \dim_eval:n {#2} } } \cs_set_eq:NN \CJKglue \xeCJK_fntef_hfilll: } { @@ -1042,7 +1053,7 @@ \tl_set:Nn \arraystretch { 1 } \cs_if_free:NF \extrarowheight { \cs_set_eq:NN \extrarowheight \c_zero_dim } - \use:x { \__xeCJK_fill_two_sides:nnn {#1} { \dim_eval:n {#2} } } {#3} + \use:e { \__xeCJK_fill_two_sides:nnn {#1} { \dim_eval:n {#2} } } {#3} } { \ignorespacesafterend } \cs_new_protected:Npn \__xeCJK_fill_two_sides:nnn #1#2#3 |