summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-07-08 22:01:34 +0000
committerKarl Berry <karl@freefriends.org>2013-07-08 22:01:34 +0000
commitb077ab9cacab5e6fa2f644a13ecf8d76297f4875 (patch)
treef4ed5128a7b1a0eeb9c27033a9d765da470c6d78 /Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty
parent604ab2b8e6483eed86c3262618436714f6a721cb (diff)
xecjk (8jul13)
git-svn-id: svn://tug.org/texlive/trunk@31138 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty')
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty143
1 files changed, 99 insertions, 44 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty
index cddd5f98527..dc3fda86212 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 438 2013-06-11 14:17:42Z sobenlee $
+%% $Id: xeCJK.dtx 465 2013-07-06 10:30:24Z sobenlee $
%% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%% -----------------------------------------------------------------
%% Author:
@@ -33,24 +33,25 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: xeCJK.dtx 438 2013-06-11 14:17:42Z sobenlee $
+\GetIdInfo$Id: xeCJK.dtx 465 2013-07-06 10:30:24Z sobenlee $
{xeCJK patch file for ulem/CJKfntef}
\ProvidesExplPackage
{xeCJKfntef}
- {\ExplFileDate}{3.2.3}{\ExplFileDescription}
+ {\ExplFileDate}{3.2.4}{\ExplFileDescription}
\PassOptionsToPackage { normalem } { ulem }
\DeclareOption* { \PassOptionsToPackage { \CurrentOption } { ulem } }
\ProcessOptions \scan_stop:
\RequirePackage { xeCJK }
\RequirePackage { ulem }
\RequirePackage { CJKfntef }
+\RequirePackage { environ }
\addto@hook \UL@hook { \xeCJK_hook_for_ulem: }
\cs_new_protected_nopar:Npn \xeCJK_hook_for_ulem:
{
\bool_if:NF \l__xeCJK_ulem_hook_used_bool
{
\bool_set_true:N \l__xeCJK_ulem_hook_used_bool
- \xeCJKsetup { CheckFullRight = false }
+ \xeCJKsetup { CheckFullRight = false , xCJKecglue = false }
\bool_if:NTF \l__xeCJK_ulem_skip_punct_bool
{ \cs_set_eq:NN \__xeCJK_ulem_leader_type: \UL@leadtype }
{
@@ -92,22 +93,22 @@
\xeCJK_cs_clear:N \__xeCJK_ulem_leader_type:
\cs_new_protected_nopar:Npn \__xeCJK_ulem_initial:
{
- \xeCJK_swap_cs:NN
- \__xeCJK_Default_and_FullLeft_glue:N \__xeCJK_ulem_Default_and_FullLeft_glue:N
- \xeCJK_swap_cs:NN
- \__xeCJK_Default_and_FullRight_glue:N \__xeCJK_ulem_Default_and_FullRight_glue:N
- \xeCJK_swap_cs:NN
- \__xeCJK_CJK_and_FullLeft_glue:N \__xeCJK_ulem_CJK_and_FullLeft_glue:N
- \xeCJK_swap_cs:NN
- \__xeCJK_CJK_and_FullRight_glue:N \__xeCJK_ulem_CJK_and_FullRight_glue:N
- \xeCJK_swap_cs:NN
- \__xeCJK_Boundary_and_FullLeft_glue:N \__xeCJK_ulem_Boundary_and_FullLeft_glue:N
- \xeCJK_swap_cs:NN \__xeCJK_punct_hskip:n \__xeCJK_ulem_punct_hskip:n
- \xeCJK_swap_cs:NN \xeCJK_FullLeft_and_Default: \__xeCJK_ulem_FullLeft_and_Default:
- \xeCJK_swap_cs:NN \xeCJK_FullLeft_and_CJK: \__xeCJK_ulem_FullLeft_and_CJK:
- \xeCJK_swap_cs:NN \xeCJK_FullRight_and_Default: \__xeCJK_ulem_FullRight_and_Default:
- \xeCJK_swap_cs:NN \xeCJK_FullRight_and_CJK: \__xeCJK_ulem_FullRight_and_CJK:
- \xeCJK_swap_cs:NN \xeCJK_CJK_and_CJK:N \__xeCJK_ulem_CJK_and_CJK:N
+ \__xeCJK_ulem_swap_cs:NN
+ \xeCJK_FullLeft_and_Default: \__xeCJK_ulem_FullLeft_and_Default:
+ \xeCJK_FullLeft_and_CJK: \__xeCJK_ulem_FullLeft_and_CJK:
+ \xeCJK_FullRight_and_Default: \__xeCJK_ulem_FullRight_and_Default:
+ \xeCJK_FullRight_and_CJK: \__xeCJK_ulem_FullRight_and_CJK:
+ \xeCJK_CJK_and_CJK:N \__xeCJK_ulem_CJK_and_CJK:N
+ \xeCJK_Boundary_and_Default: \__xeCJK_ulem_Boundary_and_Default:
+ \xeCJK@fix@penalty \__xeCJK_ulem_fix_penalty:
+ \__xeCJK_punct_hskip:n \__xeCJK_ulem_punct_hskip: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
+ \__xeCJK_CJK_and_FullLeft_glue:N \__xeCJK_ulem_CJK_and_FullLeft_glue:N
+ \__xeCJK_CJK_and_FullRight_glue:N \__xeCJK_ulem_CJK_and_FullRight_glue:N
+ \__xeCJK_Boundary_and_FullLeft_glue:N \__xeCJK_ulem_Boundary_and_FullLeft_glue:N
+ \q_recursion_tail \q_nil \q_recursion_stop
\seq_map_inline:Nn \g__xeCJK_CJK_sub_class_seq
{
\seq_map_inline:Nn \g__xeCJK_CJK_sub_class_seq
@@ -126,6 +127,12 @@
}
}
}
+\cs_new_protected_nopar:Npn \__xeCJK_ulem_swap_cs:NN #1#2
+ {
+ \quark_if_recursion_tail_stop:N #1
+ \xeCJK_swap_cs:NN #1#2
+ \__xeCJK_ulem_swap_cs:NN
+ }
\cs_new_nopar:Npn \xeCJK_if_ulem_patch:TF
{
\if_meaning:w \ \LA@space
@@ -134,6 +141,31 @@
\exp_after:wN \use_i:nn
\fi:
}
+\cs_new_protected_nopar:Npn \__xeCJK_ulem_Boundary_and_Default:
+ {
+ \xeCJK_if_ulem_patch:TF
+ {
+ \xeCJK_if_last_node:nTF { CJK }
+ { \xeCJK_remove_node: \skip_horizontal:N \l__xeCJK_ecglue_skip }
+ { \xeCJK_if_last_node:nT { CJK-space } { \xeCJK_remove_node: \c_space_tl } }
+ }
+ { \__xeCJK_ulem_Boundary_and_Default: }
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_ulem_CJK_and_Boundary_aux:
+ {
+ \xeCJK_if_ulem_patch:TF
+ {
+ \UL@stop \__xeCJK_ulem_hskip:n { \c_zero_skip } \UL@start
+ { \xeCJK_make_node:n { CJK } }
+ }
+ { \__xeCJK_ulem_CJK_and_Boundary_aux: }
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_ulem_fix_penalty:
+ {
+ \xeCJK_if_ulem_patch:TF
+ { \fix@penalty }
+ { \__xeCJK_ulem_fix_penalty: }
+ }
\cs_new_protected_nopar:Npn \__xeCJK_ulem_CJK_and_CJK:N
{
\xeCJK_if_ulem_patch:TF
@@ -214,12 +246,9 @@
\__xeCJK_punct_if_long:NTF {#1}
{ \__xeCJK_ulem_ccglue: }
{
- \__xeCJK_punct_if_middle:NT {#1}
- {
- \xeCJK_no_break:
- \__xeCJK_punct_glue:NN \c__xeCJK_right_tl {#1}
- }
\xeCJK_no_break:
+ \__xeCJK_punct_if_middle:NT {#1}
+ { \__xeCJK_punct_glue:NN \c__xeCJK_right_tl {#1} }
}
\UL@start
}
@@ -312,7 +341,8 @@
}
\RenewDocumentCommand \CJKunderdot { m }
{
- \bool_if:NT \l__xeCJK_ulem_hook_used_bool { \UL@stop }
+ \bool_if:NT \l__xeCJK_ulem_hook_used_bool
+ { \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
@@ -324,10 +354,20 @@
\cs_set_eq:NN \CJKsymbol \__xeCJK_save_under_dot_CJKsymbol:N
\tex_output:D \exp_after:wN { \l__xeCJK_underdot_output_tl }
\CJK@postUnderdot
- \bool_if:NT \l__xeCJK_ulem_hook_used_bool { \UL@start }
+ \bool_if:NT \l__xeCJK_ulem_hook_used_bool
+ { \__xeCJK_ulem_restore_CJK_and_Boundary: \UL@start }
\tex_ignorespaces:D
}
\box_new:N \g__xeCJK_under_symbol_box
+\cs_new_protected_nopar:Npn \__xeCJK_ulem_restore_CJK_and_Boundary:
+ {
+ \xeCJK_if_ulem_patch:TF
+ {
+ \xeCJK_swap_cs:NN
+ \__xeCJK_CJK_and_Boundary_aux: \__xeCJK_ulem_CJK_and_Boundary_aux:
+ }
+ { }
+ }
\RenewDocumentCommand \CJKunderanysymbol { m m m }
{
\group_begin:
@@ -374,29 +414,44 @@
{ \xeCJK_make_node:n { CJK } }
\xeCJK_ignore_spaces:w
}
-\RenewDocumentEnvironment { CJKfilltwosides } { m }
+\RenewDocumentEnvironment { CJKfilltwosides } { O { c } m }
{
- \dim_set:Nn \l__xeCJK_fill_width_dim {#1}
- \cs_set_eq:NN \CJKglue \tex_hfil:D
- \cs_set_eq:NN \\ \__xeCJK_fill_newline:
- \mode_if_vertical:T { \tex_indent:D }
- \tex_vbox:D \c_group_begin_token
- \tex_hbox:D to \l__xeCJK_fill_width_dim \c_group_begin_token
- \tex_ignorespaces:D
+ \use:x { \exp_not:N \minipage [#1] { \dim_eval:n {#2} } }
+ \cs_set_eq:NN \CJKglue \tex_hfill:D
}
{
- \tex_unskip:D
- \c_group_end_token
- \c_group_end_token
+ \endminipage
+ \ignorespacesafterend
}
-\dim_new:N \l__xeCJK_fill_width_dim
-\cs_new_protected_nopar:Npn \__xeCJK_fill_newline:
+\NewEnviron { CJKfilltwosides* } [ 2 ] [ c ]
{
- \tex_unskip:D
- \c_group_end_token
- \tex_hbox:D to \l__xeCJK_fill_width_dim \c_group_begin_token
- \tex_ignorespaces:D
+ \cs_set_eq:NN \CJKglue \tex_hfill:D
+ \tl_set:Nn \arraystretch { 1 }
+ \token_if_dim_register:NT \extrarowheight
+ { \dim_set_eq:NN \extrarowheight \c_zero_dim }
+ \dim_compare:nNnTF {#2} > \c_zero_dim
+ {
+ \hbox_set:Nn \l__xeCJK_tmp_box
+ {
+ \tabular [#1] { @ { } c @ { } }
+ \BODY
+ \endtabular
+ }
+ \dim_compare:nNnTF {#2} > { \box_wd:N \l__xeCJK_tmp_box }
+ {
+ \tabular [#1] { @ { } p { \dim_eval:n {#2} } @ { } }
+ \BODY
+ \endtabular
+ }
+ { \hbox_unpack:N \l__xeCJK_tmp_box }
+ }
+ {
+ \tabular [#1] { @ { } c @ { } }
+ \BODY
+ \endtabular
+ }
}
+ [ \ignorespacesafterend ]
%%
%% This package consists of the file xeCJK.dtx
%% and the derived files xeCJK.pdf,