summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/xelatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-01-12 23:54:58 +0000
committerKarl Berry <karl@freefriends.org>2013-01-12 23:54:58 +0000
commit0cdeac8d67ad763351ae173884fa9f5d28779de7 (patch)
tree090217371149c73d5f9c7de9e8d9546baa34319b /Master/texmf-dist/source/xelatex
parent40582d40114fa4f0b3d0432e8a85900312bff43a (diff)
xecjk (12jan13)
git-svn-id: svn://tug.org/texlive/trunk@28816 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/xelatex')
-rw-r--r--Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx550
-rw-r--r--Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins38
2 files changed, 393 insertions, 195 deletions
diff --git a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
index bc8118b51a7..17583f57357 100644
--- a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
+++ b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
@@ -51,7 +51,7 @@ xecjk.tds.zip. The later is most convenient for most users: simply
unzip this in your local texmf directory and run texhash to update the
database of file locations. If you want to unpack the dtx yourself,
running "xetex xeCJK.dtx" will extract the package whereas
-"xelatex xeCJK.dtx" will extract it and also typeset the documentation.
+"xelatex xeCJK.dtx" will typeset the documentation.
The package requires LaTeX3 support as provided in the l3kernel and
l3packages bundles and the fontspec package. All of these are available
@@ -65,23 +65,20 @@ CJK scripts fonts (TrueType or OpenType).
%<*internal>
\fi
\begingroup
-\edef\tempa{\fmtname}
-\edef\tempb{plain}
+ \edef\tempa{\fmtname}
+ \edef\tempb{plain}
+\expandafter\endgroup
\ifx\tempa\tempb
- \endgroup
- \def\xeCJKMaybeStopHere{\endbatchfile}
-\else
- \let\xeCJKMaybeStopHere\endgroup
-\fi
+\csname fi\endcsname
%</internal>
-%<*batchfile>
+%<*install>
\input l3docstrip.tex
\keepsilent
\askforoverwritefalse
\preamble
-$Id: xeCJK.dtx 382 2012-12-13 04:58:22Z sobenlee $
+$Id: xeCJK.dtx 399 2013-01-11 14:57:50Z sobenlee $
$URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
-----------------------------------------------------------------
Author:
@@ -90,7 +87,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
Leo Liu <leoliu.pku@gmail.com>
Qing Lee <sobenlee@gmail.com>
- Copyright (C) 2007--2012 Wenchang Sun
+ 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
@@ -127,19 +126,18 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\endpreamble
\declarepostamble\emptypostamble
\endpostamble
-\usedir{tex/xelatex/xecjk}
+
\generate{
+ \usedir{source/xelatex/xecjk}
+ \file{\jobname.ins}{\from{\jobname.dtx}{install}}
+ \usedir{tex/xelatex/xecjk}
\file{\jobname.sty}{\from{\jobname.dtx}{package}}
- \file{xeCJKfntef.sty}{\from{\jobname.dtx}{fntef}}}
-\usedir{tex/xelatex/xecjk/config}
-\generate{
- \usepreamble\emptypreamble
- \usepostamble\emptypostamble
- \file{\jobname.cfg}{\from{\jobname.dtx}{config}}}
-\usedir{doc/xelatex/xecjk/example}
-\generate{
+ \file{xeCJKfntef.sty}{\from{\jobname.dtx}{fntef}}
\usepreamble\emptypreamble
\usepostamble\emptypostamble
+ \usedir{tex/xelatex/xecjk/config}
+ \file{\jobname.cfg}{\from{\jobname.dtx}{config}}
+ \usedir{doc/xelatex/xecjk/example}
\file{\jobname-example-autofake.tex}{\from{\jobname.dtx}{ex-autofake}}
\file{\jobname-example-fallback.tex}{\from{\jobname.dtx}{ex-fallback}}
\file{\jobname-example-subCJKblock.tex}{\from{\jobname.dtx}{ex-block}}
@@ -147,24 +145,23 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\file{\jobname-example-checksingle.tex}{\from{\jobname.dtx}{ex-single}}
\file{\jobname-example-CJKfntef.tex}{\from{\jobname.dtx}{ex-fntef}}
\file{\jobname-example-punctstyle.tex}{\from{\jobname.dtx}{ex-punctstyle}}
- \file{\jobname-example-verbatim.tex}{\from{\jobname.dtx}{ex-verb}}}
-%</batchfile>
-%<batchfile>\endbatchfile
+ \file{\jobname-example-verbatim.tex}{\from{\jobname.dtx}{ex-verb}}
+ \nopreamble\nopostamble
+ \usedir{doc/xelatex/xecjk}
+ \file{README.txt}{\from{\jobname.dtx}{readme}}
+}
+
+\endbatchfile
+%</install>
%<*internal>
-\usedir{source/xelatex/xecjk}
-\generate{\file{\jobname.ins}{\from{\jobname.dtx}{batchfile}}}
-\nopreamble\nopostamble
-\usedir{doc/xelatex/xecjk}
-\generate{\file{README.txt}{\from{\jobname.dtx}{readme}}}
-\xeCJKMaybeStopHere
+\fi
%</internal>
-%
%<*driver|package|config|fntef>
%<*!config>
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
%</!config>
-\GetIdInfo$Id: xeCJK.dtx 382 2012-12-13 04:58:22Z sobenlee $
+\GetIdInfo$Id: xeCJK.dtx 399 2013-01-11 14:57:50Z sobenlee $
%<*!config&!fntef>
{Typesetting CJK scripts with XeLaTeX}
%</!config&!fntef>
@@ -180,9 +177,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%<package|fntef>\ProvidesExplPackage
%<package> {\ExplFileName}
%<fntef> {xeCJKfntef}
- {\ExplFileDate}{3.1.1}{\ExplFileDescription}
+ {\ExplFileDate}{3.1.2}{\ExplFileDescription}
%<*driver>
-\def\xeCJKversion{3.1.1}
+\def\xeCJKversion{3.1.2}
\let\xeCJKdate\ExplFileDate
\let\xeCJKrevnum\ExplFileVersion
\ExplSyntaxOff
@@ -275,7 +272,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%</driver>
% \fi
%
-% \CheckSum{3762}
+% \CheckSum{3869}
% \changes{v3.1.0}{2012/11/13}{放弃对 \cs{outer} 宏的特殊处理。}
% \changes{v3.1.1}{2012/12/07}{不再依赖 \pkg{xpatch} 宏包。}
%
@@ -611,7 +608,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% CheckFullRight = \meta{\TFF}
% \end{syntax}
% 某些控制序列要求不能在它的前面断行。但是在缺省状态下,单个全角右标点的后面总是
-% 可以断行的。因此当这些控制序列出现在全角右标点后面时,可能出现了意料之外的断行。
+% 可以断行的。因此当这些控制序列出现在全角右标点后面时,可能会出现意料之外的断行。
% 此时可以使用这个选项来避免这个情况。
% \end{function}
%
@@ -693,7 +690,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% 等价于
% \begin{verbatim}
% \setCJKfamilyfont{song}{SimSun}
-% \newcommand\songti{\CJKfamily{song}}
+% \newcommand*{\songti}{\CJKfamily{song}}
% \end{verbatim}
% \end{function}
%
@@ -730,21 +727,24 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{function}
%
% \begin{function}{\CJKrmdefault}
-% 保存 \cs{rmfamily} 所使用的 CJK 字体族,默认值是 |rm|。类似西文字体的 \cs{rmdefault}。
+% 保存 \cs{textrm} 和 \cs{rmfamily} 所使用的 CJK 字体族,默认值是 |rm|。
+% 类似西文字体的 \cs{rmdefault}。
% \end{function}
%
% \begin{function}{\CJKsfdefault}
-% 保存 \cs{sffamily} 所使用的 CJK 字体族,默认值是 |sf|。类似西文字体的 \cs{sfdefault}。
+% 保存 \cs{textsf} 和 \cs{sffamily} 所使用的 CJK 字体族,默认值是 |sf|。
+% 类似西文字体的 \cs{sfdefault}。
% \end{function}
%
% \begin{function}{\CJKttdefault}
-% 保存 \cs{ttfamily} 所使用的 CJK 字体族,默认值是 |tt|。类似西文字体的 \cs{ttdefault}。
+% 保存 \cs{texttt} 和 \cs{ttfamily} 所使用的 CJK 字体族,默认值是 |tt|。
+% 类似西文字体的 \cs{ttdefault}。
% \end{function}
%
-% \begin{function}{\CJKfamilydefault}
-% 保存 \cs{normalfont} 所使用的 CJK 字体族,默认值是 \cs{CJKrmdefault}。类似西文字
-% 体的 \cs{familydefault}。\pkg{xeCJK} 会在导言区结束的时候根据西文字体的情况自动
-% 更新 \cs{CJKfamilydefault}。例如,在导言区里使用
+% \begin{function}[updated=2013-01-01]{\CJKfamilydefault}
+% 保存 \cs{textnormal} 和 \cs{normalfont} 所使用的 CJK 字体族。类似西文字体的 \cs{familydefault}。
+% 初始值是 \cs{CJKrmdefault}。如果没有在导言区中修改它,\pkg{xeCJK} 会在导言区
+% 结束的时候根据西文字体的情况自动更新 \cs{CJKfamilydefault}。因此,在导言区里使用
% \begin{verbatim}
% \renewcommand\familydefault{\sfdefault}
% \end{verbatim}
@@ -795,8 +795,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{syntax}
% \cs{setCJKfallbackfamilyfont} \Arg{family} \oarg{common font features}
% \ \{
-% \ \{\oarg{font features 1} \Arg{font name 1}\} ,
-% \ \{\oarg{font features 2} \Arg{font name 2}\} ,
+% \ \{\oarg{font features_1} \Arg{font name_1}\} ,
+% \ \{\oarg{font features_2} \Arg{font name_2}\} ,
% \ ......
% \ \}
% \end{syntax}
@@ -930,16 +930,16 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{function}{\xeCJKCancelSubCJKBlock}
% \begin{syntax}
-% \cs{xeCJKCancelSubCJKBlock} \Arg{block1,block2,...}
-% \cs{xeCJKCancelSubCJKBlock*} \Arg{block1,block2,...}
+% \cs{xeCJKCancelSubCJKBlock} \Arg{block_1, block_2, ...}
+% \cs{xeCJKCancelSubCJKBlock*} \Arg{block_1, block_2, ...}
% \end{syntax}
% 在文档中取消对 |CJK| 分区的声明。带星号的命令还重置标点符号所属的字符类。
% \end{function}
%
% \begin{function}{\xeCJKRestoreSubCJKBlock}
% \begin{syntax}
-% \cs{xeCJKRestoreSubCJKBlock} \Arg{block1,block2,...}
-% \cs{xeCJKRestoreSubCJKBlock*} \Arg{block1,block2,...}
+% \cs{xeCJKRestoreSubCJKBlock} \Arg{block_1, block_2, ...}
+% \cs{xeCJKRestoreSubCJKBlock*} \Arg{block_1, block_2, ...}
% \end{syntax}
% 在文档中恢复对 |CJK| 分区的声明。带星号的命令还重置标点符号所属的字符类。
% \end{function}
@@ -1202,18 +1202,18 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% 的支持,并且 \pkg{xeCJK} 自动禁止在它之后载入 \pkg{CJK} 宏包。
%
% \CJKunderline{\pkg{xeCJK} 包含有一个子宏包 \pkg{xeCJKfntef},可以用它来实现%
-% \CJKunderdot{汉字加点}和可断行的下划线等。它是 \pkg{CJKfntef} 宏包在在 \XeLaTeX
+% \CJKunderdot{汉字加点}和可断行的下划线等。它是 \pkg{CJKfntef} 宏包在 \XeLaTeX
% 下的替换版本,基本用法完全一致,在 \pkg{CJKfntef} 的源文件\ \file{CJKfntef.sty}
% 的注解部分里有说明。}
%
% 新版本(\texttt{3.x})的 \pkg{xeCJK} 完全使用 \hologo{LaTeX3} 的语法来编写。
-% \hologo{LaTeX3} 放弃了 \cs{outer} 宏的概念,因此相关工具(例如 |peek| 类函数)在
+% \hologo{LaTeX3} 放弃了 \cs{outer} 宏的概念,因此相关工具在
% 遇到 \cs{outer} 宏时可能会存在问题。按照目前 \pkg{xeCJK} 的实现方式,在 CJK 文字
% 后面遇到 \cs{outer} 宏时会出现类似
% \begin{verbatim}
% ! Forbidden control sequence found while scanning use of \use_i:nn
% \end{verbatim}
-% 的错误。目前已知的有 \pkg{cprotect} 宏包提供的 \cs{cprotect}。它的定义是
+% 的错误。目前已知的有 \package{cprotect} 宏包提供的 \cs{cprotect}。它的定义是
% \begin{verbatim}
% \outer\long\def\cprotect{\icprotect}
% \end{verbatim}
@@ -1230,12 +1230,12 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \pkg{polyglossia})可能会存在大小不一的冲突。\pkg{xeCJK} 虽然为此作了一些处理,但与
% 它们共同使用时应该小心。
%
-% 基于历史原因,\pkg{xltxtra} 宏包引入的 \pkg{realscripts} 定义了 \cs{dim_max:nn}
-% 和 \cs{dim_min:nn} 这两个已经在当前版本的 \pkg{expl3} 中定义了的函数。
-% \pkg{realscripts} 中的定义并不好,并且了覆盖 \pkg{expl3} 中的定义,因此破坏了
+% 基于历史原因,\package{xltxtra} 宏包引入的 \package{realscripts} 定义了 \cs{dim_max:nn}
+% 和 \cs{dim_min:nn} 这两个已经在当前版本的 \pkg{expl3} 中定义了的函数。但是
+% \pkg{realscripts} 中的定义并不好,并且会覆盖 \pkg{expl3} 中的定义,因此破坏了
% \pkg{xeCJK} 中的相关计算。\pkg{xltxtra} 并没有什么实际功能,完全可以不使用它。
-% 如果原来通过 \pkg{xltxtra} 得到 \XeLaTeX 这个 Logo,现在可以改用更完善的 \pkg{hologo}。
-% 如果坚持使用它,请把它放在 \pkg{xeCJK} 之后载入。
+% 如果原来通过 \pkg{xltxtra} 得到 \XeLaTeX 这个 Logo,现在可以改用更完善的
+% \package{hologo}。如果坚持使用 \pkg{xltxtra},请把它放在 \pkg{xeCJK} 之后载入。
%
%\end{documentation}
%
@@ -1273,9 +1273,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macrocode}
\msg_new:nnn { xeCJK } { l3-too-old }
{
- Support~package~'#1'~too~old. \\\\
+ Support~package~`#1'~too~old. \\\\
Please~update~an~up~to~date~version~of~the~bundles\\\\
- 'l3kernel'~and~'l3packages'\\\\
+ `l3kernel'~and~`l3packages'\\\\
using~your~TeX~package~manager~or~from~CTAN.\\
\str_if_eq:nnT {#1} { expl3 } { Loading~xeCJK~will~abort! }
}
@@ -1572,9 +1572,41 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macrocode}
\cs_new_nopar:Npn \xeCJK_token_value_class:N #1
{ \XeTeXcharclass \xeCJK_token_value_charcode:N #1 }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\xeCJK_token_value_charcode:N}
+% \changes{v3.1.2}{2013/01/08}{考虑 \texttt{charcode} 大于等于 \texttt{0x10000} 的情况。}
+% 当记号 |#1| 的 \texttt{charcode} 大于等于 \texttt{0x10000} 时,\XeTeX
+% \texttt{0.9999} 版以前的 \cs{meaning} 的返回结果比较特殊\footnote{参见
+% \url{http://tug.org/pipermail/xetex/2013-January/023967.html} 和
+% \url{http://tex.stackexchange.com/a/64848}。},需要特别处理。
+% \begin{macrocode}
\cs_new_nopar:Npn \xeCJK_token_value_charcode:N #1
{ \exp_after:wN \@@_token_value_charcode:w \token_to_meaning:N #1 \q_stop }
-\cs_new_nopar:Npn \@@_token_value_charcode:w #1 ~ #2 ~ #3 \q_stop { `#3 }
+\fp_compare:nNnTF { \int_use:N \xetex_XeTeXversion:D \XeTeXrevision } > { 0.9998 }
+ {
+ \cs_new_nopar:Npn \@@_token_value_charcode:w #1 ~ #2 ~ #3 \q_stop
+ { `#3 }
+ }
+ {
+ \cs_new_nopar:Npn \@@_token_value_charcode:w #1 ~ #2 ~ #3#4 \q_stop
+ { \tl_if_empty:nTF {#4} { `#3 } { "20000 } }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[pTF]{\xeCJK_if_CJK_class:N}
+% 判断字符 |#1| 是否为 CJK 字符类,包括文字和标点符号。
+% \begin{macrocode}
+\prg_new_conditional:Npnn \xeCJK_if_CJK_class:N #1 { p , T , F , TF }
+ {
+ \if_cs_exist:w \@@_CJK_class_tl:n { \xeCJK_token_value_class:N #1 } \cs_end:
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\cs_new_nopar:Npn \@@_CJK_class_tl:n #1
+ { c_@@_CJK_class_ \int_eval:n {#1} _tl }
+\cs_generate_variant:Nn \@@_CJK_class_tl:n { c }
% \end{macrocode}
% \end{macro}
%
@@ -1882,8 +1914,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \subsection{字符类别处理}
%
% \begin{macro}[internal,var]
-% {\g_@@_base_class_seq,\g_@@_non_CJK_class_seq,
-% \g_@@_CJK_class_seq,\g_@@_CJK_class_prop}
+% {\g_@@_base_class_seq,\g_@@_non_CJK_class_seq,\g_@@_CJK_class_seq}
% \begin{macrocode}
\seq_new:N \g_@@_base_class_seq
\seq_gset_eq:NN \g_@@_base_class_seq \g_@@_class_seq
@@ -1891,16 +1922,11 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\seq_gset_from_clist:Nn \g_@@_non_CJK_class_seq
{ Default , HalfLeft , HalfRight , NormalSpace , Boundary }
\seq_new:N \g_@@_CJK_class_seq
-\prop_new:N \g_@@_CJK_class_prop
\cs_new_protected_nopar:Npn \@@_save_CJK_class:n #1
{
\seq_gput_right:Nn \g_@@_CJK_class_seq {#1}
- \prop_gput:Nvn \g_@@_CJK_class_prop { \@@_class_csname:n {#1} } {#1}
- \tl_gput_right:Nx \g_@@_check_single_CJK_case_tl
- { { \exp_not:c { \@@_class_csname:n {#1} } } { \exp_not:N \use_ii:nn } }
+ \tl_const:cn { \@@_CJK_class_tl:c { \@@_class_csname:n {#1} } } {#1}
}
-\tl_new:N \g_@@_check_single_CJK_case_tl
-\cs_generate_variant:Nn \prop_gput:Nnn { Nvn }
\clist_map_function:nN { CJK , FullLeft , FullRight } \@@_save_CJK_class:n
% \end{macrocode}
% \end{macro}
@@ -3050,22 +3076,19 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macro}[internal]{\@@_check_single_space:NN}
% \changes{v3.1.1}{2012/12/13}
% {\texttt{CheckSingle} 支持段末“汉字$+$汉字$+$空格$+$汉字/标点”的形式。}
+% \changes{v3.1.2}{2012/12/27}
+% {使用 \cs{xeCJK_if_CJK_class:NTF} 来代替 \cs{int_case:nnn} 判断是否是 CJK 字符类。}
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_check_single_space:NN #1#2
{
- \int_case:non { \xeCJK_token_value_class:N #2 }
- { \g_@@_check_single_CJK_case_tl }
- { \use_i:nn }
- { \@@_check_single_save:N #1 #2 ~ }
+ \xeCJK_if_CJK_class:NTF #2
{
- \int_case:non { \xeCJK_token_value_class:N \l_peek_token }
- { \g_@@_check_single_CJK_case_tl }
- { \use_i:nn }
- { \@@_check_single_save:N #1 #2 ~ }
+ \xeCJK_if_CJK_class:NTF \l_peek_token
{ \@@_check_single_save:N #1 #2 }
+ { \@@_check_single_save:N #1 #2 ~ }
}
+ { \@@_check_single_save:N #1 #2 ~ }
}
-\cs_generate_variant:Nn \int_case:nnn { no }
% \end{macrocode}
% \end{macro}
%
@@ -3254,7 +3277,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\cs_generate_variant:Nn \@@_sub_restore_or_cancel:n { x }
\@@_msg_new:nn { SubBlock-undefined }
{
- The~CJK~sub~block~'#1'~is~undefined.\\\\
+ The~CJK~sub~block~`#1'~is~undefined.\\\\
Try~to~use~\token_to_str:N \xeCJKDeclareSubCJKBlock \
to~declare~it.
}
@@ -4083,9 +4106,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
}
\@@_msg_new:nn { fallback }
{
- CJKfamily~'#2'~
+ CJKfamily~`#2'~
( \prop_get:No \g_@@_family_font_name_prop {#2} )~
- does~not~contain~glyph~'#1'~(U+\int_to_hexadecimal:n {`#1}).\\
+ does~not~contain~glyph~`#1'~(U+\int_to_hexadecimal:n {`#1}).\\
}
\bool_new:N \l_@@_fallback_first_bool
\cs_generate_variant:Nn \prop_get:Nn { No }
@@ -4380,8 +4403,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\cs_gset_protected_nopar:cpx { \@@_family_csname:n {#1} }
{
\group_begin:
- \cs_set_eq:NN
- \exp_not:n { \@@_update_family:n \use_none:n }
+ \exp_not:n { \cs_set_eq:NN \@@_update_family:n \use_none:n }
\exp_not:n { \fontspec_set_family:Nnn \l_@@_fontspec_family_tl }
{ \exp_not:V \l_@@_fontspec_options_clist }
{ \exp_not:V \l_@@_font_name_tl }
@@ -4702,7 +4724,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
{ \@@_block_select_font:n {#2} }
}
}
-\@@_msg_new:nn { CJK-block } { Switch~from~block~'#1'~to~'#2'. }
+\@@_msg_new:nn { CJK-block } { Switch~from~block~`#1'~to~`#2'. }
% \end{macrocode}
% \end{macro}
%
@@ -4809,8 +4831,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]
-% {\xeCJK_family_if_exist_use:x,\@@_family_unknown_warning:n}
+% \begin{macro}[internal]{\xeCJK_family_if_exist_use:x}
% \begin{macrocode}
\cs_new_protected_nopar:Npn \xeCJK_family_if_exist_use:x #1
{
@@ -4818,12 +4839,22 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
{ \@@_family_use:x {#1} }
{ \@@_family_unknown_warning:x {#1} }
}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\@@_family_unknown_warning:n}
+% \changes{v3.1.2}{2013/01/01}
+% {在没有定义任何 CJK 字体的情况下,不再重复给出字体没有定义的警告。}
+% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_family_unknown_warning:n #1
{
- \seq_if_in:NnF \g_@@_unknown_family_seq {#1}
+ \prop_if_empty:NF \g_@@_family_font_name_prop
{
- \seq_gput_right:Nn \g_@@_unknown_family_seq {#1}
- \@@_warning:nx { CJKfamily-Unknown } {#1}
+ \seq_if_in:NnF \g_@@_unknown_family_seq {#1}
+ {
+ \seq_gput_right:Nn \g_@@_unknown_family_seq {#1}
+ \@@_warning:nx { CJKfamily-Unknown } {#1}
+ }
}
}
\cs_generate_variant:Nn \@@_family_unknown_warning:n { x }
@@ -4831,7 +4862,10 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\@@_msg_new:nn { CJKfamily-Unknown }
{
Unknown~CJK~family~`\@@_msg_family_map:n {#1}'~is~being~ignored.\\\\
- Try~to~use~
+ Try~to~use~`\@@_msg_def_family_map:n {#1}'~to~define~it.
+ }
+\cs_new_nopar:Npn \@@_msg_def_family_map:n #1
+ {
\str_case_x:nnn {#1}
{
\CJKrmdefault { \token_to_str:N \setCJKmainfont }
@@ -4839,7 +4873,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\CJKttdefault { \token_to_str:N \setCJKmonofont }
}
{ \token_to_str:N \setCJKfamilyfont {#1} }
- [...]{...}~to~define~it.
+ [...]{...}
}
\cs_new_nopar:Npn \@@_msg_family_map:n #1
{
@@ -4979,24 +5013,50 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macrocode}
% \end{macro}
%
-% 在导言区结束的时候,若没有声明 CJK 字体,则给出一个警告。并在此时根据西文字体的
-% 情况更新 \cs{CJKfamilydefault} 和设置数学字体。
+% \changes{v3.1.2}{2013/01/01}{修正重定义 \cs{CJKfamilydefault} 无效的问题,恢复容错能力。}
+%
+% 在导言区结束的时候,若没有声明 CJK 字体,则给出一个警告。如果 \cs{CJKfamilydefault}
+% 没有被更改,则在此时根据西文字体的情况更新 \cs{CJKfamilydefault}。
+% 如果 \cs{CJKfamilydefault} 对应的字体族没有定义,则使用 \cs{CJKrmdefault} 作为
+% 默认字体族。若 \cs{CJKrmdefault} 也没有定义,则使用在导言区设置的第一个 CJK 字体
+% 作为默认字体族。最后设置数学字体。
% \begin{macrocode}
\@@_at_end_preamble:n
{
- \prop_if_empty:NTF \g_@@_family_font_name_prop
- { \@@_warning:n { no-CJKfamily } }
+ \cs_set_eq:NN \@@_family_default_wrap:n \exp_not:n
+ \tl_if_eq:NNT \CJKfamilydefault \l_@@_family_default_init_tl
{
\tl_gset:Nx \CJKfamilydefault
{
\str_case_x:nnn { \familydefault }
{
- { \rmdefault } { \CJKrmdefault }
- { \sfdefault } { \CJKsfdefault }
- { \ttdefault } { \CJKttdefault }
+ { \rmdefault } { \exp_not:N \CJKrmdefault }
+ { \sfdefault } { \exp_not:N \CJKsfdefault }
+ { \ttdefault } { \exp_not:N \CJKttdefault }
}
{ \CJKfamilydefault }
}
+ }
+ \cs_undefine:N \@@_family_default_wrap:n
+ \prop_if_empty:NTF \g_@@_family_font_name_prop
+ { \@@_warning:nx { no-CJKfamily } { \CJKfamilydefault } }
+ {
+ \xeCJK_family_if_exist:xF { \CJKfamilydefault }
+ {
+ \tl_set_eq:NN \l_@@_tmpa_tl \CJKfamilydefault
+ \str_if_eq_x:nnTF { \CJKfamilydefault } { \CJKrmdefault }
+ { \use:n }
+ {
+ \xeCJK_family_if_exist:xTF { \CJKrmdefault }
+ { \tl_gset:Nn \CJKfamilydefault { \CJKrmdefault } }
+ }
+ {
+ \prop_map_inline:Nn \g_@@_family_font_name_prop
+ { \prop_map_break:n { \tl_gset:Nn \CJKfamilydefault {#1} } }
+ }
+ \@@_warning:nxx { CJKfamilydefault-undefined }
+ { \l_@@_tmpa_tl } { \CJKfamilydefault }
+ }
\CJKfamily { \CJKfamilydefault }
\bool_if:NT \g_@@_math_bool { \xeCJK_set_mathfont: }
}
@@ -5005,8 +5065,14 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
{
It~seems~that~you~have~not~declare~a~CJKfamily.\\
If~you~want~to~use~xeCJK~in~the~right~way,~you~should~use\\\\
- \token_to_str:N \xeCJKmainfont[...]{...}\\\\
- in~the~preamble~to~declare~the~main~CJKfamily.\\
+ `\@@_msg_def_family_map:n {#1}'\\\\
+ in~the~preamble~to~declare~the~default~CJKfamily.\\
+ }
+\@@_msg_new:nn { CJKfamilydefault-undefined }
+ {
+ Undefined~CJK~default~family~`\@@_msg_family_map:n {#1}'~
+ has~been~replaced~by~`\@@_msg_family_map:n {#2}'.\\\\
+ Try~to~use~`\@@_msg_def_family_map:n {#1}'~to~define~it.
}
% \end{macrocode}
%
@@ -5283,8 +5349,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
}
\@@_msg_new:nn { key-unknown }
{
- Sorry,~but~\l__keys_module_tl \ does~not~have~a~key~called~'#1'.\\\\
- The~key~'#1'~is~being~ignored.
+ Sorry,~but~\l__keys_module_tl \ does~not~have~a~key~called~`#1'.\\\\
+ The~key~`#1'~is~being~ignored.
}
% \end{macrocode}
% \end{macro}
@@ -5369,8 +5435,18 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\tl_if_exist:NF \CJKrmdefault { \tl_gset:Nn \CJKrmdefault { rm } }
\tl_if_exist:NF \CJKsfdefault { \tl_gset:Nn \CJKsfdefault { sf } }
\tl_if_exist:NF \CJKttdefault { \tl_gset:Nn \CJKttdefault { tt } }
-\tl_if_exist:NF \CJKfamilydefault { \tl_gset:Nn \CJKfamilydefault { \CJKrmdefault } }
-\tl_new:c { \@@_family_csname:n { \CJKfamilydefault } }
+\tl_new:N \l_@@_family_default_init_tl
+\cs_new_eq:NN \@@_family_default_wrap:n \use:n
+\tl_gset:Nx \l_@@_family_default_init_tl
+ {
+ \exp_not:N \@@_family_default_wrap:n
+ {
+ \tl_if_exist:NTF \CJKfamilydefault
+ { \exp_not:V \CJKfamilydefault }
+ { \exp_not:N \CJKrmdefault }
+ }
+ }
+\tl_gset_eq:NN \CJKfamilydefault \l_@@_family_default_init_tl
% \end{macrocode}
% \end{macro}
%
@@ -5445,6 +5521,36 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \subsection{兼容性修补}
%
+% \begin{macro}[internal]{\nobreakspace}
+% \changes{v3.1.2}{2013/01/01}
+% {修正非 \cs{UTFencname} 编码下面 \pkg{xunicode} 重定义的 \cs{nobreakspace} 会失效的问题。}
+% 按照 \pkg{xunicode} 的设计,使用 \cs{DeclareUTFcharacter} 定义符号命令时,如果命令
+% 已经存在,那么它会检查它是否是“健壮”的。如果是,则什么也不做;否则使用
+% \cs{DeclareTextCommand} 来重定义它,实际意义与原来相同,原来的定义保存在名为
+% |?-\cs| 的宏中。这里的主要问题是 \pkg{xunicode} 的健壮性检查对像 \cs{nobreakspace}
+% 这种原本由 \cs{DeclareRobustCommand} 定义的命令返回结果是“假”,因而重定义它。
+% 如果编码发生变化,使用 \cs{nobreakspace} 时,\textsf{NFSS} 就会报错。
+% 按照 \textsf{NFSS} 的机制,我们用 \cs{ProvideTextCommandDefault} 对未声明的编码给出
+% 默认定义即可避免报错。其实 \pkg{xunicode} 重定义 \cs{nobreakspace} 的方式并不恰当。因为
+% 在 \LaTeXe 中,\cs{nobreakspace} 原本并不是由 \cs{DeclareTextCommand} 或
+% \cs{DeclareTextSymbol} 来定义,这样按照 \pkg{xunicode} 的实现方式,\cs{nobreakspace}
+% 永远都不会输出 |\char"00A0|。要想让 \cs{nobreakspace} 在 \cs{UTFencname} 编码下面输出
+% |\char"00A0|,除非在 \pkg{xunicode} 载入\textbf{前}用 \cs{DeclareTextCommandDefault} 重新定义它:
+% \begin{verbatim}
+% \DeclareTextCommandDefault\nobreakspace{\leavevmode\nobreak\ }
+% \end{verbatim}
+% 这样我们也就不需要再做下面的处理。另外,如果作者使用名字 |?\cs| 来保存原来的定义
+% 的话,也不需要下面的处理。因为下面实际上是定义了一个名为 |?\nobreakspace| 的宏作为
+% 未声明编码的默认定义。但是作者使用了 |?-\cs|,不知道这是有意为之还是一个疏忽。
+% \begin{macrocode}
+\cs_if_exist:cT { ? - \token_to_str:N \nobreakspace }
+ {
+ \exp_args:NNv \ProvideTextCommandDefault \nobreakspace
+ { ? - \token_to_str:N \nobreakspace }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \changes{v3.1.1}{2012/12/13}{对于与 \pkg{xltxtra} 的冲突给出错误警告。}
% \begin{macrocode}
\@@_msg_new:nn { conflict-package }
@@ -5455,7 +5561,13 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\xeCJK_if_package_loaded:nTF { realscripts }
{
\@ifpackagelater { realscripts } { 2010/10/10 } { }
- { \@@_error:nx { conflict-package } { xltxtra } }
+ {
+ \@@_error:nx { conflict-package }
+ {
+ \xeCJK_if_package_loaded:nTF { xltxtra }
+ { xltxtra } { realscripts }
+ }
+ }
}
{
\cs_new_eq:NN \@@_dim_max:nn \dim_max:nn
@@ -5478,6 +5590,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{macro}[internal]{\fontfamily}
% \changes{v3.1.1}{2012/12/06}{修改主要 \texttt{CJK} 字体族的自动更新方式。}
+% \changes{v3.1.2}{2013/01/01}{不将参数完全展开。}
% 修改 \cs{fontfamily},使主要 |CJK| 字体族能随西文主要字体更新。
% \begin{macrocode}
\RenewDocumentCommand \fontfamily { m }
@@ -5485,7 +5598,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\tl_set:Nx \f@family {#1}
\@@_update_family:n
{
- \str_case_x:nnn {#1}
+ \str_case:nnn {#1}
{
{ \rmdefault } { \CJKfamily { \CJKrmdefault } }
{ \sfdefault } { \CJKfamily { \CJKsfdefault } }
@@ -5852,22 +5965,22 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_ulem_initial:
{
- \cs_set_eq:NN \@@_punct_hskip:n \@@_ulem_hskip:n
- \cs_set_eq:NN
+ \xeCJK_swap_cs:NN
\@@_Default_and_FullLeft_glue:N \@@_ulem_Default_and_FullLeft_glue:N
- \cs_set_eq:NN
+ \xeCJK_swap_cs:NN
\@@_Default_and_FullRight_glue:N \@@_ulem_Default_and_FullRight_glue:N
- \cs_set_eq:NN
+ \xeCJK_swap_cs:NN
\@@_CJK_and_FullLeft_glue:N \@@_ulem_CJK_and_FullLeft_glue:N
- \cs_set_eq:NN
+ \xeCJK_swap_cs:NN
\@@_CJK_and_FullRight_glue:N \@@_ulem_CJK_and_FullRight_glue:N
- \cs_set_eq:NN
+ \xeCJK_swap_cs:NN
\@@_Boundary_and_FullLeft_glue:N \@@_ulem_Boundary_and_FullLeft_glue:N
- \cs_set_eq:NN \xeCJK_FullLeft_and_Default: \@@_ulem_FullLeft_and_Default:
- \cs_set_eq:NN \xeCJK_FullLeft_and_CJK: \@@_ulem_FullLeft_and_CJK:
- \cs_set_eq:NN \xeCJK_FullRight_and_Default: \@@_ulem_FullRight_and_Default:
- \cs_set_eq:NN \xeCJK_FullRight_and_CJK: \@@_ulem_FullRight_and_CJK:
- \cs_set_eq:NN \xeCJK_CJK_and_CJK:N \@@_ulem_CJK_and_CJK:N
+ \xeCJK_swap_cs:NN \@@_punct_hskip:n \@@_ulem_punct_hskip:n
+ \xeCJK_swap_cs:NN \xeCJK_FullLeft_and_Default: \@@_ulem_FullLeft_and_Default:
+ \xeCJK_swap_cs:NN \xeCJK_FullLeft_and_CJK: \@@_ulem_FullLeft_and_CJK:
+ \xeCJK_swap_cs:NN \xeCJK_FullRight_and_Default: \@@_ulem_FullRight_and_Default:
+ \xeCJK_swap_cs:NN \xeCJK_FullRight_and_CJK: \@@_ulem_FullRight_and_CJK:
+ \xeCJK_swap_cs:NN \xeCJK_CJK_and_CJK:N \@@_ulem_CJK_and_CJK:N
\seq_map_inline:Nn \g_@@_CJK_sub_class_seq
{
\seq_map_inline:Nn \g_@@_CJK_sub_class_seq
@@ -5889,14 +6002,36 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macrocode}
% \end{macro}
%
+% \changes{v3.1.2}{2012/12/27}{解决在下划线状态下使用 \cs{makebox} 时的错误。}
+%
+% \begin{macro}[internal]{\xeCJK_if_ulem_patch:TF}
+% 在下划线状态下,\pkg{ulem} 宏包在数学模式或者盒子中使用 \cs{UL@hrest} 恢复
+% \verb*|\ | 等的定义,此时不需要使用 \cs{UL@stop} 和 \cs{UL@start} 来断开下划线而
+% 产生断点。
+% \begin{macrocode}
+\cs_new_nopar:Npn \xeCJK_if_ulem_patch:TF
+ {
+ \if_meaning:w \ \LA@space
+ \exp_after:wN \use_ii:nn
+ \else:
+ \exp_after:wN \use_i:nn
+ \fi:
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}[internal]{\@@_ulem_CJK_and_CJK:N}
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_ulem_CJK_and_CJK:N
{
- \xeCJK_class_group_end:
- \UL@stop \@@_ulem_ccglue: \UL@start
- \@@_ulem_class_group_begin:
- \CJKsymbol
+ \xeCJK_if_ulem_patch:TF
+ {
+ \xeCJK_class_group_end:
+ \UL@stop \@@_ulem_ccglue: \UL@start
+ \@@_ulem_class_group_begin:
+ \CJKsymbol
+ }
+ { \@@_ulem_CJK_and_CJK:N }
}
% \end{macrocode}
% \end{macro}
@@ -5916,12 +6051,20 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_ulem_between_CJK_blocks:nnN #1#2
{
- \xeCJK_class_group_end:
- \UL@stop \@@_ulem_ccglue: \UL@start
- \xeCJK_class_group_begin:
- \xeCJK_clear_Boundary_and_CJK_toks:
- \@@_switch_font:nn {#1} {#2}
- \CJKsymbol
+ \xeCJK_if_ulem_patch:TF
+ {
+ \xeCJK_class_group_end:
+ \UL@stop \@@_ulem_ccglue: \UL@start
+ \xeCJK_class_group_begin:
+ \xeCJK_clear_Boundary_and_CJK_toks:
+ \@@_switch_font:nn {#1} {#2}
+ \CJKsymbol
+ }
+ {
+ \skip_horizontal:N \l_@@_ccglue_skip
+ \@@_switch_font:nn {#1} {#2}
+ \CJKsymbol
+ }
}
% \end{macrocode}
% \end{macro}
@@ -5930,10 +6073,14 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_ulem_Default_and_FullLeft_glue:N #1
{
- \UL@stop
- \@@_ulem_skip_punct_begin:
- \@@_punct_glue:NN \c_@@_left_tl {#1}
- \UL@start
+ \xeCJK_if_ulem_patch:TF
+ {
+ \UL@stop
+ \@@_ulem_skip_punct_begin:
+ \@@_punct_glue:NN \c_@@_left_tl {#1}
+ \UL@start
+ }
+ { \@@_ulem_Default_and_FullLeft_glue:N #1 }
}
% \end{macrocode}
% \end{macro}
@@ -5942,11 +6089,15 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_ulem_Boundary_and_FullLeft_glue:N #1
{
- \UL@stop
- \@@_ulem_skip_punct_begin:
- \int_compare:nNnF \etex_lastnodetype:D = \c_one
- { \@@_punct_glue:NN \c_@@_left_tl {#1} }
- \UL@start
+ \xeCJK_if_ulem_patch:TF
+ {
+ \UL@stop
+ \@@_ulem_skip_punct_begin:
+ \int_compare:nNnF \etex_lastnodetype:D = \c_one
+ { \@@_punct_glue:NN \c_@@_left_tl {#1} }
+ \UL@start
+ }
+ { \@@_ulem_Boundary_and_FullLeft_glue:N #1 }
}
% \end{macrocode}
% \end{macro}
@@ -5955,13 +6106,17 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_ulem_CJK_and_FullLeft_glue:N #1
{
- \xeCJK_class_group_end:
- \UL@stop
- \@@_ulem_skip_punct_begin:
- \@@_ulem_ccglue:
- \@@_punct_glue:NN \c_@@_left_tl {#1}
- \UL@start
- \@@_ulem_class_group_begin:
+ \xeCJK_if_ulem_patch:TF
+ {
+ \xeCJK_class_group_end:
+ \UL@stop
+ \@@_ulem_skip_punct_begin:
+ \@@_ulem_ccglue:
+ \@@_punct_glue:NN \c_@@_left_tl {#1}
+ \UL@start
+ \@@_ulem_class_group_begin:
+ }
+ { \@@_ulem_CJK_and_FullLeft_glue:N #1 }
}
% \end{macrocode}
% \end{macro}
@@ -5970,19 +6125,23 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_ulem_Default_and_FullRight_glue:N #1
{
- \UL@stop
- \@@_ulem_skip_punct_begin:
- \@@_punct_if_long:NTF {#1}
- { \@@_ulem_ccglue: }
+ \xeCJK_if_ulem_patch:TF
{
- \@@_punct_if_middle:NT {#1}
+ \UL@stop
+ \@@_ulem_skip_punct_begin:
+ \@@_punct_if_long:NTF {#1}
+ { \@@_ulem_ccglue: }
{
+ \@@_punct_if_middle:NT {#1}
+ {
+ \xeCJK_no_break:
+ \@@_punct_glue:NN \c_@@_right_tl {#1}
+ }
\xeCJK_no_break:
- \@@_punct_glue:NN \c_@@_right_tl {#1}
}
- \xeCJK_no_break:
+ \UL@start
}
- \UL@start
+ { \@@_ulem_Default_and_FullRight_glue:N #1 }
}
% \end{macrocode}
% \end{macro}
@@ -5991,9 +6150,13 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_ulem_CJK_and_FullRight_glue:N #1
{
- \xeCJK_class_group_end:
- \@@_ulem_Default_and_FullRight_glue:N {#1}
- \@@_ulem_class_group_begin:
+ \xeCJK_if_ulem_patch:TF
+ {
+ \xeCJK_class_group_end:
+ \@@_ulem_Default_and_FullRight_glue:N {#1}
+ \@@_ulem_class_group_begin:
+ }
+ { \@@_ulem_CJK_and_FullRight_glue:N #1 }
}
% \end{macrocode}
% \end{macro}
@@ -6002,17 +6165,21 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_ulem_FullLeft_and_Default:
{
- \@@_punct_if_middle:NTF \g_@@_last_punct_tl
+ \xeCJK_if_ulem_patch:TF
{
- \xeCJK_get_punct_bounds:NN \c_@@_left_tl \g_@@_last_punct_tl
- \@@_punct_rule:NN \c_@@_right_tl \g_@@_last_punct_tl
- \xeCJK_class_group_end: \UL@stop \xeCJK_no_break:
- \@@_punct_glue:NN \c_@@_left_tl \g_@@_last_punct_tl
+ \@@_punct_if_middle:NTF \g_@@_last_punct_tl
+ {
+ \xeCJK_get_punct_bounds:NN \c_@@_left_tl \g_@@_last_punct_tl
+ \@@_punct_rule:NN \c_@@_right_tl \g_@@_last_punct_tl
+ \xeCJK_class_group_end: \UL@stop \xeCJK_no_break:
+ \@@_punct_glue:NN \c_@@_left_tl \g_@@_last_punct_tl
+ }
+ { \xeCJK_class_group_end: \UL@stop }
+ \@@_ulem_skip_punct_end:
+ \xeCJK_no_break:
+ \UL@start
}
- { \xeCJK_class_group_end: \UL@stop }
- \@@_ulem_skip_punct_end:
- \xeCJK_no_break:
- \UL@start
+ { \@@_ulem_FullLeft_and_Default: }
}
% \end{macrocode}
% \end{macro}
@@ -6021,8 +6188,12 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_ulem_FullLeft_and_CJK:
{
- \@@_ulem_FullLeft_and_Default:
- \@@_ulem_class_group_begin:
+ \xeCJK_if_ulem_patch:TF
+ {
+ \@@_ulem_FullLeft_and_Default:
+ \@@_ulem_class_group_begin:
+ }
+ { \@@_ulem_FullLeft_and_CJK: }
}
% \end{macrocode}
% \end{macro}
@@ -6031,12 +6202,16 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_ulem_FullRight_and_Default:
{
- \@@_punct_rule:NN \c_@@_right_tl \g_@@_last_punct_tl
- \xeCJK_class_group_end:
- \UL@stop
- \@@_punct_glue:NN \c_@@_right_tl \g_@@_last_punct_tl
- \@@_ulem_skip_punct_end:
- \UL@start
+ \xeCJK_if_ulem_patch:TF
+ {
+ \@@_punct_rule:NN \c_@@_right_tl \g_@@_last_punct_tl
+ \xeCJK_class_group_end:
+ \UL@stop
+ \@@_punct_glue:NN \c_@@_right_tl \g_@@_last_punct_tl
+ \@@_ulem_skip_punct_end:
+ \UL@start
+ }
+ { \@@_ulem_FullRight_and_Default: }
}
% \end{macrocode}
% \end{macro}
@@ -6045,14 +6220,29 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_ulem_FullRight_and_CJK:
{
- \@@_punct_rule:NN \c_@@_right_tl \g_@@_last_punct_tl
- \xeCJK_class_group_end:
- \UL@stop
- \@@_punct_glue:NN \c_@@_right_tl \g_@@_last_punct_tl
- \@@_ulem_ccglue:
- \@@_ulem_skip_punct_end:
- \UL@start
- \@@_ulem_class_group_begin:
+ \xeCJK_if_ulem_patch:TF
+ {
+ \@@_punct_rule:NN \c_@@_right_tl \g_@@_last_punct_tl
+ \xeCJK_class_group_end:
+ \UL@stop
+ \@@_punct_glue:NN \c_@@_right_tl \g_@@_last_punct_tl
+ \@@_ulem_ccglue:
+ \@@_ulem_skip_punct_end:
+ \UL@start
+ \@@_ulem_class_group_begin:
+ }
+ { \@@_ulem_FullRight_and_CJK: }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\@@_ulem_punct_hskip:n}
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_ulem_punct_hskip:n
+ {
+ \xeCJK_if_ulem_patch:TF
+ { \@@_ulem_hskip:n }
+ { \@@_ulem_punct_hskip:n }
}
% \end{macrocode}
% \end{macro}
@@ -6062,9 +6252,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_ulem_glue:n #1
{
- \cs_if_eq:NNTF \ \LA@space
- { \skip_horizontal:n {#1} }
+ \xeCJK_if_ulem_patch:TF
{ \UL@stop \@@_ulem_hskip:n {#1} \UL@start }
+ { \skip_horizontal:n {#1} }
}
\cs_new_protected_nopar:Npn \@@_ulem_ccglue:
{ \skip_set_eq:NN \UL@skip \l_@@_ccglue_skip \UL@leaders }
diff --git a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins
index 9a689cc6ba9..4ab58ad723a 100644
--- a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins
+++ b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins
@@ -4,9 +4,9 @@
%%
%% The original source files were:
%%
-%% xeCJK.dtx (with options: `batchfile')
+%% xeCJK.dtx (with options: `install')
%%
-%% $Id: xeCJK.dtx 382 2012-12-13 04:58:22Z sobenlee $
+%% $Id: xeCJK.dtx 399 2013-01-11 14:57:50Z sobenlee $
%% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%% -----------------------------------------------------------------
%% Author:
@@ -15,7 +15,9 @@
%% Leo Liu <leoliu.pku@gmail.com>
%% Qing Lee <sobenlee@gmail.com>
%%
-%% Copyright (C) 2007--2012 Wenchang Sun
+%% 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
@@ -35,7 +37,7 @@
\askforoverwritefalse
\preamble
-$Id: xeCJK.dtx 382 2012-12-13 04:58:22Z sobenlee $
+$Id: xeCJK.dtx 399 2013-01-11 14:57:50Z sobenlee $
$URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
-----------------------------------------------------------------
Author:
@@ -44,7 +46,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
Leo Liu <leoliu.pku@gmail.com>
Qing Lee <sobenlee@gmail.com>
- Copyright (C) 2007--2012 Wenchang Sun
+ 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
@@ -81,19 +85,18 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\endpreamble
\declarepostamble\emptypostamble
\endpostamble
-\usedir{tex/xelatex/xecjk}
+
\generate{
+ \usedir{source/xelatex/xecjk}
+ \file{\jobname.ins}{\from{\jobname.dtx}{install}}
+ \usedir{tex/xelatex/xecjk}
\file{\jobname.sty}{\from{\jobname.dtx}{package}}
- \file{xeCJKfntef.sty}{\from{\jobname.dtx}{fntef}}}
-\usedir{tex/xelatex/xecjk/config}
-\generate{
- \usepreamble\emptypreamble
- \usepostamble\emptypostamble
- \file{\jobname.cfg}{\from{\jobname.dtx}{config}}}
-\usedir{doc/xelatex/xecjk/example}
-\generate{
+ \file{xeCJKfntef.sty}{\from{\jobname.dtx}{fntef}}
\usepreamble\emptypreamble
\usepostamble\emptypostamble
+ \usedir{tex/xelatex/xecjk/config}
+ \file{\jobname.cfg}{\from{\jobname.dtx}{config}}
+ \usedir{doc/xelatex/xecjk/example}
\file{\jobname-example-autofake.tex}{\from{\jobname.dtx}{ex-autofake}}
\file{\jobname-example-fallback.tex}{\from{\jobname.dtx}{ex-fallback}}
\file{\jobname-example-subCJKblock.tex}{\from{\jobname.dtx}{ex-block}}
@@ -101,7 +104,12 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\file{\jobname-example-checksingle.tex}{\from{\jobname.dtx}{ex-single}}
\file{\jobname-example-CJKfntef.tex}{\from{\jobname.dtx}{ex-fntef}}
\file{\jobname-example-punctstyle.tex}{\from{\jobname.dtx}{ex-punctstyle}}
- \file{\jobname-example-verbatim.tex}{\from{\jobname.dtx}{ex-verb}}}
+ \file{\jobname-example-verbatim.tex}{\from{\jobname.dtx}{ex-verb}}
+ \nopreamble\nopostamble
+ \usedir{doc/xelatex/xecjk}
+ \file{README.txt}{\from{\jobname.dtx}{readme}}
+}
+
\endbatchfile
%%
%% This package consists of the file xeCJK.dtx