summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-05-20 23:58:58 +0000
committerKarl Berry <karl@freefriends.org>2012-05-20 23:58:58 +0000
commit5bed059ee6199aca34f267e3b0d97ea59bb32ac4 (patch)
treeb53f3c9d429dad985b7b47ea1d763dc873dd862e /Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
parentba135237e227af8d0a0cb28713636e65b95f7f2d (diff)
xecjk (18may12)
git-svn-id: svn://tug.org/texlive/trunk@26516 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty')
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty90
1 files changed, 49 insertions, 41 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
index 6ee01e7a082..adf0c16231d 100644
--- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
+++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
@@ -6,11 +6,14 @@
%%
%% xeCJK.dtx (with options: `package')
%%
-%% Version 3.0.4 (06-May-2012)
+%% Version 3.0.5 (19-May-2012)
%% -----------------------------------------------------------------
-%% Author: Wenchang Sun <sunwch@hotmail.com>
-%% Maintainer: Leo Liu <leoliu.pku@gmail.com>
-%% Qing Lee <sobenlee@gmail.com>
+%% Author:
+%% Wenchang Sun <sunwch@nankai.edu.cn>
+%% Current Maintainers:
+%% Leo Liu <leoliu.pku@gmail.com>
+%% Qing Lee <sobenlee@gmail.com>
+%%
%% Copyright (C) 2007--2012 Wenchang Sun
%%
%% This file may be distributed and/or modified under the
@@ -27,15 +30,16 @@
%%
\RequirePackage{xparse}
\RequirePackage{l3keys2e}
-\ProvidesExplPackage {xeCJK} {2012/05/06} {3.0.4}
+\ProvidesExplPackage {xeCJK} {2012/05/19} {3.0.5}
{package for typesetting CJK scripts with XeLaTeX}
-\cs_new_nopar:Npn \xeCJK_msg_new:nn { \msg_new:nnn { xeCJK } }
-\cs_new_nopar:Npn \xeCJK_error:n { \msg_error:nn { xeCJK } }
-\cs_new_nopar:Npn \xeCJK_error:nx { \msg_error:nnx { xeCJK } }
-\cs_new_nopar:Npn \xeCJK_warning:n { \msg_warning:nn { xeCJK } }
-\cs_new_nopar:Npn \xeCJK_warning:nx { \msg_warning:nnx { xeCJK } }
-\cs_new_nopar:Npn \xeCJK_info:nx { \msg_info:nnx { xeCJK } }
-\cs_new_nopar:Npn \xeCJK_info:nxx { \msg_info:nnxx { xeCJK } }
+\cs_new_nopar:Npn \xeCJK_msg_new:nn { \msg_new:nnn { xeCJK } }
+\cs_new_nopar:Npn \xeCJK_error:n { \msg_error:nn { xeCJK } }
+\cs_new_nopar:Npn \xeCJK_error:nx { \msg_error:nnx { xeCJK } }
+\cs_new_nopar:Npn \xeCJK_warning:n { \msg_warning:nn { xeCJK } }
+\cs_new_nopar:Npn \xeCJK_warning:nx { \msg_warning:nnx { xeCJK } }
+\cs_new_nopar:Npn \xeCJK_warning:nxx { \msg_warning:nnxx { xeCJK } }
+\cs_new_nopar:Npn \xeCJK_info:nx { \msg_info:nnx { xeCJK } }
+\cs_new_nopar:Npn \xeCJK_info:nxx { \msg_info:nnxx { xeCJK } }
\msg_new:nnn {xeCJK} { Require-XeTeX }
{
The~xeCJK~package~requires~XeTeX~to~function.\\\\
@@ -70,7 +74,7 @@
\int_const:Nn \xeCJK_Boundary_class { 255 }
\cs_new_nopar:Nn \xeCJK_new_class:n
{
- \exp_after:wN \newXeTeXintercharclass \cs:w xeCJK_#1_class\cs_end:
+ \exp_args:Nc \newXeTeXintercharclass { xeCJK_#1_class }
\clist_gclear_new:c { g_xeCJK_#1_range_clist }
\seq_gput_right:Nv \g_xeCJK_class_seq { xeCJK_#1_class }
}
@@ -94,7 +98,7 @@
}
\cs_generate_variant:Nn \prop_gput:Nnn { Nvx }
\clist_map_inline:nn { CJK, FullLeft, FullRight } { \xeCJK_save_CJK_class:n {#1} }
-\cs_new_nopar:Nn \xeCJK_class_num:n { \use:c { xeCJK_#1_class } }
+\cs_new_nopar:Nn \xeCJK_class_num:n { \tl_use:c { xeCJK_#1_class } }
\prg_set_conditional:Nnn \tl_if_blank:x { p , T , F , TF }
{
\if_int_compare:w \pdftex_strcmp:D { \c_empty_tl } {#1} = \c_zero
@@ -245,9 +249,7 @@
}
\cs_generate_variant:Nn \xeCJK_app_inter_class_toks:nnn { nnc }
\cs_new_nopar:Nn \xeCJK_get_inter_class_toks:nn
- {
- \tex_the:D \XeTeXinterchartoks \xeCJK_class_num:n {#1} \xeCJK_class_num:n {#2}
- }
+ { \tex_the:D \XeTeXinterchartoks \xeCJK_class_num:n {#1} \xeCJK_class_num:n {#2} }
\cs_new_nopar:Nn \xeCJK_copy_inter_class_toks:nnnn
{
\use:x
@@ -272,16 +274,12 @@
\xeCJK_clear_inter_class_toks:nn {#1} {##1}
\xeCJK_clear_CJK_toks:
}
+ \xeCJK_inter_class_toks:nnn {##1} {#1} { \c_group_end_token }
}
\xeCJK_app_inter_class_toks:nnn {#1} { CJK } { \CJKsymbol }
\clist_map_inline:nn { FullLeft, FullRight }
{ \xeCJK_app_inter_class_toks:nnc {#1} {##1} { xeCJK_CJK_and_##1:N } }
- \xeCJK_inter_class_toks:nnn { CJK } {#1} { \c_group_end_token }
- \xeCJK_inter_class_toks:nnn { FullLeft } {#1} { \nobreak \c_group_end_token }
- \xeCJK_inter_class_toks:nnn { FullRight } {#1}
- { \xeCJK_after_FullRight: \c_group_end_token }
}
-\xeCJK_pre_inter_class_toks:nnn { Default } { CJK } { \CJKecglue }
\clist_map_inline:nn { Default, HalfLeft, NormalSpace }
{
\xeCJK_inter_class_toks:nnn { Boundary } {#1}
@@ -299,6 +297,8 @@
\peek_catcode:NTF \c_space_token
{ { \xeCJK_default_space_kern: } } { { \xeCJK_default_kern: } }
}
+ \str_if_eq:xxF {#1} { NormalSpace }
+ { \xeCJK_pre_inter_class_toks:nnn {#1} { CJK } { \CJKecglue } }
}
\xeCJK_inter_class_toks:nnn { Boundary } { CJK } { \xeCJK_Boundary_and_CJK: }
\cs_new_nopar:Nn \xeCJK_Boundary_and_CJK:
@@ -324,8 +324,7 @@
{
\l_xeCJK_xecglue_bool &&
\int_compare_p:nNn \etex_lastnodetype:D = \c_eleven &&
- ( \int_compare_p:nNn
- \tex_lastskip:D = { \tex_fontdimen:D \c_two \tex_font:D } ||
+ ( \skip_if_eq_p:nn \tex_lastskip:D \l_xeCJK_space_glue_tl ||
\int_compare_p:nNn \tex_lastskip:D = \l_xeCJK_ecglue_dim )
}
{
@@ -358,6 +357,12 @@
\xeCJK_select_font:
\CJKsymbol
}
+\tl_set:Nn \l_xeCJK_space_glue_tl
+ {
+ \tex_fontdimen:D \c_two \tex_font:D
+ \@plus \tex_fontdimen:D \c_three \tex_font:D
+ \@minus \tex_fontdimen:D \c_four \tex_font:D
+ }
\xeCJK_inter_class_toks:nnn { CJK } { Boundary }
{
\c_group_end_token
@@ -376,17 +381,22 @@
\use:c { xeCJK_CJK_and_#1:N }
}
\xeCJK_inter_class_toks:nnn {#1} { CJK } { \CJKsymbol }
- \xeCJK_inter_class_toks:nnn {#1} { Boundary }
- { \c_group_end_token \tex_ignorespaces:D }
- \clist_map_inline:nn { CJK, Boundary }
+ \xeCJK_inter_class_toks:nnn {#1} { Boundary } { \c_group_end_token \tex_ignorespaces:D }
+ }
+\clist_map_inline:Nn \g_xeCJK_base_class_clist
+ {
+ \bool_if:nF
+ { \str_if_eq_p:xx {#1} { FullLeft } || \str_if_eq_p:xx {#1} { FullRight } }
{
- \exp_args:Nnnx \xeCJK_pre_inter_class_toks:nnn {#1} {##1}
- {
- \str_if_eq:xxTF {#1} { FullLeft }
- { \exp_not:N \nobreak } { \exp_not:N \xeCJK_after_FullRight: }
- }
+ \xeCJK_pre_inter_class_toks:nnn { FullLeft } {#1} { \nobreak }
+ \xeCJK_pre_inter_class_toks:nnn { FullRight } {#1} { \xeCJK_after_FullRight: }
}
}
+\clist_map_inline:nn { CJK, FullLeft, FullRight }
+ {
+ \clist_map_inline:nn { FullLeft, FullRight }
+ { \xeCJK_inter_class_toks:nnc {#1} {##1} { xeCJK_#1_and_##1:N } }
+ }
\cs_new_nopar:Nn \xeCJK_punct_rule:n
{
\tex_vrule:D
@@ -418,11 +428,6 @@
\xeCJK_punct_rule:n { r/\l_xeCJK_lastpunct_tl }
\xeCJK_punct_glue:n { r/\l_xeCJK_lastpunct_tl }
}
-\clist_map_inline:nn { CJK, FullLeft, FullRight }
- {
- \clist_map_inline:nn { FullLeft, FullRight }
- { \xeCJK_inter_class_toks:nnc {#1} {##1} { xeCJK_#1_and_##1:N } }
- }
\cs_new_nopar:Nn \xeCJK_CJK_and_FullLeft:N
{
\xeCJK_get_punct_bounds:nN { l } {#1}
@@ -922,8 +927,7 @@
{ \l_xeCJK_punct_coor_tl/bound/\str_if_eq:xxTF {#1} lrl/#2 }
\dim_set:Nn \l_tmpc_dim
{
- \tl_if_exist:cTF { g_xeCJK_punct_width/#2 }
- { \tl_use:c { g_xeCJK_punct_width/#2 } }
+ \cs_if_exist_use:cF { g_xeCJK_punct_width/#2 }
{
\tl_if_blank:xTF \g_xeCJK_punct_width_tl
{ \c_zero_dim }
@@ -1310,7 +1314,7 @@
{
\exp_args:No \tl_if_head_group:nT #1
{
- \exp_after:wN \tl_set:Nn \exp_after:wN #1 #1
+ \exp_last_unbraced:NNo \tl_set:Nn #1 #1
\xeCJK_gobble_brace:N #1
}
}
@@ -1398,6 +1402,8 @@
\tl_set:Nx \l_xeCJK_family_tl {#1}
\clist_set:Nx \l_xeCJK_fontoptions_clist {#2}
\tl_set:Nx \l_xeCJK_fontname_tl {#3}
+ \prop_gpop:NVNT \g_xeCJK_family_name_prop \l_xeCJK_family_tl \l_tmpa_tl
+ { \xeCJK_warning:nxx { CJKfamily-redef } \l_xeCJK_family_tl \l_tmpa_tl }
\keys_set_known:nxN { xeCJK / features }
{ \g_xeCJK_default_features_clist, #2 } \l_xeCJK_pass_features_clist
\xeCJK_parse_features:
@@ -1421,6 +1427,7 @@
\group_end:
}
\cs_generate_variant:Nn \xeCJK_set_family:nnn { ncc }
+\xeCJK_msg_new:nn { CJKfamily-redef } { Redefining~CJKfamily~`#1'~(#2). }
\cs_new_nopar:Nn \xeCJK_add_font:nn
{
\prop_put:Nxx \l_xeCJK_add_font_prop
@@ -1433,6 +1440,7 @@
}
\cs_generate_variant:Nn \xeCJK_add_font:nn { nx, nc, nV, nv }
\cs_generate_variant:Nn \xeCJK_add_font_if_new:nn { nx, nc, nV, nv }
+\cs_generate_variant:Nn \prop_gpop:NnNT { NV }
\cs_generate_variant:Nn \prop_put:Nnn { Nxx }
\cs_generate_variant:Nn \prop_get:Nn { NV }
\cs_generate_variant:Nn \prop_get:NnNF { Nx }
@@ -1910,7 +1918,7 @@
{
CJKnumber .bool_set:N = \g_xeCJK_number_bool ,
indentfirst .bool_set:N = \g_xeCJK_indent_bool ,
- normalindentfirst .meta:n = { indentfirst = true } ,
+ normalindentfirst .meta:n = { indentfirst = false } ,
quiet .code:n =
{
\msg_redirect_module:nnn { xeCJK } { warning } { info }