summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/xecjk
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-11-15 00:12:39 +0000
committerKarl Berry <karl@freefriends.org>2013-11-15 00:12:39 +0000
commit4909c173ce26f3b8abbb198131d4c2846918c8b0 (patch)
tree44a1bbd5326973b999f7d68d86677bb491e1cbb6 /Master/texmf-dist/tex/xelatex/xecjk
parentfb4f5722355aa3de14f51566a960bfd81e8f6c1a (diff)
xecjk
git-svn-id: svn://tug.org/texlive/trunk@32149 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.sty14
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty391
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty85
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty6
5 files changed, 339 insertions, 161 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg b/Master/texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg
index e8e4375851b..0b64ecbefdd 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 510 2013-08-15 23:20:17Z sobenlee $
+\GetIdInfo$Id: xeCJK.dtx 525 2013-11-11 06:32:00Z sobenlee $
{Configuration file for xeCJK package}
\ProvidesExplFile
{\ExplFileName.cfg}
- {\ExplFileDate}{3.2.6}{\ExplFileDescription}
+ {\ExplFileDate}{3.2.7}{\ExplFileDescription}
%%
%%
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty
index e07d41cfa1d..0926ab3ea99 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 510 2013-08-15 23:20:17Z sobenlee $
+%% $Id: xeCJK.dtx 525 2013-11-11 06:32:00Z 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 510 2013-08-15 23:20:17Z sobenlee $
+\GetIdInfo$Id: xeCJK.dtx 525 2013-11-11 06:32:00Z sobenlee $
{xeCJK patch file for listings}
\ProvidesExplPackage
{xeCJK-listings}
- {\ExplFileDate}{3.2.6}{\ExplFileDescription}
+ {\ExplFileDate}{3.2.7}{\ExplFileDescription}
\DeclareOption* { \PassOptionsToPackage { \CurrentOption } { xeCJK } }
\ProcessOptions \scan_stop:
\RequirePackage { xeCJK }
@@ -56,13 +56,7 @@
\tex_noindent:D
\bool_gset_false:N \g__xeCJK_listings_IVS_bool
\tl_put_left:Nn \lst@numberstyle { \l__xeCJK_restore_listings_toks_tl }
- \tex_output:D \exp_after:wN \exp_after:wN \exp_after:wN
- {
- \exp_after:wN \exp_after:wN
- \exp_after:wN \l__xeCJK_restore_listings_toks_tl
- \exp_after:wN \use:n
- \tex_the:D \tex_output:D
- }
+ \__xeCJK_add_to_shipout:n { \l__xeCJK_restore_listings_toks_tl }
\lst@ifbreaklines
\cs_set_eq:NN \__xeCJK_listings_CJK_toks: \__xeCJK_listings_breaklines_toks:
\fi:
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
index c52709f906a..b5e43f0b26b 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 510 2013-08-15 23:20:17Z sobenlee $
+%% $Id: xeCJK.dtx 525 2013-11-11 06:32:00Z 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 510 2013-08-15 23:20:17Z sobenlee $
+\GetIdInfo$Id: xeCJK.dtx 525 2013-11-11 06:32:00Z sobenlee $
{Typesetting CJK scripts with XeLaTeX}
\ProvidesExplPackage
{\ExplFileName}
- {\ExplFileDate}{3.2.6}{\ExplFileDescription}
+ {\ExplFileDate}{3.2.7}{\ExplFileDescription}
\msg_new:nnn { xeCJK } { Require-XeTeX }
{
The~xeCJK~package~requires~XeTeX~to~function.\\\\
@@ -87,6 +87,7 @@
\@ifpackagelater { xtemplate } { 2012/11/10 } { }
{ \msg_error:nnn { xeCJK } { l3-too-old } { xtemplate } }
\RequirePackage { xparse , l3keys2e }
+\RequirePackage { everypage }
\tl_new:N \l__xeCJK_tmp_tl
\int_new:N \l__xeCJK_tmp_int
\box_new:N \l__xeCJK_tmp_box
@@ -133,6 +134,19 @@
\__xeCJK_document_right_hook:
}
}
+\AddEverypageHook { \xeCJKShipoutHook }
+\NewDocumentCommand \xeCJKShipoutHook { }
+ {
+ \bool_if:NF \l__xeCJK_shipout_hook_bool
+ {
+ \bool_set_true:N \l__xeCJK_shipout_hook_bool
+ \tl_use:N \l__xeCJK_shipout_hook_tl
+ }
+ }
+\cs_new_protected:Npn \__xeCJK_add_to_shipout:n #1
+ { \tl_put_right:Nn \l__xeCJK_shipout_hook_tl {#1} }
+\tl_new:N \l__xeCJK_shipout_hook_tl
+\bool_new:N \l__xeCJK_shipout_hook_bool
\cs_new_nopar:Npn \xeCJK_reverse:nnn #1#2#3
{ \str_if_eq_x:nnTF {#1} {#2} {#3} {#2} }
\cs_new_protected_nopar:Npn \xeCJK_tl_remove_outer_braces:N #1
@@ -522,6 +536,13 @@
\int_set:Nn #4 { \int_max:nn {#1} { \IfNoValueTF {#2} {#1} {#2} } }
}
}
+\int_set:Nn \l__xeCJK_begin_int { "AC00 }
+\int_set:Nn \l__xeCJK_end_int { "D7A3 }
+\xeCJK_int_until_do:nn { \l__xeCJK_begin_int > \l__xeCJK_end_int }
+ {
+ \char_set_catcode_letter:n { \l__xeCJK_begin_int }
+ \int_incr:N \l__xeCJK_begin_int
+ }
\cs_new_protected_nopar:Npn \xeCJK_set_char_class:nnn #1#2#3
{
\__xeCJK_check_num_range:nnNN {#1} {#2} \l__xeCJK_begin_int \l__xeCJK_end_int
@@ -927,30 +948,42 @@
\clist_map_inline:nn { FullLeft , FullRight }
{ \xeCJK_inter_class_toks:nnc {#1} {##1} { xeCJK_#1_and_##1:N } }
}
+\cs_new_protected_nopar: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
{
\tex_vrule:D
- width - \__xeCJK_use_punct_dim:nnn { bound } {#1} {#2}
+ 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_offset:NN #1#2
+ { \__xeCJK_punct_kern:n { - \__xeCJK_use_punct_dim:nnn { offset } {#1} {#2} } }
+\cs_new_protected_nopar:Npn \__xeCJK_punct_kern:n #1
+ { \tex_kern:D #1 \exp_stop_f: }
\cs_new_protected_nopar:Npn \__xeCJK_punct_glue:NN #1#2
{
\__xeCJK_punct_hskip:n
{
\__xeCJK_use_punct_dim:nnn { glue } {#1} {#2}
- minus \dim_eval:n { ( \__xeCJK_use_punct_dim:nnn { glue } {#1} {#2} ) / \c_two }
+ plus \__xeCJK_use_punct_dim:nnn { plus } {#1} {#2}
+ minus \__xeCJK_use_punct_dim:nnn { minus } {#1} {#2}
}
}
\cs_new_eq:NN \__xeCJK_punct_hskip:n \skip_horizontal:n
\cs_new_protected_nopar:Npn \__xeCJK_punct_kern:NN #1#2
- { \tex_kern:D \__xeCJK_use_punct_dim:nnn { kern } {#1} {#2} }
+ { \tex_kern:D \__xeCJK_use_punct_dim:nnn { kern } {#1} {#2} \exp_stop_f: }
\tl_new:N \g__xeCJK_last_punct_tl
\cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_CJK:
{
\__xeCJK_punct_if_middle:NTF \g__xeCJK_last_punct_tl
{
- \__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
+ \__xeCJK_punct_bound_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\xeCJK_no_break:
\__xeCJK_punct_glue:NN \c__xeCJK_left_tl \g__xeCJK_last_punct_tl
}
@@ -960,7 +993,7 @@
{
\__xeCJK_punct_if_middle:NTF \g__xeCJK_last_punct_tl
{
- \__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
+ \__xeCJK_punct_bound_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\xeCJK_class_group_end: \xeCJK_no_break:
\__xeCJK_punct_glue:NN \c__xeCJK_left_tl \g__xeCJK_last_punct_tl
}
@@ -971,6 +1004,7 @@
\cs_new_protected_nopar:Npn \xeCJK_FullRight_and_CJK:
{
\__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
+ \__xeCJK_punct_offset:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\__xeCJK_punct_glue:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\CJKglue
}
@@ -978,6 +1012,7 @@
{
\__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\xeCJK_class_group_end:
+ \__xeCJK_punct_offset:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\__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
@@ -993,7 +1028,10 @@
\CJKpunctsymbol {#2}
}
\cs_new_protected_nopar:Npn \__xeCJK_Default_and_FullLeft_glue:N #1
- { \__xeCJK_punct_glue:NN \c__xeCJK_left_tl {#1} }
+ {
+ \__xeCJK_punct_glue:NN \c__xeCJK_left_tl {#1}
+ \__xeCJK_punct_offset:NN \c__xeCJK_left_tl {#1}
+ }
\cs_new_protected_nopar:Npn \xeCJK_CJK_and_FullLeft:N #1
{
\xeCJK_get_punct_bounds:NN \c__xeCJK_left_tl {#1}
@@ -1003,11 +1041,16 @@
\CJKpunctsymbol {#1}
}
\cs_new_protected_nopar:Npn \__xeCJK_CJK_and_FullLeft_glue:N #1
- { \CJKglue \__xeCJK_punct_glue:NN \c__xeCJK_left_tl {#1} }
+ {
+ \CJKglue
+ \__xeCJK_punct_glue:NN \c__xeCJK_left_tl {#1}
+ \__xeCJK_punct_offset:NN \c__xeCJK_left_tl {#1}
+ }
\cs_new_protected_nopar:Npn \xeCJK_Boundary_and_FullLeft:N #1
{
\xeCJK_get_punct_bounds:NN \c__xeCJK_left_tl {#1}
\__xeCJK_Boundary_and_FullLeft_glue:N {#1}
+ \__xeCJK_punct_offset:NN \c__xeCJK_left_tl {#1}
\xeCJK_class_group_begin:
\xeCJK_select_font:
\xeCJK_clear_Boundary_and_CJK_toks:
@@ -1030,7 +1073,7 @@
{ \box_use_clear:N \l__xeCJK_tmp_box \use_none:n }
{ \box_use_clear:N \l__xeCJK_tmp_box \use:n }
}
- { \c_minus_one } { \use_none:n }
+ { \c_minus_one } { \__xeCJK_zero_glue: \use_none:n }
{ \c_eleven }
{
\bool_if:nTF
@@ -1038,7 +1081,7 @@
! ( \skip_if_finite_p:n { \tex_lastskip:D } ) ||
\skip_if_eq_p:nn { \tex_lastskip:D } { 1 sp }
}
- { \use_none:n }
+ { \__xeCJK_zero_glue: \use_none:n }
{
\skip_if_eq:nnTF { \tex_lastskip:D } { \labelsep }
{
@@ -1078,8 +1121,6 @@
\xeCJK_clear_inter_class_toks:nn {#1} { FullRight }
\xeCJK_clear_Boundary_and_CJK_toks:
\tl_gset:Nx \g__xeCJK_last_punct_tl {#2}
- \__xeCJK_punct_if_middle:NT {#2}
- { \__xeCJK_punct_rule:NN \c__xeCJK_left_tl {#2} }
\xeCJK_FullRight_symbol:N {#2}
}
\cs_new_protected_nopar:Npn \xeCJK_Boundary_and_FullRight:N #1
@@ -1090,8 +1131,6 @@
\xeCJK_select_font:
\xeCJK_clear_Boundary_and_CJK_toks:
\tl_gset:Nx \g__xeCJK_last_punct_tl {#1}
- \__xeCJK_punct_if_middle:NT {#1}
- { \__xeCJK_punct_rule:NN \c__xeCJK_left_tl {#1} }
\xeCJK_FullRight_symbol:N {#1}
}
\cs_new_protected_nopar:Npn \xeCJK_CJK_and_FullRight:N #1
@@ -1099,8 +1138,6 @@
\xeCJK_get_punct_bounds:NN \c__xeCJK_right_tl {#1}
\__xeCJK_CJK_and_FullRight_glue:N {#1}
\tl_gset:Nx \g__xeCJK_last_punct_tl {#1}
- \__xeCJK_punct_if_middle:NT {#1}
- { \__xeCJK_punct_rule:NN \c__xeCJK_left_tl {#1} }
\xeCJK_FullRight_symbol:N {#1}
}
\cs_new_protected_nopar:Npn \__xeCJK_CJK_and_FullRight_glue:N #1
@@ -1108,9 +1145,13 @@
\__xeCJK_punct_if_long:NTF {#1}
{ \CJKglue }
{
- \xeCJK_no_break:
- \__xeCJK_punct_if_middle:NT {#1}
- { \__xeCJK_punct_glue:NN \c__xeCJK_right_tl {#1} }
+ \__xeCJK_punct_if_middle:NTF {#1}
+ {
+ \xeCJK_no_break:
+ \__xeCJK_punct_glue:NN \c__xeCJK_right_tl {#1}
+ \__xeCJK_punct_bound_rule:NN \c__xeCJK_left_tl {#1}
+ }
+ { \xeCJK_no_break: }
}
}
\cs_new_eq:NN \__xeCJK_Default_and_FullRight_glue:N \__xeCJK_CJK_and_FullRight_glue:N
@@ -1150,14 +1191,11 @@
\cs_new_protected_nopar:Npn \__xeCJK_punct_breakable_kern:NN #1#2
{
\__xeCJK_punct_rule:NN \c__xeCJK_right_tl #1
- \__xeCJK_punct_hskip:n
- {
- \__xeCJK_use_punct_dim:nnn { kern } {#1} {#2} +
- \__xeCJK_use_punct_dim:nnn { bound } { \c__xeCJK_right_tl } {#1} +
- \__xeCJK_use_punct_dim:nnn { bound } { \c__xeCJK_left_tl } {#2}
- }
+ \__xeCJK_punct_breakable_kern:n
+ { \__xeCJK_use_punct_dim:nnn { break_kern } {#1} {#2} }
\__xeCJK_punct_rule:NN \c__xeCJK_left_tl #2
}
+\cs_new_eq:NN \__xeCJK_punct_breakable_kern:n \skip_horizontal:n
\cs_new_protected_nopar:Npn \xeCJK_FullRight_and_FullRight:N #1
{
\xeCJK_get_punct_bounds:NN \c__xeCJK_right_tl {#1}
@@ -1195,6 +1233,7 @@
{
\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
+ \__xeCJK_punct_offset:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\group_align_safe_begin:
\tl_case:NoTF \l_peek_token
{ \l__xeCJK_no_break_cs_case_tl }
@@ -1300,7 +1339,11 @@
\xeCJK_peek_catcode_ignore_spaces:NTF \c_catcode_letter_token
{
\bool_if:NTF \l__xeCJK_peek_ignore_spaces_bool
- { \__xeCJK_check_single_space:NN #1#2 }
+ {
+ \bool_if:NTF \l__xeCJK_reserve_space_bool
+ { \__xeCJK_check_single_save:N #1 #2 ~ }
+ { \__xeCJK_check_single_space:NN #1#2 }
+ }
{ \__xeCJK_check_single_save:N #1 #2 }
}
{
@@ -1545,11 +1588,23 @@
\xeCJKsetup { PunctStyle = plain }
}
}
-\NewDocumentCommand \xeCJKsetwidth { m m }
- { \tl_map_inline:xn {#1} { \tl_gset:cn { g__xeCJK_punct_width/##1/tl } {#2} } }
+\NewDocumentCommand \xeCJKsetwidth { s m m }
+ {
+ \IfBooleanTF {#1}
+ {
+ \tl_map_inline:xn {#2}
+ { \tl_gset:cn { g__xeCJK_punct_bound_width/##1/tl } {#3} }
+ }
+ {
+ \tl_map_inline:xn {#2}
+ { \tl_gset:cn { g__xeCJK_punct_width/##1/tl } {#3} }
+ }
+ }
+\@onlypreamble \xeCJKsetwidth
\cs_generate_variant:Nn \tl_map_inline:nn { x }
\NewDocumentCommand \xeCJKsetkern { m m m }
{ \tl_gset:cn { g__xeCJK_punct/kern/#1/#2/tl } {#3} }
+\@onlypreamble \xeCJKsetkern
\tl_const:Nn \c__xeCJK_left_tl { left }
\tl_const:Nn \c__xeCJK_right_tl { right }
\keys_define:nn { xeCJK / options }
@@ -1575,7 +1630,10 @@
MiddlePunct .code:n = { \__xeCJK_set_special_punct:nn { middle } {#1} } ,
MiddlePunct+ .code:n = { \__xeCJK_add_special_punct:nn { middle } {#1} } ,
MiddlePunct- .code:n = { \__xeCJK_sub_special_punct:nn { middle } {#1} } ,
- PunctWidth .tl_gset:N = \g__xeCJK_punct_width_tl
+ PunctWidth .tl_gset:N = \g__xeCJK_punct_width_tl ,
+ PunctBoundWidth .tl_gset:N = \g__xeCJK_punct_bound_width_tl ,
+ PunctWidth .value_required: ,
+ PunctBoundWidth .value_required:
}
\bool_new:N \l__xeCJK_punct_breakable_bool
\clist_new:N \g__xeCJK_special_punct_clist
@@ -1630,20 +1688,18 @@
}
\cs_new_nopar:Npn \__xeCJK_punct_dim_csname:nn #1#2
{ c__\l_xeCJK_current_font_tl/\l_xeCJK_punct_style_tl/#1/#2/tl }
-\cs_new_nopar:Npn \__xeCJK_punct_dim_csname:nnn
- { \__xeCJK_punct_dim_csname:nnnn { \l_xeCJK_punct_style_tl } }
-\cs_new_nopar:Npn \__xeCJK_punct_dim_csname:nnnn #1#2#3#4
- { c__\l_xeCJK_current_font_tl/#1/#2/#3/#4/tl }
+\cs_new_nopar:Npn \__xeCJK_punct_dim_csname:nnn #1#2#3
+ { c__\l_xeCJK_current_font_tl/\l_xeCJK_punct_style_tl/#1/#2/#3/tl }
\cs_new_nopar:Npn \__xeCJK_use_punct_dim:nn #1#2
- { \tl_use:c { \__xeCJK_punct_dim_csname:nn {#1} {#2} } }
+ { \use:c { \__xeCJK_punct_dim_csname:nn {#1} {#2} } }
\cs_new_nopar:Npn \__xeCJK_use_punct_dim:nnn #1#2#3
- { \tl_use:c { \__xeCJK_punct_dim_csname:nnn {#1} {#2} {#3} } }
+ { \use:c { \__xeCJK_punct_dim_csname:nnn {#1} {#2} {#3} } }
\cs_new_protected_nopar:Npn \__xeCJK_save_punct_dim:nnn #1#2#3
{ \tl_const:cx { \__xeCJK_punct_dim_csname:nn {#1} {#2} } { \dim_eval:n {#3} } }
\cs_new_protected_nopar:Npn \__xeCJK_save_punct_dim:nnnn #1#2#3#4
{ \tl_const:cx { \__xeCJK_punct_dim_csname:nnn {#1} {#2} {#3} } { \dim_eval:n {#4} } }
-\DeclareObjectType { xeCJK / punctuation } { \c_three }
-\DeclareTemplateInterface { xeCJK / punctuation } { basic } { \c_three }
+\DeclareObjectType { xeCJK / punctuation } { \c_zero }
+\DeclareTemplateInterface { xeCJK / punctuation } { basic } { \c_zero }
{
enabled-global-setting : boolean = true ,
fixed-punct-width : length = \c_max_dim ,
@@ -1658,6 +1714,11 @@
mixed-margin-ratio : real = \KeyValue { fixed-margin-ratio } ,
middle-margin-width : length = \KeyValue { fixed-margin-width } ,
middle-margin-ratio : real = \KeyValue { fixed-margin-ratio } ,
+ bound-punct-width : length = \c_max_dim ,
+ bound-punct-ratio : real = \c_nan_fp ,
+ bound-margin-width : length = \c_max_dim ,
+ bound-margin-ratio : real = \c_zero_fp ,
+ enabled-hanging : boolean = false ,
add-min-bound-to-margin : boolean = false ,
optimize-margin : boolean = false ,
margin-minimum : length = \c_zero_dim ,
@@ -1667,14 +1728,14 @@
kerning-total-ratio : real = 0.75 ,
optimize-kerning : boolean = false ,
same-align-margin : length = \c_max_dim ,
- same-align-ratio : real = \c_zero_fp ,
+ same-align-ratio : real = \c_nan_fp ,
different-align-margin : length = \c_max_dim ,
- different-align-ratio : real = \c_zero_fp ,
+ different-align-ratio : real = \c_nan_fp ,
kerning-margin-width : length = \c_max_dim ,
kerning-margin-ratio : real = \c_one_fp ,
kerning-margin-minimum : length = \c_zero_dim
}
-\DeclareTemplateCode { xeCJK / punctuation } { basic } { \c_three }
+\DeclareTemplateCode { xeCJK / punctuation } { basic } { \c_zero }
{
enabled-global-setting = \l__xeCJK_enabled_global_setting_bool ,
fixed-punct-width = \l__xeCJK_fixed_punct_width_dim ,
@@ -1689,6 +1750,11 @@
mixed-margin-ratio = \l__xeCJK_mixed_margin_ratio_fp ,
middle-margin-width = \l__xeCJK_middle_margin_width_dim ,
middle-margin-ratio = \l__xeCJK_middle_margin_ratio_fp ,
+ bound-punct-width = \l__xeCJK_bound_punct_width_dim ,
+ bound-punct-ratio = \l__xeCJK_bound_punct_ratio_fp ,
+ bound-margin-width = \l__xeCJK_bound_margin_width_dim ,
+ bound-margin-ratio = \l__xeCJK_bound_margin_ratio_fp ,
+ enabled-hanging = \l__xeCJK_enabled_hanging_bool ,
add-min-bound-to-margin = \l__xeCJK_add_min_bound_to_margin_bool ,
optimize-margin = \l__xeCJK_optimize_margin_bool ,
margin-minimum = \l__xeCJK_margin_minimum_dim ,
@@ -1705,20 +1771,57 @@
kerning-margin-ratio = \l__xeCJK_kerning_margin_ratio_fp ,
kerning-margin-minimum = \l__xeCJK_kerning_margin_minimum_dim
}
+ { \AssignTemplateKeys }
+\cs_new_protected_nopar:Npn \xeCJK_get_punct_bounds:NN #1#2
{
- \AssignTemplateKeys
- \tl_if_blank:nTF {#3}
- { \xeCJK_punct_margin_process:NN {#1} {#2} }
- { \xeCJK_punct_kerning_process:NN {#2} {#3} }
+ \tl_if_exist:cF { \__xeCJK_punct_dim_csname:nnn { glue } {#1} {#2} }
+ {
+ \tl_if_eq:NNTF \l_xeCJK_punct_style_tl \c__xeCJK_punct_style_plain_tl
+ {
+ \__xeCJK_save_punct_dim:nnnn { rule } {#1} {#2} { \c_zero_dim }
+ \__xeCJK_save_punct_dim:nnnn { glue } {#1} {#2} { \c_zero_dim }
+ \__xeCJK_save_punct_dim:nnnn { plus } {#1} {#2} { \c_zero_dim }
+ \__xeCJK_save_punct_dim:nnnn { minus } {#1} {#2} { \c_zero_dim }
+ \__xeCJK_save_punct_dim:nnnn { offset } {#1} {#2} { \c_zero_dim }
+ \__xeCJK_save_punct_dim:nnnn { bound } \c__xeCJK_left_tl {#2} { \c_zero_dim }
+ \__xeCJK_save_punct_dim:nnnn { bound } \c__xeCJK_right_tl {#2} { \c_zero_dim }
+ }
+ {
+ { \xeCJK_select_font: \xeCJK_calc_punct_dimen:f {#2} }
+ \dim_set:Nn \l__xeCJK_bound_dim
+ { \__xeCJK_use_punct_dim:nnn { bound } {#1} {#2} }
+ \dim_set:Nn \l__xeCJK_reverse_bound_dim
+ {
+ \__xeCJK_use_punct_dim:nnn { bound }
+ { \xeCJK_reverse:nnn {#1} \c__xeCJK_left_tl \c__xeCJK_right_tl }
+ {#2}
+ }
+ \UseInstance { xeCJK / punctuation } { \l_xeCJK_punct_style_tl }
+ \xeCJK_punct_margin_process:NN {#1} {#2}
+ \xeCJK_punct_offset_process:NN {#1} {#2}
+ }
+ }
}
-\cs_new_protected_nopar:Npn \xeCJK_punct_margin_process:NN #1#2
+\dim_new:N \l__xeCJK_bound_dim
+\dim_new:N \l__xeCJK_reverse_bound_dim
+\cs_new_protected_nopar:Npn \xeCJK_get_punct_kerning:NN #1#2
{
- \dim_set:Nn \l__xeCJK_bound_dim { \__xeCJK_use_punct_dim:nnn { bound } {#1} {#2} }
- \dim_set:Nn \l__xeCJK_reverse_bound_dim
+ \tl_if_exist:cF { \__xeCJK_punct_dim_csname:nnn { kern } {#1} {#2} }
{
- \__xeCJK_use_punct_dim:nnn { bound }
- { \xeCJK_reverse:nnn {#1} \c__xeCJK_left_tl \c__xeCJK_right_tl } {#2}
+ \tl_if_eq:NNTF \l_xeCJK_punct_style_tl \c__xeCJK_punct_style_plain_tl
+ {
+ \__xeCJK_save_punct_dim:nnnn { kern } {#1} {#2} { \c_zero_dim }
+ \__xeCJK_save_punct_dim:nnnn { break_kern } {#1} {#2} { \c_zero_dim }
+ }
+ {
+ \UseInstance { xeCJK / punctuation } { \l_xeCJK_punct_style_tl }
+ \xeCJK_punct_kerning_process:NN {#1} {#2}
+ }
}
+ }
+\cs_generate_variant:Nn \xeCJK_get_punct_kerning:NN { o }
+\cs_new_protected_nopar:Npn \xeCJK_punct_margin_process:NN #1#2
+ {
\dim_set:Nn \l__xeCJK_tmp_dim
{
\bool_if:NTF \l__xeCJK_enabled_global_setting_bool
@@ -1726,7 +1829,7 @@
\cs_if_exist_use:cTF { g__xeCJK_punct_width/#2/tl }
{ \use_none:n }
{
- \xeCJK_if_blank_x:nTF \g__xeCJK_punct_width_tl
+ \tl_if_empty:NTF \g__xeCJK_punct_width_tl
{ \use:n }
{ \g__xeCJK_punct_width_tl \use_none:n }
}
@@ -1742,7 +1845,7 @@
}
}
}
- \__xeCJK_save_punct_dim:nnnn { glue } {#1} {#2}
+ \dim_set:Nn \l__xeCJK_tmp_dim
{
\dim_max:nn
{ \l__xeCJK_margin_minimum_dim }
@@ -1793,15 +1896,84 @@
}
}
}
+ \__xeCJK_save_punct_dim:nnnn { glue } {#1} {#2} { \l__xeCJK_tmp_dim }
+ \__xeCJK_save_punct_dim:nnnn { plus } {#1} {#2}
+ {
+ \dim_max:nn { \c_zero_dim }
+ {
+ \__xeCJK_punct_if_middle:NTF {#2}
+ {
+ ( \__xeCJK_use_punct_dim:nn { width } {#2} -
+ \__xeCJK_use_punct_dim:nn { dimen } {#2} ) / \c_two
+ - \l__xeCJK_tmp_dim
+ }
+ { \l__xeCJK_bound_dim - \l__xeCJK_tmp_dim }
+ }
+ }
+ \__xeCJK_save_punct_dim:nnnn { minus } {#1} {#2}
+ {
+ \dim_max:nn { \c_zero_dim }
+ {
+ \__xeCJK_punct_if_middle:NTF {#2}
+ { .5 \l__xeCJK_tmp_dim }
+ { \l__xeCJK_tmp_dim - \l__xeCJK_reverse_bound_dim }
+ }
+ }
+ }
+\cs_new_protected_nopar:Npn \xeCJK_punct_offset_process:NN #1#2
+ {
+ \dim_set:Nn \l__xeCJK_tmp_dim
+ {
+ \bool_if:NTF \l__xeCJK_enabled_global_setting_bool
+ {
+ \cs_if_exist_use:cTF { g__xeCJK_punct_bound_width/#2/tl }
+ { \use_none:n }
+ {
+ \tl_if_empty:NTF \g__xeCJK_punct_bound_width_tl
+ { \use:n }
+ { \g__xeCJK_punct_bound_width_tl \use_none:n }
+ }
+ }
+ { \use:n }
+ { \__xeCJK_punct_width_or_ratio:nN { bound } {#2} }
+ }
+ \dim_set:Nn \l__xeCJK_tmp_dim
+ {
+ \bool_if:NTF \l__xeCJK_enabled_hanging_bool
+ { \use:n }
+ { \dim_max:nn { \l__xeCJK_margin_minimum_dim } }
+ {
+ \dim_compare:nNnTF \l__xeCJK_tmp_dim < \c_max_dim
+ {
+ \__xeCJK_punct_if_middle:NTF {#2}
+ {
+ \l__xeCJK_tmp_dim
+ - ( \__xeCJK_use_punct_dim:nnn { glue } {#1} {#2} )
+ - ( \__xeCJK_use_punct_dim:nn { dimen } {#2} )
+ }
+ {
+ \l__xeCJK_tmp_dim - \l__xeCJK_reverse_bound_dim
+ - ( \__xeCJK_use_punct_dim:nn { dimen } {#2} )
+ }
+ }
+ {
+ \bool_if:NTF \l__xeCJK_optimize_margin_bool
+ { \dim_min:nn { \l__xeCJK_bound_dim } }
+ { \use:n }
+ { \__xeCJK_margin_width_or_ratio:n { bound } }
+ }
+ }
+ }
+ \__xeCJK_save_punct_dim:nnnn { offset } {#1} {#2} { \l__xeCJK_tmp_dim }
+ \__xeCJK_save_punct_dim:nnnn { rule } {#1} {#2}
+ { - \l__xeCJK_bound_dim + \l__xeCJK_tmp_dim }
}
-\dim_new:N \l__xeCJK_bound_dim
-\dim_new:N \l__xeCJK_reverse_bound_dim
\cs_new_nopar: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 } }
{
- \fp_compare:nNnTF { \use:c { l__xeCJK_#1_punct_ratio_fp } } = \c_zero_fp
+ \fp_compare:nNnTF { \use:c { l__xeCJK_#1_punct_ratio_fp } } ? \c_zero_fp
{ \c_max_dim }
{
\fp_use:c { l__xeCJK_#1_punct_ratio_fp }
@@ -1822,7 +1994,7 @@
}
\cs_new_protected_nopar:Npn \xeCJK_punct_kerning_process:NN #1#2
{
- \__xeCJK_save_punct_dim:nnnn { kern } {#1} {#2}
+ \dim_set:Nn \l__xeCJK_tmp_dim
{
\bool_if:nTF
{
@@ -1835,8 +2007,24 @@
{ \__xeCJK_calc_kerning_margin:NN {#1} {#2} }
{ \__xeCJK_original_kerning_margin:NN {#1} {#2} }
}
- - ( \__xeCJK_use_punct_dim:nnn { bound } \c__xeCJK_right_tl {#1} )
- - ( \__xeCJK_use_punct_dim:nnn { bound } \c__xeCJK_left_tl {#2} )
+ }
+ \__xeCJK_save_punct_dim:nnnn { kern } {#1} {#2}
+ {
+ \l__xeCJK_tmp_dim
+ - ( \__xeCJK_use_punct_dim:nnn { bound } \c__xeCJK_right_tl {#1} )
+ - ( \__xeCJK_use_punct_dim:nnn { bound } \c__xeCJK_left_tl {#2} )
+ }
+ \__xeCJK_punct_if_right:NF {#2}
+ {
+ \__xeCJK_punct_if_right:NT {#1}
+ {
+ \__xeCJK_save_punct_dim:nnnn { break_kern } {#1} {#2}
+ {
+ \l__xeCJK_tmp_dim
+ - ( \__xeCJK_use_punct_dim:nnn { offset } \c__xeCJK_right_tl {#1} )
+ - ( \__xeCJK_use_punct_dim:nnn { offset } \c__xeCJK_left_tl {#2} )
+ }
+ }
}
}
\cs_new_nopar:Npn \__xeCJK_original_kerning_margin:NN #1#2
@@ -1866,7 +2054,7 @@
\dim_compare:nNnTF \l__xeCJK_kerning_total_width_dim < \c_max_dim
{ \__xeCJK_calc_kerning_margin:nNN \l__xeCJK_kerning_total_width_dim }
{
- \fp_compare:nNnTF \l__xeCJK_kerning_total_ratio_fp = \c_zero_fp
+ \fp_compare:nNnTF \l__xeCJK_kerning_total_ratio_fp ? \c_zero_fp
{
\xeCJK_if_same_class:NNTF {#1} {#2}
{ \__xeCJK_kerning_width_or_ratio:nNN { same } }
@@ -1891,18 +2079,17 @@
\cs_new_nopar: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 } \use_none:nn }
+ { \use:c { l__xeCJK_#1_align_margin_dim } }
{
- \fp_compare:nNnTF { \use:c { l__xeCJK_#1_align_ratio_fp } } = \c_zero_fp
- { \use:n }
- { \fp_use:c { l__xeCJK_#1_align_ratio_fp } \use_ii:nn }
- }
- {
- \dim_compare:nNnTF \l__xeCJK_kerning_margin_width_dim < \c_max_dim
- { \l__xeCJK_kerning_margin_width_dim \use_none:n }
- { \fp_use:N \l__xeCJK_kerning_margin_ratio_fp \use:n }
+ \fp_compare:nNnTF { \use:c { l__xeCJK_#1_align_ratio_fp } } ? \c_zero_fp
+ {
+ \dim_compare:nNnTF \l__xeCJK_kerning_margin_width_dim < \c_max_dim
+ { \l__xeCJK_kerning_margin_width_dim \use_none:n }
+ { \fp_use:N \l__xeCJK_kerning_margin_ratio_fp \use:n }
+ }
+ { \fp_use:c { l__xeCJK_#1_align_ratio_fp } \use:n }
+ { \etex_dimexpr:D \__xeCJK_original_kerning_margin:NN {#2} {#3} \scan_stop: }
}
- { \etex_dimexpr:D \__xeCJK_original_kerning_margin:NN {#2} {#3} \scan_stop: }
}
\cs_new_nopar:Npn \__xeCJK_punct_min_bound:NN #1#2
{
@@ -1933,27 +2120,6 @@
- ( \__xeCJK_use_punct_dim:nn { dimen } {#3} )
}
}
-\cs_new_protected_nopar:Npn \xeCJK_get_punct_bounds:NN #1#2
- {
- \tl_if_exist:cF { \__xeCJK_punct_dim_csname:nnn { glue } {#1} {#2} }
- {
- \tl_if_eq:NNTF \l_xeCJK_punct_style_tl \c__xeCJK_punct_style_plain_tl
- {
- \__xeCJK_save_punct_dim:nnnn { glue } {#1} {#2} { \c_zero_dim }
- \__xeCJK_save_punct_dim:nnnn { bound } \c__xeCJK_left_tl {#2} { \c_zero_dim }
- \__xeCJK_save_punct_dim:nnnn { bound } \c__xeCJK_right_tl {#2} { \c_zero_dim }
- }
- {
- { \xeCJK_select_font: \xeCJK_calc_punct_dimen:f {#2} }
- \__xeCJK_punct_if_long:NTF {#2}
- { \__xeCJK_save_punct_dim:nnnn { glue } {#1} {#2} { \c_zero_dim } }
- {
- \UseInstance { xeCJK / punctuation }
- { \l_xeCJK_punct_style_tl } {#1} {#2} { }
- }
- }
- }
- }
\cs_new_protected_nopar:Npn \xeCJK_calc_punct_dimen:N #1
{
\__xeCJK_save_punct_dim:nnnn { bound } \c__xeCJK_left_tl {#1}
@@ -1973,11 +2139,8 @@
{
\__xeCJK_save_punct_dim:nnnn { kern } {#1} {#1}
{
- \bool_if:nTF
- {
- \str_if_eq_p:nn {#1} { ^^^^2025 } ||
- \str_if_eq_p:nn {#1} { ^^^^2026 }
- }
+ \str_case:nnTF {#1}
+ { { ^^^^2025 } { } { ^^^^2026 } { } }
{ \c_zero_dim }
{ - \l__xeCJK_tmp_dim }
}
@@ -1989,19 +2152,6 @@
\dim_use:N \XeTeXglyphbounds #1 ~
\XeTeXcharglyph \xeCJK_token_value_charcode:N #2 \exp_stop_f:
}
-\cs_new_protected_nopar:Npn \xeCJK_get_punct_kerning:NN #1#2
- {
- \tl_if_exist:cF { \__xeCJK_punct_dim_csname:nnn { kern } {#1} {#2} }
- {
- \tl_if_eq:NNTF \l_xeCJK_punct_style_tl \c__xeCJK_punct_style_plain_tl
- { \__xeCJK_save_punct_dim:nnnn { kern } {#1} {#2} { \c_zero_dim } }
- {
- \UseInstance { xeCJK / punctuation }
- { \l_xeCJK_punct_style_tl } { } {#1} {#2}
- }
- }
- }
-\cs_generate_variant:Nn \xeCJK_get_punct_kerning:NN { o }
\keys_define:nn { xeCJK / options }
{
PunctStyle .choice: ,
@@ -2344,7 +2494,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:nn }
+ \exp_not:n { \cs_set_eq:NN \__xeCJK_update_family:nn \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 }
@@ -2853,7 +3003,7 @@
\clist_map_inline:Nn \l__xeCJK_tmp_clist
{
\__xeCJK_set_char_class_aux:Nnw \xeCJK_gset_mathcode:nnnn {##1}
- { \c_seven } { \c_xeCJK_math_fam_int }
+ { \c_zero } { \c_xeCJK_math_fam_int }
}
}
}
@@ -2943,13 +3093,7 @@
\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
- {
- \exp_after:wN \exp_after:wN
- \exp_after:wN \xeCJKOffVerbAddon
- \exp_after:wN \use:n
- \tex_the:D \tex_output:D
- }
+ \__xeCJK_add_to_shipout:n { \xeCJKOffVerbAddon }
\xeCJKsetup { xCJKecglue = false }
}
\skip_if_eq:nnTF { \l__xeCJK_verb_exspace_skip } { \c_zero_skip }
@@ -3233,6 +3377,17 @@
\xeCJK_set_char_class:nnn {#1} {#2} {#3}
\xeCJKResetPunctClass
}
+\cs_new_protected_nopar:Npn \__xeCJK_update_url_font:
+ {
+ \group_begin: \xeCJK_select_font: \exp_after:wN \group_end:
+ \exp_after:wN \tex_textfont:D \exp_after:wN \c_xeCJK_math_fam_int
+ \tex_the:D \tex_font:D
+ }
+\__xeCJK_after_end_preamble:n
+ {
+ \bool_if:nT { \g__xeCJK_math_bool && \cs_if_exist_p:N \Url@MathSetup }
+ { \tl_put_right:Nn \Url@MathSetup { \__xeCJK_update_url_font: } }
+ }
\cs_if_free:NF \fontspec_setup_maths:
{
\cs_gset_protected_nopar:Npx \fontspec_setup_maths:
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty
index bab6a2e918d..91da63156f2 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 510 2013-08-15 23:20:17Z sobenlee $
+%% $Id: xeCJK.dtx 525 2013-11-11 06:32:00Z 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 510 2013-08-15 23:20:17Z sobenlee $
+\GetIdInfo$Id: xeCJK.dtx 525 2013-11-11 06:32:00Z sobenlee $
{xeCJK patch file for ulem/CJKfntef}
\ProvidesExplPackage
{xeCJKfntef}
- {\ExplFileDate}{3.2.6}{\ExplFileDescription}
+ {\ExplFileDate}{3.2.7}{\ExplFileDescription}
\PassOptionsToPackage { normalem } { ulem }
\DeclareOption* { \PassOptionsToPackage { \CurrentOption } { ulem } }
\ProcessOptions \scan_stop:
@@ -102,7 +102,9 @@
\xeCJK_Boundary_and_Default: \__xeCJK_ulem_Boundary_and_Default:
\xeCJK_Boundary_and_NormalSp: \__xeCJK_ulem_Boundary_and_NormalSp:
\xeCJK@fix@penalty \__xeCJK_ulem_fix_penalty:
+ \__xeCJK_punct_kern:n \__xeCJK_ulem_punct_kern:n
\__xeCJK_punct_hskip:n \__xeCJK_ulem_punct_hskip:n
+ \__xeCJK_punct_breakable_kern:n \__xeCJK_ulem_punct_breakable_kern:n
\__xeCJK_CJK_and_Boundary_aux: \__xeCJK_ulem_CJK_and_Boundary_aux:
\__xeCJK_Default_and_FullLeft_glue:N \__xeCJK_ulem_Default_and_FullLeft_glue:N
\__xeCJK_Default_and_FullRight_glue:N \__xeCJK_ulem_Default_and_FullRight_glue:N
@@ -215,6 +217,7 @@
\UL@stop
\__xeCJK_ulem_skip_punct_begin:
\__xeCJK_punct_glue:NN \c__xeCJK_left_tl {#1}
+ \__xeCJK_punct_offset:NN \c__xeCJK_left_tl {#1}
\UL@start
}
{ \__xeCJK_ulem_Default_and_FullLeft_glue:N #1 }
@@ -225,7 +228,8 @@
{
\UL@stop
\__xeCJK_ulem_skip_punct_begin:
- \int_compare:nNnF \etex_lastnodetype:D = \c_one
+ \int_compare:nNnTF \etex_lastnodetype:D = \c_one
+ { \__xeCJK_zero_glue: }
{ \__xeCJK_punct_glue:NN \c__xeCJK_left_tl {#1} }
\UL@start
}
@@ -240,6 +244,7 @@
\__xeCJK_ulem_skip_punct_begin:
\__xeCJK_ulem_ccglue:
\__xeCJK_punct_glue:NN \c__xeCJK_left_tl {#1}
+ \__xeCJK_punct_offset:NN \c__xeCJK_left_tl {#1}
\UL@start
\__xeCJK_ulem_class_group_begin:
}
@@ -254,9 +259,13 @@
\__xeCJK_punct_if_long:NTF {#1}
{ \__xeCJK_ulem_ccglue: }
{
- \xeCJK_no_break:
- \__xeCJK_punct_if_middle:NT {#1}
- { \__xeCJK_punct_glue:NN \c__xeCJK_right_tl {#1} }
+ \__xeCJK_punct_if_middle:NTF {#1}
+ {
+ \xeCJK_no_break:
+ \__xeCJK_punct_glue:NN \c__xeCJK_right_tl {#1}
+ \__xeCJK_punct_bound_rule:NN \c__xeCJK_left_tl {#1}
+ }
+ { \xeCJK_no_break: }
}
\UL@start
}
@@ -279,7 +288,7 @@
\__xeCJK_punct_if_middle:NTF \g__xeCJK_last_punct_tl
{
\xeCJK_get_punct_bounds:NN \c__xeCJK_left_tl \g__xeCJK_last_punct_tl
- \__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
+ \__xeCJK_punct_bound_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\xeCJK_class_group_end: \UL@stop \xeCJK_no_break:
\__xeCJK_punct_glue:NN \c__xeCJK_left_tl \g__xeCJK_last_punct_tl
}
@@ -306,6 +315,7 @@
\__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\xeCJK_class_group_end:
\UL@stop
+ \__xeCJK_punct_offset:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\__xeCJK_punct_glue:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\__xeCJK_ulem_skip_punct_end:
\UL@start
@@ -319,6 +329,7 @@
\__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\xeCJK_class_group_end:
\UL@stop
+ \__xeCJK_punct_offset:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\__xeCJK_punct_glue:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\__xeCJK_ulem_ccglue:
\__xeCJK_ulem_skip_punct_end:
@@ -333,6 +344,22 @@
{ \__xeCJK_ulem_hskip:n }
{ \__xeCJK_ulem_punct_hskip:n }
}
+\cs_new_protected_nopar:Npn \__xeCJK_ulem_punct_kern:n
+ {
+ \xeCJK_if_ulem_patch:TF
+ { \__xeCJK_ulem_hskip:n }
+ { \__xeCJK_ulem_punct_kern:n }
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_ulem_punct_breakable_kern:n #1
+ {
+ \xeCJK_if_ulem_patch:TF
+ {
+ \xeCJK_class_group_end:
+ \UL@stop \__xeCJK_ulem_hskip:n {#1} \UL@start
+ \__xeCJK_ulem_class_group_begin:
+ }
+ { \__xeCJK_ulem_punct_breakable_kern:n {#1} }
+ }
\cs_new_protected_nopar:Npn \__xeCJK_ulem_glue:n #1
{
\xeCJK_if_ulem_patch:TF
@@ -353,14 +380,14 @@
{ \UL@stop \__xeCJK_ulem_restore_CJK_and_Boundary: }
\CJK@preUnderdot
\__xeCJK_make_under_symbol:n { \CJK@underdotSkip }
- \cs_gset_eq:NN \__xeCJK_save_under_dot_CJKsymbol:N \CJKsymbol
+ \cs_gset_eq:NN \__xeCJK_save_under_CJKsymbol:N \CJKsymbol
\cs_set_eq:NN \CJKsymbol \__xeCJK_under_CJKsymbol:N
- \__xeCJK_restore_output_CJKsymbol:
+ \__xeCJK_restore_shipout_CJKsymbol:
\bool_if:NT \l__xeCJK_ulem_hook_used_bool { \UL@start }
#1
\bool_if:NT \l__xeCJK_ulem_hook_used_bool { \UL@stop }
- \cs_set_eq:NN \CJKsymbol \__xeCJK_save_under_dot_CJKsymbol:N
- \tex_output:D \exp_after:wN { \l__xeCJK_underdot_output_tl }
+ \cs_set_eq:NN \CJKsymbol \__xeCJK_save_under_CJKsymbol:N
+ \tl_clear:N \l__xeCJK_fntef_shipout_tl
\CJK@postUnderdot
\bool_if:NT \l__xeCJK_ulem_hook_used_bool
{ \__xeCJK_ulem_restore_CJK_and_Boundary: \UL@start }
@@ -381,26 +408,30 @@
\group_begin:
\hbox_set:Nn \CJK@underdotBox {#2}
\__xeCJK_make_under_symbol:n {#1}
- \cs_gset_eq:NN \__xeCJK_save_under_dot_CJKsymbol:N \CJKsymbol
+ \cs_set_eq:NN \__xeCJK_save_under_CJKsymbol:N \CJKsymbol
\cs_set_eq:NN \CJKsymbol \__xeCJK_under_CJKsymbol:N
- \__xeCJK_restore_output_CJKsymbol:
+ \__xeCJK_restore_shipout_CJKsymbol:
+ \tl_clear:N \l__xeCJK_underdot_shipout_tl
#3
\group_end:
\tex_ignorespaces:D
}
-\cs_new_protected:Npn \__xeCJK_restore_output_CJKsymbol:
+\cs_new_protected:Npn \__xeCJK_restore_shipout_CJKsymbol:
{
- \tl_set:Nx \l__xeCJK_underdot_output_tl
- { \exp_after:wN \exp_not:n \tex_the:D \tex_output:D }
- \tex_output:D \exp_after:wN
+ \tl_set:Nn \l__xeCJK_fntef_shipout_tl
{
- \exp_after:wN \cs_set_eq:NN
- \exp_after:wN \CJKsymbol
- \exp_after:wN \__xeCJK_save_under_dot_CJKsymbol:N
- \l__xeCJK_underdot_output_tl
+ \l__xeCJK_underdot_shipout_tl
+ \cs_set_eq:NN \CJKsymbol \__xeCJK_save_under_CJKsymbol:N
}
}
-\tl_new:N \l__xeCJK_underdot_output_tl
+\tl_new:N \l__xeCJK_fntef_shipout_tl
+\tl_new:N \l__xeCJK_underdot_shipout_tl
+\tl_set:Nn \l__xeCJK_underdot_shipout_tl
+ {
+ \cs_set_eq:NN \CJKf@global \scan_stop:
+ \int_zero:N \CJK@nest \CJK@postUnderdot
+ }
+\__xeCJK_add_to_shipout:n { \l__xeCJK_fntef_shipout_tl }
\cs_new_protected:Npn \__xeCJK_make_under_symbol:n #1
{
\hbox_set:Nn \l__xeCJK_tmp_box { ^^^^4e00 }
@@ -409,7 +440,7 @@
\skip_vertical:n {#1}
\hbox_to_zero:n
{
- \tex_kern:D - \box_wd:N \l__xeCJK_tmp_box
+ \tex_kern:D \box_wd:N \l__xeCJK_tmp_box
\tex_hss:D \box_use:N \CJK@underdotBox \tex_hss:D
}
\tex_vss:D
@@ -417,10 +448,8 @@
}
\cs_new_protected_nopar:Npn \__xeCJK_under_CJKsymbol:N #1
{
- \__xeCJK_save_under_dot_CJKsymbol:N {#1}
- \hbox_overlap_left:n { \box_use:N \g__xeCJK_under_symbol_box }
- { \xeCJK_make_node:n { CJK } }
- \xeCJK_ignore_spaces:w
+ \hbox_overlap_right:n { \box_use:N \g__xeCJK_under_symbol_box }
+ \xeCJK_no_break: \__xeCJK_save_under_CJKsymbol:N {#1}
}
\RenewDocumentEnvironment { CJKfilltwosides } { O { c } m }
{
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty
index 66817b79bf6..8338f15acf2 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 510 2013-08-15 23:20:17Z sobenlee $
+%% $Id: xeCJK.dtx 525 2013-11-11 06:32:00Z 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 510 2013-08-15 23:20:17Z sobenlee $
+\GetIdInfo$Id: xeCJK.dtx 525 2013-11-11 06:32:00Z sobenlee $
{addon file for xunicode}
\ProvidesExplPackage
{xunicode-addon}
- {\ExplFileDate}{3.2.6}{\ExplFileDescription}
+ {\ExplFileDate}{3.2.7}{\ExplFileDescription}
\pdftex_if_engine:T
{
\msg_new:nnnn { xunicode-addon } { cannot-use-pdftex }