From 0d86c7d5d9844f4cff10ca5c99a1444820e8b4f8 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 25 Jun 2013 00:25:15 +0000 Subject: xecjk (19jun13) git-svn-id: svn://tug.org/texlive/trunk@30920 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg | 4 +- .../tex/xelatex/xecjk/xeCJK-listings.sty | 256 +++++++++++++++ Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty | 348 +++++++++++++-------- Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty | 35 ++- 4 files changed, 505 insertions(+), 138 deletions(-) create mode 100644 Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty (limited to 'Master/texmf-dist/tex/xelatex/xecjk') diff --git a/Master/texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg b/Master/texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg index 92ceeeb3bff..d08c1b95449 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 418 2013-05-29 06:41:21Z sobenlee $ +\GetIdInfo$Id: xeCJK.dtx 438 2013-06-11 14:17:42Z sobenlee $ {Configuration file for xeCJK package} \ProvidesExplFile {\ExplFileName.cfg} - {\ExplFileDate}{3.2.1}{\ExplFileDescription} + {\ExplFileDate}{3.2.3}{\ExplFileDescription} %% %% diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty new file mode 100644 index 00000000000..9bafa15d860 --- /dev/null +++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty @@ -0,0 +1,256 @@ +%% +%% This is file `xeCJK-listings.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xeCJK.dtx (with options: `listings') +%% +%% $Id: xeCJK.dtx 438 2013-06-11 14:17:42Z sobenlee $ +%% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ +%% ----------------------------------------------------------------- +%% Author: +%% Wenchang Sun +%% Current Maintainers: +%% Leo Liu +%% Qing Lee +%% +%% Copyright (C) 2007--2013 Wenchang Sun +%% (C) 2009--2013 Leo Liu +%% (C) 2012--2013 Qing Lee +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% The Current Maintainer of this work are Leo Liu and Qing Lee. +%% ----------------------------------------------------------------- +%% +\NeedsTeXFormat{LaTeX2e} +\RequirePackage{expl3} +\GetIdInfo$Id: xeCJK.dtx 438 2013-06-11 14:17:42Z sobenlee $ + {xeCJK patch file for listings} +\ProvidesExplPackage + {xeCJK-listings} + {\ExplFileDate}{3.2.3}{\ExplFileDescription} +\DeclareOption* { \PassOptionsToPackage { \CurrentOption } { xeCJK } } +\ProcessOptions \scan_stop: +\RequirePackage { xeCJK } +\RequirePackage { listings } +\lst@AddToHook { Init } { \__xeCJK_listings_initial_hook: } +\lst@AddToHook { SelectCharTable } { \__xeCJK_listings_toks_hook: } +\lst@AddToHook { OutputBox } + { + \l__xeCJK_restore_listings_toks_tl + \__xeCJK_listings_output_IVS: + } +\lst@AddToHook { PreSet } { \bool_set_true:N \l__xeCJK_listings_env_bool } +\cs_new_protected_nopar:Npn \__xeCJK_listings_initial_hook: + { + \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 + } + } +\cs_new_protected_nopar:Npn \__xeCJK_listings_toks_hook: + { + \tl_set:Nx \l__xeCJK_restore_listings_toks_tl + { + \__xeCJK_backup_inter_class_toks:nn { Boundary } { Default } + \__xeCJK_backup_inter_class_toks:nn { Boundary } { CJK } + \__xeCJK_backup_inter_class_toks:nn { Boundary } { IVS } + \__xeCJK_backup_inter_class_toks:nn { Boundary } { FullLeft } + \__xeCJK_backup_inter_class_toks:nn { Boundary } { FullRight } + } + \seq_map_inline:Nn \g__xeCJK_CJK_sub_class_seq + { + \tl_put_right:Nx \l__xeCJK_restore_listings_toks_tl + { \__xeCJK_backup_inter_class_toks:nn { Boundary } { CJK/##1 } } + } + \xeCJK_inter_class_toks:nnn { Boundary } { Default } + { \__xeCJK_listings_process_Default:N } + \xeCJK_inter_class_toks:nnn { Boundary } { CJK } + { \__xeCJK_listings_process_CJK:nN { \c_two } } + \xeCJK_inter_class_toks:nnn { Boundary } { IVS } + { \__xeCJK_listings_process_IVS:nN { \c_zero } } + \xeCJK_inter_class_toks:nnn { Boundary } { FullLeft } + { \__xeCJK_listings_process_CJK:nN { \c_two } } + \xeCJK_inter_class_toks:nnn { Boundary } { FullRight } + { \__xeCJK_listings_process_CJK:nN { \c_two } } + \seq_map_inline:Nn \g__xeCJK_CJK_sub_class_seq + { + \xeCJK_inter_class_toks:nnn { Boundary } { CJK/##1 } + { \__xeCJK_listings_process_CJK:nN { \c_two } } + } + } +\tl_new:N \l__xeCJK_restore_listings_toks_tl +\cs_new_nopar:Npn \__xeCJK_backup_inter_class_toks:nn #1#2 + { + \xeCJK_inter_class_toks:nnn {#1} {#2} + { \xeCJK_get_inter_class_toks:nn {#1} {#2} } + } +\cs_new_protected_nopar:Npn \__xeCJK_listings_process_Default:N #1 + { + \token_if_letter:NTF #1 + { \lst@ProcessLetter #1 } + { \lst@ProcessOther #1 } + } +\cs_new_protected_nopar:Npn \__xeCJK_listings_process_CJK:nN #1#2 + { + \token_if_letter:NTF #2 + { \__xeCJK_listings_process_letter:nN {#1} #2 } + { \__xeCJK_listings_process_other:nN {#1} #2 } + } +\cs_new_protected_nopar:Npn \__xeCJK_listings_append:nN #1#2 + { + \int_add:Nn \lst@length { #1 - \c_one } + \lst@Append #2 + } +\cs_new_protected_nopar:Npn \__xeCJK_listings_process_letter:nN + { + \lst@whitespacefalse + \bool_if:NTF \l__xeCJK_listings_letter_bool + { \lst@lettertrue } + { + \lst@ifletter + \lst@Output + \else: + \lst@OutputOther + \lst@lettertrue + \fi: + \bool_set_true:N \l__xeCJK_listings_letter_bool + } + \__xeCJK_listings_append:nN + } +\cs_new_protected_nopar:Npn \__xeCJK_listings_process_other:nN #1#2 + { + \lst@whitespacefalse + \bool_if:NTF \l__xeCJK_listings_letter_bool + { + \lst@Output + \bool_set_false:N \l__xeCJK_listings_letter_bool + \lst@letterfalse + } + { \lst@ifletter \lst@Output \lst@letterfalse \fi: } + \cs_set_eq:NN \lst@lastother #2 + \__xeCJK_listings_append:nN {#1} #2 + } +\bool_new:N \l__xeCJK_listings_letter_bool +\cs_set_protected_nopar:Npn \lst@AppendLetter + { + \bool_if:NTF \l__xeCJK_listings_letter_bool + { + \lst@Output + \bool_set_false:N \l__xeCJK_listings_letter_bool + \lst@lettertrue + } + { \reverse_if:N \lst@ifletter \lst@OutputOther \lst@lettertrue \fi: } + \lst@Append + } +\cs_set_protected_nopar:Npn \lst@AppendOther + { + \bool_if:NTF \l__xeCJK_listings_letter_bool + { + \lst@Output + \bool_set_false:N \l__xeCJK_listings_letter_bool + \lst@letterfalse + } + { \lst@ifletter \lst@Output \lst@letterfalse \fi: } + \tex_futurelet:D \lst@lastother \lst@Append + } +\cs_new_protected_nopar:Npn \__xeCJK_listings_process_IVS:nN + { + \reverse_if:N \lst@ifflexible + \bool_gset_true:N \g__xeCJK_listings_IVS_bool + \fi: + \__xeCJK_listings_process_letter:nN + } +\cs_new_protected_nopar:Npn \__xeCJK_listings_output_IVS: + { + \reverse_if:N \lst@ifflexible + \bool_if:NT \g__xeCJK_listings_IVS_bool + { + \bool_gset_false:N \g__xeCJK_listings_IVS_bool + \xeCJK_cs_clear:N \lst@FillOutputBox + \cs_set_eq:NN \CJKglue \tex_hss:D + } + \fi: + } +\bool_new:N \g__xeCJK_listings_IVS_bool +\cs_new_protected:Npn \__xeCJK_listings_peek_active_loop:TF #1#2#3 + { + \token_if_active:NTF #3 + { #1#3 } + { + \token_if_cs:NTF #3 + { #2#3 } + { + \int_compare:nNnTF { `#3 } > { \lst@ifec 255 \else: 127 \fi: } + { \__xeCJK_listings_peek_active_loop:TF { #1#3 } { #2#3 } } + { #2#3 } + } + } + } +\cs_set_eq:NN \lst@IfNextCharActive \__xeCJK_listings_peek_active_loop:TF +\cs_new_protected:Npn \__xeCJK_listings_inside_convert:nw #1 ~ \@empty + { + \tl_set_rescan:Nnn \l__xeCJK_tmpa_tl { } {#1} + \__xeCJK_set_listings_escape: + \tl_put_right:NV \lst@arg \l__xeCJK_tmpa_tl + } +\cs_set_eq:NN \lst@InsideConvert@ \__xeCJK_listings_inside_convert:nw +\cs_new_protected_nopar:Npn \__xeCJK_listings_inline_group:w + { + \exp_after:wN \__xeCJK_listings_inline_group:n + \exp_after:wN { \if_false: } \fi: + } +\cs_set_eq:NN \lst@InlineGJ \__xeCJK_listings_inline_group:w +\cs_new_protected:Npn \__xeCJK_listings_inline_group:n #1 + { + \tl_set_rescan:Nnn \lst@arg { } {#1} + \__xeCJK_set_listings_escape: + \lst@InlineGJEnd + } +\group_begin: +\char_set_catcode_active:N \/ +\char_set_lccode:nn { `\/ } { `\\ } +\tl_to_lowercase:n + { + \group_end: + \cs_new_protected:Npn \__xeCJK_set_listings_escape: + { \xeCJK_swap_cs:NN / \__xeCJK_listings_escape:N } + \cs_new_protected:Npn \__xeCJK_listings_escape:N #1 + { \cs_if_eq:NNTF / #1 { \__xeCJK_listings_escape:N } {#1} } + } +%% +%% This package consists of the file xeCJK.dtx +%% and the derived files xeCJK.pdf, +%% xeCJK.sty, +%% xeCJK.cfg, +%% xeCJK.ins, +%% xeCJKfntef.sty, +%% xeCJK-listings.sty, +%% xeCJK-example-autofake.tex, +%% xeCJK-example-fallback.tex, +%% xeCJK-example-subCJKblock.tex, +%% xeCJK-example-CJKecglue.tex, +%% xeCJK-example-checksingle.tex, +%% xeCJK-example-CJKfntef.tex, +%% xeCJK-example-punctstyle.tex, +%% xeCJK-example-verbatim.tex, +%% xeCJK-example-IVS.tex, +%% xeCJK-example-listings.tex, and +%% README.txt. +%% +%% End of file `xeCJK-listings.sty'. diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty index 70dba4b08f2..1d1d0fcb2ad 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 418 2013-05-29 06:41:21Z sobenlee $ +%% $Id: xeCJK.dtx 438 2013-06-11 14:17:42Z 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 418 2013-05-29 06:41:21Z sobenlee $ +\GetIdInfo$Id: xeCJK.dtx 438 2013-06-11 14:17:42Z sobenlee $ {Typesetting CJK scripts with XeLaTeX} \ProvidesExplPackage {\ExplFileName} - {\ExplFileDate}{3.2.1}{\ExplFileDescription} + {\ExplFileDate}{3.2.3}{\ExplFileDescription} \msg_new:nnn { xeCJK } { Require-XeTeX } { The~xeCJK~package~requires~XeTeX~to~function.\\\\ @@ -348,69 +348,96 @@ \clist_const:Nn \c__xeCJK_HalfRight_chars_clist { "21 , "22 , "25 , "27 , "29 , "2C , "2E , "3A , "3B , "3F , "5D , "7D } \clist_const:Nn \c__xeCJK_NormalSpace_chars_clist { "2F } -\clist_const:Nn \c__xeCJK_FullLeft_chars_clist - { - "2018 , "201C , "3008 , "300A , "300C , "300E , "3010 , "3012 , "3014 , - "3016 , "3018 , "301A , "301D , "3036 , "FE59 , "FE5B , "FE5D , "FE5F , - "FE60 , "FE69 , "FE6B , "FF03 , "FF04 , "FF08 , "FF20 , "FF3B , "FF5B , - "FFE0 , "FFE1 , "FFE5 , "FFE6 - } -\clist_const:Nn \c__xeCJK_FullRight_chars_clist - { - "00B7 , "2019 , "201D , "2014 , "2015 , "2025 , "2026 , "2027 , "2500 , - "3001 , "3002 , "3005 , "3006 , "3009 , "300B , "300D , "300F , "3011 , - "3015 , "3017 , "3019 , "301B , "301E , "301F , "3041 , "3043 , "3045 , - "3047 , "3049 , "3063 , "3083 , "3085 , "3087 , "308E , "309B , "309C , - "309D , "309E , "30A1 , "30A3 , "30A5 , "30A7 , "30A9 , "30C3 , "30E3 , - "30E5 , "30E7 , "30EE , "30F5 , "30F6 , "30FB , "30FC , "30FD , "30FE , - "FE50 , "FE51 , "FE52 , "FE54 , "FE55 , "FE56 , "FE57 , "FE5A , "FE5C , - "FE5E , "FE6A , "FF01 , "FF05 , "FF09 , "FF0C , "FF0E , "FF1A , "FF1B , - "FF1F , "FF3D , "FF5D , "FF61 , "FF63 , "FF64 , "FF65 , "FF67 , "FF68 , - "FF69 , "FF6A , "FF6B , "FF6C , "FF6D , "FF6E , "FF6F , "FF70 , "FF9E , - "FF9F +\clist_const:Nn \c__xeCJK_OP_chars_clist + { + "2018 , "201C , + "2329 , "3008 , "300A , "300C , "300E , "3010 , "3014 , "3016 , "3018 , "301A , + "301D , "FE17 , "FE35 , "FE37 , "FE39 , "FE3B , "FE3D , "FE3F , "FE41 , "FE43 , + "FE47 , "FE59 , "FE5B , "FE5D , "FF08 , "FF3B , "FF5B , "FF5F , "FF62 + } +\clist_const:Nn \c__xeCJK_PO_chars_clist { "FE6A , "FF05 , "FFE0 } +\clist_const:Nx \c__xeCJK_FullLeft_chars_clist + { + \c__xeCJK_OP_chars_clist , + \c__xeCJK_PO_chars_clist + } +\clist_const:Nn \c__xeCJK_CL_chars_clist + { + "00B7 , "2019 , "201D , "2014 , "2015 , "2025 , "2026 , "2027 , "2500 , + "232A , "3001 , "3002 , "3009 , "300B , "300D , "300F , "3011 , "3015 , "3017 , + "3019 , "301B , "301E , "301F , "FE11 , "FE12 , "FE18 , "FE36 , "FE38 , "FE3A , + "FE3C , "FE3E , "FE40 , "FE42 , "FE44 , "FE48 , "FE50 , "FE52 , "FE5A , "FE5C , + "FE5E , "FF09 , "FF0C , "FF0E , "FF3D , "FF5D , "FF60 , "FF61 , "FF63 , "FF64 + } +\clist_const:Nn \c__xeCJK_NS_chars_clist + { + "3005 , "301C , "303B , "303C , "309B , "309C , "309D , "309E , "30A0 , "30FB , + "30FD , "30FE , "A015 , "FE54 , "FE55 , "FF1A , "FF1B , "FF65 , "FF9E , "FF9F + } +\clist_const:Nn \c__xeCJK_EX_chars_clist + { "FE15 , "FE16 , "FE56 , "FE57 , "FF01 , "FF1F } +\clist_const:Nn \c__xeCJK_IS_chars_clist { "FE10 , "FE13 , "FE14 } +\clist_const:Nn \c__xeCJK_CJ_chars_clist + { + "3041 , "3043 , "3045 , "3047 , "3049 , "3063 , "3083 , "3085 , "3087 , "308E , + "3095 , "3096 , "30A1 , "30A3 , "30A5 , "30A7 , "30A9 , "30C3 , "30E3 , "30E5 , + "30E7 , "30EE , "30F5 , "30F6 , "30FC , "31F0 , "31F1 , "31F2 , "31F3 , "31F4 , + "31F5 , "31F6 , "31F7 , "31F8 , "31F9 , "31FA , "31FB , "31FC , "31FD , "31FE , + "31FF , "FF67 , "FF68 , "FF69 , "FF6A , "FF6B , "FF6C , "FF6D , "FF6E , "FF6F , + "FF70 + } +\clist_const:Nn \c__xeCJK_PR_chars_clist + { "20A9 , "FE69 , "FF04 , "FFE1 , "FFE5 , "FFE6 } +\clist_const:Nx \c__xeCJK_FullRight_chars_clist + { + \c__xeCJK_CL_chars_clist , + \c__xeCJK_NS_chars_clist , + \c__xeCJK_EX_chars_clist , + \c__xeCJK_IS_chars_clist , + \c__xeCJK_CJ_chars_clist , + \c__xeCJK_PR_chars_clist } \clist_const:Nn \c__xeCJK_CJK_chars_clist { - "1100 -> "11FF , - "2E80 -> "2EFF , - "2F00 -> "2FDF , - "2FF0 -> "2FFF , - "3000 -> "303F , - "3040 -> "309F , - "30A0 -> "30FF , - "3100 -> "312F , - "3130 -> "318F , - "3190 -> "319F , - "31A0 -> "31BF , - "31C0 -> "31EF , - "31F0 -> "31FF , - "3200 -> "32FF , - "3300 -> "33FF , - "3400 -> "4DBF , - "4DC0 -> "4DFF , - "4E00 -> "9FFF , - "A000 -> "A48F , - "A490 -> "A4CF , - "A960 -> "A97F , - "AC00 -> "D7AF , - "D7B0 -> "D7FF , - "F900 -> "FAFF , - "FE10 -> "FE1F , - "FE30 -> "FE4F , - "FF00 -> "FFEF , - "1B000 -> "1B0FF , - "1F200 -> "1F2FF , - "20000 -> "2A6DF , - "2A700 -> "2B73F , - "2B740 -> "2B81F , - "2F800 -> "2FA1F + "1100 -> "11FF , + "2E80 -> "2EFF , + "2F00 -> "2FDF , + "2FF0 -> "2FFF , + "3000 -> "303F , + "3040 -> "309F , + "30A0 -> "30FF , + "3100 -> "312F , + "3130 -> "318F , + "3190 -> "319F , + "31A0 -> "31BF , + "31C0 -> "31EF , + "31F0 -> "31FF , + "3200 -> "32FF , + "3300 -> "33FF , + "3400 -> "4DBF , + "4DC0 -> "4DFF , + "4E00 -> "9FFF , + "A000 -> "A48F , + "A490 -> "A4CF , + "A960 -> "A97F , + "AC00 -> "D7AF , + "D7B0 -> "D7FF , + "F900 -> "FAFF , + "FE10 -> "FE1F , + "FE30 -> "FE4F , + "FF00 -> "FFEF , + "1B000 -> "1B0FF , + "1F200 -> "1F2FF , + "20000 -> "2A6DF , + "2A700 -> "2B73F , + "2B740 -> "2B81F , + "2F800 -> "2FA1F } \clist_const:Nn \c__xeCJK_IVS_chars_clist { - "3099 , - "309A , - "FE00 -> "FE0F , - "E0100 -> "E01EF + "3099 -> "309A , + "FE00 -> "FE0F , + "E0100 -> "E01EF } \seq_new:N \g__xeCJK_base_class_seq \seq_gset_eq:NN \g__xeCJK_base_class_seq \g__xeCJK_class_seq @@ -443,27 +470,25 @@ { \xeCJK_class_num:n {#1} } } } + \xeCJK_set_char_class:nnn { "3099 } { "309A } { \xeCJK_class_num:n { IVS } } } \NewDocumentCommand \__xeCJK_set_char_class_aux:Nnw { m > { \SplitArgument { 1 } { -> } } m } { #1 #2 } \cs_generate_variant:Nn \clist_gconcat:NNN { cc } \cs_generate_variant:Nn \xeCJK_declare_char_class:nn { nx , nV } -\cs_new_protected_nopar:Npn \__xeCJK_set_char_class_catcode:nnn #1#2#3 +\cs_new_protected_nopar:Npn \__xeCJK_check_num_range:nnNN #1#2#3#4 { - \__xeCJK_check_num_range:nnNN {#1} {#2} \l__xeCJK_tmpa_int \l__xeCJK_tmpb_int - \int_set:Nn \l__xeCJK_tmpc_int {#3} - \int_compare:nNnTF - { \use:c { \__xeCJK_class_csname:n { CJK } } } = \l__xeCJK_tmpc_int - { \cs_set_eq:NN \__xeCJK_set_char_catcode:n \char_set_catcode_other:n } - { \cs_set_eq:NN \__xeCJK_set_char_catcode:n \use_none:n } - \xeCJK_int_until_do:nn { \l__xeCJK_tmpa_int > \l__xeCJK_tmpb_int } + \bool_if:nTF { \xeCJK_if_blank_x_p:n {#1} || \xeCJK_if_blank_x_p:n {#2} } { - \__xeCJK_set_char_catcode:n { \l__xeCJK_tmpa_int } - \XeTeXcharclass \l__xeCJK_tmpa_int = \l__xeCJK_tmpc_int - \int_incr:N \l__xeCJK_tmpa_int + \int_set:Nn #3 { \xeCJK_if_blank_x:nTF {#1} {#2} {#1} } + \int_set_eq:NN #3 #4 + } + { + \int_set:Nn #3 { \int_min:nn {#1} { \IfNoValueTF {#2} {#1} {#2} } } + \int_set:Nn #4 { \int_max:nn {#1} { \IfNoValueTF {#2} {#1} {#2} } } } } -\cs_new_protected_nopar:Npn \__xeCJK_set_char_class:nnn #1#2#3 +\cs_new_protected_nopar:Npn \xeCJK_set_char_class:nnn #1#2#3 { \__xeCJK_check_num_range:nnNN {#1} {#2} \l__xeCJK_tmpa_int \l__xeCJK_tmpb_int \int_set:Nn \l__xeCJK_tmpc_int {#3} @@ -473,21 +498,6 @@ \int_incr:N \l__xeCJK_tmpa_int } } -\cs_new_protected_nopar:Npn \__xeCJK_check_num_range:nnNN #1#2#3#4 - { - \bool_if:nTF { \xeCJK_if_blank_x_p:n {#1} || \xeCJK_if_blank_x_p:n {#2} } - { - \int_set:Nn #3 { \xeCJK_if_blank_x:nTF {#1} {#2} {#1} } - \int_set_eq:NN #3 #4 - } - { - \int_set:Nn #3 { \int_min:nn {#1} { \IfNoValueTF {#2} {#1} {#2} } } - \int_set:Nn #4 { \int_max:nn {#1} { \IfNoValueTF {#2} {#1} {#2} } } - } - } -\cs_new_eq:NN \xeCJK_set_char_class:nnn \__xeCJK_set_char_class_catcode:nnn -\AtEndOfPackage - { \cs_set_eq:NN \xeCJK_set_char_class:nnn \__xeCJK_set_char_class:nnn } \cs_new_protected_nopar:Npn \__xeCJK_set_char_class_eq:nn #1#2 { \int_set:Nn \l__xeCJK_tmpa_int { \xeCJK_class_num:n {#2} } @@ -1024,7 +1034,7 @@ #1+ .code:n = { \tl_map_inline:nn {##1} - { \seq_if_in:NnF #2 {####1} { \seq_put_right:Nn #3 {####1} } } + { \seq_if_in:NnF #3 {####1} { \seq_put_right:Nn #3 {####1} } } \__xeCJK_update_cs_case_tl:NNnn #2#3 {#4} {#5} } , #1- .code:n = @@ -1080,22 +1090,27 @@ } \cs_new_protected_nopar:Npn \xeCJK_check_single:Nw #1 { - \peek_catcode:NTF \c_catcode_other_token + \peek_catcode:NTF \c_catcode_letter_token { \xeCJK_check_single:NNw #1 } { - \bool_if:nTF + \token_if_other:NTF \l_peek_token + { \xeCJK_check_single:NNw #1 } { - \xeCJK_if_blank_x_p:n { \token_get_arg_spec:N \l_peek_token } && - \exp_args:No \tl_if_single_token_p:n \l_peek_token && - \exp_after:wN \token_if_other_p:N \l_peek_token + \bool_if:nTF + { + \xeCJK_if_blank_x_p:n { \token_get_arg_spec:N \l_peek_token } && + \exp_args:No \tl_if_single_token_p:n \l_peek_token && + ( \exp_after:wN \token_if_other_p:N \l_peek_token || + \exp_after:wN \token_if_letter_p:N \l_peek_token ) + } + { \exp_after:wN \xeCJK_check_single:NNw \exp_after:wN #1 } + { \__xeCJK_check_single_save:N #1 } } - { \exp_after:wN \xeCJK_check_single:NNw \exp_after:wN #1 } - { \__xeCJK_check_single_save:N #1 } } } \cs_new_protected_nopar:Npn \xeCJK_check_single:NNw #1#2 { - \xeCJK_peek_catcode_ignore_spaces:NTF \c_catcode_other_token + \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 } @@ -1103,29 +1118,38 @@ } { \group_align_safe_begin: - \token_if_cs:NTF \l_peek_token + \token_if_other:NTF \l_peek_token { \group_align_safe_end: \bool_if:NTF \l__xeCJK_peek_ignore_spaces_bool - { \xeCJK_check_single_cs:NNn #1#2 { ~ } } - { \xeCJK_check_single_cs:NNn #1#2 { } } + { \__xeCJK_check_single_space:NN #1#2 } + { \__xeCJK_check_single_save:N #1 #2 } } { - \group_align_safe_end: - \bool_if:nTF - { - \l__xeCJK_plain_equation_bool && - \token_if_math_toggle_p:N \l_peek_token - } + \token_if_cs:NTF \l_peek_token { + \group_align_safe_end: \bool_if:NTF \l__xeCJK_peek_ignore_spaces_bool - { \xeCJK_check_single_equation:NNnNw #1 #2 { ~ } } - { \xeCJK_check_single_equation:NNnNw #1 #2 { } } + { \xeCJK_check_single_cs:NNn #1#2 { ~ } } + { \xeCJK_check_single_cs:NNn #1#2 { } } } { - \bool_if:NTF \l__xeCJK_peek_ignore_spaces_bool - { \__xeCJK_check_single_save:N #1 #2 ~ } - { \__xeCJK_check_single_save:N #1 #2 } + \group_align_safe_end: + \bool_if:nTF + { + \l__xeCJK_plain_equation_bool && + \token_if_math_toggle_p:N \l_peek_token + } + { + \bool_if:NTF \l__xeCJK_peek_ignore_spaces_bool + { \xeCJK_check_single_equation:NNnNw #1 #2 { ~ } } + { \xeCJK_check_single_equation:NNnNw #1 #2 { } } + } + { + \bool_if:NTF \l__xeCJK_peek_ignore_spaces_bool + { \__xeCJK_check_single_save:N #1 #2 ~ } + { \__xeCJK_check_single_save:N #1 #2 } + } } } } @@ -1151,9 +1175,10 @@ } \cs_new_protected_nopar:Npn \xeCJK_check_single_cs:NNn #1#2#3 { + \group_align_safe_begin: \tl_case:Non \l_peek_token { \l__xeCJK_check_single_cs_case_tl } - { \use_iii:nnn } + { \group_align_safe_end: \use_iii:nnn } { \xeCJK_check_single_env:nnNn } { \xeCJK_no_break: \__xeCJK_check_single_save:N #1 @@ -1164,21 +1189,24 @@ \tl_new:N \l__xeCJK_check_single_cs_case_tl \cs_new_protected_nopar:Npn \xeCJK_check_single_env:nnNn #1#2#3#4 { + \group_align_safe_begin: \str_case_x:non {#4} { \l__xeCJK_inline_env_case_tl } - { \use_i:nn } + { \group_align_safe_end: \use_i:nn } {#1} {#2} \scan_stop: #3 {#4} } \cs_generate_variant:Nn \str_case_x:nnn { no } \xeCJK_cs_case_keys_define:nNNnn { NewLineCS } - \l__xeCJK_new_line_cs_case_tl \l__xeCJK_new_line_cs_seq { \use_ii:nnn } + \l__xeCJK_new_line_cs_case_tl \l__xeCJK_new_line_cs_seq + { \group_align_safe_end: \use_ii:nnn } { \tl_concat:NNN \l__xeCJK_check_single_cs_case_tl \l__xeCJK_new_line_cs_case_tl \l__xeCJK_env_cs_case_tl } \xeCJK_cs_case_keys_define:nNNnn { EnvCS } - \l__xeCJK_env_cs_case_tl \l__xeCJK_env_cs_seq { \use:n } + \l__xeCJK_env_cs_case_tl \l__xeCJK_env_cs_seq + { \group_align_safe_end: \use:n } { \tl_concat:NNN \l__xeCJK_check_single_cs_case_tl \l__xeCJK_new_line_cs_case_tl \l__xeCJK_env_cs_case_tl @@ -2665,20 +2693,14 @@ \cs_set_eq:NN \CJKecglue \__xeCJK_zero_glue: \or: \int_compare:nNnTF \etex_currentgrouptype:D = \c_fourteen - { - \__xeCJK_set_verb_exspace: - \__xeCJK_verb_addon: - } + { \xeCJKVerbAddon } { \cs_set_eq:NN \CJKglue \__xeCJK_zero_glue: \cs_set_eq:NN \CJKecglue \__xeCJK_zero_glue: } \or: \int_compare:nNnT \etex_currentgrouptype:D = \c_fourteen - { - \__xeCJK_set_verb_exspace: - \__xeCJK_verb_addon: - } + { \xeCJKVerbAddon } \fi: } } @@ -2686,10 +2708,15 @@ { \int_compare:nNnF \etex_currentgrouplevel:D = \c_zero { - \__xeCJK_set_verb_exspace: - \__xeCJK_verb_addon: + \bool_if:NF \l__xeCJK_listings_env_bool + { + \__xeCJK_set_verb_exspace: + \__xeCJK_verb_addon: + } } } +\bool_new:N \l__xeCJK_listings_env_bool +\NewDocumentCommand \xeCJKOffVerbAddon { } { } \cs_new_protected_nopar:Npn \__xeCJK_verb_addon: { \bool_if:NF \l__xeCJK_verb_addon_bool @@ -2700,6 +2727,36 @@ \__xeCJK_set_char_class_eq:nn { HalfLeft } { Default } \__xeCJK_set_char_class_eq:nn { HalfRight } { Default } \__xeCJK_set_char_class_eq:nn { NormalSpace } { Default } + \cs_set_eq:NN \__xeCJK_verb_CJKglue: \CJKglue + \cs_set_eq:NN \__xeCJK_verb_CJKecglue: \CJKecglue + \cs_set_eq:NN \__xeCJK_verb_check_for_glue: \xeCJK_check_for_glue: + \cs_set_eq:NN \__xeCJK_verb_ignore_spaces:w \xeCJK_ignore_spaces:w + \cs_set_protected_nopar:Npx \xeCJKOffVerbAddon + { + \__xeCJK_reset_char_class:n { FullLeft } + \__xeCJK_reset_char_class:n { FullRight } + \__xeCJK_reset_char_class:n { HalfLeft } + \__xeCJK_reset_char_class:n { HalfLeft } + \__xeCJK_reset_char_class:n { NormalSpace } + \skip_set:Nn \tex_rightskip:D { \skip_use:N \tex_rightskip:D } + \exp_not:c + { bool_set_ \bool_if:NTF \l__xeCJK_xecglue_bool { true } { false } :N } + \l__xeCJK_xecglue_bool + \exp_not:n + { + \cs_set_eq:NN \CJKglue \__xeCJK_verb_CJKglue: + \cs_set_eq:NN \CJKecglue \__xeCJK_verb_CJKecglue: + \cs_set_eq:NN \xeCJK_check_for_glue: \__xeCJK_verb_check_for_glue: + \cs_set_eq:NN \xeCJK_ignore_spaces:w \__xeCJK_verb_ignore_spaces: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 + } \xeCJKsetup { xCJKecglue = false } \cs_set_protected_nopar:Npn \CJKglue { \skip_horizontal:N \g__xeCJK_verb_exspace_skip } @@ -2710,6 +2767,12 @@ \skip_set:Nn \tex_rightskip:D { \c_zero_dim plus 1 fil } } } +\cs_new_protected_nopar:Npn \__xeCJK_reset_char_class:n #1 + { + \int_set:Nn \l__xeCJK_tmpa_int { \xeCJK_class_num:n {#1} } + \clist_map_inline:cn { c__xeCJK_#1_chars_clist } + { \XeTeXcharclass ##1 = \l__xeCJK_tmpa_int } + } \bool_new:N \l__xeCJK_verb_addon_bool \cs_new_eq:NN \CJKfixedspacing \xeCJKVerbAddon \cs_new_protected_nopar:Npn \__xeCJK_set_verb_exspace: @@ -2919,6 +2982,20 @@ \exp_args:NNv \ProvideTextCommandDefault \nobreakspace { ? - \token_to_str:N \nobreakspace } } +\cs_new_nopar:Npn \xeCJK@text@composite #1#2#3 \@text@composite + { + \str_if_eq:nnTF {#3} { \@empty } + { \orig@text@composite #1#2#3 \@text@composite } + { \__xeCJK_text_composite:Nnw #1#2#3 } + } +\cs_new_nopar:Npn \__xeCJK_text_composite:Nnw #1#2 \@empty + { + \tl_if_empty:nTF {#2} + { \orig@text@composite #1 \@empty \@text@composite } + { \cs_if_exist_use:cF { \token_to_str:N #1 - \token_to_str:N #2 } } + } +\cs_new_eq:NN \orig@text@composite \@text@composite +\cs_set_eq:NN \@text@composite \xeCJK@text@composite \__xeCJK_msg_new:nn { conflict-package } { The~`#1'~package~is~too~old. \\ @@ -3058,7 +3135,16 @@ } \tl_put_left:Nn \tipaencoding { \makexeCJKinactive } \cs_new_eq:NN \__xeCJK_aux_r:n \r - \cs_set_nopar:Npn \r #1 { { \makexeCJKinactive \__xeCJK_aux_r:n {#1} } } + \cs_set_nopar:Npn \r #1 + { + \bool_if:nTF + { + \str_if_eq_x_p:nn { \f@encoding } { T1 } && + \str_if_eq_x_p:nn {#1} { u } + } + { { \makexeCJKinactive \__xeCJK_aux_r:n {#1} } } + { \__xeCJK_aux_r:n {#1} } + } \xeCJK_if_package_loaded:nT { pifont } { \RenewDocumentCommand \Pifont { m } @@ -3101,7 +3187,7 @@ \XeTeXdefaultencoding "UTF-8" } \cs_if_eq:NNTF \ifCTEX@fntef \tex_iftrue:D - { \RequirePackage { xeCJKfntef } } + { \AtEndOfPackage { \RequirePackage { xeCJKfntef } } } { \__xeCJK_at_end_preamble:n { @@ -3116,6 +3202,11 @@ } } } +\__xeCJK_at_end_preamble:n + { + \xeCJK_if_package_loaded:nT { listings } + { \RequirePackage { xeCJK-listings } } + } \bool_if:NT \g__xeCJK_number_bool { \tl_set:Nn \CJK@UnicodeEnc { UTF8 } @@ -3141,6 +3232,7 @@ %% xeCJK.cfg, %% xeCJK.ins, %% xeCJKfntef.sty, +%% xeCJK-listings.sty, %% xeCJK-example-autofake.tex, %% xeCJK-example-fallback.tex, %% xeCJK-example-subCJKblock.tex, @@ -3148,7 +3240,9 @@ %% xeCJK-example-checksingle.tex, %% xeCJK-example-CJKfntef.tex, %% xeCJK-example-punctstyle.tex, -%% xeCJK-example-verbatim.tex, and +%% xeCJK-example-verbatim.tex, +%% xeCJK-example-IVS.tex, +%% xeCJK-example-listings.tex, and %% README.txt. %% %% End of file `xeCJK.sty'. diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty index 72e1cbcdeab..cddd5f98527 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 418 2013-05-29 06:41:21Z sobenlee $ +%% $Id: xeCJK.dtx 438 2013-06-11 14:17:42Z sobenlee $ %% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ %% ----------------------------------------------------------------- %% Author: @@ -33,17 +33,15 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 418 2013-05-29 06:41:21Z sobenlee $ +\GetIdInfo$Id: xeCJK.dtx 438 2013-06-11 14:17:42Z sobenlee $ {xeCJK patch file for ulem/CJKfntef} \ProvidesExplPackage {xeCJKfntef} - {\ExplFileDate}{3.2.1}{\ExplFileDescription} + {\ExplFileDate}{3.2.3}{\ExplFileDescription} \PassOptionsToPackage { normalem } { ulem } \DeclareOption* { \PassOptionsToPackage { \CurrentOption } { ulem } } \ProcessOptions \scan_stop: -\@ifpackageloaded { xeCJK } - { } - { \RequirePackage { xeCJK } } +\RequirePackage { xeCJK } \RequirePackage { ulem } \RequirePackage { CJKfntef } \addto@hook \UL@hook { \xeCJK_hook_for_ulem: } @@ -232,7 +230,7 @@ \xeCJK_if_ulem_patch:TF { \xeCJK_class_group_end: - \__xeCJK_ulem_Default_and_FullRight_glue:N {#1} + \__xeCJK_Default_and_FullRight_glue:N {#1} \__xeCJK_ulem_class_group_begin: } { \__xeCJK_ulem_CJK_and_FullRight_glue:N #1 } @@ -259,7 +257,7 @@ { \xeCJK_if_ulem_patch:TF { - \__xeCJK_ulem_FullLeft_and_Default: + \xeCJK_FullLeft_and_Default: \__xeCJK_ulem_class_group_begin: } { \__xeCJK_ulem_FullLeft_and_CJK: } @@ -319,10 +317,12 @@ \__xeCJK_make_under_symbol:n { \CJK@underdotSkip } \cs_gset_eq:NN \__xeCJK_save_under_dot_CJKsymbol:N \CJKsymbol \cs_set_eq:NN \CJKsymbol \__xeCJK_under_CJKsymbol:N + \__xeCJK_restore_output_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 } \CJK@postUnderdot \bool_if:NT \l__xeCJK_ulem_hook_used_bool { \UL@start } \tex_ignorespaces:D @@ -335,10 +335,24 @@ \__xeCJK_make_under_symbol:n {#1} \cs_gset_eq:NN \__xeCJK_save_under_dot_CJKsymbol:N \CJKsymbol \cs_set_eq:NN \CJKsymbol \__xeCJK_under_CJKsymbol:N + \__xeCJK_restore_output_CJKsymbol: #3 \group_end: \tex_ignorespaces:D } +\cs_new_protected:Npn \__xeCJK_restore_output_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 + { + \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 + } + } +\tl_new:N \l__xeCJK_underdot_output_tl \cs_new_protected:Npn \__xeCJK_make_under_symbol:n #1 { \hbox_set:Nn \l__xeCJK_tmp_box { ^^^^4e00 } @@ -390,6 +404,7 @@ %% xeCJK.cfg, %% xeCJK.ins, %% xeCJKfntef.sty, +%% xeCJK-listings.sty, %% xeCJK-example-autofake.tex, %% xeCJK-example-fallback.tex, %% xeCJK-example-subCJKblock.tex, @@ -397,7 +412,9 @@ %% xeCJK-example-checksingle.tex, %% xeCJK-example-CJKfntef.tex, %% xeCJK-example-punctstyle.tex, -%% xeCJK-example-verbatim.tex, and +%% xeCJK-example-verbatim.tex, +%% xeCJK-example-IVS.tex, +%% xeCJK-example-listings.tex, and %% README.txt. %% %% End of file `xeCJKfntef.sty'. -- cgit v1.2.3