summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/xelatex/xecjk
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-11-05 23:10:56 +0000
committerKarl Berry <karl@freefriends.org>2014-11-05 23:10:56 +0000
commit614e92fcfb7bbf20b314eafeac08856e5b337f05 (patch)
tree1161d4db72a4fbe6780125390fd3d23eb6866bb6 /Master/texmf-dist/source/xelatex/xecjk
parentb3a15e5c9eaee42f3ea8d48970d289643293e145 (diff)
xecjk (5nov14)
git-svn-id: svn://tug.org/texlive/trunk@35520 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/xelatex/xecjk')
-rw-r--r--Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx1891
-rw-r--r--Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins30
2 files changed, 1376 insertions, 545 deletions
diff --git a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
index 05160b253ca..38db97e7078 100644
--- a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
+++ b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
@@ -95,7 +95,7 @@ CJK scripts fonts (TrueType or OpenType).
\askforoverwritefalse
\preamble
-$Id: xeCJK.dtx 692 2014-06-20 12:25:35Z sobenlee $
+$Id: xeCJK.dtx 729 2014-11-05 13:46:36Z sobenlee@gmail.com $
$URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
-----------------------------------------------------------------
Author:
@@ -163,9 +163,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\generate{
\usedir{source/xelatex/xecjk}
- \file{\jobname.ins}{\from{\jobname.dtx}{install}}
+ \file{xeCJK.ins}{\from{\jobname.dtx}{install}}
\usedir{tex/xelatex/xecjk}
- \file{\jobname.sty}{\from{\jobname.dtx}{package}}
+ \file{xeCJK.sty}{\from{\jobname.dtx}{package}}
\file{xeCJKfntef.sty}{\from{\jobname.dtx}{fntef}}
\file{xeCJK-listings.sty}{\from{\jobname.dtx}{listings}}
\file{xunicode-addon.sty}{\from{\jobname.dtx}{xunicode}}
@@ -173,18 +173,18 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\usepreamble\emptypreamble
\usepostamble\emptypostamble
\usedir{tex/xelatex/xecjk/config}
- \file{\jobname.cfg}{\from{\jobname.dtx}{config}}
+ \file{xeCJK.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}}
- \file{\jobname-example-CJKecglue.tex}{\from{\jobname.dtx}{ex-ecglue}}
- \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-IVS.tex}{\from{\jobname.dtx}{ex-IVS}}
- \file{\jobname-example-listings.tex}{\from{\jobname.dtx}{ex-listings}}
+ \file{xeCJK-example-autofake.tex}{\from{\jobname.dtx}{ex-autofake}}
+ \file{xeCJK-example-fallback.tex}{\from{\jobname.dtx}{ex-fallback}}
+ \file{xeCJK-example-subCJKblock.tex}{\from{\jobname.dtx}{ex-block}}
+ \file{xeCJK-example-CJKecglue.tex}{\from{\jobname.dtx}{ex-ecglue}}
+ \file{xeCJK-example-checksingle.tex}{\from{\jobname.dtx}{ex-single}}
+ \file{xeCJK-example-CJKfntef.tex}{\from{\jobname.dtx}{ex-fntef}}
+ \file{xeCJK-example-punctstyle.tex}{\from{\jobname.dtx}{ex-punctstyle}}
+ \file{xeCJK-example-verbatim.tex}{\from{\jobname.dtx}{ex-verb}}
+ \file{xeCJK-example-IVS.tex}{\from{\jobname.dtx}{ex-IVS}}
+ \file{xeCJK-example-listings.tex}{\from{\jobname.dtx}{ex-listings}}
\file{xunicode-symbols.tex}{\from{\jobname.dtx}{xunicode-symbols}}
\nopreamble\nopostamble
\usedir{doc/xelatex/xecjk}
@@ -201,12 +201,12 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
%</!config&!xunextra>
-\GetIdInfo$Id: xeCJK.dtx 692 2014-06-20 12:25:35Z sobenlee $
+\GetIdInfo$Id: xeCJK.dtx 729 2014-11-05 13:46:36Z sobenlee@gmail.com $
%<*driver|package>
{Typesetting CJK scripts with XeLaTeX}
%</driver|package>
%<config> {Configuration file for xeCJK package}
-%<fntef> {xeCJK patch file for ulem/CJKfntef}
+%<fntef> {xeCJK font effect}
%<listings> {xeCJK patch file for listings}
%<xunicode> {addon file for xunicode}
%<xunextra> {extra definition for xunicode}
@@ -223,7 +223,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%<fntef> {xeCJKfntef}
%<listings> {xeCJK-listings}
%<xunicode> {xunicode-addon}
- {\ExplFileDate}{3.2.13}{\ExplFileDescription}
+ {\ExplFileDate}{3.2.14}{\ExplFileDescription}
%<xunextra>\ExplSyntaxOff
%<*driver>
\let\xeCJKrevnum\ExplFileVersion
@@ -241,6 +241,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\usepackage[toc]{multitoc}
\usepackage{indentfirst}
\usepackage{unicode-math}
+\usepackage{fvrb-ex}
\fvset{formatcom=\xeCJKVerbAddon}
\linespread{1.1}
\setlist{noitemsep,topsep=1ex}
@@ -309,58 +310,47 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\endgroup
\par
}
-\cs_set_protected_nopar:Npn \__codedoc_special_main_index:n #1
+\cs_set_protected:Npn \__codedoc_special_index_aux:nnnnn #1#2#3#4#5
{
- \tl_if_empty:NTF \l__codedoc_function_name_prefix_tl
- { \SpecialOptionIndex }
- { \SpecialUsageIndex }
- {#1}
- }
-\cs_new_eq:NN \@@_special_main_index:n \SpecialMainIndex
-\group_begin:
- \char_set_lccode:nn { `\/ } { `\\ }
- \char_set_lccode:nn { `\L } { `\L }
- \char_set_lccode:nn { `\T } { `\T }
- \char_set_lccode:nn { `\X } { `\X }
-\tex_lowercase:D
- {
- \group_end:
- \DeclareDocumentCommand \SpecialMainIndex { m }
+ \__codedoc_special_index_set:Nn \l__codedoc_index_escaped_macro_tl {#2}
+ \str_if_eq:onTF { \@currenvir } { macrocode }
+ { \codeline@wrindex }
{
- \tl_if_head_eq_meaning:nNTF {#1} /
- { \@@_special_main_index:n }
- { \@@_special_main_option_index:n }
- {#1}
- }
- \cs_new_protected:Npn \@@_special_main_option_index:n #1
- {
- \@bsphack
- \group_begin:
- \special@index
- {
- #1 \actualchar { /ttfamily ~ #1 } ~ (option)
- \encapchar main
- }
- \special@index
- {
- options: \levelchar #1 \actualchar { /ttfamily ~ #1 }
- \encapchar main
- }
- \group_end:
- \@esphack
+ \HD@target
+ \index
}
- \DeclareDocumentCommand \tn { m }
{
- { \ttfamily /#1 }
- \SortIndex
- { TeX~and~LaTeX2e~commands }
- {
- /TeX{} ~ and ~ /LaTeXe{} ~ commands: \levelchar
- #1 \actualchar { /ttfamily /bslash ~ #1 }
- }
+ \tl_if_empty:nF { #3 #4 }
+ { #3 \actualchar #4 \levelchar }
+ #1
+ \actualchar
+ {
+ \token_to_str:N \verbatim@font \c_space_tl
+ \l__codedoc_index_escaped_macro_tl
+ }
+ \encapchar
+ hdclindex{\the\c@HD@hypercount}{#5}
}
}
+\DeclareDocumentCommand \cs { O{} m }
+ { \__codedoc_cmd_aux:no {#1} { \c__codedoc_backslash_tl #2 } }
+\DeclareDocumentCommand \tn { O{} m }
+ {
+ \__codedoc_cmd_aux:no
+ { index = TeX , replace = false , #1 }
+ { \c__codedoc_backslash_tl #2 }
+ }
+\DeclareDocumentCommand \meta { +m }
+ { \__codedoc_meta_aux:n {#1} }
+\DeclareExpandableDocumentCommand \bookmarkcstn { O{} m }
+ { \tl_to_str:n {#2} }
+\cs_new:Npn \bookmarkmeta #1 { < \tl_to_str:n {#1} > }
+\cs_generate_variant:Nn \__codedoc_cmd_aux:nn { no }
\ExplSyntaxOff
+\pdfstringdefDisableCommands{%
+ \let\cs\bookmarkcstn
+ \let\tn\bookmarkcstn
+ \let\meta\bookmarkmeta}
\geometry{includemp,hmargin={0mm,15mm},vmargin=15mm,footskip=7mm}
\preto\IndexParms{\linespread{1}}
\appto\GlossaryParms{%
@@ -400,14 +390,14 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%</driver>
% \fi
%
-% \changes{v3.1.0}{2012/11/13}{放弃对 \cs{outer} 宏的特殊处理。}
+% \changes{v3.1.0}{2012/11/13}{放弃对 \tn{outer} 宏的特殊处理。}
% \changes{v3.1.1}{2012/12/07}{不再依赖 \pkg{xpatch} 宏包。}
% \changes{v3.2.2}{2013/06/01}{修正某些重音不能正确显示的问题。}
% \changes{v3.2.3}{2013/06/07}{提供四个 TECkit 映射文件用于句号转换和简繁互换。}
% \changes{v3.2.4}{2013/07/02}{遵循 \hologo{LaTeX3} 变量需要预先声明的原则。}
% \changes{v3.2.6}{2013/07/29}{\texttt{case} 类函数的用法与 \hologo{LaTeX3} 同步。}
%
-% \CheckSum{9027}
+% \CheckSum{9574}
% \GetFileInfo{\jobname.dtx}
%
% \title{\bfseries\pkg{xeCJK} 宏包}
@@ -467,8 +457,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% 用更为高层的 \package{ctex} 宏包或文档类,它将自动调用 \pkg{xeCJK} 并设置好中文
% 字体,同时提供了进一步的本地化支持。详细内容参看 \package{ctex} 宏包套件的说明。
%
-% \pkg{xeCJK} 提供了大量选项,可以在宏包调用时作为宏包选项或用 \cs{xeCJKsetup}
-% 命令进行设置,详见 \ref{subsec:opts}~节。除了 \cs{setCJKmainfont} 命令,
+% \pkg{xeCJK} 提供了大量选项,可以在宏包调用时作为宏包选项或用 \tn{xeCJKsetup}
+% 命令进行设置,详见 \ref{subsec:opts}~节。除了 \tn{setCJKmainfont} 命令,
% \pkg{xeCJK} 还提供了许多其他命令设置和选择中文字体,详见
% \ref{subsec:fontset}~节。其他更详细的功能也都将在下面详细说明。在本文档所在的
% 文件夹的 |example| 目录下面也有一些例子可以参考。
@@ -479,13 +469,13 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \label{subsec:opts}
%
% \pkg{xeCJK} 以 \meta{key}|=|\meta{var} 的形式提供宏包选项,你可以在调用宏包
-% 的时候直接设置这些选项,也可以在调用宏包之后使用 \cs{xeCJKsetup} 来设置这些选
+% 的时候直接设置这些选项,也可以在调用宏包之后使用 \tn{xeCJKsetup} 来设置这些选
% 项。\pkg{xeCJK} 内部调用 \pkg{fontspec} 宏包,可以在调用 \pkg{xeCJK} 的时候,
% 使用它的宏包选项。\pkg{xeCJK} 会将 \pkg{fontspec} 的选项传递给它。
%
% \begin{function}{\xeCJKsetup}
% \begin{syntax}
-% \cs{xeCJKsetup} \{\meta{key_1}=\meta{var_1}, \meta{key_2}=\meta{var_2}, ...\}
+% \tn{xeCJKsetup} \{\meta{key_1}=\meta{var_1}, \meta{key_2}=\meta{var_2}, ...\}
% \end{syntax}
% 其中 \meta{key_1}, \meta{key_2} 是设置选项,而 \meta{val_1}, \meta{val_2} 则是对应选项的
% 设置内容。多个选项可以在一个语句中完成设置。例如
@@ -524,7 +514,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{function}
%
% 请注意,\pkg{xeCJK} 宏包中只有上述 |LocalConfig| 选项需要在调用 \pkg{xeCJK} 时
-% 设置,而不能通过 \cs{xeCJKsetup} 来设置。
+% 设置,而不能通过 \tn{xeCJKsetup} 来设置。
%
% \begin{function}{xeCJKactive}
% \begin{syntax}
@@ -547,12 +537,12 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{syntax}
% 是否支持在数学环境中直接输入 CJK 字符。使用这个选项后,可以直接在数学环境中
% 输出 CJK 字符。\pkg{url} 宏包将一个 URL 放在一个特殊的数学环境中排版,所以如果在
-% \cs{path} 等命令的路径参数中含有汉字,则需要启用这个选项,路径中的汉字才能显示。
+% \tn{path} 等命令的路径参数中含有汉字,则需要启用这个选项,路径中的汉字才能显示。
% \end{function}
%
% \begin{function}{CJKglue}
% \begin{syntax}
-% CJKglue = \{\cs{hskip} 0pt plus 0.08\cs{baselineskip}\}
+% CJKglue = \{\tn{hskip} 0pt plus 0.08\tn{baselineskip}\}
% \end{syntax}
% 设置 CJK 文字之间插入的 |glue|,上边是 \pkg{xeCJK} 的默认值。一般来说,除非有
% 特殊需要(例如,改变文字间距等),否则不需要设置这个选项,使用默认值即可。如果要设置
@@ -598,7 +588,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{function}[added=2012-12-04]{NewLineCS,NewLineCS+,NewLineCS-}
% \begin{syntax}
-% NewLineCS = \{ \cs{par} \cs{[} \}
+% NewLineCS = \{ \tn{par} |\[| \}
% \end{syntax}
% 设置造成断行的控制序列,以便 |CheckSingle| 选项能够正确识别。
% 以上是 \pkg{xeCJK} 的初始设置。
@@ -606,7 +596,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{function}[added=2012-12-04]{EnvCS,EnvCS+,EnvCS-}
% \begin{syntax}
-% EnvCS = \{ \cs{begin} \cs{end} \}
+% EnvCS = \{ \tn{begin} \tn{end} \}
% \end{syntax}
% 设置 \LaTeX 环境开始和结束的控制序列,以便 |CheckSingle| 选项能够正确识别。
% 以上是 \pkg{xeCJK} 的初始设置。
@@ -672,7 +662,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \item[CCT] CCT 格式:所有标点符号的宽度略小于一个汉字宽度;
% \item[plain] 原样(不调整标点间距)。
% \end{description}
-% 可以使用 \ref{subsec:punctstyle} 中介绍的 \cs{xeCJKDeclarePunctStyle} 定义新的标点
+% 可以使用 \ref{subsec:punctstyle} 中介绍的 \tn{xeCJKDeclarePunctStyle} 定义新的标点
% 格式。
% \end{function}
%
@@ -710,7 +700,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% 这里设置的 |length| 的单位最好用 |em| 等相对距离单位,而不建议使用诸如 |pt| 之类的
% 绝对距离单位。这里的设置可用于除了 |plain| 以外的所有标点处理格式。同时,这里的
% 设置对所有的 CJK 标点都生效,如果只要设置部分标点,请使用 \ref{subsec:punct}~节的
-% \cs{xeCJKsetwidth}。
+% \tn{xeCJKsetwidth}。
% \end{function}
%
% \begin{function}[EXP,added=2013-08-22]{PunctBoundWidth}
@@ -747,23 +737,23 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{function}[added=2012-12-02]{NoBreakCS,NoBreakCS+,NoBreakCS-}
% \begin{syntax}
-% NoBreakCS = \{ \cs{footnote} \cs{footnotemark} \cs{nobreak} \}
+% NoBreakCS = \{ \tn{footnote} \tn{footnotemark} \tn{nobreak} \}
% \end{syntax}
% 设置不能在全角右标点后断行的控制序列。以上是 \pkg{xeCJK} 的默认设置。如果这些
% 控制序列在文档中只出现少量几次,也可以不必使用 |CheckFullRight| 选项,而是手工
-% 在这些控制序列前面加上 \ref{subsec:others}~节介绍的 \cs{xeCJKnobreak}。
+% 在这些控制序列前面加上 \ref{subsec:others}~节介绍的 \tn{xeCJKnobreak}。
% \end{function}
%
% \begin{function}[updated=2013-11-16]{Verb}
% \begin{syntax}
% Verb = \meta{\TF\orvar\defaultvar{env}\orvar{}env+}
% \end{syntax}
-% \texttt{true} 表示在 \cs{verb} 命令或 \texttt{verbatim} 环境里不自动调整中英文
+% \texttt{true} 表示在 \tn{verb} 命令或 \texttt{verbatim} 环境里不自动调整中英文
% 之间的间距。\texttt{env} 选项在 \texttt{verbatim} 环境里自动计算中西文间距和中文
-% 之间的间距,以便于保持代码的对齐;\texttt{env} 选项不调整 \cs{verb} 里的间距,^^A
-% \texttt{env+} 选项还将正文里设置的间距应用到 \cs{verb} 里。^^A
-% 这个选项对使用到 \cs{verbatim@font} 命令的情形均有效,更一般的情况可以使用
-% \ref{subsec:others}~节介绍的 \cs{xeCJKVerbAddon}。\texttt{false} 表示不作任何
+% 之间的间距,以便于保持代码的对齐;\texttt{env} 选项不调整 \tn{verb} 里的间距,^^A
+% \texttt{env+} 选项还将正文里设置的间距应用到 \tn{verb} 里。^^A
+% 这个选项对使用到 \tn{verbatim@font} 命令的情形均有效,更一般的情况可以使用
+% \ref{subsec:others}~节介绍的 \tn{xeCJKVerbAddon}。\texttt{false} 表示不作任何
% 处理。以上选项的值除 \texttt{false} 外,都禁止在汉字之间和汉字与西文之间自动换行。
% \end{function}
%
@@ -780,9 +770,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{function}[EXP]{\setCJKmainfont}
% \begin{syntax}
-% \cs{setCJKmainfont} \oarg{font features} \Arg{font name}
+% \tn{setCJKmainfont} \oarg{font features} \Arg{font name}
% \end{syntax}
-% 设置正文罗马族的 CJK 字体,影响 \cs{rmfamily} 和 \cs{textrm} 的字体。后面两个
+% 设置正文罗马族的 CJK 字体,影响 \tn{rmfamily} 和 \tn{textrm} 的字体。后面两个
% 参数继承自 \pkg{fontspec} 宏包, \meta{font features} 表示字体属性选项,
% \meta{font name} 是字体名。字体名可以是字体族名,也可以是字体的文件名,查
% 找字体名见 \ref{subsubsec:fontsearch}~节;可用的字体属性选项参见
@@ -814,44 +804,44 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{function}[EXP]{\setCJKsansfont}
% \begin{syntax}
-% \cs{setCJKsansfont} \oarg{font features} \Arg{font name}
+% \tn{setCJKsansfont} \oarg{font features} \Arg{font name}
% \end{syntax}
-% 设置正文无衬线族的 CJK 字体,影响 \cs{sffamily} 和 \cs{textsf} 的字体。
+% 设置正文无衬线族的 CJK 字体,影响 \tn{sffamily} 和 \tn{textsf} 的字体。
% \end{function}
%
% \begin{function}[EXP]{\setCJKmonofont}
% \begin{syntax}
-% \cs{setCJKmonofont} \oarg{font features} \Arg{font name}
+% \tn{setCJKmonofont} \oarg{font features} \Arg{font name}
% \end{syntax}
-% 设置正文等宽族的 CJK 字体,影响 \cs{ttfamily} 和 \cs{texttt} 的字体。
+% 设置正文等宽族的 CJK 字体,影响 \tn{ttfamily} 和 \tn{texttt} 的字体。
% \end{function}
%
% \begin{function}[EXP]{\setCJKfamilyfont}
% \begin{syntax}
-% \cs{setCJKfamilyfont} \Arg{family} \oarg{font features} \Arg{font name}
+% \tn{setCJKfamilyfont} \Arg{family} \oarg{font features} \Arg{font name}
% \end{syntax}
% 声明新的 CJK 字体族 \meta{family} 并指定字体。
% \end{function}
%
% \begin{function}[updated=2012-10-27]{\CJKfamily}
% \begin{syntax}
-% \cs{CJKfamily} \Arg{family}
-% \cs{CJKfamily+} \Arg{family}
-% \cs{CJKfamily-} \Arg{family}
+% \tn{CJKfamily} \Arg{family}
+% \tn{CJKfamily}|+| \Arg{family}
+% \tn{CJKfamily}|-| \Arg{family}
% \end{syntax}
-% 用于在文档中切换 |CJK| 字体族,\meta{family} 必须预先声明。\cs{CJKfamily} 仅对
-% CJK 字符类有效,\cs{CJKfamily+} 对所有字符类均有效,\cs{CJKfamily-} 对非 CJK 字
-% 符类有效。当 \cs{CJKfamily+} 和 \cs{CJKfamily-} 的参数为空时,则使用当前的 |CJK| 字体族。
+% 用于在文档中切换 |CJK| 字体族,\meta{family} 必须预先声明。\tn{CJKfamily} 仅对
+% CJK 字符类有效,\tn{CJKfamily}|+| 对所有字符类均有效,\tn{CJKfamily}|-| 对非 CJK 字
+% 符类有效。当 \tn{CJKfamily}|+| 和 \tn{CJKfamily}|-| 的参数为空时,则使用当前的 |CJK| 字体族。
% \end{function}
%
% \begin{function}[EXP]{\newCJKfontfamily}
% \begin{syntax}
-% \cs{newCJKfontfamily} \oarg{family} \cs{\meta{font-switch}} \oarg{font features} \Arg{font name}
+% \tn{newCJKfontfamily} \oarg{family} \cs{\meta{font-switch}} \oarg{font features} \Arg{font name}
% \end{syntax}
% 声明新的 CJK 字体族 \meta{family} 并指定字体,并定义 \cs{\meta{font-switch}},在
% 文档中可以使用它来切换 CJK 字体族。可以不必指定 \meta{family},这时候 \meta{family}
-% 将等于 \meta{font-switch}。事实上,\cs{newCJKfontfamily} 是 \cs{setCJKfamilyfont} 和
-% \cs{CJKfamily} 的合并。例如
+% 将等于 \meta{font-switch}。事实上,\tn{newCJKfontfamily} 是 \tn{setCJKfamilyfont} 和
+% \tn{CJKfamily} 的合并。例如
% \begin{verbatim}
% \newCJKfontfamily[song]\songti{SimSun}
% \end{verbatim}
@@ -864,14 +854,14 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{function}{\CJKfontspec}
% \begin{syntax}
-% \cs{CJKfontspec} \oarg{font features} \Arg{font name}
+% \tn{CJKfontspec} \oarg{font features} \Arg{font name}
% \end{syntax}
% 在文档中随机定义新的 CJK 字体族,并马上使用它。
% \end{function}
%
% \begin{function}[rEXP]{\defaultCJKfontfeatures}
% \begin{syntax}
-% \cs{defaultCJKfontfeatures} \Arg{font features}
+% \tn{defaultCJKfontfeatures} \Arg{font features}
% \end{syntax}
% 全局设置 CJK 字体族的默认选项。例如,使用
% \begin{verbatim}
@@ -885,10 +875,10 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{function}[updated=2013-06-30]{\addCJKfontfeatures}
% \begin{syntax}
-% \cs{addCJKfontfeatures} \Arg{font features}
-% \cs{addCJKfontfeatures} * \Arg{font features}
-% \cs{addCJKfontfeatures} \oarg{block_1, block_2, ...} \Arg{font features}
-% \cs{addCJKfontfeatures} * \oarg{block_1, block_2, ...} \Arg{font features}
+% \tn{addCJKfontfeatures} \Arg{font features}
+% \tn{addCJKfontfeatures} * \Arg{font features}
+% \tn{addCJKfontfeatures} \oarg{block_1, block_2, ...} \Arg{font features}
+% \tn{addCJKfontfeatures} * \oarg{block_1, block_2, ...} \Arg{font features}
% \end{syntax}
% 临时增加当前使用的 CJK 字体的选项。第一条命令,仅对当前 CJK 主分区字体有效;
% 第二条对主分区和其它分区的字体都有效;第三条仅对可选参数中指定的分区有效;
@@ -900,24 +890,24 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{function}
%
% \begin{function}{\CJKrmdefault}
-% 保存 \cs{textrm} 和 \cs{rmfamily} 所使用的 CJK 字体族,默认值是 |rm|。
-% 类似西文字体的 \cs{rmdefault}。
+% 保存 \tn{textrm} 和 \tn{rmfamily} 所使用的 CJK 字体族,默认值是 |rm|。
+% 类似西文字体的 \tn{rmdefault}。
% \end{function}
%
% \begin{function}{\CJKsfdefault}
-% 保存 \cs{textsf} 和 \cs{sffamily} 所使用的 CJK 字体族,默认值是 |sf|。
-% 类似西文字体的 \cs{sfdefault}。
+% 保存 \tn{textsf} 和 \tn{sffamily} 所使用的 CJK 字体族,默认值是 |sf|。
+% 类似西文字体的 \tn{sfdefault}。
% \end{function}
%
% \begin{function}{\CJKttdefault}
-% 保存 \cs{texttt} 和 \cs{ttfamily} 所使用的 CJK 字体族,默认值是 |tt|。
-% 类似西文字体的 \cs{ttdefault}。
+% 保存 \tn{texttt} 和 \tn{ttfamily} 所使用的 CJK 字体族,默认值是 |tt|。
+% 类似西文字体的 \tn{ttdefault}。
% \end{function}
%
% \begin{function}[updated=2013-01-01]{\CJKfamilydefault}
-% 保存 \cs{textnormal} 和 \cs{normalfont} 所使用的 CJK 字体族。类似西文字体的 \cs{familydefault}。
-% 初始值是 \cs{CJKrmdefault}。如果没有在导言区中修改它,\pkg{xeCJK} 会在导言区
-% 结束的时候根据西文字体的情况自动更新 \cs{CJKfamilydefault}。因此,在导言区里使用
+% 保存 \tn{textnormal} 和 \tn{normalfont} 所使用的 CJK 字体族。类似西文字体的 \tn{familydefault}。
+% 初始值是 \tn{CJKrmdefault}。如果没有在导言区中修改它,\pkg{xeCJK} 会在导言区
+% 结束的时候根据西文字体的情况自动更新 \tn{CJKfamilydefault}。因此,在导言区里使用
% \begin{verbatim}
% \renewcommand\familydefault{\sfdefault}
% \end{verbatim}
@@ -926,16 +916,16 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{function}[EXP]{\setCJKmathfont}
% \begin{syntax}
-% \cs{setCJKmathfont} \oarg{font features} \Arg{font name}
+% \tn{setCJKmathfont} \oarg{font features} \Arg{font name}
% \end{syntax}
% 设置数学公式中的 CJK 字体族。如果使用了 |CJKmath| 选项,但是没有使用
-% \cs{setCJKmathfont} 设置数学公式中的 CJK 字体,那么将使用 \cs{CJKfamilydefault}
+% \tn{setCJKmathfont} 设置数学公式中的 CJK 字体,那么将使用 \tn{CJKfamilydefault}
% 作为数学公式中的 CJK 字体。
% \end{function}
%
% \begin{function}[EXP]{\setCJKfallbackfamilyfont}
% \begin{syntax}
-% \cs{setCJKfallbackfamilyfont} \Arg{family} \oarg{font features} \Arg{font name}
+% \tn{setCJKfallbackfamilyfont} \Arg{family} \oarg{font features} \Arg{font name}
% \end{syntax}
% 设置 CJK 字体族 \meta{family} 的备用字体。例如,使用
% \begin{verbatim}
@@ -966,14 +956,14 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{function}[EXP,updated=2013-06-30]{\setCJKfallbackfamilyfont}
% \begin{syntax}
-% \cs{setCJKfallbackfamilyfont} \Arg{family} \oarg{common font features}
+% \tn{setCJKfallbackfamilyfont} \Arg{family} \oarg{common font features}
% \ \{
% \ \{\oarg{font features_1} \Arg{font name_1}\} ,
% \ \{\oarg{font features_2} \Arg{font name_2}\} ,
% \ ......
% \ \}
% \end{syntax}
-% \cs{setCJKfallbackfamilyfont} 还可以用于设置多层的备用字体。例如,使用
+% \tn{setCJKfallbackfamilyfont} 还可以用于设置多层的备用字体。例如,使用
% \begin{verbatim}
% \setCJKmainfont[AutoFakeBold,AutoFakeSlant]{KaiTi_GB2312}
% \setCJKfallbackfamilyfont{\CJKrmdefault}[AutoFakeSlant]
@@ -982,7 +972,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{verbatim}
% 之后,就设置了 |SimSun| 是 |KaiTi_GB2312| 的备用字体,而 |SimSun-ExtB| 是
% |SimSun| 的备用字体。若当前字体族缺字,并没有备用字体,则尝试使用
-% \cs{CJKfamilydefault} 的备用字体。
+% \tn{CJKfamilydefault} 的备用字体。
% \end{function}
%
% \subsubsection{\XeTeX 的字体名查找}
@@ -1068,8 +1058,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{function}[EXP]{\xeCJKDeclareSubCJKBlock}
% \begin{syntax}
-% \cs{xeCJKDeclareSubCJKBlock} \Arg{block} \Arg{block range}
-% \cs{xeCJKDeclareSubCJKBlock*} \Arg{block} \Arg{block range}
+% \tn{xeCJKDeclareSubCJKBlock} \Arg{block} \Arg{block range}
+% \tn{xeCJKDeclareSubCJKBlock}|*| \Arg{block} \Arg{block range}
% \end{syntax}
% 其中 \meta{block range} 是逗号列表,可以是 CJK 字符的 |Unicode| 范围,也可以是单个字符
% 的 |Unicode|。例如\strut
@@ -1096,24 +1086,24 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% 设置文档的主字体是 |SimSun|,|SPUA| 分区的字体是 |SunmanPUA|,而 |Ext-B| 分区
% 的字体是 |SimSun-ExtB|。
%
-% \cs{xeCJKDeclareSubCJKBlock} 应该在声明所有的 CJK 字体族之前使用。如果有某个 CJK 字
-% 体族没有设置 \meta{block} 选项,将使用 \cs{CJKfamilydefault} 的 \meta{block} 选项
+% \tn{xeCJKDeclareSubCJKBlock} 应该在声明所有的 CJK 字体族之前使用。如果有某个 CJK 字
+% 体族没有设置 \meta{block} 选项,将使用 \tn{CJKfamilydefault} 的 \meta{block} 选项
% 作为该 CJK 字体族的 \meta{block} 选项。如果希望在使用某 CJK 字体族时,不在 CJK 主
% 分区与 \meta{block} 之间切换字体,可以使用 \meta{block}|=*| 选项。带星号的命令除了
% 设置 CJK 子分区以外,还重置标点符号所属的字符类。
%
% \begin{function}{\xeCJKCancelSubCJKBlock}
% \begin{syntax}
-% \cs{xeCJKCancelSubCJKBlock} \Arg{block_1, block_2, ...}
-% \cs{xeCJKCancelSubCJKBlock*} \Arg{block_1, block_2, ...}
+% \tn{xeCJKCancelSubCJKBlock} \Arg{block_1, block_2, ...}
+% \tn{xeCJKCancelSubCJKBlock} \Arg{block_1, block_2, ...}
% \end{syntax}
% 在文档中取消对 |CJK| 分区的声明。带星号的命令还重置标点符号所属的字符类。
% \end{function}
%
% \begin{function}{\xeCJKRestoreSubCJKBlock}
% \begin{syntax}
-% \cs{xeCJKRestoreSubCJKBlock} \Arg{block_1, block_2, ...}
-% \cs{xeCJKRestoreSubCJKBlock*} \Arg{block_1, block_2, ...}
+% \tn{xeCJKRestoreSubCJKBlock} \Arg{block_1, block_2, ...}
+% \tn{xeCJKRestoreSubCJKBlock}|*| \Arg{block_1, block_2, ...}
% \end{syntax}
% 在文档中恢复对 |CJK| 分区的声明。带星号的命令还重置标点符号所属的字符类。
% \end{function}
@@ -1122,8 +1112,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{function}[EXP]{\xeCJKDeclareCharClass}
% \begin{syntax}
-% \cs{xeCJKDeclareCharClass} \Arg{class} \Arg{class range}
-% \cs{xeCJKDeclareCharClass*} \Arg{class} \Arg{class range}
+% \tn{xeCJKDeclareCharClass} \Arg{class} \Arg{class range}
+% \tn{xeCJKDeclareCharClass}|*| \Arg{class} \Arg{class range}
% \end{syntax}
% \meta{class range} 的格式和 \ref{subsec:block} 节的 \meta{block range} 相同。
% \meta{class} 的有效值见源代码(第 \ref{sec:xeCJK-class-set} 节)。\pkg{xeCJK} 已
@@ -1141,7 +1131,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{function}{\normalspacedchars}
% \begin{syntax}
-% \cs{normalspacedchars} \Arg{char list}
+% \tn{normalspacedchars} \Arg{char list}
% \end{syntax}
% 在 \meta{char list} 中出现的字符两端不自动添加空格,初始设置是 |/|。
% \end{function}
@@ -1161,8 +1151,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{function}[EXP,updated=2013-08-22]{\xeCJKsetwidth}
% \begin{syntax}
-% \cs{xeCJKsetwidth} \Arg{标点列表} \Arg{length}
-% \cs{xeCJKsetwidth*} \Arg{标点列表} \Arg{length}
+% \tn{xeCJKsetwidth} \Arg{标点列表} \Arg{length}
+% \tn{xeCJKsetwidth}|*| \Arg{标点列表} \Arg{length}
% \end{syntax}
% \meta{标点列表}可以是单个标点,也可以是多个标点。例如,
% \begin{verbatim}
@@ -1174,7 +1164,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{function}[EXP]{\xeCJKsetkern}
% \begin{syntax}
-% \cs{xeCJKsetkern} \Arg{前标点} \Arg{后标点} \Arg{length}
+% \tn{xeCJKsetkern} \Arg{前标点} \Arg{后标点} \Arg{length}
% \end{syntax}
% \pkg{xeCJK} 会根据选定的标点处理格式自动调整相邻的前后两个 |CJK| 标点符号的
% 空白宽度。如果需要对个别情况进行特殊调整,可以使用这个命令。例如,
@@ -1189,14 +1179,14 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{function}[EXP,updated=2013-08-22]{\xeCJKDeclarePunctStyle}
% \begin{syntax}
-% \cs{xeCJKDeclarePunctStyle} \Arg{style} \Arg{options}
+% \tn{xeCJKDeclarePunctStyle} \Arg{style} \Arg{options}
% \end{syntax}
% 定义新的标点符号处理格式,已经存在的同名格式将被覆盖。可以设置的选项将在下面介绍。
% \end{function}
%
% \begin{function}[EXP,updated=2013-08-22]{\xeCJKEditPunctStyle}
% \begin{syntax}
-% \cs{xeCJKEditPunctStyle} \Arg{style} \Arg{options}
+% \tn{xeCJKEditPunctStyle} \Arg{style} \Arg{options}
% \end{syntax}
% 修改已有的标点符号处理格式。\strut
% \end{function}
@@ -1204,27 +1194,27 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% 下面是可以设置的标点符号格式选项。其中左边一栏是选项名称,中间是选项的输入值类
% 型,右边则是相关说明。某些选项之间是互斥的,具有优先级关系。要使下一级的选项有
% 效,则需要先禁用上一级的设置:对于 \meta{boolean} 类型的选项,将其设置为 |false|,
-% 对于 \meta{length} 类型的选项,将其设置为 \cs{maxdimen},而对于 \meta{real} 类型
+% 对于 \meta{length} 类型的选项,将其设置为 \tn{maxdimen},而对于 \meta{real} 类型
% 的选项,将其设置为 |nan|。
%
% \begin{optiondesc}
% \PSKeyVal{enabled-global-setting}{boolean}
-% 是否使用 \cs{xeCJKsetup} 的 |PunctWidth|、|PunctBoundWidth| 选项和
-% \cs{xeCJKsetwidth}、\cs{xeCJKsetkern} 的设置。默认值是 |true|。
+% 是否使用 \tn{xeCJKsetup} 的 |PunctWidth|、|PunctBoundWidth| 选项和
+% \tn{xeCJKsetwidth}、\tn{xeCJKsetkern} 的设置。默认值是 |true|。
% \end{optiondesc}
%
% \begin{optiondesc}
% \PSKeyVal{fixed-punct-width}{length}
-% 设置单个标点符号的宽度。默认值是 \cs{maxdimen}。
+% 设置单个标点符号的宽度。默认值是 \tn{maxdimen}。
% \PSKeyVal{fixed-punct-ratio}{real}
% 设置单个标点符号的输出宽度与实际宽度的比例。默认值是 |1.0|。
% \PSKeyVal{mixed-punct-width}{length}
-% 设置句末标点符号的宽度。其中句末标点符号通过 \cs{xeCJKsetup} 的 |KaiMingPunct|
+% 设置句末标点符号的宽度。其中句末标点符号通过 \tn{xeCJKsetup} 的 |KaiMingPunct|
% 来设置。默认值是与 |fixed-punct-width| 选项的值相同。
% \PSKeyVal{mixed-punct-width}{real}
% 设置句末标点符号的宽度比例。默认值是与 |fixed-punct-ratio| 选项的值相同。
% \PSKeyVal{middle-punct-width}{length}
-% 设置居中标点符号的宽度。其中居中标点符号通过 \cs{xeCJKsetup} 的 |MiddlePunct|
+% 设置居中标点符号的宽度。其中居中标点符号通过 \tn{xeCJKsetup} 的 |MiddlePunct|
% 来设置。默认值是与 |fixed-punct-width| 选项的值相同。
% \PSKeyVal{middle-punct-width}{real}
% 设置居中标点符号的宽度比例。默认值是与 |fixed-punct-ratio| 选项的值相同。
@@ -1236,7 +1226,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{optiondesc}
% \PSKeyVal{fixed-margin-width}{length}
-% 设置标点的左/右空白宽度。默认值是 \cs{maxdimen}。
+% 设置标点的左/右空白宽度。默认值是 \tn{maxdimen}。
% \PSKeyVal{fixed-margin-ratio}{real}
% 设置标点的左/右空白宽度与字体中该标点的相应实际边界宽度的比例。默认值是~|1.0|。
% \PSKeyVal{mixed-margin-width}{length}
@@ -1254,11 +1244,11 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{optiondesc}
% \PSKeyVal{bound-punct-width}{length}
-% 设置标点符号出现在行首/尾时的宽度。默认值是 \cs{maxdimen}。
+% 设置标点符号出现在行首/尾时的宽度。默认值是 \tn{maxdimen}。
% \PSKeyVal{bound-punct-ratio}{real}
% 设置标点符号出现在行首/尾时的输出宽度与实际宽度的比例。默认值是 |nan|。
% \PSKeyVal{bound-margin-width}{length}
-% 设置标点符号出现在行首/尾时的左/右空白宽度。默认值是 \cs{maxdimen}。
+% 设置标点符号出现在行首/尾时的左/右空白宽度。默认值是 \tn{maxdimen}。
% \PSKeyVal{bound-margin-ratio}{real}
% 设置标点符号出现在行首/尾时的左/右空白宽度与相应实际边界宽度的比例。默认值是 |0|。
% \PSKeyVal{enabled-hanging}{boolean}
@@ -1298,19 +1288,19 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% 中的最大值作为两个标点之间的空白宽度。默认值是 |false|。
% \PSKeyVal{kerning-total-width}{length}
% 设置两个标点的总共宽度。此时 \pkg{xeCJK} 会自动计算两个标点之间的空白宽度。
-% 默认值是 \cs{maxdimen}。
+% 默认值是 \tn{maxdimen}。
% \PSKeyVal{kerning-total-ratio}{real}
% 设置两个标点的总共输出宽度与实际宽度的比例。默认值是 |0.75|。
% \PSKeyVal{same-align-margin}{length}
-% 前后两个标点位于同侧时,它们之间的空白宽度。默认值是 \cs{maxdimen}。
+% 前后两个标点位于同侧时,它们之间的空白宽度。默认值是 \tn{maxdimen}。
% \PSKeyVal{same-align-ratio}{real}
% 前后两个标点位于同侧时,它们之间的空白宽度与实际输出宽度的比例。默认值是~|nan|。
% \PSKeyVal{different-align-margin}{length}
-% 前后两个标点位于异侧时,它们之间的空白宽度。默认值是 \cs{maxdimen}。
+% 前后两个标点位于异侧时,它们之间的空白宽度。默认值是 \tn{maxdimen}。
% \PSKeyVal{different-align-ratio}{real}
% 前后两个标点位于异侧时,它们之间的空白宽度与实际输出宽度的比例。默认值是~|nan|。
% \PSKeyVal{kerning-margin-width}{length}
-% 设置前后两个标点之间的空白宽度。默认值是 \cs{maxdimen}。
+% 设置前后两个标点之间的空白宽度。默认值是 \tn{maxdimen}。
% \PSKeyVal{kerning-margin-ratio}{real}
% 设置前后两个标点之间的空白宽度与实际输出空白的比例。默认值是 |1.0|。
% \end{optiondesc}
@@ -1357,7 +1347,208 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{verbatim}
% \xeCJKEditPunctStyle { hangmobanjiao } { enabled-global-setting = false }
% \end{verbatim}
-% 将使得 \cs{xeCJKsetkern} 等的设置对 |hangmobanjiao| 这一格式无效。
+% 将使得 \tn{xeCJKsetkern} 等的设置对 |hangmobanjiao| 这一格式无效。
+%
+% \subsection{\pkg{xeCJKfntef} 用法说明}
+%
+% \pkg{xeCJK} 包含有一个子宏包 \pkg{xeCJKfntef},可以用它来实现\CJKunderdot{汉字加点}%
+% 和可断行的下划线等。它是 \pkg{CJKfntef} 宏包在 \XeLaTeX 下的替换版本,基本用法完全一致。
+%
+% \pkg{xeCJKfntef} 基于 \package{ulem} 宏包,除了兼容 \pkg{ulem} 定义的一些命令外,
+% 还进行了一些扩充:
+%
+% \begin{function}[updated=2014-11-04]
+% {\CJKunderline,\CJKunderdblline,\CJKunderwave,\CJKsout,\CJKxout}
+% \begin{syntax}
+% \tn{CJKunderline} [*] [-] \oarg{选项} \Arg{内容}
+% \end{syntax}
+% \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.35\linewidth,gobble=6]
+% \CJKunderline{虚室生白,吉祥止止}\\
+% \CJKunderdblline{虚室生白,吉祥止止}\\
+% \CJKunderwave{虚室生白,吉祥止止}\\
+% \CJKsout{虚室生白,吉祥止止}\\
+% \CJKxout{虚室生白,吉祥止止}
+% \end{SideBySideExample}
+% \end{function}
+%
+% \csappto{NoHighlight@Attributes}{\catcode37=14\relax}
+%
+% \begin{Example}[frame=single,numbers=left,gobble=4]
+% \CJKsout*{瞻彼阕者,虚室生白,吉祥止止}\\
+% \CJKunderline-{南朝}\CJKunderline-{梁}\CJKunderline-{劉勰}%
+% \CJKunderwave-{文心雕龍}\CJKunderwave-{養氣}
+% \end{Example}
+%
+% \begin{function}[updated=2014-11-04]{\CJKunderdot}
+% \begin{syntax}
+% \tn{CJKunderdot} \oarg{选项} \Arg{内容}
+% \end{syntax}
+% 在汉字下加点,可以和上述下划线命令嵌套使用。例如\smallskip
+%
+% \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.35\linewidth,gobble=6]
+% \CJKunderline{虚室生白,\CJKunderdot{吉祥}止止}\\
+% \CJKunderdot{虚室生白,\CJKunderline{吉祥}止止}
+% \end{SideBySideExample}
+% \end{function}
+%
+% \medskip
+%
+% 对上述六种对象,\pkg{xeCJKfntef} 提供了一些选项,设置点或线的位置和颜色。可以用
+% \tn{xeCJKsetup} 预先统一设置它们,也可以在使用时特别设置。
+%
+% \begin{function}[added=2014-11-04]{skip}
+% \begin{syntax}
+% \tn{xeCJKsetup} \{ underline/skip = \meta{\TTF} \}
+% \tn{xeCJKsetup} \{ underline = \{ skip = \meta{\TTF} , ... \} \}
+% \end{syntax}
+% 默认情况下,下划线会自动跳过中文标点符号,可以设置本选项为 \texttt{false},
+% 禁用这一功能。相应下划线命令后加上 |*| 号,具有相同的效果。
+% \end{function}
+%
+% \begin{function}{subtract}
+% 设置本选项为 \texttt{true},使得下划线的首尾减少一定距离,避免前后的下划线
+% 连在一起,适用于古籍标点整理中的专名号和书名号。在相应下划线命令后加上 |-|
+% 号,具有相同的效果。
+% \end{function}
+%
+% \begin{function}{format}
+% \begin{syntax}
+% \tn{xeCJKsetup} \{ underline/format = \tn{color}\{red\} \}
+% \tn{xeCJKsetup} \{ underwave = \{ format = \tn{color}\{red\}, ... \} \}
+% \end{syntax}
+% 设置线或点的格式,比如颜色。
+% \end{function}
+%
+% \begin{function}{symbol}
+% 设置 \tn{CJKunderwave} 或 \tn{CJKunderdot} 的符号。
+% \end{function}
+%
+% \smallskip
+%
+% 例如,波浪线 \tn{CJKunderwave} 的符号不会随字号而变化,在小字号下不好看。我们可以
+% 将它改为随字号而变化大小:
+%
+% \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.35\linewidth,gobble=4]
+% % \usepackage{fix-cm}
+% \xeCJKsetup{%
+% underwave/symbol=
+% \fontsize{0.5em}{0pt}%
+% \fontencoding{U}\fontfamily{lasy}\selectfont
+% \char 58\relax}
+% \footnotesize
+% \CJKunderwave{瞻彼阕者,虚室生白,吉祥止止}
+% \end{SideBySideExample}
+%
+% \begin{function}{thickness}
+% 设置 \tn{CJKunderline}、\tn{CJKunderdblline} 和 \tn{CJKsout} 的线的厚度。
+% 初始值是 \tn{ULthickness}。
+% \end{function}
+%
+% \begin{function}{depth}
+% 设置线或点的深度(基线到线或点的顶部的距离)。初始值都是 \texttt{0.2em}。
+% \end{function}
+%
+% \begin{function}{boxdepth}
+% \tn{CJKunderdot} 可能会影响到行距,可以设置本选项进行调整。如果不希望
+% \tn{CJKunderdot} 影响行距,可以将本选项设置为 \texttt{0pt}。
+% \end{function}
+%
+% \begin{function}{sep}
+% 设置 \tn{CJKunderdot} 与 \tn{CJKunderline}、\tn{CJKunderdblline} 或
+% \tn{CJKunderwave} 嵌套使用时,点与线或者线与点的距离。
+% \end{function}
+%
+% \begin{function}{gap}
+% 设置 \tn{CJKunderdblline} 的两条线之间的距离。初始值是 \texttt{1.1pt}。
+% \end{function}
+%
+% \begin{function}{height}
+% 设置删除线 \tn{CJKsout} 的高度(线的中心到基线的距离)。初始值是 \texttt{0.35em}。
+% \end{function}
+%
+% \smallskip
+%
+% 例如,我们可以设置 \tn{CJKsout} 的厚度和颜色,让它具有类似高亮的效果:
+%
+% \begin{Example}[frame=single,numbers=left,gobble=4]
+% \CJKsout*[thickness=2.5ex, format=\color{yellow}]{瞻彼阕者,虚室生白,吉祥止止}
+% \end{Example}
+%
+% \medskip
+%
+% \pkg{xeCJKfntef} 还提供给了自定义下划线和符号的 \tn{CJKunderanyline} 和
+% \tn{CJKunderanysymbol}。
+%
+% \begin{function}[updated=2014-11-04]{\CJKunderanyline}
+% \begin{syntax}
+% \tn{CJKunderanyline} [*] [-] \Arg{深度} \Arg{下划内容} \Arg{文本内容}
+% \end{syntax}
+% \pkg{xeCJKfntef} 先将 \meta{下划内容} 放进一个盒子(\tn{xeCJKfntefbox})里,然后
+% 向下移动 \meta{深度} 给定的距离,再用于填充。
+% \end{function}
+%
+% \smallskip
+%
+% 例如,高亮效果也可以如下实现:
+%
+% \begin{Example}[frame=single,numbers=left,gobble=4]
+% \CJKunderanyline*{0.5ex}{\color{yellow}\rule{2pt}{2.5ex}}{虚室生白,吉祥止止}
+% \end{Example}
+%
+% \begin{function}[updated=2014-11-04]{\CJKunderanysymbol}
+% \begin{syntax}
+% \tn{CJKunderanysymbol} \oarg{选项} \Arg{深度} \Arg{符号} \Arg{文本内容}
+% \end{syntax}
+% \pkg{xeCJKfntef} 将 \meta{符号} 放进一个盒子(\tn{xeCJKfntefbox})里。
+% \meta{深度} 参数用于设置盒子顶部的深度(基线到盒子顶部的距离)。
+% 可用的 \meta{选项} 是 \texttt{sep} 和 \texttt{boxdepth},意义与
+% \tn{CJKunderdot} 的相同。
+% \end{function}
+%
+% \smallskip
+%
+% 例如,给汉字加三角形,可以如下设置:
+%
+% \begin{Example}[frame=single,numbers=left,gobble=4]
+% \CJKunderanysymbol[sep=0.1em]{0.2em}{\tiny$\triangle$}
+% {瞻彼阕者,虚室生白,\CJKunderline{吉祥止止}}
+% \end{Example}
+%
+% \begin{function}[added=2014-11-04]{\xeCJKfntefon}
+% 功能与用法 \pkg{ulem} 宏包的 \tn{ULon} 相同,扩展了可选参数符号 |*| 和 |-|,分别
+% 用于设置下划线不跳过下划线和下划线首尾缩小一定距离。
+% \end{function}
+%
+% 此外,\pkg{xeCJKfntef} 还提供了指定宽度,让汉字分散对齐的的环境
+% \env{CJKfilltwosides} 和 \env{CJKfilltwosides*}。
+%
+% \begin{function}[updated=2014-11-04]{CJKfilltwosides}
+% \begin{syntax}
+% \tn{begin}\{CJKfilltwosides\} \oarg{位置} \Arg{宽度}
+% 文本内容|\\|
+% 文本内容
+% \tn{end}\{CJKfilltwosides\}
+% \end{syntax}
+% 环境中的内容被放入垂直盒子中,可选参数 \oarg{位置} 指定盒子的基线位置。
+% 可以使用 \texttt{t}(顶部)、\texttt{c}(居中)和 \texttt{b}(底部),默认是 \texttt{c}。
+% \meta{宽度} 参数指定盒子的宽度。
+% \env{CJKfilltwosides*} 环境与 \env{CJKfilltwosides} 的区别是,当 \meta{宽度}
+% 不大于零或者不大于盒子的自然宽度时,就取盒子的自然宽度。例如
+% \end{function}
+%
+% \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.5\linewidth,gobble=4]
+% \begin{CJKfilltwosides}{.8\linewidth}
+% 瞻彼阕者,\\
+% 虚室生白,吉祥止止
+% \end{CJKfilltwosides}
+% \end{SideBySideExample}
+%
+% \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.5\linewidth,gobble=4]
+% \begin{CJKfilltwosides*}{0pt}
+% 瞻彼阕者,\\
+% 虚室生白,吉祥止止
+% \end{CJKfilltwosides*}
+% \end{SideBySideExample}
%
% \subsection{其它}
% \label{subsec:others}
@@ -1365,77 +1556,73 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{function}[updated=2013-11-16]{\xeCJKVerbAddon,\xeCJKOffVerbAddon}
% 调整文字间距以便于让 CJK 字符占的宽度等于西文等宽字体中两个空格的宽度。如果这两
% 个空格的宽度小于当前 CJK 正常文字的宽度,将对 CJK 字体进行适当地缩小。这有利于
-% 等宽字体的代码对齐等情形。需要注意的是,\cs{xeCJKVerbAddon} 对 \pkg{xeCJK} 的内
+% 等宽字体的代码对齐等情形。需要注意的是,\tn{xeCJKVerbAddon} 对 \pkg{xeCJK} 的内
% 部进行了比较大的修改,使用它之后,将禁止在 CJK 字符类之间自动换行,这与西文在
% 抄录环境中的情况是一致的。所以不应该单独使用,应该放在分组里限制其作用域,否则
% 是无效的。当然它可以和其它关于代码抄录的宏包配合使用。例如,可以使用于
% \package{fancyvrb} 宏包的 \texttt{formatcom} 选项。此时设置的西文字体应该确实
% 是等宽的以保证对齐。若西文等宽字体发生变动(包括字体大小),则需要在其后面使用
-% \cs{xeCJKVerbAddon},重新计算间距的宽度。\cs{xeCJKOffVerbAddon}
-% 用于在使用 \cs{xeCJKVerbAddon} 的环境中局部取消它的作用。由于 \package{listings}
-% 宏包有自己的代码对齐机制,所以 \cs{xeCJKVerbAddon} 在由 \pkg{listings} 定义的
+% \tn{xeCJKVerbAddon},重新计算间距的宽度。\tn{xeCJKOffVerbAddon}
+% 用于在使用 \tn{xeCJKVerbAddon} 的环境中局部取消它的作用。由于 \package{listings}
+% 宏包有自己的代码对齐机制,所以 \tn{xeCJKVerbAddon} 在由 \pkg{listings} 定义的
% 代码环境中无效。
% \end{function}
%
% \begin{function}[added=2012-12-03]{\xeCJKnobreak}
% \begin{syntax}
-% ……汉字。\cs{xeCJKnobreak}\cs{footnote}\{脚注\}
+% ……汉字。\tn{xeCJKnobreak}\tn{footnote}\{脚注\}
% \end{syntax}
-% \cs{xeCJKnobreak} 用在全角标点符号后面,目的是确保不能在此处断行。如果已经启用了
+% \tn{xeCJKnobreak} 用在全角标点符号后面,目的是确保不能在此处断行。如果已经启用了
% 前面介绍的 |CheckFullRight| 选项,则不需要再用此命令。
% \end{function}
%
% \begin{function}[added=2013-11-09]{\xeCJKShipoutHook}
% \pkg{xeCJK} 在正文中的一些特殊设置(汉字下加点、在 \env{verbatim} 或
% \env{lstlisting} 环境中分页)可能会影响到 \TeX 的输出例行程序(output routine)
-% 中的内容(比如页眉和页脚)。\cs{xeCJKShipoutHook} 用于恢复正文中的普通设置。
+% 中的内容(比如页眉和页脚)。\tn{xeCJKShipoutHook} 用于恢复正文中的普通设置。
% \pkg{xeCJK} 已经处理了页眉和页脚的情况,其它的就需要根据情况自行调用。
% 比如若使用 \pkg{eso-pic} 或者 \pkg{atbegshi} 实现文字水印,并且正文中使用了
-% 以上所列的特殊形式,就需要在命令 \cs{AtBeginShipout} 的参数的最前面使用
-% \cs{xeCJKShipoutHook}。
+% 以上所列的特殊形式,就需要在命令 \tn{AtBeginShipout} 的参数的最前面使用
+% \tn{xeCJKShipoutHook}。
% \end{function}
%
% \section{已知问题和兼容性}
%
-% \XeTeX 在配置文件 \file{unicode-letters.tex} 中将所有 CJK 表意文字的 \cs{catcode}
+% \XeTeX 在配置文件 \file{unicode-letters.tex} 中将所有 CJK 表意文字的 \tn{catcode}
% 设置为 $11$。因此汉字可以直接用作控制序列的名字,但是当汉字出现在控制序列后面的
% 时候,要用空格分隔开,否则就会出现“\texttt{! Undefined control sequence.}”的错误。
%
-% \pkg{xeCJK} 使用并重新定义了 \pkg{CJK} 宏包的部分宏命令,如 \cs{CJKfamily}、
-% \cs{CJKsymbol} 和 \cs{CJKglue} 等。需要指出,\pkg{xeCJK} 不需要 \pkg{CJK}
+% \pkg{xeCJK} 使用并重新定义了 \pkg{CJK} 宏包的部分宏命令,如 \tn{CJKfamily}、
+% \tn{CJKsymbol} 和 \tn{CJKglue} 等。需要指出,\pkg{xeCJK} 不需要 \pkg{CJK}
% 的支持,并且 \pkg{xeCJK} 自动禁止在它之后载入 \pkg{CJK} 宏包。
-% 可以在 \pkg{xeCJK} 之\emph{后}载入 \pkg{CJKnumb} 宏包,实现数字的中文化。
-%
-% \CJKunderline{\pkg{xeCJK} 包含有一个子宏包 \pkg{xeCJKfntef},可以用它来实现%
-% \CJKunderdot{汉字加点}和可断行的下划线等。它是 \pkg{CJKfntef} 宏包在 \XeLaTeX
-% 下的替换版本,基本用法完全一致,在 \pkg{CJKfntef} 的源文件\ \file{CJKfntef.sty}
-% 的注解部分里有说明。}
+% 可以在 \pkg{xeCJK} 之\emph{后}载入 \pkg{CJKnumb} 宏包,实现数字的中文化,
+% 也可以用功能更完善的 \package{zhnumber} 宏包。
%
% \pkg{xeCJK} 进行了一些处理,使得在使用 \XeTeX 时 \package{listings} 宏包可以
% 支持 Unicode,因此在 \texttt{listings} 定义的代码环境中可以直接使用中文,不再
% 需要通过 \texttt{escapechar}。
%
% 新版本(\texttt{3.x})的 \pkg{xeCJK} 完全使用 \hologo{LaTeX3} 的语法来编写。
-% \hologo{LaTeX3} 放弃了 \cs{outer} 宏的概念,因此相关工具在
-% 遇到 \cs{outer} 宏时可能会存在问题。按照目前 \pkg{xeCJK} 的实现方式,在 CJK 文字
-% 后面遇到 \cs{outer} 宏时会出现类似
+% \hologo{LaTeX3} 放弃了 \tn{outer} 宏的概念,因此相关工具在
+% 遇到 \tn{outer} 宏时可能会存在问题。按照目前 \pkg{xeCJK} 的实现方式,在 CJK 文字
+% 后面遇到 \tn{outer} 宏时会出现类似
% \begin{verbatim}
% ! Forbidden control sequence found while scanning use of \use_i:nn
% \end{verbatim}
-% 的错误。目前已知的有 \package{cprotect} 宏包提供的 \cs{cprotect}。它的定义是
+% 的错误。目前已知的有 \package{cprotect} 宏包提供的 \tn{cprotect}。它的定义是
% \begin{verbatim}
% \outer\long\def\cprotect{\icprotect}
% \end{verbatim}
-% 因此,这时可以暂时用 \cs{icprotect} 代替 \cs{cprotect}。事实上,当 \pkg{cprotect}
+% 因此,这时可以暂时用 \tn{icprotect} 代替 \tn{cprotect}。事实上,当 \pkg{cprotect}
% 被引入时,\pkg{xeCJK} 将使用
% \begin{verbatim}
% \let\cprotect\icprotect
% \end{verbatim}
-% 来取消 \cs{cprotect} 的外部宏限制。但由于 \cs{cprotect} 的特殊性,应该只在外部
-% 使用它,即不要让它出现在任何宏的参数中。其它 \cs{outer} 宏的情况,可以在它前面
-% 加上 \cs{relax} 来回避上面的错误。
+% 来取消 \tn{cprotect} 的外部宏限制。但由于 \tn{cprotect} 的特殊性,应该只在外部
+% 使用它,即不要让它出现在任何宏的参数中。其它 \tn{outer} 宏的情况,可以在它前面
+% 加上 \tn{relax} 来回避上面的错误。
%
-% \pkg{xeCJK} 依赖 \XeTeX 的 \cs{XeTeXinterchartoks} 机制,与使用相同机制的宏包(例如
+% \pkg{xeCJK} 依赖 \XeTeX 的 \tn{XeTeXinterchartoks} 机制,与使用相同机制的宏包(例如
% \pkg{polyglossia})可能会存在大小不一的冲突。\pkg{xeCJK} 虽然为此作了一些处理,但与
% 它们共同使用时应该小心。
%
@@ -1481,7 +1668,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
using~your~TeX~package~manager~or~from~CTAN.\\
\str_if_eq:nnT {#1} { expl3 } { Loading~xeCJK~will~abort! }
}
-\@ifpackagelater { expl3 } { 2014/05/06 } { }
+\@ifpackagelater { expl3 } { 2014/07/20 } { }
{ \msg_critical:nnn { xeCJK } { l3-too-old } { expl3 } }
% \end{macrocode}
%
@@ -1522,7 +1709,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
}
% \end{macrocode}
%
-% 以下日期以前的 \pkg{xtemplate} 宏包关于 \cs{KeyValue} 的 Bug 会影响到后面
+% 以下日期以前的 \pkg{xtemplate} 宏包关于 \tn{KeyValue} 的 Bug 会影响到后面
% 标点符号的处理。
% \begin{macrocode}
\RequirePackage { xtemplate }
@@ -1576,7 +1763,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{macro}[internal]
% {\@@_at_end_preamble:n,\@@_after_preamble:n,\@@_after_end_preamble:n}
-% 在 \cs{document} 前后加上各种钩子。
+% 在 \tn{document} 前后加上各种钩子。
% \begin{macrocode}
\tl_new:N \g_@@_at_end_preamble_hook_tl
\tl_new:N \g_@@_after_preamble_hook_tl
@@ -1609,11 +1796,11 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macrocode}
% \end{macro}
%
-% \changes{v3.2.7}{2013/11/09}{使用 \pkg{everypage} 往 \cs{shipout} 盒子里加钩子。}
+% \changes{v3.2.7}{2013/11/09}{使用 \pkg{everypage} 往 \tn{shipout} 盒子里加钩子。}
%
% \begin{macro}{\xeCJKShipoutHook}
-% 在 \cs{shipout} 盒子里加钩子,可以影响到页眉页脚。\cs{AtBeginDvi} 将参数保存在
-% 盒子中,而 \pkg{atbegshi} 的 \cs{AtBeginShipout} 在 \cs{shipout} 盒子构建好之后
+% 在 \tn{shipout} 盒子里加钩子,可以影响到页眉页脚。\tn{AtBeginDvi} 将参数保存在
+% 盒子中,而 \pkg{atbegshi} 的 \tn{AtBeginShipout} 在 \tn{shipout} 盒子构建好之后
% 才起作用,所以它们都影响不到页眉页脚。
% \begin{macrocode}
\AddEverypageHook { \xeCJKShipoutHook }
@@ -1630,7 +1817,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{macro}[internal]{\xeCJK_add_to_shipout:n}
% \changes{v3.2.11}{2014/03/14}{不再使用内部名字。}
-% 往 \cs{shipout} 盒子中加入钩子。
+% 往 \tn{shipout} 盒子中加入钩子。
% \begin{macrocode}
\cs_new_protected:Npn \xeCJK_add_to_shipout:n #1
{ \tl_put_right:Nn \l_@@_shipout_hook_tl {#1} }
@@ -1718,8 +1905,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal,var]{\c_xeCJK_space_skip_tl}
-% \changes{v3.1.0}{2012/11/18}{字间空格考虑 \cs{spaceskip} 不为零的情况。}
-% \changes{v3.2.0}{2013/05/22}{字间空格考虑到 \cs{spacefactor} 和 \cs{xspaceskip} 的情况。}
+% \changes{v3.1.0}{2012/11/18}{字间空格考虑 \tn{spaceskip} 不为零的情况。}
+% \changes{v3.2.0}{2013/05/22}{字间空格考虑到 \tn{spacefactor} 和 \tn{xspaceskip} 的情况。}
% 当前字体状态下,一个字间空格产生的 |glue| 的长度,包括伸展和收缩部分。
% \begin{macrocode}
\tl_const:Nn \c_xeCJK_space_skip_tl
@@ -1871,7 +2058,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\xeCJK_peek_after_ignore_spaces:nw}
-% 与 \cs{@ifnextchar} 和 \cs{futurenonspacelet} 类似,会省略掉后面的空格。
+% 与 \tn{@ifnextchar} 和 \tn{futurenonspacelet} 类似,会省略掉后面的空格。
% \begin{macrocode}
\cs_new_protected:Npn \xeCJK_peek_after_ignore_spaces:nw #1
{
@@ -1893,7 +2080,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\xeCJK_token_value_class:N}
-% 用于取得记号 |#1| 所在的 \XeTeX 字符类。|#1| 应为 \cs{catcode} 为 |11| 或 |12|
+% 用于取得记号 |#1| 所在的 \XeTeX 字符类。|#1| 应为 \tn{catcode} 为 |11| 或 |12|
% 的显性或隐性记号。
% \begin{macrocode}
\cs_new_nopar:Npn \xeCJK_token_value_class:N #1
@@ -1904,11 +2091,11 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macro}[internal]{\xeCJK_token_value_charcode:N}
% \changes{v3.2.4}{2013/06/30}{考虑 \texttt{charcode} 超出 BMP 的情况。}
% 当记号 |#1| 的 \texttt{charcode} 大于等于 \texttt{0x10000} 时,\XeTeX\
-% \texttt{0.9999.0} 版以前的 \cs{meaning} 的返回结果比较特殊\footnote{参见
+% \texttt{0.9999.0} 版以前的 \tn{meaning} 的返回结果比较特殊\footnote{参见
% \url{http://tug.org/pipermail/xetex/2013-January/023967.html} 和
% \url{http://tex.stackexchange.com/a/64848}。},需要特别处理。同时使用较新版本中
% 提供的原语设置 \texttt{mathcode}。目前,\texttt{0.9999.0} 版以后的 \XeTeX 的
-% \cs{meaning} 对于超出 BMP 的字符,会返回两个字符,分别对应于其 UTF-16 编码的
+% \tn{meaning} 对于超出 BMP 的字符,会返回两个字符,分别对应于其 UTF-16 编码的
% 首尾代理。\footnote{参见 \url{http://tug.org/pipermail/xetex/2013-June/024543.html}。}
% \begin{macrocode}
\cs_new_nopar:Npn \xeCJK_token_value_charcode:N #1
@@ -2481,9 +2668,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macrocode}
% \end{macro}
%
-% \changes{v3.2.3}{2013/06/08}{不再改变 CJK 字符类的 \cs{catcode}。}
+% \changes{v3.2.3}{2013/06/08}{不再改变 CJK 字符类的 \tn{catcode}。}
% \changes{v3.2.7}{2013/08/29}{修正 \file{unicode-letters.tex} 中谚文符号
-% \cs{catcode} 不准的问题。}
+% \tn{catcode} 不准的问题。}
% \begin{macrocode}
\int_set:Nn \l_@@_begin_int { "AC00 }
\int_set:Nn \l_@@_end_int { "D7A3 }
@@ -2495,7 +2682,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macrocode}
%
% \begin{macro}[internal]{\xeCJK_set_char_class:nnn}
-% \changes{v3.1.1}{2012/12/05}{在文档中设置字符类别时不重复设置 \cs{catcode}。}
+% \changes{v3.1.1}{2012/12/05}{在文档中设置字符类别时不重复设置 \tn{catcode}。}
% 设置字符类别,|#1| 和 |#2| 为字符类别起止的 |Unicode|,|#3| 为类别名称对应编号。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \xeCJK_set_char_class:nnn #1#2#3
@@ -2827,7 +3014,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\xeCJK_if_last_node_p:n { CJK } ||
\xeCJK_if_last_node_p:n { CJK-space }
}
- { \xeCJK_remove_node: \CJKecglue } { ~ }
+ { \xeCJK_remove_node: \CJKecglue }
+ { \xeCJK_space_glue: }
}
{
\bool_if:nTF
@@ -2853,7 +3041,10 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
{
\int_gset_eq:NN \g_@@_spacefactor_int \tex_spacefactor:D
\peek_meaning_remove:NTF \tex_italiccorrection:D
- { \tex_italiccorrection:D { \xeCJK_make_node:n { default } } }
+ {
+ \tex_italiccorrection:D
+ { \xeCJK_make_node:n { default } }
+ }
{
\token_if_space:NTF \l_peek_token
{ { \xeCJK_make_node:n { default-space } } }
@@ -2890,7 +3081,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\xeCJK_if_last_node_p:n { CJK } ||
\xeCJK_if_last_node_p:n { CJK-space }
}
- { \xeCJK_remove_node: \CJKecglue } { ~ }
+ { \xeCJK_remove_node: \CJKecglue }
+ { \xeCJK_space_glue: }
}
{
\xeCJK_if_last_node:nT { CJK-space }
@@ -2906,7 +3098,10 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
{
\int_gset_eq:NN \g_@@_spacefactor_int \tex_spacefactor:D
\peek_meaning_remove:NTF \tex_italiccorrection:D
- { \tex_italiccorrection:D { \xeCJK_make_node:n { normalspace } } }
+ {
+ \tex_italiccorrection:D
+ { \xeCJK_make_node:n { normalspace } }
+ }
{
\token_if_space:NTF \l_peek_token
{ { \xeCJK_make_node:n { default-space } } }
@@ -2944,38 +3139,41 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\int_compare_p:nNn \etex_lastnodetype:D = \c_ten
}
{ \xeCJK_remove_node: \CJKecglue }
+ { \xeCJK_check_for_xglue: }
+ }
+ }
+ }
+\cs_new_eq:NN \xeCJK_check_for_xglue: \prg_do_nothing:
+\cs_new_protected_nopar:Npn \@@_check_for_xglue:
+ {
+ \bool_if:nT
+ {
+ \int_compare_p:nNn \etex_lastnodetype:D = \c_eleven &&
+ ( \skip_if_eq_p:nn \tex_lastskip:D \c_xeCJK_space_skip_tl ||
+ \skip_if_eq_p:nn \tex_lastskip:D \l_@@_ecglue_skip )
+ }
+ {
+ \tex_unskip:D
+ \bool_if:nTF
+ {
+ \xeCJK_if_last_node_p:n { default-space } ||
+ \int_compare_p:nNn \etex_lastnodetype:D = \c_ten ||
+ \xeCJK_if_last_node_p:n { default }
+ }
+ { \xeCJK_remove_node: \CJKecglue }
+ {
+ \bool_if:nTF
{
- \bool_if:nT
- {
- \l_@@_xecglue_bool &&
- \int_compare_p:nNn \etex_lastnodetype:D = \c_eleven &&
- ( \skip_if_eq_p:nn \tex_lastskip:D \c_xeCJK_space_skip_tl ||
- \skip_if_eq_p:nn \tex_lastskip:D \l_@@_ecglue_skip )
- }
- {
- \tex_unskip:D
- \bool_if:nTF
- {
- \xeCJK_if_last_node_p:n { default-space } ||
- \int_compare_p:nNn \etex_lastnodetype:D = \c_ten ||
- \xeCJK_if_last_node_p:n { default }
- }
- { \xeCJK_remove_node: \CJKecglue }
- {
- \bool_if:nTF
- {
- \xeCJK_if_last_node_p:n { CJK } ||
- \xeCJK_if_last_node_p:n { CJK-space }
- }
- {
- \xeCJK_remove_node:
- \bool_if:NTF \l_@@_reserve_space_bool
- { ~ } { \CJKglue }
- }
- { ~ }
- }
- }
+ \xeCJK_if_last_node_p:n { CJK } ||
+ \xeCJK_if_last_node_p:n { CJK-space }
+ }
+ {
+ \xeCJK_remove_node:
+ \bool_if:NTF \l_@@_reserve_space_bool
+ { \xeCJK_space_glue: }
+ { \CJKglue }
}
+ { \xeCJK_space_glue: }
}
}
}
@@ -2993,30 +3191,40 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \changes{v3.1.0}{2012/11/14}{删除多余的 \texttt{default-itcorr} 结点。}
-% \changes{v3.2.4}{2013/07/03}{尽量移除用作判断标志的 \cs{kern}。}
+% \changes{v3.2.4}{2013/07/03}{尽量移除用作判断标志的 \tn{kern}。}
%
-% \begin{macro}[internal]{\xeCJK_def_node:nn,\xeCJK_make_node:n}
+% \begin{macro}[internal]{\xeCJK_declare_node:n,\xeCJK_make_node:n}
+% \changes{v3.2.14}{2014/11/01}{保持 \tn{spacefactor}。}
% 用于判断插入的各种 |kern|。
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \xeCJK_def_node:nn #1#2
+\cs_new_protected_nopar:Npn \xeCJK_declare_node:n #1
{
+ \int_gincr:N \g_@@_node_int
\dim_if_exist:cTF { c_@@_#1_node_dim }
{ \dim_gset:cn } { \dim_const:cn }
- { c_@@_#1_node_dim } {#2}
+ { c_@@_#1_node_dim } { \g_@@_node_int sp }
}
+\int_new:N \g_@@_node_int
+\int_gset_eq:NN \g_@@_node_int \c_ten
\cs_new_protected_nopar:Npn \xeCJK_make_node:n #1
{
- \tex_kern:D - \use:c { c_@@_#1_node_dim }
- \tex_kern:D \use:c { c_@@_#1_node_dim }
+ \exp_after:wN \@@_make_node:N
+ \cs:w c_@@_#1_node_dim \exp_after:wN \cs_end:
+ \exp_after:wN \tex_spacefactor:D \int_use:N \tex_spacefactor:D \exp_stop_f:
+ }
+\cs_new_protected_nopar:Npn \@@_make_node:N #1
+ {
+ \tex_kern:D - #1
+ \tex_kern:D #1
}
\cs_new_protected_nopar:Npn \xeCJK_remove_node:
{ \tex_unkern:D \tex_unkern:D }
-\xeCJK_def_node:nn { CJK } { 11 sp }
-\xeCJK_def_node:nn { CJK-space } { 12 sp }
-\xeCJK_def_node:nn { default } { 13 sp }
-\xeCJK_def_node:nn { default-space } { 14 sp }
-\xeCJK_def_node:nn { CJK-nobreak } { 15 sp }
-\xeCJK_def_node:nn { normalspace } { 16 sp }
+\xeCJK_declare_node:n { CJK }
+\xeCJK_declare_node:n { CJK-space }
+\xeCJK_declare_node:n { default }
+\xeCJK_declare_node:n { default-space }
+\xeCJK_declare_node:n { CJK-nobreak }
+\xeCJK_declare_node:n { normalspace }
% \end{macrocode}
% \end{macro}
%
@@ -3050,11 +3258,13 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
{
\bool_set_true:N \l_@@_xecglue_bool
\cs_set_eq:NN \xeCJK_space_or_xecglue: \CJKecglue
+ \cs_set_eq:NN \xeCJK_check_for_xglue: \@@_check_for_xglue:
} ,
xCJKecglue / false .code:n =
{
\bool_set_false:N \l_@@_xecglue_bool
- \cs_set_eq:NN \xeCJK_space_or_xecglue: \c_space_tl
+ \cs_set_eq:NN \xeCJK_space_or_xecglue: \xeCJK_space_glue:
+ \xeCJK_cs_clear:N \xeCJK_check_for_xglue:
} ,
xCJKecglue / unknown .code:n =
{
@@ -3062,9 +3272,11 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\cs_set_protected_nopar:Npn \CJKecglue {#1}
\xeCJK_glue_to_skip:nN {#1} \l_@@_ecglue_skip
\cs_set_eq:NN \xeCJK_space_or_xecglue: \CJKecglue
+ \cs_set_eq:NN \xeCJK_check_for_xglue: \@@_check_for_xglue:
} ,
xCJKecglue .default:n = { true }
}
+\cs_new_eq:NN \xeCJK_space_glue: \c_space_tl
\skip_new:N \l_@@_ecglue_skip
\bool_new:N \l_@@_xecglue_bool
% \end{macrocode}
@@ -3088,8 +3300,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macrocode}
%
% \begin{macro}[internal]{\xeCJK_CJK_and_Boundary:w}
-% \changes{v3.2.6}{2013/08/05}{更好的处理边界是 \cs{relax} 的情况。}
-% 当边界是 \cs{relax} 的时候,它可能是由 |\csname ...\endcsname| 的形式产生的,
+% \changes{v3.2.6}{2013/08/05}{更好的处理边界是 \tn{relax} 的情况。}
+% 当边界是 \tn{relax} 的时候,它可能是由 |\csname ...\endcsname| 的形式产生的,
% 这样就可能出现问题\footnote{参见 \url{http://bbs.ctex.org/forum.php?mod=viewthread&tid=71563}。}。
% 原来是都在未定义控制序列前都加上 \cs{exp_not:N},现在是采用分组结束后手工恢复的方式。
% \begin{macrocode}
@@ -3247,12 +3459,15 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\@@_punct_offset:NN}
-% 经过以上 \cs{vrule} 处理后,标点输出边界与实际边界的距离。
+% 经过以上 \tn{vrule} 处理后,标点输出边界与实际边界的距离。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_punct_offset:NN #1#2
{ \@@_punct_kern:n { - \@@_use_punct_dim:nnn { offset } {#1} {#2} } }
\cs_new_protected_nopar:Npn \@@_punct_kern:n #1
- { \tex_kern:D #1 \exp_stop_f: }
+ {
+ \dim_compare:nNnF {#1} = \c_zero_dim
+ { \tex_kern:D #1 \exp_stop_f: }
+ }
% \end{macrocode}
% \end{macro}
%
@@ -3411,19 +3626,19 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \texttt{glue} 和 \texttt{penalty} 等节点时,压缩其左空白。}
% \changes{v3.2.4}{2013/07/03}{细化边界与全角左标点之间是否压缩空白的判断。}
% \changes{v3.2.5}{2013/07/13}{细化全角左标点是否位于段首的判断。}
-% \changes{v3.2.5}{2013/07/13}{增加对 \pkg{enumitem} 宏包修改的 \cs{item} 的判断。}
+% \changes{v3.2.5}{2013/07/13}{增加对 \pkg{enumitem} 宏包修改的 \tn{item} 的判断。}
% \cs{etex_lastnodetype:D} 为 $1$ 表示 hlist node,在这里用来判断是否位于段首。基于
-% 正常情况下,\TeX 会在段落开头插入宽度为 \cs{parindent} 的水平盒子用于缩进。
-% $-1$ 表示 empty list,常出现在盒子的起始位置,在段落前使用 \cs{noindent} 就
+% 正常情况下,\TeX 会在段落开头插入宽度为 \tn{parindent} 的水平盒子用于缩进。
+% $-1$ 表示 empty list,常出现在盒子的起始位置,在段落前使用 \tn{noindent} 就
% 是这种情况。$11$ 表示 glue node,这里判断的目的是当全角左标点出现在 \LaTeX 表格
% 的非 \texttt{p} 列行首时,能够对齐到单元格的边界。判断基于标准 \LaTeX 表格的
-% 列格式(\cs{@tabclassz})定义中,在 \texttt{l} 列和 \texttt{r} 列前为了防止
-% \cs{tabcolsep} 被无意 \cs{unskip} 掉,都加了 |\hskip1sp|,而 \texttt{c} 列前
-% 则有 \cs{hfil}。$13$ 表示 penalty node,这里判断的目的是全角左标点出现在 \LaTeX
-% 列表环境的 \cs{item} 后面时,能对齐到边界。判断基于 \cs{item} 的内部定义
-% \cs{@item} 对 \cs{everypar} 进行了修改,在这里起到影响作用的是
+% 列格式(\tn{@tabclassz})定义中,在 \texttt{l} 列和 \texttt{r} 列前为了防止
+% \tn{tabcolsep} 被无意 \tn{unskip} 掉,都加了 |\hskip1sp|,而 \texttt{c} 列前
+% 则有 \tn{hfil}。$13$ 表示 penalty node,这里判断的目的是全角左标点出现在 \LaTeX
+% 列表环境的 \tn{item} 后面时,能对齐到边界。判断基于 \tn{item} 的内部定义
+% \tn{@item} 对 \tn{everypar} 进行了修改,在这里起到影响作用的是
% |\box\@labels \penalty\z@|。\package{enumitem} 宏包修改了 \env{description}
-% 环境中使用的 \cs{item}(\cs{enit@postlabel@i}),在这里起到影响作用的是
+% 环境中使用的 \tn{item}(\tn{enit@postlabel@i}),在这里起到影响作用的是
% |\penalty\z@ \hskip\labelsep|。以上判断都比较粗略,暂时也没有想起更好的办法。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_Boundary_and_FullLeft_glue:N #1
@@ -3740,7 +3955,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}{\xeCJKnobreak}
-% \changes{v3.1.1}{2012/12/03}{增加 \cs{nobreak} 的 \pkg{xeCJK} 版本。}
+% \changes{v3.1.1}{2012/12/03}{增加 \tn{nobreak} 的 \pkg{xeCJK} 版本。}
% 为保险起见,我们在这里用了一个循环。
% \begin{macrocode}
\NewDocumentCommand \xeCJKnobreak { }
@@ -3818,7 +4033,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{macro}[internal]{\xeCJK_check_single:NNw}
% \changes{v3.1.1}{2012/12/04}{改进定义,减少使用 \texttt{peek} 函数的次数。}
-% \changes{v3.2.7}{2013/08/30}{与 \cs{CJKspace} 兼容。}
+% \changes{v3.2.7}{2013/08/30}{与 \tn{CJKspace} 兼容。}
% 使用 \cs{group_align_safe_begin:} 和 \cs{group_align_safe_end:} 是为了防止在表格
% 里面报错。
% \begin{macrocode}
@@ -3911,7 +4126,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \changes{v3.2.3}{2013/06/11}
% {解决 \texttt{CheckSingle} 选项与 \pkg{tablists} 宏包的冲突。}
% \changes{v3.2.4}{2013/06/26}
-% {解决使用 \texttt{CheckSingle} 时,某些 \cs{CJKglue} 不能被正确加入的问题。}
+% {解决使用 \texttt{CheckSingle} 时,某些 \tn{CJKglue} 不能被正确加入的问题。}
%
% \begin{macro}[internal]{\xeCJK_check_single_cs:NNn}
% 在使用 \texttt{CheckSingle} 选项时,在 \package{tablists} 宏包定义的
@@ -3922,9 +4137,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \par
% l.10 \item
% \end{verbatim}
-% 原因在于 \env{tabenum} 实际上是一个 \TeX 对齐环境(\cs{halign}),\cs{par} 在
-% 其中被重定义为 \cs{cr}。而在下面 \cs{tl_case:NnF} 的分支里有对 \cs{par} 的
-% \cs{ifx} 判断。解决办法是将判断用 \cs{group_align_safe_begin:} 和
+% 原因在于 \env{tabenum} 实际上是一个 \TeX 对齐环境(\tn{halign}),\tn{par} 在
+% 其中被重定义为 \tn{cr}。而在下面 \cs{tl_case:NnF} 的分支里有对 \tn{par} 的
+% \tn{ifx} 判断。解决办法是将判断用 \cs{group_align_safe_begin:} 和
% \cs{group_align_safe_end:} 包起来。或者改用原语 \cs{tex_par:D} 作为判断条件。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \xeCJK_check_single_cs:NNn #1#2#3
@@ -4168,7 +4383,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \changes{v3.2.7}{2013/08/22}{实现自定义行首/尾标点符号宽度功能。}
%
-% \cs{XeTeXglyphbouds} 可以得到一个字符的左右边距,用于标点压缩。如果它不可用,则
+% \tn{XeTeXglyphbouds} 可以得到一个字符的左右边距,用于标点压缩。如果它不可用,则
% 在文档中只能使用 |plain| 这一标点格式原样输出标点。
% \begin{macrocode}
\cs_if_exist:NF \XeTeXglyphbounds
@@ -4883,7 +5098,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\xeCJK_glyph_bounds:NN}
-% 用 \cs{XeTeXglyphbounds} 取得标点符号的上下左右空白。
+% 用 \tn{XeTeXglyphbounds} 取得标点符号的上下左右空白。
% \begin{macrocode}
\cs_new_nopar:Npn \xeCJK_glyph_bounds:NN #1#2
{
@@ -5045,9 +5260,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macro}[internal]{\xeCJK_fallback_loop:Nn}
% \changes{v3.1.0}{2012/11/19}{调整备用字体的循环方式。}
% \changes{v3.2.4}{2013/06/30}
-% {使 \cs{CJKfamilydefault} 的 \texttt{FallBack} 设置全局可用。}
+% {使 \tn{CJKfamilydefault} 的 \texttt{FallBack} 设置全局可用。}
% 循环测试后备字体是否包含字符 |#1|。若后备字体中存在该字符或者再没有后备字体,则
-% 结束循环。当前字体族没有备用字体时,使用 \cs{CJKfamilydefault} 的设置。
+% 结束循环。当前字体族没有备用字体时,使用 \tn{CJKfamilydefault} 的设置。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \xeCJK_fallback_loop:Nn #1#2
{
@@ -5077,7 +5292,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\@@_msg_new:nn { missing-glyph }
{
CJKfamily~`\@@_msg_family_map:n {#1}'~
- ( \prop_get:Nn \g_@@_family_font_name_prop {#1} )~
+ ( \prop_item:Nn \g_@@_family_font_name_prop {#1} )~
does~not~contain~glyph~`#2'~(U+#3).\\
}
% \end{macrocode}
@@ -5305,7 +5520,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\xeCJK_set_family:nnn}
-% 设置一个 CJK 新字体族,与 \cs{newfontfamily} 类似,增加 |FallBack| 选项。
+% 设置一个 CJK 新字体族,与 \tn{newfontfamily} 类似,增加 |FallBack| 选项。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \xeCJK_set_family:nnn #1#2#3
{
@@ -5568,8 +5783,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\@@_block_select_font:n}
-% 若当前 CJK 字体族没有定义子分区 |#1| 的字体,则使用 \cs{CJKfamilydefault} 的对应
-% 分区字体;若 \cs{CJKfamilydefault} 也没有定义该分区字体,则使用当前 CJK 字体族的
+% 若当前 CJK 字体族没有定义子分区 |#1| 的字体,则使用 \tn{CJKfamilydefault} 的对应
+% 分区字体;若 \tn{CJKfamilydefault} 也没有定义该分区字体,则使用当前 CJK 字体族的
% 主分区字体。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_block_select_font:n #1
@@ -5669,7 +5884,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{macro}[var,internal]{\l_xeCJK_family_tl,\CJK@family}
% 用于保存文档当前正在使用的 CJK 字体族。
-% \changes{v3.2.0}{2013/04/14}{不将其初始化为 \cs{CJKfamilydefault}。}
+% \changes{v3.2.0}{2013/04/14}{不将其初始化为 \tn{CJKfamilydefault}。}
% \begin{macrocode}
\tl_new:N \l_xeCJK_family_tl
% \end{macrocode}
@@ -5677,7 +5892,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{macro}[var,internal]{\CJK@family}
% 用于保存实际的字体族名称。
-% \changes{v3.2.11}{2014/03/29}{引入 \cs{CJK@family} 保存实际的字体族名。}
+% \changes{v3.2.11}{2014/03/29}{引入 \tn{CJK@family} 保存实际的字体族名。}
% \begin{macrocode}
\tl_new:N \CJK@family
% \end{macrocode}
@@ -5750,7 +5965,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{macro}{\setCJKmainfont,\setCJKsansfont,\setCJKmonofont}
% 设置文档的 CJK 普通字体、无衬线和等宽字体。
-% \changes{v3.2.0}{2013/04/14}{定义中加入 \cs{normalfont}。}
+% \changes{v3.2.0}{2013/04/14}{定义中加入 \tn{normalfont}。}
% \begin{macrocode}
\NewDocumentCommand \setCJKmainfont { O { } m }
{
@@ -5947,13 +6162,13 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macrocode}
% \end{macro}
%
-% \changes{v3.1.2}{2013/01/01}{修正重定义 \cs{CJKfamilydefault} 无效的问题,恢复容错能力。}
-% \changes{v3.2.13}{2014/06/02}{自动调整 \cs{CJKfamilydefault} 时,只将 \cs{familydefault} 展开一次。}
+% \changes{v3.1.2}{2013/01/01}{修正重定义 \tn{CJKfamilydefault} 无效的问题,恢复容错能力。}
+% \changes{v3.2.13}{2014/06/02}{自动调整 \tn{CJKfamilydefault} 时,只将 \tn{familydefault} 展开一次。}
%
-% 在导言区结束的时候,若没有声明 CJK 字体,则给出一个警告。如果 \cs{CJKfamilydefault}
-% 没有被更改,则在此时根据西文字体的情况更新 \cs{CJKfamilydefault}。
-% 如果 \cs{CJKfamilydefault} 对应的字体族没有定义,则使用 \cs{CJKrmdefault} 作为
-% 默认字体族。若 \cs{CJKrmdefault} 也没有定义,则使用在导言区设置的第一个 CJK 字体
+% 在导言区结束的时候,若没有声明 CJK 字体,则给出一个警告。如果 \tn{CJKfamilydefault}
+% 没有被更改,则在此时根据西文字体的情况更新 \tn{CJKfamilydefault}。
+% 如果 \tn{CJKfamilydefault} 对应的字体族没有定义,则使用 \tn{CJKrmdefault} 作为
+% 默认字体族。若 \tn{CJKrmdefault} 也没有定义,则使用在导言区设置的第一个 CJK 字体
% 作为默认字体族。最后设置数学字体。
% \begin{macrocode}
\@@_at_end_preamble:n
@@ -6054,7 +6269,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \changes{v3.2.6}{2013/08/01}{设置粗体时先检查对应字体是否存在。}
% \changes{v3.2.7}{2013/11/09}{将 CJK 字符的数学归类由 $7$ 改为 $0$,解决汉字路径的问题。}
% \changes{v3.2.13}{2014/06/20}{修复参数类型错误。}
-% 当没有设置 CJK 数学字体时,使用 \cs{CJKfamilydefault} 作为数学字体。
+% 当没有设置 CJK 数学字体时,使用 \tn{CJKfamilydefault} 作为数学字体。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \xeCJK_set_mathfont:
{
@@ -6110,14 +6325,14 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \changes{v3.1.0}{2012/11/19}{放弃使用放缩字体大小的方式,而只采用调整间距的方式
% 与西文等宽字体对齐。并且只适用于与抄录环境下。}
% \changes{v3.2.0}{2013/04/15}{增加 \texttt{Verb} 选项。}
-% \changes{v3.2.1}{2013/05/29}{调整 \texttt{Verb} 选项:在命令 \cs{verb} 里使用时,
+% \changes{v3.2.1}{2013/05/29}{调整 \texttt{Verb} 选项:在命令 \tn{verb} 里使用时,
% 不破坏标点禁则,增加值 \texttt{env+}。}
%
% \begin{macro}{Verb}
% \changes{v3.2.5}{2013/07/25}{微调定义。}
-% 如果设置为 \texttt{env},则只在 \LaTeX 的抄录环境里使用 \cs{xeCJKVerbAddon},^^A
-% 而不包括 \cs{verb}。对当前使用环境的判断基于在标准 \LaTeX 的坏境定义里使用
-% \cs{begingroup} 和 \cs{endgroup} 来分组。
+% 如果设置为 \texttt{env},则只在 \LaTeX 的抄录环境里使用 \tn{xeCJKVerbAddon},^^A
+% 而不包括 \tn{verb}。对当前使用环境的判断基于在标准 \LaTeX 的坏境定义里使用
+% \tn{begingroup} 和 \tn{endgroup} 来分组。
% \begin{macrocode}
\int_new:N \l_@@_verb_case_int
\keys_define:nn { xeCJK / options }
@@ -6151,7 +6366,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\@@_nobreak_skip_zero:,\@@_nobreak_skip:}
-% \changes{v3.2.8}{2013/11/16}{禁止在 \cs{verb} 中断行。}
+% \changes{v3.2.8}{2013/11/16}{禁止在 \tn{verb} 中断行。}
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_nobreak_skip_zero:
{
@@ -6204,9 +6419,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\@@_shipout_punct_breakable_kern:n \@@_punct_breakable_kern:n
\tl_set:Nx \l_@@_off_verb_addon_tl
{
- \exp_not:c
- { bool_set_ \bool_if:NTF \l_@@_xecglue_bool { true } { false } :N }
- \l_@@_xecglue_bool
+ \bool_if:NTF \l_@@_xecglue_bool
+ { \xeCJKsetup { xCJKecglue = true } }
+ { \xeCJKsetup { xCJKecglue = false } }
\exp_not:n
{
\cs_set_eq:NN \CJKglue \@@_shipout_CJKglue:
@@ -6225,15 +6440,15 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}{\xeCJKOffVerbAddon,\xeCJKVerbAddon}
-% \changes{v3.1.0}{2012/11/19}{新增 \cs{xeCJKVerbAddon} 用于抄录环境中的间距调整。}
+% \changes{v3.1.0}{2012/11/19}{新增 \tn{xeCJKVerbAddon} 用于抄录环境中的间距调整。}
% \changes{v3.2.3}{2013/06/04}
-% {新增 \cs{xeCJKOffVerbAddon} 用于局部取消 \cs{xeCJKOffVerbAddon} 的影响;并解决
+% {新增 \tn{xeCJKOffVerbAddon} 用于局部取消 \tn{xeCJKOffVerbAddon} 的影响;并解决
% 跨页使用时影响到页眉页脚的问题。}
% \changes{v3.2.5}{2013/07/13}{禁止自动换行,与西文一致。}
% \changes{v3.2.8}{2013/11/16}{增加是否是等宽字体的判断。}
-% \cs{xeCJKVerbAddon} 进行了比较大的调整,应该只在分组环境里使用。为了方便调整间距
+% \tn{xeCJKVerbAddon} 进行了比较大的调整,应该只在分组环境里使用。为了方便调整间距
% 以利于对齐,这里只把字符分成了两类,并且在 CJK 类与边界(空格)之间也插入
-% \cs{CJKecglue}。以字母“M”的宽度是否等于 \cs{fontdimen2} 来判断当前字体是否是
+% \tn{CJKecglue}。以字母“M”的宽度是否等于 \tn{fontdimen2} 来判断当前字体是否是
% 等宽字体。如果不是等宽字体,则设置间距为零或正文间距。
% \begin{macrocode}
\NewDocumentCommand \xeCJKVerbAddon { }
@@ -6453,7 +6668,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\xeCJK_set_visible_space_font:}
-% 当前字体空格的宽度与后备字体 |lmtt| 不一样时,就对 \cs{textvisiblespace} 的字体尺寸
+% 当前字体空格的宽度与后备字体 |lmtt| 不一样时,就对 \tn{textvisiblespace} 的字体尺寸
% 按相应的比例放缩。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \xeCJK_set_visible_space_font:
@@ -6627,7 +6842,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \changes{v3.1.0}{2012/11/21}{改用 \pkg{indentfirst} 宏包处理缩进的问题。}
%
-% 对不能通过 \cs{xeCJKsetup} 设置的选项给出警告。
+% 对不能通过 \tn{xeCJKsetup} 设置的选项给出警告。
% \begin{macrocode}
\keys_define:nn { xeCJK / options }
{
@@ -6734,8 +6949,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \subsection{兼容性修补}
%
% \begin{macro}[internal]{\@@_update_url_font:,\Url@MathSetup}
-% \changes{v3.2.7}{2013/11/09}{使通过 \cs{UrlFont} 等命令设置的 CJK 字体生效。}
-% 使通过 \cs{urlstyle} 或者 \cs{UrlFont} 设置的路径中使用的 CJK 字体生效。
+% \changes{v3.2.7}{2013/11/09}{使通过 \tn{UrlFont} 等命令设置的 CJK 字体生效。}
+% 使通过 \tn{urlstyle} 或者 \tn{UrlFont} 设置的路径中使用的 CJK 字体生效。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_update_url_font:
{
@@ -6752,13 +6967,13 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\fontspec_setup_maths:,\mathrm}
-% \changes{v3.2.6}{2013/08/02}{为 \cs{mathrm} 减少一个可能的数学字体族。}
-% 如果没有设置 \cs{setboldmathrm},即 \cs{g_fontspec_bfmathrm_tl} 为空,那么
-% \cs{mathrm} 的字体实际与 \texttt{operators} 字体族完全一致。这时候应该通过
-% \cs{DeclareSymbolFontAlphabet} 来定义 \cs{mathrm},避免使用它的时候再声明
-% 一个重复的数学字体族。
+% \changes{v3.2.6}{2013/08/02}{为 \tn{mathrm} 减少一个可能的数学字体族。}
+% 如果没有设置 \tn{setboldmathrm},即 \cs{g_fontspec_bfmathrm_tl} 为空,那么
+% \tn{mathrm} 的字体实际与 \texttt{operators} 字体族完全一致。这时候应该通过
+% \tn{DeclareSymbolFontAlphabet} 来定义 \tn{mathrm},避免使用它的时候再声明
+% 一个重复的数学字体族。\pkg{fontspec} v2.4a 已经正确定义了 \tn{mathrm}。
% \begin{macrocode}
-\cs_if_free:NF \fontspec_setup_maths:
+\@ifpackagelater { fontspec } { 2014/06/21 } { }
{
\cs_gset_protected_nopar:Npx \fontspec_setup_maths:
{
@@ -6779,22 +6994,22 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{macro}[internal]{\(,\),\math,\endmath,\ensuremath,\@@_math_robust:N}
% \changes{v3.2.5}{2013/07/25}
-% {解决汉字后紧跟 \cs{(}\texttt{...}\cs{)} 形式的行内数学公式时,不能加入间距的问题。}
-% \changes{v3.2.6}{2013/08/03}{考虑 \pkg{ulem} 对 \cs{MakeRobust} 的不当定义。}
-% \changes{v3.2.6}{2013/08/03}{考虑 \cs{math} 和 \cs{ensuremath}。}
-% \cs{(} 的在 \LaTeXe 中的定义是
+% {解决汉字后紧跟 \tn{(}\texttt{...}\tn{)} 形式的行内数学公式时,不能加入间距的问题。}
+% \changes{v3.2.6}{2013/08/03}{考虑 \pkg{ulem} 对 \tn{MakeRobust} 的不当定义。}
+% \changes{v3.2.6}{2013/08/03}{考虑 \tn{math} 和 \tn{ensuremath}。}
+% \tn{(} 的在 \LaTeXe 中的定义是
% \begin{verbatim}
% \def\({\relax\ifmmode\@badmath\else$\fi}
% \end{verbatim}
-% 这个定义最开始的 \cs{relax} 是为了防止 \cs{(} 出现在表格单元格的开始位置时,模式
-% 判断不正确(因为 \TeX 会先看单元格中第一个不可展的非空格记号是否是 \cs{omit} 或
-% \cs{noalign})。但是它会造成一个边界,使 \pkg{xeCJK} 不能看到 \cs{relax} 后面出现的
+% 这个定义最开始的 \tn{relax} 是为了防止 \tn{(} 出现在表格单元格的开始位置时,模式
+% 判断不正确(因为 \TeX 会先看单元格中第一个不可展的非空格记号是否是 \tn{omit} 或
+% \tn{noalign})。但是它会造成一个边界,使 \pkg{xeCJK} 不能看到 \tn{relax} 后面出现的
% |$|,从而不能加入间距\footnote{\url{http://tex.stackexchange.com/q/124773}}。使用
-% \hologo{eTeX} 的 \cs{protected} 来定义它,可以不需要 \cs{relax},或者将 \cs{relax}
+% \hologo{eTeX} 的 \tn{protected} 来定义它,可以不需要 \tn{relax},或者将 \tn{relax}
% 改成 \cs{scan_align_safe_stop:},都可以避免这些情况。同时 \pkg{fixltx2e} 中还使用了
-% |\MakeRobust\(|,我们需要小心处理。另外 \pkg{ulem} 也定义了一个 \cs{MakeRobust},
+% |\MakeRobust\(|,我们需要小心处理。另外 \pkg{ulem} 也定义了一个 \tn{MakeRobust},
% 如果它被放在 \pkg{fixltx2e} 之前载入,那么 \pkg{fixltx2e} 的定义就会失效(因为
-% \pkg{fixltx2e} 使用 \cs{providecommand*} 来定义 \cs{MakeRobust})。但是 \pkg{ulem}
+% \pkg{fixltx2e} 使用 \tn{providecommand}|*| 来定义 \tn{MakeRobust})。但是 \pkg{ulem}
% 的定义并不完全正确,没有考虑 \TeX 不会略去控制符号后面的空格的情况。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_math_robust:N #1
@@ -6851,7 +7066,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{macro}[internal]{\[,\]}
% \changes{v3.2.5}{2013/07/25}{解决 \pkg{fixltx2e} 和 \pkg{amsthm} 的冲突。}
-% 当 \pkg{amsmath} 没有在 \pkg{amsthm} 之前被调用时,\pkg{amsthm} 会展开 \cs{[},
+% 当 \pkg{amsmath} 没有在 \pkg{amsthm} 之前被调用时,\pkg{amsthm} 会展开 |\[|,
% 并用 |$| 作为参数定界记号,相关代码为
% \begin{verbatim}
% \def\@tempa#1$#2#3\@nil{%
@@ -6859,10 +7074,10 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% }%
% \expandafter\@tempa\[\@nil
% \end{verbatim}
-% 而 \pkg{fixltx2e} 中使用了 |\MakeRobust\[|,使得将 \cs{[} 展开一次的内容中并
+% 而 \pkg{fixltx2e} 中使用了 |\MakeRobust\[|,使得将 |\[| 展开一次的内容中并
% 不直接含有 |$|,从而造成了 \texttt{Runaway argument?} 的错误。可以在 \pkg{amsthm}
-% 之前引入 \pkg{amsmath},避免出现这个错误。我们下面用 \hologo{eTeX} 的 \cs{protected}
-% 来定义它。当然,如果之后只使用 \pkg{amsthm},那么 \cs{[} 会被修改,将不再是^^A
+% 之前引入 \pkg{amsmath},避免出现这个错误。我们下面用 \hologo{eTeX} 的 \tn{protected}
+% 来定义它。当然,如果之后只使用 \pkg{amsthm},那么 |\[| 会被修改,将不再是^^A
% “健壮”的了。这也是上面 \cs{@@_math_robust:NN} 中还使用 \cs{scan_align_safe_stop:} 的原因。
% \begin{macrocode}
\bool_if:nF
@@ -6879,8 +7094,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{macro}[internal]{\nobreakspace}
% \changes{v3.1.2}{2013/01/01}
-% {修正非 \cs{UTFencname} 编码下面 \pkg{xunicode} 重定义的 \cs{nobreakspace} 会失效的问题。}
-% \changes{v3.2.5}{2013/07/18}{恢复 \cs{nobreakspace} 的原始定义。}
+% {修正非 \tn{UTFencname} 编码下面 \pkg{xunicode} 重定义的 \tn{nobreakspace} 会失效的问题。}
+% \changes{v3.2.5}{2013/07/18}{恢复 \tn{nobreakspace} 的原始定义。}
% 空格在 \TeX 中是特殊的记号,似乎不应该把它定义为字体中的符号(\texttt{U+00A0})。
% \begin{macrocode}
\UndeclareTextCommand \nobreakspace { \UTFencname }
@@ -6936,7 +7151,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| 字体族能随西文主要字体更新。
+% 修改 \tn{fontfamily},使主要 |CJK| 字体族能随西文主要字体更新。
% \begin{macrocode}
\RenewDocumentCommand \fontfamily { m }
{
@@ -6960,13 +7175,13 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macrocode}\egroup
%
% \begin{macro}[internal]{\xeCJK@fix@penalty}
-% \changes{v3.1.0}{2012/11/13}{采用通过不修改原语 \cs{/} 的方式对修复倾斜校正。}
-% 对 \LaTeXe 内核中的 \cs{fix@penalty} 被用于诸如 \cs{textit} 之类的文档
+% \changes{v3.1.0}{2012/11/13}{采用通过不修改原语 \tn{/} 的方式对修复倾斜校正。}
+% 对 \LaTeXe 内核中的 \tn{fix@penalty} 被用于诸如 \tn{textit} 之类的文档
% 字体转换命令的定义之中。这里对它进行补丁的目的是修复其中的倾斜校正,并使得这些
-% 文档命令与紧随其后的汉字之间可以正确的插入 \cs{CJKecglue} 或者忽略其中的空格。
+% 文档命令与紧随其后的汉字之间可以正确的插入 \tn{CJKecglue} 或者忽略其中的空格。
% 例如 \verb*|这是 \emph{强调} 文本|,第二个空格可以被忽略掉。如果使用 |xCJKecglue|
-% 选项,第一个空格也可以被省略。事实上,在 \cs{sw@slant} 的定义中,\cs{@@italiccorr}
-% 前面的 \cs{lastskip} 和 \cs{lastpenalty} 有四种情况,这里只对它们都为零的情况进行
+% 选项,第一个空格也可以被省略。事实上,在 \tn{sw@slant} 的定义中,\tn{@@italiccorr}
+% 前面的 \tn{lastskip} 和 \tn{lastpenalty} 有四种情况,这里只对它们都为零的情况进行
% 处理。
% \begin{macrocode}
\cs_new_eq:NN \xeCJK@fix@penalty \fix@penalty
@@ -7003,7 +7218,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
}
% \end{macrocode}
% \cs{xeCJK_ignore_spaces:w} 里面用到 |peek| 函数来判断后面是不是空格,而此时它
-% 后面还有 $4$ 个 \cs{fi} 或者 |\else...\fi| 没有被展开,将影响 |peek| 函数的
+% 后面还有 $4$ 个 \tn{fi} 或者 |\else...\fi| 没有被展开,将影响 |peek| 函数的
% 判断。因此我们需要用 $2^4-1=15$ 个 \cs{exp_after:wN} 来展开它们。
% 显然,这里用 \cs{exp_last_unbraced:Nf} 会比较方便,但是它会吃掉
% \verb*|\textit{...} | 等后面原来存在的空格作为完全展开的结束。要正确使用它还
@@ -7029,7 +7244,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macrocode}\egroup
%
% \begin{macro}[internal]{\@@_set_others_toks:n}
-% 简单处理与同样使用 \cs{XeTeXinterchartoks} 机制的宏包的兼容问题。
+% 简单处理与同样使用 \tn{XeTeXinterchartoks} 机制的宏包的兼容问题。
% \begin{macrocode}
\@@_after_end_preamble:n
{
@@ -7215,8 +7430,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
}
% \end{macrocode}
%
-% \changes{v3.1.0}{2012/11/13}{取消 \cs{cprotect} 的外部宏限制。}
-% 当探测到 \pkg{cprotect} 宏包被引入时,则取消 \cs{cprotect} 宏的 \cs{outer} 定义。
+% \changes{v3.1.0}{2012/11/13}{取消 \tn{cprotect} 的外部宏限制。}
+% 当探测到 \pkg{cprotect} 宏包被引入时,则取消 \tn{cprotect} 宏的 \tn{outer} 定义。
% \begin{macrocode}
\@@_after_end_preamble:n
{
@@ -7226,10 +7441,10 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
}
% \end{macrocode}
%
-% \changes{v3.2.11}{2014/03/14}{删除 \cs{xeCJKcaption}。}
+% \changes{v3.2.11}{2014/03/14}{删除 \tn{xeCJKcaption}。}
%
% 由于 \pkg{xeCJK} 禁止 \pkg{CJKulem} 的载入,因此当使用 \pkg{ctex} 宏包的 |fntef|
-% 选项时,就会出现 \cs{normalem} 没有定义的问题。此时改用 \pkg{xeCJKfntef} 以便
+% 选项时,就会出现 \tn{normalem} 没有定义的问题。此时改用 \pkg{xeCJKfntef} 以便
% 载入 \pkg{ulem}。
%
% 判断过于繁琐,应该在 \pkg{ctex} 包中妥善处理。这段代码应在 \pkg{ctex} 包发布
@@ -7263,7 +7478,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macrocode}
%
% 由于 \pkg{xeCJK} 假装 \pkg{CJK} 已经被引入了,导致 \pkg{everysel} 判断错误,
-% 从而给出 \cs{selectfont} 已经被修改的警告,并加入不必要的内容。需要在它判断
+% 从而给出 \tn{selectfont} 已经被修改的警告,并加入不必要的内容。需要在它判断
% 之前取消定义。
% \begin{macrocode}
\@@_at_end_preamble:n
@@ -7279,7 +7494,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macro}[internal]{\CJKaddEncHook}
% 为使用 \pkg{CJKnumb} 宏包而作一些处理。另外 \pkg{CJKnumb} 使用的是传统汉字“萬”
% 和“億”,我们在这里把它们修正为简体字。
-% \changes{v3.2.10}{2014/03/01}{使用 \pkg{CJKnumb} 时,让 \cs{Unicode} 有定义。}
+% \changes{v3.2.10}{2014/03/01}{使用 \pkg{CJKnumb} 时,让 \tn{Unicode} 有定义。}
% \begin{macrocode}
\cs_new_protected:Npn \CJKaddEncHook #1#2
{
@@ -7315,7 +7530,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macrocode}
% \end{macro}
%
-% 最后引入本地配置文件。使用 \cs{@pushfilename} 和 \cs{@pushfilename} 是为了使
+% 最后引入本地配置文件。使用 \tn{@pushfilename} 和 \tn{@pushfilename} 是为了使
% 配置文件可以不受 \hologo{LaTeX3} 语法环境的影响。
% \begin{macrocode}
\bool_if:NT \g_@@_config_bool
@@ -7334,13 +7549,14 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \changes{v3.1.1}{2012/12/08}{增加小宏包 \pkg{xeCJKfntef},用于处理下划线的问题。}
% \changes{v3.2.4}{2013/06/23}{修正 \pkg{xeCJKfntef} 与 \pkg{natbib} 等的冲突。}
+% \changes{v3.2.14}{2014/10/31}{完善 \tn{varCJKunderline} 的实现。}
+% \changes{v3.2.14}{2014/10/31}{解决下划线前后没有 \tn{CJKglue} 或 \tn{CJKecglue} 的问题。}
+% \changes{v3.2.14}{2014/11/03}{\pkg{xeCJKfntef} 不再依赖 \pkg{CJKfntef}。}
%
% \begin{macrocode}
%<*fntef>
% \end{macrocode}
%
-% \pkg{xeCJKfntef} 不需要 \pkg{CJKulem} 宏包的支持,因此当使用 \pkg{CJKfntef} 时,%
-% 需要另行载入 \pkg{ulem}。
% \begin{macrocode}
\PassOptionsToPackage { normalem } { ulem }
\DeclareOption* { \PassOptionsToPackage { \CurrentOption } { ulem } }
@@ -7350,10 +7566,15 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macrocode}
\RequirePackage { xeCJK }
\RequirePackage { ulem }
-\RequirePackage { CJKfntef }
\RequirePackage { environ }
% \end{macrocode}
%
+% 虽然我们不再依赖 \pkg{CJKfntef},但基于历史原因,我们仍然载入它。
+% \begin{macrocode}
+\file_if_exist:nT { CJKfntef.sty }
+ { \RequirePackage { CJKfntef } }
+% \end{macrocode}
+%
% \begin{macrocode}
\addto@hook \UL@hook { \xeCJK_hook_for_ulem: }
% \end{macrocode}
@@ -7367,14 +7588,20 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\bool_if:NF \l_@@_ulem_hook_used_bool
{
\bool_set_true:N \l_@@_ulem_hook_used_bool
- \xeCJKsetup { CheckFullRight = false , xCJKecglue = false }
- \bool_if:NTF \l_@@_ulem_skip_punct_bool
- { \cs_set_eq:NN \@@_ulem_leader_type: \UL@leadtype }
+ \@@_ulem_initial:
+ \bool_if:NT \l_@@_ulem_subtract_bool
{
+ \cs_set_eq:NN \xeCJK_ulem_leaders: \UL@leaders
+ \cs_set_eq:NN \UL@leaders \xeCJK_ulem_var_leaders:
+ \cs_set_eq:NN \xeCJK_ulem_right_skip: \@@_ulem_right_skip:
+ }
+ \bool_if:NF \l_@@_ulem_skip_bool
+ {
+ \xeCJK_swap_cs:NN \@@_punct_kern:n \@@_ulem_punct_kern:n
+ \xeCJK_swap_cs:NN \@@_punct_hskip:n \@@_ulem_punct_hskip:n
\xeCJK_cs_clear:N \@@_ulem_skip_punct_begin:
\xeCJK_cs_clear:N \@@_ulem_skip_punct_end:
}
- \@@_ulem_initial:
\xeCJK_glue_to_skip:nN
{
\cs_set_eq:NN \ \tex_space:D
@@ -7389,45 +7616,246 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\cs_set_eq:NN \hskip \skip_horizontal:N
\CJKecglue
} \l_@@_ecglue_skip
+ \xeCJK_glue_to_skip:nN { \xeCJK_space_glue: } \l_@@_space_skip
\cs_set_protected_nopar:Npn \CJKglue
{ \@@_ulem_glue:n \l_@@_ccglue_skip }
\cs_set_protected_nopar:Npn \CJKecglue
{ \@@_ulem_glue:n \l_@@_ecglue_skip }
+ \cs_set_protected_nopar:Npn \xeCJK_space_glue:
+ { \@@_ulem_glue:n \l_@@_space_skip }
+ \xeCJKsetup { CheckFullRight = false , xCJKecglue = false }
+ \xeCJK_ulem_detect_node:
}
}
+\skip_new:N \l_@@_space_skip
\bool_new:N \l_@@_ulem_hook_used_bool
% \end{macrocode}
% \end{macro}
%
-% \setbox\xeCJKtmpbox\vbox\bgroup\gobblelineno
+% \begin{macro}[internal]{\UL@word,\xeCJK_ulem_word:nw}
+% 修改 \tn{UL@word},目的是取得分组中的 \tn{UL@leadtype},以便加入 \cs{xeCJK_ulem_right_skip:}。
% \begin{macrocode}
-%<@@=>
-% \end{macrocode}\egroup
+\cs_new_protected_nopar:Npn \xeCJK_ulem_word:nw #1 ~
+ {
+ \exp_after:wN \UL@start #1 ~
+ \exp_after:wN \if_meaning:w \exp_after:wN \UL@end #1
+ \exp_after:wN \@@_ulem_end:
+ \else:
+ \exp_after:wN \@@_ulem_loop:nw
+ \fi:
+ }
+\cs_new_protected_nopar:Npn \@@_ulem_end:
+ {
+ \c_group_end_token
+ \hbox_set_end:
+ \tex_unskip:D \tex_unskip:D \tex_unskip:D
+ \xeCJK_ulem_right_skip:
+ \xeCJK_ulem_right_node:
+ \int_set:Nn \tex_spacefactor:D { \UL@spfactor }
+ \c_group_end_token
+ }
+\cs_new_protected_nopar:Npn \@@_ulem_loop:nw
+ {
+ \reverse_if:N \if_mode_math:
+ \reverse_if:N \if_dim:w \tex_lastskip:D = \c_zero_dim
+ \skip_gset_eq:NN \UL@skip \tex_lastskip:D
+ \tex_unskip:D
+ \UL@stop \UL@leaders
+ \fi:
+ \fi:
+ \xeCJK_ulem_word:nw \prg_do_nothing:
+ }
+\cs_set_eq:NN \UL@word \xeCJK_ulem_word:nw
+% \end{macrocode}
+% \end{macro}
%
-% \begin{macro}[internal]{\CJK@UL,\CJK@@UL}
-% 修改 \pkg{CJKfntef} 中的 \cs{CJK@UL} 和 \cs{CJK@@UL} 以适应下面的修改。
+% \begin{macro}[internal]{\xeCJK_ulem_left:, \xeCJK_ulem_detect_node:}
+% 在下划线开始之前探测之前的 \texttt{node},以便随后插入 \tn{CJKglue} 或 \tn{CJKecglue}。
% \begin{macrocode}
-\cs_set_eq:NN \CJK@UL \CJK@@UL
-\tl_replace_once:Nnn \CJK@UL { \ULon }
- { \bool_set_true:N \l__xeCJK_ulem_skip_punct_bool \ULon }
-\tl_replace_once:Nnn \CJK@@UL { \ULon }
- { \bool_set_false:N \l__xeCJK_ulem_skip_punct_bool \ULon }
-\bool_new:N \l__xeCJK_ulem_skip_punct_bool
+\cs_new_protected_nopar:Npn \xeCJK_ulem_left:
+ {
+ \xeCJK_ulem_left_node:
+ \xeCJK_make_group_tag:
+ }
+\cs_new_eq:NN \xeCJK_ulem_left_node: \prg_do_nothing:
+\cs_new_protected_nopar:Npn \xeCJK_ulem_detect_node:
+ {
+ \scan_stop:
+ \dim_compare:nNnTF \tex_lastkern:D = \c_zero_dim
+ {
+ \xeCJK_cs_clear:N \xeCJK_ulem_left_node:
+ \cs_set_eq:NN \@@_ulem_hskip:n \xeCJK_ulem_hskip:n
+ }
+ {
+ \dim_set_eq:NN \l_@@_tmp_dim \tex_lastkern:D
+ \tex_unkern:D
+ \dim_compare:nNnTF \tex_lastkern:D = { - \l_@@_tmp_dim }
+ {
+ \tex_unkern:D
+ { \xeCJK_make_node:n { ulem-left } }
+ \cs_set_protected_nopar:Npx \xeCJK_ulem_left_node:
+ {
+ \tex_kern:D - \dim_use:N \l_@@_tmp_dim \exp_stop_f:
+ \tex_kern:D \dim_use:N \l_@@_tmp_dim \exp_stop_f:
+ }
+ \cs_set_eq:NN \@@_ulem_hskip:n \@@_ulem_hskip_first:n
+ }
+ {
+ \tex_kern:D \l_@@_tmp_dim
+ \xeCJK_cs_clear:N \xeCJK_ulem_left_node:
+ \cs_set_eq:NN \@@_ulem_hskip:n \xeCJK_ulem_hskip:n
+ }
+ }
+ }
+\xeCJK_declare_node:n { ulem-left }
% \end{macrocode}
% \end{macro}
%
-% \setbox\xeCJKtmpbox\vbox\bgroup\gobblelineno
+% \begin{macro}[internal]{\@@_ulem_hskip_first:n, \xeCJK_ulem_hskip:n}
+% 如果第一次调用的 \tn{CJKglue} 或 \tn{CJKecglue} 由下划线中的第一个文字和之前的
+% 内容产生,就不用画下划线。
% \begin{macrocode}
-%<@@=xeCJK>
-% \end{macrocode}\egroup
+\cs_new_protected_nopar:Npn \@@_ulem_hskip_first:n #1
+ {
+ \xeCJK_if_last_node:nTF { ulem-left }
+ {
+ \xeCJK_remove_node:
+ \skip_horizontal:n {#1}
+ }
+ { \xeCJK_ulem_hskip:n {#1} }
+ \cs_set_eq:NN \@@_ulem_hskip:n \xeCJK_ulem_hskip:n
+ }
+\cs_new_eq:NN \@@_ulem_hskip:n \@@_ulem_hskip_first:n
+\cs_new_protected_nopar:Npn \xeCJK_ulem_hskip:n #1
+ { \skip_set:Nn \UL@skip {#1} \UL@leaders }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\xeCJK_ulem_right:, \xeCJK_ulem_right_node:}
+% 在下划线最后的位置保存 \texttt{node}。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \xeCJK_ulem_right:
+ {
+ \scan_stop:
+ \dim_compare:nNnTF \tex_lastkern:D = \c_zero_dim
+ { \xeCJK_cs_gclear:N \xeCJK_ulem_right_node: }
+ {
+ \dim_compare:nNnTF \tex_lastkern:D = { 3 sp }
+ { \xeCJK_cs_gclear:N \xeCJK_ulem_right_node: }
+ {
+ \exp_after:wN \tex_unkern:D
+ \exp_after:wN \@@_ulem_right_aux:n
+ \exp_after:wN { \dim_use:N \tex_lastkern:D }
+ }
+ }
+ }
+\cs_new_protected_nopar:Npn \@@_ulem_right_aux:n #1
+ {
+ \dim_compare:nNnTF \tex_lastkern:D = { - #1 }
+ {
+ \tex_unkern:D
+ \cs_gset_protected_nopar:Npn \xeCJK_ulem_right_node:
+ {
+ \tex_kern:D - #1 \exp_stop_f:
+ \tex_kern:D #1 \exp_stop_f:
+ }
+ \tl_gset:Nx \UL@spfactor { \int_use:N \tex_spacefactor:D }
+ }
+ {
+ \tex_kern:D #1 \exp_stop_f:
+ \xeCJK_cs_gclear:N \xeCJK_ulem_right_node:
+ }
+ }
+\cs_new_eq:NN \xeCJK_ulem_right_node: \prg_do_nothing:
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\xeCJK_ulem_var_leaders:}
+% 第一次画下划线时,先向右平移 \tn{CJKulineleftskip},再画缩小了相同长度的下划线,
+% 让左侧有间距。
+% \begin{macrocode}
+\cs_new_eq:NN \xeCJK_ulem_leaders: \UL@leaders
+\cs_new_protected_nopar:Npn \xeCJK_ulem_var_leaders:
+ {
+ \scan_stop:
+ \skip_if_eq:nnF { \UL@skip } { \c_zero_skip }
+ {
+ \UL@leadtype \skip_horizontal:n { \UL@skip + \UL@pixel }
+ \skip_horizontal:n { - \UL@pixel }
+ \cs_gset_eq:NN \UL@leaders \xeCJK_ulem_leaders:
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\xeCJK_ulem_right_skip:}
+% 在下划线完全画好之后,我们检测最后的情况。用 \tn{unskip} 去掉最后一个下划线,再
+% 重新画一个减少 \tn{CJKulinerightskip} 的。
+% \begin{macrocode}
+\cs_new_eq:NN \xeCJK_ulem_right_skip: \prg_do_nothing:
+\cs_new_protected_nopar:Npn \@@_ulem_right_skip:
+ {
+ \int_case:nn { \etex_lastnodetype:D }
+ {
+ { \c_one } { \@@_ulem_right_skip_hbox: }
+ { \c_eleven } { \@@_ulem_right_skip_glue: }
+ { \c_thirteen } { \@@_ulem_right_skip_penalty: }
+ }
+ }
+\cs_new_protected_nopar:Npn \@@_ulem_right_skip_hbox:
+ {
+ \box_set_to_last:N \l_@@_tmp_box
+ \dim_set:Nn \l_@@_tmp_dim { - \box_wd:N \l_@@_tmp_box }
+ \dim_compare:nNnT \tex_lastkern:D = \l_@@_tmp_dim
+ {
+ \tex_unkern:D
+ \@@_ulem_right_skip_glue:
+ \tex_kern:D \l_@@_tmp_dim
+ }
+ \box_use_clear:N \l_@@_tmp_box
+ }
+\cs_new_protected_nopar:Npn \@@_ulem_right_skip_glue:
+ {
+ \skip_if_eq:nnT { \tex_lastskip:D } { - \UL@pixel }
+ {
+ \tex_unskip:D
+ \skip_set:Nn \l_@@_tmp_skip { \tex_lastskip:D - \UL@pixel }
+ \tex_unskip:D
+ \UL@leadtype \skip_horizontal:N \l_@@_tmp_skip
+ }
+ }
+\cs_new_protected_nopar:Npn \@@_ulem_right_skip_penalty:
+ {
+ \int_set_eq:NN \l_@@_tmp_int \tex_lastpenalty:D
+ \tex_unpenalty:D
+ \int_compare:nNnT \etex_lastnodetype:D = \c_one
+ { \@@_ulem_right_skip_hbox: }
+ \tex_penalty:D \l_@@_tmp_int
+ }
+% \end{macrocode}
+% \end{macro}
%
% \begin{macro}[internal]{\@@_ulem_skip_punct_begin:,\@@_ulem_skip_punct_end:}
+% 让下划线跳过标点符号的设置。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_ulem_skip_punct_begin:
- { \xeCJK_cs_clear:N \UL@leadtype }
+ {
+ \cs_set_eq:NN \@@_ulem_putbox: \UL@putbox
+ \cs_set_eq:NN \UL@putbox \@@_ulem_skip_putbox:
+ \cs_set_eq:NN \@@_ulem_hskip_aux:n \xeCJK_ulem_hskip:n
+ \cs_set_eq:NN \xeCJK_ulem_hskip:n \skip_horizontal:n
+ }
\cs_new_protected_nopar:Npn \@@_ulem_skip_punct_end:
- { \cs_set_eq:NN \UL@leadtype \@@_ulem_leader_type: }
-\xeCJK_cs_clear:N \@@_ulem_leader_type:
+ {
+ \cs_set_eq:NN \UL@putbox \@@_ulem_putbox:
+ \cs_set_eq:NN \xeCJK_ulem_hskip:n \@@_ulem_hskip_aux:n
+ }
+\cs_new_eq:NN \@@_ulem_putbox: \UL@putbox
+\cs_new_protected_nopar:Npn \@@_ulem_skip_putbox:
+ {
+ \tl_if_empty:NF \UL@start
+ { \box_use_clear:N \UL@box }
+ }
% \end{macrocode}
% \end{macro}
%
@@ -7443,13 +7871,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\xeCJK_FullRight_and_Default: \@@_ulem_FullRight_and_Default:
\xeCJK_FullRight_and_CJK: \@@_ulem_FullRight_and_CJK:
\xeCJK_CJK_and_CJK:N \@@_ulem_CJK_and_CJK:N
- \xeCJK_Boundary_and_Default: \@@_ulem_Boundary_and_Default:
- \xeCJK_Boundary_and_NormalSp: \@@_ulem_Boundary_and_NormalSp:
+ \xeCJK_CJK_and_Boundary:w \@@_ulem_CJK_and_Boundary:w
\xeCJK@fix@penalty \@@_ulem_fix_penalty:
- \@@_punct_kern:n \@@_ulem_punct_kern:n
- \@@_punct_hskip:n \@@_ulem_punct_hskip:n
\@@_punct_breakable_kern:n \@@_ulem_punct_breakable_kern:n
- \@@_CJK_and_Boundary_aux: \@@_ulem_CJK_and_Boundary_aux:
\@@_Default_and_FullLeft_glue:N \@@_ulem_Default_and_FullLeft_glue:N
\@@_Default_and_FullRight_glue:N \@@_ulem_Default_and_FullRight_glue:N
\@@_CJK_and_FullLeft_glue:N \@@_ulem_CJK_and_FullLeft_glue:N
@@ -7483,11 +7907,11 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macrocode}
% \end{macro}
%
-% \changes{v3.1.2}{2012/12/27}{解决在下划线状态下使用 \cs{makebox} 时的错误。}
+% \changes{v3.1.2}{2012/12/27}{解决在下划线状态下使用 \tn{makebox} 时的错误。}
%
% \begin{macro}[internal]{\xeCJK_if_ulem_patch:TF}
-% 在下划线状态下,\pkg{ulem} 宏包在数学模式或者盒子中使用 \cs{UL@hrest} 恢复
-% \verb*|\ | 等的定义,此时不需要使用 \cs{UL@stop} 和 \cs{UL@start} 来断开下划线而
+% 在下划线状态下,\pkg{ulem} 宏包在数学模式或者盒子中使用 \tn{UL@hrest} 恢复
+% \verb*|\ | 等的定义,此时不需要使用 \tn{UL@stop} 和 \tn{UL@start} 来断开下划线而
% 产生断点。
% \begin{macrocode}
\cs_new_nopar:Npn \xeCJK_if_ulem_patch:TF
@@ -7501,44 +7925,28 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\@@_ulem_Boundary_and_Default:}
-% \begin{macrocode}
-\cs_new_protected_nopar:Npn \@@_ulem_Boundary_and_Default:
- {
- \xeCJK_if_ulem_patch:TF
- {
- \xeCJK_if_last_node:nTF { CJK }
- { \xeCJK_remove_node: \skip_horizontal:N \l_@@_ecglue_skip }
- { \xeCJK_if_last_node:nT { CJK-space } { \xeCJK_remove_node: \c_space_tl } }
- }
- { \@@_ulem_Boundary_and_Default: }
- }
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}[internal]{\@@_ulem_Boundary_and_NormalSp:}
-% \begin{macrocode}
-\cs_new_protected_nopar:Npn \@@_ulem_Boundary_and_NormalSp:
- {
- \xeCJK_if_ulem_patch:TF
- { \xeCJK_if_last_node:nT { CJK-space } { \xeCJK_remove_node: \c_space_tl } }
- { \@@_ulem_Boundary_and_NormalSp: }
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[internal]{\@@_ulem_CJK_and_Boundary_aux:}
+% \begin{macro}[internal]{\@@_ulem_CJK_and_Boundary:w}
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \@@_ulem_CJK_and_Boundary_aux:
+\cs_new_protected_nopar:Npn \@@_ulem_CJK_and_Boundary:w
{
\xeCJK_if_ulem_patch:TF
{
- \xeCJK_class_group_end:
- \UL@stop \@@_ulem_hskip:n { \c_zero_skip } \UL@start
- { \xeCJK_make_node:n { CJK } }
+ \xeCJK_peek_catcode_ignore_spaces:NTF \c_math_toggle_token
+ { }
+ {
+ \bool_if:NTF \l_@@_peek_ignore_spaces_bool
+ {
+ \xeCJK_class_group_end: \UL@stop
+ \UL@start { \xeCJK_make_node:n { CJK-space } }
+ }
+ {
+ \xeCJK_class_group_end: \UL@stop
+ \UL@start { \xeCJK_make_node:n { CJK } }
+ }
+ \xeCJK_make_group_tag:
+ }
}
- { \@@_ulem_CJK_and_Boundary_aux: }
+ { \@@_ulem_CJK_and_Boundary:w }
}
% \end{macrocode}
% \end{macro}
@@ -7628,9 +8036,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
{
\UL@stop
\@@_ulem_skip_punct_begin:
- \int_compare:nNnTF \etex_lastnodetype:D = \c_one
- { \@@_zero_glue: }
- { \@@_punct_glue:NN \c_@@_left_tl {#1} }
+ \@@_punct_glue:NN \c_@@_left_tl {#1}
\UL@start
}
{ \@@_ulem_Boundary_and_FullLeft_glue:N #1 }
@@ -7725,7 +8131,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{macro}[internal]{\@@_ulem_FullLeft_and_CJK:}
% \changes{v3.2.3}{2013/06/04}
-% {修正全角左标点后下划线与 \cs{CJKunderdot} 连用时结果不正常的问题。}
+% {修正全角左标点后下划线与 \tn{CJKunderdot} 连用时结果不正常的问题。}
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_ulem_FullLeft_and_CJK:
{
@@ -7784,7 +8190,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\cs_new_protected_nopar:Npn \@@_ulem_punct_hskip:n
{
\xeCJK_if_ulem_patch:TF
- { \@@_ulem_hskip:n }
+ { \xeCJK_ulem_hskip:n }
{ \@@_ulem_punct_hskip:n }
}
% \end{macrocode}
@@ -7792,11 +8198,14 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{macro}[internal]{\@@_ulem_punct_kern:n}
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \@@_ulem_punct_kern:n
+\cs_new_protected_nopar:Npn \@@_ulem_punct_kern:n #1
{
\xeCJK_if_ulem_patch:TF
- { \@@_ulem_hskip:n }
- { \@@_ulem_punct_kern:n }
+ {
+ \dim_compare:nNnF {#1} = \c_zero_dim
+ { \xeCJK_ulem_hskip:n {#1} }
+ }
+ { \@@_ulem_punct_kern:n {#1} }
}
% \end{macrocode}
% \end{macro}
@@ -7808,7 +8217,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\xeCJK_if_ulem_patch:TF
{
\xeCJK_class_group_end:
- \UL@stop \@@_ulem_hskip:n {#1} \UL@start
+ \UL@stop \xeCJK_ulem_hskip:n {#1} \UL@start
\@@_ulem_class_group_begin:
}
{ \@@_ulem_punct_breakable_kern:n {#1} }
@@ -7816,128 +8225,504 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\@@_ulem_glue:n,\@@_ulem_ccglue:,\@@_ulem_hskip:n}
-% 在下划线状态下的分别代替 \cs{CJKglue} 等。
+% \begin{macro}[internal]{\@@_ulem_glue:n,\@@_ulem_ccglue:}
+% 在下划线状态下的分别代替 \tn{CJKglue} 等。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_ulem_glue:n #1
{
\xeCJK_if_ulem_patch:TF
- { \UL@stop \@@_ulem_hskip:n {#1} \UL@start }
+ {
+ \tl_if_empty:NTF \l_@@_group_tag_tl
+ { \UL@stop \@@_ulem_hskip:n {#1} \UL@start }
+ {
+ \str_if_eq_x:nnTF { \l_@@_group_tag_tl } { \c_@@_group_tag_tl }
+ { \UL@stop \@@_ulem_hskip:n {#1} \UL@start }
+ { \skip_horizontal:n {#1} }
+ }
+ }
{ \skip_horizontal:n {#1} }
}
+\cs_new_protected_nopar:Npn \xeCJK_make_group_tag:
+ { \tl_set:Nx \l_@@_group_tag_tl { \c_@@_group_tag_tl } }
+\tl_new:N \l_@@_group_tag_tl
+\tl_const:Nn \c_@@_group_tag_tl
+ {
+ T \int_use:N \etex_currentgrouptype:D
+ L \int_use:N \etex_currentgrouplevel:D
+ }
\cs_new_protected_nopar:Npn \@@_ulem_ccglue:
{ \skip_set_eq:NN \UL@skip \l_@@_ccglue_skip \UL@leaders }
-\cs_new_protected_nopar:Npn \@@_ulem_hskip:n #1
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\xeCJKfntefon}
+% 扩展 \tn{ULon} 的参数,带 |*| 表示不跳过标点符号,带 |-| 表示两端减小一定距离。
+% \begin{macrocode}
+\NewDocumentCommand \xeCJKfntefon
+ { > { \ReverseBoolean } s t- > { \ReverseBoolean } s }
{
- \int_compare:nNnTF \tex_lastkern:D = \c_three
- { \skip_horizontal:n {#1} }
- { \skip_set:Nn \UL@skip {#1} \UL@leaders }
+ \bool_set:Nn \l_@@_ulem_skip_bool { #1 && #3 }
+ \bool_set_eq:NN \l_@@_ulem_subtract_bool #2
+ \ULon
}
+\bool_new:N \l_@@_ulem_subtract_bool
+\bool_new:N \l_@@_ulem_skip_bool
+\cs_new_eq:NN \xeCJK_ulem_on:n \UL@on
+\cs_set_protected:Npn \UL@on #1
+ { \xeCJK_ulem_on:n { \xeCJK_ulem_left: #1 \xeCJK_ulem_right: } }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\CJKunderdot}
-% 使用 \pkg{xeCJK} 时,\pkg{CJKfntef} 中的 \cs{CJKunderdot} 和 \cs{CJKunderanysymbol}
-% 在汉字之间不能断行。因此需要我们在这里修改它们。
+% \begin{macro}{\CJKunderline}
% \begin{macrocode}
-\RenewDocumentCommand \CJKunderdot { m }
+\DeclareDocumentCommand \CJKunderline { s t- s o }
{
- \bool_if:NT \l_@@_ulem_hook_used_bool
- { \UL@stop \@@_ulem_restore_CJK_and_Boundary: }
- \CJK@preUnderdot
- \@@_make_under_symbol:n { \CJK@underdotSkip }
- \cs_gset_eq:NN \@@_save_under_CJKsymbol:N \CJKsymbol
- \cs_set_eq:NN \CJKsymbol \@@_under_CJKsymbol:N
- \@@_restore_shipout_CJKsymbol:
- \bool_if:NT \l_@@_ulem_hook_used_bool { \UL@start }
- #1
- \bool_if:NT \l_@@_ulem_hook_used_bool { \UL@stop }
- \cs_set_eq:NN \CJKsymbol \@@_save_under_CJKsymbol:N
- \tl_clear:N \l_@@_fntef_shipout_tl
- \CJK@postUnderdot
- \bool_if:NT \l_@@_ulem_hook_used_bool
- { \@@_ulem_restore_CJK_and_Boundary: \UL@start }
- \tex_ignorespaces:D
+ \c_group_begin_token
+ \xeCJK_fntef_boot:nnNNNn { underline } { uline } #1#2#3 {#4}
+ \xeCJK_fntef_initial:nnn
+ { \l_@@_uline_depth_tl }
+ { \l_@@_uline_sep_tl }
+ {
+ \l_@@_uline_format_tl
+ \tex_vrule:D
+ height \dim_eval:n { \l_@@_uline_thickness_tl }
+ depth \c_zero_dim
+ width .2em
+ }
+ \ULon
}
-\box_new:N \g_@@_under_symbol_box
-\cs_new_protected_nopar:Npn \@@_ulem_restore_CJK_and_Boundary:
+\DeclareDocumentCommand \varCJKunderline { }
+ { \CJKunderline - }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CJKunderwave}
+% \begin{macrocode}
+\DeclareDocumentCommand \CJKunderwave { s t- s o }
{
- \xeCJK_if_ulem_patch:TF
+ \c_group_begin_token
+ \xeCJK_fntef_boot:nnNNNn { underwave } { uwave } #1#2#3 {#4}
+ \xeCJK_fntef_initial:nnn
+ { \l_@@_uwave_depth_tl }
+ { \l_@@_uwave_sep_tl }
+ { \l_@@_uwave_format_tl \l_@@_uwave_symbol_tl }
+ \ULon
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CJKunderdblline}
+% \begin{macrocode}
+\DeclareDocumentCommand \CJKunderdblline { s t- s o }
+ {
+ \c_group_begin_token
+ \xeCJK_fntef_boot:nnNNNn { underdblline } { udbline } #1#2#3 {#4}
+ \xeCJK_fntef_initial:nnn
+ { \l_@@_udbline_depth_tl }
+ { \l_@@_udbline_sep_tl }
+ {
+ \l_@@_udbline_format_tl
+ \vbox_top:n
+ {
+ \tex_hrule:D
+ height \dim_eval:n { \l_@@_udbline_thickness_tl }
+ depth \c_zero_dim
+ width .2em
+ \tex_kern:D \dim_eval:n { \l_@@_udbline_gap_tl }
+ \tex_hrule:D
+ height \dim_eval:n { \l_@@_udbline_thickness_tl }
+ depth \c_zero_dim
+ width .2em
+ }
+ }
+ \ULon
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CJKsout}
+% \begin{macrocode}
+\DeclareDocumentCommand \CJKsout { s t- s o }
+ {
+ \c_group_begin_token
+ \xeCJK_fntef_boot:nnNNNn { sout } { sout } #1#2#3 {#4}
+ \xeCJK_fntef_initial:nn
+ {
+ \l_@@_sout_format_tl
+ \tex_vrule:D
+ height \dim_eval:n { \l_@@_sout_thickness_tl }
+ depth \c_zero_dim
+ width .2em
+ }
+ {
+ \box_move_up:nn
+ { \l_@@_sout_height_tl - \box_ht:N \l_@@_fntef_box / 2 }
+ { \box_use:N \l_@@_fntef_box }
+ }
+ \ULon
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CJKxout}
+% \begin{macrocode}
+\DeclareDocumentCommand \CJKxout { s t- s o }
+ {
+ \c_group_begin_token
+ \xeCJK_fntef_boot:nnNNNn { xout } { xout } #1#2#3 {#4}
+ \xeCJK_fntef_initial:nn
+ {
+ \l_@@_xout_format_tl
+ \tex_kern:D -.1 em $/$
+ \tex_kern:D -.1 em
+ }
+ {
+ \box_move_up:nn
+ { \box_dp:N \l_@@_fntef_box / 2 }
+ { \box_use:N \l_@@_fntef_box }
+ }
+ \ULon
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CJKunderanyline}
+% \begin{macrocode}
+\DeclareDocumentCommand \CJKunderanyline
+ { > { \ReverseBoolean } s t- > { \ReverseBoolean } s m m }
+ {
+ \c_group_begin_token
+ \xeCJK_fntef_initial:nn
+ {#5}
+ {
+ \box_move_down:nn
+ {#4}
+ { \box_use:N \l_@@_fntef_box }
+ }
+ \bool_set:Nn \l_@@_ulem_skip_bool { #1 && #3 }
+ \bool_set_eq:NN \l_@@_ulem_subtract_bool #2
+ \ULon
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\xeCJK_fntef_boot:nnNNNn}
+% 处理参数问题。
+% \begin{macrocode}
+\cs_new_protected:Npn \xeCJK_fntef_boot:nnNNNn #1#2#3#4#5#6
+ {
+ \bool_if:nT { #3 || #5 }
+ { \bool_set_false:c { l_@@_#2_skip_bool } }
+ \IfBooleanT #4
+ { \bool_set_true:c { l_@@_#2_subtract_bool } }
+ \IfNoValueF {#6}
+ { \keys_set:nn { xeCJK / options / #1 } {#6} }
+ \bool_set_eq:Nc \l_@@_ulem_skip_bool { l_@@_#2_skip_bool }
+ \bool_set_eq:Nc \l_@@_ulem_subtract_bool { l_@@_#2_subtract_bool }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\xeCJK_fntef_initial:n}
+% 不支持下划线的嵌套使用。下划线嵌套使用时,里层的下划线会被放在盒子里,不能折行。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \xeCJK_fntef_initial:n
+ {
+ \xeCJK_leave_vmode:
+ \bool_if:NTF \l_@@_nest_bool
+ { \@@_warning:n { fntef-nesting } }
+ {
+ \bool_set_true:N \l_@@_nest_bool
+ \@@_restore_shipout_fntef:
+ }
+ \xeCJK_fntef_sbox:n
+ }
+\cs_new_protected:Npn \xeCJK_fntef_initial:nn #1
+ {
+ \xeCJK_fntef_initial:n {#1}
+ \bool_if:NF \l_@@_fntef_bool
+ { \dim_zero:N \l_@@_fntef_dim }
+ \markoverwith
+ }
+\cs_new_protected:Npn \xeCJK_fntef_initial:nnn #1#2#3
+ {
+ \xeCJK_fntef_initial:n {#3}
+ \bool_if:NF \l_@@_fntef_bool
{
- \xeCJK_swap_cs:NN
- \@@_CJK_and_Boundary_aux: \@@_ulem_CJK_and_Boundary_aux:
+ \bool_set_true:N \l_@@_fntef_bool
+ \dim_set:Nn \l_@@_fntef_dim {#1}
}
- { }
+ \markoverwith
+ {
+ \box_move_down:nn
+ { \l_@@_fntef_dim + \box_ht:N \l_@@_fntef_box }
+ { \box_use:N \l_@@_fntef_box }
+ }
+ \dim_set:Nn \l_@@_fntef_dim { #2 + \box_dp:N \ULC@box }
}
+\box_new:N \l_@@_fntef_box
+\cs_new_eq:NN \xeCJKfntefbox \l_@@_fntef_box
+\bool_new:N \l_@@_nest_bool
+\bool_new:N \l_@@_fntef_bool
+\@@_msg_new:nn { fntef-nesting }
+ { Nesting~is~not~supported. }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\CJKunderanysymbol}
+% \begin{macro}[var,internal]{\l_@@_fntef_dim}
+% 记录下划线或者下划符号的深度,以便它们嵌套使用时能自动调整好距离。
+% \tn{ULdepth} 被 \pkg{ulem} 初始化为 \tn{maxdimen}。下划线嵌套时,\pkg{ulem}
+% 要使用它作计算,可能会溢出。为简便起见,\cs{l_@@_fntef_dim} 与 \tn{ULdepth}
+% 共用一个寄存器。
% \begin{macrocode}
-\RenewDocumentCommand \CJKunderanysymbol { m m m }
+\cs_new_eq:NN \l_@@_fntef_dim \ULdepth
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\xeCJK_fntef_sbox:n}
+% 与 \cs{hcoffin_set:Nn} 和 \LaTeXe{} 的 \tn{sbox} 功能类似,确保颜色的正确。
+% 虽然 \texttt{coffin} 可以更方便的操作盒子,但速度要慢一点。并且,我们的需求
+% 也比较简单,就不用它了。
+% \begin{macrocode}
+\cs_new_protected:Npn \xeCJK_fntef_sbox:n #1
{
- \group_begin:
- \hbox_set:Nn \CJK@underdotBox {#2}
- \@@_make_under_symbol:n {#1}
- \cs_set_eq:NN \@@_save_under_CJKsymbol:N \CJKsymbol
- \cs_set_eq:NN \CJKsymbol \@@_under_CJKsymbol:N
- \@@_restore_shipout_CJKsymbol:
- \tl_clear:N \l_@@_underdot_shipout_tl
- #3
- \group_end:
+ \hbox_set:Nn \l_@@_fntef_box
+ {
+ \color_group_begin:
+ \color_ensure_current:
+ #1
+ \color_group_end:
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\xeCJK_leave_vmode:}
+% 功能与 \tn{leavevmode} 类似,但不会影响 \tn{everypar}。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \xeCJK_leave_vmode:
+ {
+ \if_mode_vertical:
+ \exp_after:wN \tex_indent:D
+ \fi:
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\keys_define:nn { xeCJK / options }
+ {
+ underdot / symbol .tl_set:N = \l_@@_udot_symbol_tl ,
+ underdot / depth .tl_set:N = \l_@@_udot_depth_tl ,
+ underdot / sep .tl_set:N = \l_@@_udot_sep_tl ,
+ underdot / format .tl_set:N = \l_@@_udot_format_tl ,
+ underdot / boxdepth .tl_set:N = \l_@@_udot_boxdepth_tl ,
+ symbol / sep .tl_set:N = \l_@@_symbol_sep_tl ,
+ symbol / boxdepth .tl_set:N = \l_@@_symbol_boxdepth_tl ,
+ underline / skip .bool_set:N = \l_@@_uline_skip_bool ,
+ underline / subtract .bool_set:N = \l_@@_uline_subtract_bool ,
+ underline / thickness .tl_set:N = \l_@@_uline_thickness_tl ,
+ underline / depth .tl_set:N = \l_@@_uline_depth_tl ,
+ underline / sep .tl_set:N = \l_@@_uline_sep_tl ,
+ underline / format .tl_set:N = \l_@@_uline_format_tl ,
+ underdblline / skip .bool_set:N = \l_@@_udbline_skip_bool ,
+ underdblline / subtract .bool_set:N = \l_@@_udbline_subtract_bool ,
+ underdblline / thickness .tl_set:N = \l_@@_udbline_thickness_tl ,
+ underdblline / depth .tl_set:N = \l_@@_udbline_depth_tl ,
+ underdblline / sep .tl_set:N = \l_@@_udbline_sep_tl ,
+ underdblline / format .tl_set:N = \l_@@_udbline_format_tl ,
+ underdblline / gap .tl_set:N = \l_@@_udbline_gap_tl ,
+ underwave / skip .bool_set:N = \l_@@_uwave_skip_bool ,
+ underwave / subtract .bool_set:N = \l_@@_uwave_subtract_bool ,
+ underwave / symbol .tl_set:N = \l_@@_uwave_symbol_tl ,
+ underwave / depth .tl_set:N = \l_@@_uwave_depth_tl ,
+ underwave / sep .tl_set:N = \l_@@_uwave_sep_tl ,
+ underwave / format .tl_set:N = \l_@@_uwave_format_tl ,
+ sout / skip .bool_set:N = \l_@@_sout_skip_bool ,
+ sout / subtract .bool_set:N = \l_@@_sout_subtract_bool ,
+ sout / thickness .tl_set:N = \l_@@_sout_thickness_tl ,
+ sout / height .tl_set:N = \l_@@_sout_height_tl ,
+ sout / format .tl_set:N = \l_@@_sout_format_tl ,
+ xout / skip .bool_set:N = \l_@@_xout_skip_bool ,
+ xout / subtract .bool_set:N = \l_@@_xout_subtract_bool ,
+ xout / format .tl_set:N = \l_@@_xout_format_tl
+ }
+\clist_map_inline:nn
+ { underdot , underline , underdblline , underwave , sout , xout }
+ {
+ \keys_define:nn { xeCJK / options }
+ { #1 .meta:nn = { xeCJK / options / #1 } { ##1 } }
+ }
+\keys_set:nn { xeCJK / options }
+ {
+ underdot / symbol = \normalfont . ,
+ underdot / depth = 0.20 em ,
+ underdot / sep = 0.04 em ,
+ underdot / boxdepth = \c_max_dim ,
+ symbol / sep = \c_zero_dim ,
+ symbol / boxdepth = \c_max_dim ,
+ underline / skip = true ,
+ underline / thickness = \ULthickness ,
+ underline / depth = 0.20 em ,
+ underline / sep = 0.07 em ,
+ underdblline / skip = true ,
+ underdblline / thickness = \ULthickness ,
+ underdblline / depth = 0.20 em ,
+ underdblline / sep = 0.17 em ,
+ underdblline / gap = 1.1 pt ,
+ underwave / skip = true ,
+ underwave / symbol = \sixly \tex_char:D 58 \exp_stop_f: ,
+ underwave / depth = 0.20 em ,
+ underwave / sep = 0.00 em ,
+ sout / skip = true ,
+ sout / thickness = \ULthickness ,
+ sout / height = 0.35 em ,
+ xout / skip = true
+ }
+\cs_if_free:NF \color
+ {
+ \keys_set:nn { xeCJK / options }
+ {
+ underdot / format = \color { red } ,
+ underline / format = \color { blue } ,
+ underdblline / format = \color { blue } ,
+ underwave / format = \color { blue } ,
+ sout / format = \color { red } ,
+ xout / format = \color { blue }
+ }
+ }
+% \end{macrocode}
+%
+% \begin{macro}{\CJKunderanysymbol}
+% \begin{macrocode}
+\DeclareDocumentCommand \CJKunderanysymbol { o m m m }
+ {
+ \xeCJK_under_symbol:nnnnnn { symbol } { symbol } {#1} {#2} {#3} {#4}
\tex_ignorespaces:D
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\@@_restore_shipout_CJKsymbol:}
-% \changes{v3.2.3}{2013/06/04}{解决 \cs{CJKunderdot} 跨页使用时影响到页眉页脚的问题。}
-% \cs{CJKunderdot} 中对 \cs{CJKsymbol} 的修改会影响到页眉和页脚,需要小心处理。
+% \begin{macro}{\CJKunderdot}
+% \tn{CJKunderdot} 是 \tn{CJKunderanysymbol} 的特殊情况。\pkg{CJKfntef} 原来使用
+% 的是数学符号 \tn{cdot},这里改成更合适的 |.|。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_restore_shipout_CJKsymbol:
+\DeclareDocumentCommand \CJKunderdot { o m }
{
- \tl_set:Nn \l_@@_fntef_shipout_tl
- {
- \l_@@_underdot_shipout_tl
- \cs_set_eq:NN \CJKsymbol \@@_save_under_CJKsymbol:N
- }
+ \xeCJK_under_symbol:nnnnnn { underdot } { udot }
+ {#1}
+ { \l_@@_udot_depth_tl }
+ { \l_@@_udot_format_tl \l_@@_udot_symbol_tl }
+ {#2}
+ \tex_ignorespaces:D
}
-\tl_new:N \l_@@_fntef_shipout_tl
-\tl_new:N \l_@@_underdot_shipout_tl
-\tl_set:Nn \l_@@_underdot_shipout_tl
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\xeCJK_under_symbol:nnnnnn}
+% 当处在下划线中时,我们先断开下划线,在分组外设置下划符号。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \xeCJK_under_symbol:nnnnnn
{
- \cs_set_eq:NN \CJKf@global \scan_stop:
- \int_zero:N \CJK@nest \CJK@postUnderdot
+ \xeCJK_if_ulem_patch:TF
+ { \@@_under_symbol_auxi:nnnnnn }
+ { \@@_under_symbol_auxii:nnnnnn }
}
-\xeCJK_add_to_shipout:n { \l_@@_fntef_shipout_tl }
+\cs_new_protected:Npn \@@_under_symbol_auxi:nnnnnn #1#2#3#4#5#6
+ {
+ \xeCJK_ulem_right: \UL@stop
+ \group_begin:
+ \xeCJK_under_symbol_initial:nnnnn {#1} {#2} {#3} {#4} {#5}
+ \UL@start \xeCJK_ulem_right_node:
+ #6
+ \xeCJK_ulem_right: \UL@stop
+ \group_end:
+ \UL@start \xeCJK_ulem_right_node:
+ }
+\cs_new_protected:Npn \@@_under_symbol_auxii:nnnnnn #1#2#3#4#5#6
+ {
+ \xeCJK_leave_vmode:
+ \group_begin:
+ \xeCJK_under_symbol_initial:nnnnn {#1} {#2} {#3} {#4} {#5}
+ #6
+ \group_end:
+ }
+\cs_new_protected:Npn \xeCJK_under_symbol_initial:nnnnn #1#2#3#4#5
+ {
+ \IfNoValueF {#3}
+ { \keys_set:nn { xeCJK / options / #1 } {#3} }
+ \xeCJK_fntef_sbox:n {#5}
+ \bool_if:NTF \l_@@_fntef_bool
+ { \xeCJK_make_under_symbol:nn { \l_@@_fntef_dim } }
+ {
+ \bool_set_true:N \l_@@_fntef_bool
+ \xeCJK_make_under_symbol:nn {#4}
+ }
+ { \use:c { l_@@_#2_boxdepth_tl } }
+ \dim_set:Nn \l_@@_fntef_dim
+ { \use:c { l_@@_#2_sep_tl } + \box_dp:N \l_@@_under_symbol_box }
+ \xeCJK_swap_cs:NN \CJKsymbol \@@_under_CJKsymbol:N
+ \@@_restore_shipout_CJKsymbol:
+ }
+\box_new:N \l_@@_under_symbol_box
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\@@_make_under_symbol:n}
+% \begin{macro}[internal]{\xeCJK_make_under_symbol:n}
+% 我们量取“一”的宽度作为汉字的宽度。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_make_under_symbol:n #1
+\cs_new_protected:Npn \xeCJK_make_under_symbol:nn #1#2
{
- \hbox_set:Nn \l_@@_tmp_box { ^^^^4e00 }
- \vbox_gset_to_ht:Nnn \g_@@_under_symbol_box \c_zero_dim
+ \hbox_set:Nn \l_@@_under_symbol_box
{
- \skip_vertical:n {#1}
- \hbox_to_zero:n
+ \box_move_down:nn { #1 + \box_ht:N \l_@@_fntef_box }
{
- \tex_kern:D \box_wd:N \l_@@_tmp_box
- \tex_hss:D \box_use:N \CJK@underdotBox \tex_hss:D
+ \hbox_to_zero:n
+ {
+ \xeCJK_select_font:
+ \tex_kern:D \etex_fontcharwd:D \tex_font:D "4E00 \exp_stop_f:
+ \tex_hss:D \box_use:N \l_@@_fntef_box \tex_hss:D
+ }
}
- \tex_vss:D
}
+ \dim_compare:nNnF {#2} = \c_max_dim
+ { \box_set_dp:Nn \l_@@_under_symbol_box {#2} }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\@@_restore_shipout_CJKsymbol:}
+% \changes{v3.2.3}{2013/06/04}{解决 \tn{CJKunderdot} 跨页使用时影响到页眉页脚的问题。}
+% \tn{CJKunderdot} 中对 \tn{CJKsymbol} 的修改会影响到页眉和页脚,需要小心处理。
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_restore_shipout_CJKsymbol:
+ {
+ \tl_put_right:Nn \l_@@_fntef_shipout_tl
+ { \xeCJK_swap_cs:NN \CJKsymbol \@@_under_CJKsymbol:N }
+ \@@_restore_shipout_fntef:
+ \xeCJK_cs_clear:N \@@_restore_shipout_CJKsymbol:
+ }
+\cs_new_protected:Npn \@@_restore_shipout_fntef:
+ {
+ \tl_put_right:Nn \l_@@_fntef_shipout_tl
+ {
+ \bool_set_false:N \l_@@_fntef_bool
+ \dim_zero:N \l_@@_fntef_dim
+ }
+ \xeCJK_cs_clear:N \@@_restore_shipout_fntef:
}
+\tl_new:N \l_@@_fntef_shipout_tl
+\xeCJK_add_to_shipout:n { \l_@@_fntef_shipout_tl }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[internal]{\@@_under_CJKsymbol:N}
+% 盒子放在汉字的左侧,比较容易处理状态转移的问题。
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \@@_under_CJKsymbol:N #1
+\cs_new_protected_nopar:Npn \@@_under_CJKsymbol:N
{
- \hbox_overlap_right:n { \box_use:N \g_@@_under_symbol_box }
- \xeCJK_no_break: \@@_save_under_CJKsymbol:N {#1}
+ \box_use:N \l_@@_under_symbol_box
+ \xeCJK_no_break: \@@_under_CJKsymbol:N
}
% \end{macrocode}
% \end{macro}
@@ -7949,10 +8734,10 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% 可选参数 |#1| 表示环境的垂直对齐位置,默认居中;参数 |#2| 表示环境的宽度。
% 带星号的环境,如果 |#2| 不大于零或者不大于环境最长文本行的宽度,则取环境的自然宽度。
% \begin{macrocode}
-\RenewDocumentEnvironment { CJKfilltwosides } { O { c } m }
+\DeclareDocumentEnvironment { CJKfilltwosides } { O { c } m }
{
\use:x { \exp_not:N \minipage [#1] { \dim_eval:n {#2} } }
- \cs_set_eq:NN \CJKglue \tex_hfill:D
+ \cs_set_eq:NN \CJKglue \xeCJK_fntef_hfilll:
}
{
\endminipage
@@ -7960,10 +8745,15 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
}
\NewEnviron { CJKfilltwosides* } [ 2 ] [ c ]
{
- \cs_set_eq:NN \CJKglue \tex_hfill:D
+ \cs_set_eq:NN \CJKglue \xeCJK_fntef_hfilll:
\tl_set:Nn \arraystretch { 1 }
- \token_if_dim_register:NT \extrarowheight
- { \dim_set_eq:NN \extrarowheight \c_zero_dim }
+ \cs_if_free:NF \extrarowheight
+ { \cs_set_eq:NN \extrarowheight \c_zero_dim }
+ \use:x { \@@_fill_two_sides:nn {#1} { \dim_eval:n {#2} } }
+ }
+ [ \ignorespacesafterend ]
+\cs_new_protected:Npn \@@_fill_two_sides:nn #1#2
+ {
\dim_compare:nNnTF {#2} > \c_zero_dim
{
\hbox_set:Nn \l_@@_tmp_box
@@ -7974,11 +8764,11 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
}
\dim_compare:nNnTF {#2} > { \box_wd:N \l_@@_tmp_box }
{
- \tabular [#1] { @ { } p { \dim_eval:n {#2} } @ { } }
+ \tabular [#1] { @ { } p {#2} @ { } }
\BODY
\endtabular
}
- { \hbox_unpack:N \l_@@_tmp_box }
+ { \box_use:N \l_@@_tmp_box }
}
{
\tabular [#1] { @ { } c @ { } }
@@ -7986,7 +8776,17 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\endtabular
}
}
- [ \ignorespacesafterend ]
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\xeCJK_fntef_hfilll:}
+% \pkg{colortbl} 将表格 |c| 列用于填充的 \tn{hfil} 改为了更高阶的 \texttt{fill},
+% 影响到了 \env{CJKfilltwosides*}。因此,我们也要用高阶的 \texttt{filll}。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \xeCJK_fntef_hfilll:
+ { \skip_horizontal:N \c_@@_filll_skip }
+\skip_new:N \c_@@_filll_skip
+\skip_set:Nn \c_@@_filll_skip { \c_zero_dim plus 1 filll }
% \end{macrocode}
% \end{macro}
%
@@ -8031,9 +8831,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \changes{v3.2.3}{2013/06/04}
% {解决 \texttt{listings} 坏境中代码行号输出不正确的问题,并解决在其中跨页时对页眉
% 和页脚的影响。}
-% 为使代码行号结果正确,需要在 \cs{lst@numberstyle} 中恢复 \cs{XeTeXinterchartoks}。
-% 在 \texttt{listings} 环境中换页时,对 \cs{XeTeXinterchartoks} 的修改会影响到
-% 页眉和页脚,需要在 \cs{shipout} 盒子中恢复成正常定义。加入 \cs{tex_noindent:D}
+% 为使代码行号结果正确,需要在 \tn{lst@numberstyle} 中恢复 \tn{XeTeXinterchartoks}。
+% 在 \texttt{listings} 环境中换页时,对 \tn{XeTeXinterchartoks} 的修改会影响到
+% 页眉和页脚,需要在 \tn{shipout} 盒子中恢复成正常定义。加入 \cs{tex_noindent:D}
% 是为了防止汉字出现在首行的时候可能会产生额外空行。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_listings_initial_hook:
@@ -8050,7 +8850,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\@@_listings_toks_hook:}
-% 采用不同的 \cs{XeTeXinterchartoks} 处理方式,输入的时候是将汉字加入到 \pkg{listings}
+% 采用不同的 \tn{XeTeXinterchartoks} 处理方式,输入的时候是将汉字加入到 \pkg{listings}
% 的输出队列,实际输出的时候是普通文字。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_listings_toks_hook:
@@ -8118,9 +8918,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\@@_listings_process_Default:N,\@@_listings_process_CJK:nN}
-% \changes{v3.2.3}{2013/06/08}{在 \texttt{listings} 坏境中对 \cs{charcode} 大于
-% $255$ 的字符根据其 \cs{catcode} 区分 \texttt{letter} 和 \texttt{other}。}
-% 对于 \cs{charcode} 大于 $255$ 的字符,根据 \cs{catcode} 进行处理。
+% \changes{v3.2.3}{2013/06/08}{在 \texttt{listings} 坏境中对 \tn{charcode} 大于
+% $255$ 的字符根据其 \tn{catcode} 区分 \texttt{letter} 和 \texttt{other}。}
+% 对于 \tn{charcode} 大于 $255$ 的字符,根据 \tn{catcode} 进行处理。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_listings_process_Default:N #1
{
@@ -8140,7 +8940,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macro}[internal]{\@@_listings_append:nN}
% 普通 CJK 字符的宽度为一般基本宽度的两倍,IVS 类不增加宽度。这里有一个问题,
% 对 CJK 字符类中的一些半角字符(例如半角日文假名)没有区分开。\pkg{listings} 通过
-% 重定义 \cs{lst@Append} 将代码写入外部文件,因此需要保留。
+% 重定义 \tn{lst@Append} 将代码写入外部文件,因此需要保留。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_listings_append:nN #1#2
{
@@ -8277,7 +9077,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\@@_listings_process_IVS:nN}
-% \texttt{IVS} 类作为 \texttt{letter} 处理,不用增加 \cs{lst@length}。
+% \texttt{IVS} 类作为 \texttt{letter} 处理,不用增加 \tn{lst@length}。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_listings_process_IVS:nN
{
@@ -8291,7 +9091,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{macro}[internal]{\@@_listings_output_IVS:}
% 在使用 \texttt{columns=fixed} 选项时,\pkg{listings} 会在输出盒子里的每个字符
-% 之间加入 \cs{hss},这就破坏了 \XeTeX 将基本字和 IVS 正确的组合起来。
+% 之间加入 \tn{hss},这就破坏了 \XeTeX 将基本字和 IVS 正确的组合起来。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_listings_output_IVS:
{
@@ -8309,7 +9109,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\@@_listings_peek_active_loop:TF}
-% \cs{lstinline} 通过判断参数中第一个字符是否是 \texttt{active} 类来区分
+% \tn{lstinline} 通过判断参数中第一个字符是否是 \texttt{active} 类来区分
% 它是否被用在其它宏的参数之中。如果这第一个字符不在 \pkg{listings} 预定义的
% 符号表中,判断就会出问题。我们在这里通过一个循环跳过这些字符。
% \begin{macrocode}
@@ -8332,9 +9132,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\@@_listings_inside_convert:nw,\@@_listings_inline_group:w}
-% 当 \cs{lstinline} 被使用在参数中时,\pkg{listings} 会使用一个循环逐个将
-% \cs{lstinline} 参数中的字符设置为活动字符。我们可以通过 \cs{tl_set_rescan:Nnn}
-% 来完成这里的 \cs{catcode} 转换,避免将 \cs{charcode} 超过 $255$ 的字符都设置为
+% 当 \tn{lstinline} 被使用在参数中时,\pkg{listings} 会使用一个循环逐个将
+% \tn{lstinline} 参数中的字符设置为活动字符。我们可以通过 \cs{tl_set_rescan:Nnn}
+% 来完成这里的 \tn{catcode} 转换,避免将 \tn{charcode} 超过 $255$ 的字符都设置为
% 活动字符。
% \begin{macrocode}
\cs_new_protected:Npn \@@_listings_inside_convert:nw #1 ~ \@empty
@@ -8360,7 +9160,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\@@_set_listings_escape:}
-% 由于我们在上面的修改,需要保留 |\| 用于转义 \cs{lstinline} 参数中的某些 \TeX
+% 由于我们在上面的修改,需要保留 |\| 用于转义 \tn{lstinline} 参数中的某些 \TeX
% 特殊字符,与原来宏包一致。
% \begin{macrocode}
\group_begin:
@@ -8402,7 +9202,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macrocode}
%
% \pkg{xunicode} 对编码相关的符号命令的定义中用的是诸如 |\char"0022\relax| 的形式。
-% 例如 \cs{textbar} 被展开为 |\char"007C\relax|。并且诸如下述的定义是无效的:
+% 例如 \tn{textbar} 被展开为 |\char"007C\relax|。并且诸如下述的定义是无效的:
% \begin{verbatim}
% \DeclareUTFcomposite[\UTFencname]{x1EBF}{\'}{\^e}
% \end{verbatim}
@@ -8435,8 +9235,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
{ \clist_gput_left:Nx \g_@@_encname_clist { \UTFencname } }
% \end{macrocode}
%
-% 若 \pkg{xunicode} 已经被调用,则在宏包结束的时候,重新设置 \cs{UTFencname}
-% 对应的编码命令。否则设置 \cs{UTFencname},如果使用的是 \hologo{LuaLaTeX},则
+% 若 \pkg{xunicode} 已经被调用,则在宏包结束的时候,重新设置 \tn{UTFencname}
+% 对应的编码命令。否则设置 \tn{UTFencname},如果使用的是 \hologo{LuaLaTeX},则
% 需要作一些设置,使得 \pkg{xunicode} 可用。
%
% \begin{macrocode}
@@ -8508,9 +9308,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\DeclareUTFmathsymbols}
-% \changes{v3.2.8}{2013/12/04}{修正 \cs{UseMathAsText} 的功能,恢复 \cs{hbar}
+% \changes{v3.2.8}{2013/12/04}{修正 \tn{UseMathAsText} 的功能,恢复 \tn{hbar}
% 和增加以 \texttt{text} 打头的文本符号命令。}
-% 将文本符号定义为 \cs{protected} 宏后,为了与 \pkg{hyperref} 的书签功能兼容
+% 将文本符号定义为 \tn{protected} 宏后,为了与 \pkg{hyperref} 的书签功能兼容
% 需要作一点额外处理。
% \begin{macrocode}
\RenewDocumentCommand \DeclareUTFmathsymbols { m }
@@ -8642,7 +9442,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\@@_restore_hbar:}
-% 恢复 \cs{hbar} 为原本定义。
+% 恢复 \tn{hbar} 为原本定义。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_restore_hbar:
{
@@ -8660,7 +9460,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{macro}[internal]{\@@_declare_character:Nnn}
% 通过 \texttt{lowercase} 技巧,直接由 Unicode |#3| 得到编码 |#2| 下的符号命令
-% |#1| 对应的实际字符。\cs{DeclareUTFSymbol} 的参数格式与 \cs{DeclareTextSymbol}
+% |#1| 对应的实际字符。\tn{DeclareUTFSymbol} 的参数格式与 \tn{DeclareTextSymbol}
% 完全一致。
% \begin{macrocode}
\cs_new_protected:Npn \@@_declare_character:Nnn #1#2#3
@@ -8680,7 +9480,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\DeclareUTFSymbol,\DeclareUTFCommand}
-% \cs{DeclareUTFCommand} 只能用于定义不带参数的符号命令。
+% \tn{DeclareUTFCommand} 只能用于定义不带参数的符号命令。
% \begin{macrocode}
\NewDocumentCommand \DeclareUTFSymbol { m O { \UTFencname } m }
{ \@@_declare_character:Nnn #1 {#2} {#3} }
@@ -8700,7 +9500,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{macro}[internal]{\@@_provide_text_command_default:N}
% 如果控制序列 |#1| 已经存在,但不是符号命令,\pkg{xunicode} 会将它定义为
-% \cs{UTFencname} 编码下的符号命令。但是编码被转换之后,再使用这些控制序列,
+% \tn{UTFencname} 编码下的符号命令。但是编码被转换之后,再使用这些控制序列,
% \pkg{NFSS} 就会报错。为此需要给出这些符号命令的默认定义,与原来的意义相同。
% 这些命令包括
% \begin{verbatim}
@@ -8712,7 +9512,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \hbar macro:->{\mathchar '26\mkern -9muh}
% \textaolig macro:->{a\kern -.25em o}
% \end{verbatim}
-% 影响比较大的是 \cs{nobreakspace}、\cs{copyright} 和 \cs{hbar}。
+% 影响比较大的是 \tn{nobreakspace}、\tn{copyright} 和 \tn{hbar}。
% \begin{macrocode}
\cs_new_protected:Npn \@@_provide_text_command_default:N #1
{
@@ -8728,7 +9528,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%
% \begin{macro}[internal]{\@@_declare_character:NNnn}
% 使用编码 |#4| 下的符号命令 |#2| 的时候先判断它对应的实际字符 |#1| 在当前字体中
-% 是否存在。如果不存在则转换到 \cs{DeclareTextSymbolDefault} 中设置的编码或者使用
+% 是否存在。如果不存在则转换到 \tn{DeclareTextSymbolDefault} 中设置的编码或者使用
% \cs{Declare\-Text\-Command\-Default} 中设置的命令。
% \begin{macrocode}
\cs_new_protected:Npn \@@_declare_character:NNnn #1#2#3#4
@@ -8777,7 +9577,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \DeclareUTFcomposite[\UTFencname]{x02E8\char"02E5}{\tonebar}{25}
% \DeclareUTFcomposite[\UTFencname]{x02E5\char"02E8}{\tonebar}{52}
% \end{verbatim}
-% 对复合符号命令的定义用的是 \cs{chardef},这有利于下面字符是否存在的判断。
+% 对复合符号命令的定义用的是 \tn{chardef},这有利于下面字符是否存在的判断。
% \begin{macrocode}
\cs_new_protected:Npn \@@_declare_composite:Nnnn #1#2#3#4
{
@@ -8874,7 +9674,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\DeclareUTFDoubleEncodedAccent}
-% \changes{v3.2.10}{2014/02/20}{改进 \cs{t} 等的定义方式。}
+% \changes{v3.2.10}{2014/02/20}{改进 \tn{t} 等的定义方式。}
% \begin{macrocode}
\NewDocumentCommand \DeclareUTFDoubleEncodedAccent { m O { \UTFencname } m m }
{ \@@_declare_encoded:NNnnn \@@_combine_double_accent:nnNNn #1 {#2} {#3} {#4} }
@@ -8882,7 +9682,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\DeclareUTFDoubleEncodedSymbol}
-% \changes{v3.2.10}{2014/02/21}{改进 \cs{sliding} 等的定义方式。}
+% \changes{v3.2.10}{2014/02/21}{改进 \tn{sliding} 等的定义方式。}
% \begin{macrocode}
\NewDocumentCommand \DeclareUTFDoubleEncodedSymbol { m O { \UTFencname } m m }
{ \@@_declare_encoded:NNnnn \@@_combine_double_symbol:nnNNn #1 {#2} {#3} {#4} }
@@ -8946,7 +9746,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\@@_text_combine:NnnNNn}
-% 若重音命令 |#2| 与它的参数 |#6| 的复合已经由 \cs{DeclareUTFcomposite} 设置,
+% 若重音命令 |#2| 与它的参数 |#6| 的复合已经由 \tn{DeclareUTFcomposite} 设置,
% 并且在当前字体中存在该字符,则直接使用。否则使用组合命令。
% \begin{macrocode}
\cs_new_protected:Npn \@@_text_combine:NnnNNn #1#2#3#4#5#6
@@ -8994,10 +9794,10 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \begin{macro}[internal]{\@@_combine_accent:nnNNn,\@@_add_accent:nnNN}
% 若组合重音符号的 |#3| 和基本重音符号 |#4| 在当前字体中都不存在,则转换到
% \cs{Declare\-Text\-Accent\-Default} 设置的编码或者使用
-% \cs{DeclareTextCommandDefault} 中设置的命令。\texttt{0.9999} 版以前的 \XeTeX
-% 需要设置 \cs{XeTeXinputnormalization} 为 $1$,才能使用字体中由基础字符和组合符号
+% \tn{DeclareTextCommandDefault} 中设置的命令。\texttt{0.9999} 版以前的 \XeTeX
+% 需要设置 \tn{XeTeXinputnormalization} 为 $1$,才能使用字体中由基础字符和组合符号
% 对应的实际字符;而 \texttt{0.9999} 版以后的 \XeTeX 默认就启用这个功能,^^A
-% \cs{XeTeXinputnormalization} 似乎是无效的,怀疑是使用 HarfBuzz 库替代 ICU 进行
+% \tn{XeTeXinputnormalization} 似乎是无效的,怀疑是使用 HarfBuzz 库替代 ICU 进行
% 字体排版的缘故\footnote{\url{http://tug.org/pipermail/xetex/2013-July/024579.html}}。
% \begin{macrocode}
\cs_new_protected:Npn \@@_combine_accent:nnNNn
@@ -9068,23 +9868,24 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
{
\hcoffin_set:Nn \l_@@_tmp_coffin {#1}
\hcoffin_set:Nn \l_@@_circle_coffin {#2}
- \dim_set:Nn \l_@@_circle_width_dim
- { \fp_use:N \l_@@_circle_ratio_fp \coffin_wd:N \l_@@_circle_coffin }
- \coffin_resize:Nnn \l_@@_tmp_coffin
- { \l_@@_circle_width_dim }
+ \fp_set:Nn \l_@@_circle_scale_fp
{
- ( \coffin_ht:N \l_@@_tmp_coffin + \coffin_dp:N \l_@@_tmp_coffin )
- * \tex_number:D \l_@@_circle_width_dim
- / \tex_number:D \coffin_wd:N \l_@@_tmp_coffin
+ \dim_to_decimal_in_unit:nn
+ {
+ \fp_use:N \l_@@_circle_ratio_fp
+ \coffin_wd:N \l_@@_circle_coffin
+ }
+ { \coffin_wd:N \l_@@_tmp_coffin }
}
+ \coffin_scale:Nnn \l_@@_tmp_coffin
+ { \l_@@_circle_scale_fp } { \l_@@_circle_scale_fp }
\coffin_attach:NnnNnnnn
\l_@@_circle_coffin { hc } { vc }
- \l_@@_tmp_coffin { hc } { vc }
- { \c_zero_dim } { \c_zero_dim }
+ \l_@@_tmp_coffin { hc } { vc } { \c_zero_dim } { \c_zero_dim }
\coffin_typeset:Nnnnn \l_@@_circle_coffin
{ H } { l } { \c_zero_dim } { \c_zero_dim }
}
-\dim_new:N \l_@@_circle_width_dim
+\fp_new:N \l_@@_circle_scale_fp
\coffin_new:N \l_@@_tmp_coffin
\coffin_new:N \l_@@_circle_coffin
% \end{macrocode}
@@ -9101,7 +9902,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\@@_combine_double_accent:nnNNn}
-% 使 \cs{t} 等组合重音符号放在参数的第一个字母的右边。
+% 使 \tn{t} 等组合重音符号放在参数的第一个字母的右边。
% \begin{macrocode}
\cs_new_protected:Npn \@@_combine_double_accent:nnNNn
{ \@@_text_combine:NnnNNn \@@_add_double_accent:nnNN }
@@ -9127,7 +9928,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\@@_combine_double_symbol:nnNNn}
-% 使 \cs{sliding} 等组合重音符号放在参数的第一个字母的右边。
+% 使 \tn{sliding} 等组合重音符号放在参数的第一个字母的右边。
% \begin{macrocode}
\cs_new_protected:Npn \@@_combine_double_symbol:nnNNn
{ \@@_text_combine:NnnNNn \@@_add_double_symbol:nnNN }
@@ -9149,7 +9950,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\@@_add_double_symbol:nN}
-% 如果参数的第一个记号是字母类、其它符号类或者由 \cs{chardef} 定义,则将组合符号
+% 如果参数的第一个记号是字母类、其它符号类或者由 \tn{chardef} 定义,则将组合符号
% 放在它的右边,否则不作处理。
% \begin{macrocode}
\cs_new_protected:Npn \@@_add_double_symbol:nN #1#2
@@ -9245,7 +10046,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
% \end{macro}
%
% \begin{macro}[internal]{\DeclareUTFTIPACommand}
-% \changes{v3.2.10}{2014/02/20}{检查 \cs{t} 和 \cs{sliding} 的参数是否以 \cs{textipa} 开头。}
+% \changes{v3.2.10}{2014/02/20}{检查 \tn{t} 和 \tn{sliding} 的参数是否以 \tn{textipa} 开头。}
% \begin{macrocode}
\NewDocumentCommand \DeclareUTFTIPACommand { O { \UTFencname } m }
{ \use:x { \@@_text_tipa_command:Nnn \exp_not:N #2 { \token_to_str:N #2 } {#1} } }
@@ -11025,7 +11826,7 @@ x^2+y^2
\CJKunderanyline{0.2em}{\kern-.03em\vtop{\kern.2ex\hrule width.2em\kern 0.11em
\hrule height 0.1em}\kern-.03em}{自定义下划线}
-\indent\CJKunderanyline{0.5em}{-}{\showtext}
+\CJKunderanyline{0.5em}{-}{\showtext}
\CJKunderanysymbol{0.2em}{-}{\showtext}
@@ -11048,6 +11849,36 @@ x^2+y^2
\CJKfntef{CJKsout}
\CJKfntef{CJKxout}
+\def\Book{\CJKunderwave-}
+\def\Noun{\CJKunderline-}
+
+如上所述,\Book{中國文學史}原是\Noun{復旦大學出版社}出版的,\Book{中國文學史新著}則由\Noun{上海文藝出版社}出版。現承\Noun{復旦大學出版社}\Noun{賀聖遂}先生的盛情和\Noun{上海文藝出版總社}\Noun{楊益萍}、\Noun{何承偉}先生以及有關負責人\Noun{陳鳴華}先生的高誼,此書增訂本改由兩社聯合出版。\Noun{賀聖遂}先生並與\Noun{杜榮根}副社長、\Noun{韓結根}編審共同擔任此書的責任編輯。對上述諸位先生謹在這裡表示衷心的感謝。對\Book{中國文學史新著}原版的責任編輯\Noun{戴俊}先生(現為\Noun{上海三聯書店}副總經理)也在此一併致謝。
+
+\Noun{與文學史的}\Noun{應有任務}\Noun{對文學發展過程}\Noun{的內在聯繫的描述}\Noun{還有很大的距離}\Noun{至於距離的所在}\Noun{本書原已有說明}\Book{此不贅述}\Book{為了對學術負責}\Book{我們決定重寫一部並迅即出版}
+
+\Noun{南朝}\Noun{梁}\Noun{劉勰}\Book{文心雕龍}\Book{養氣}
+
+\Noun{鎌池和馬}\Book{魔法禁書目錄}\Book{某科學的超電磁砲}
+
+\Noun{西尾維新}\Book{化物語}\Book{偽物語}\Book{貓物語}%
+\Book{傾物语}\Book{囤物語}\Book{鬼物語}\Book{戀物語}\Book{花物語}
+
+\Noun{岡田麿里}\Book{我們仍未知道那天所看見的花的名字。}\Book{絕園的暴風雨}
+
+\Noun{虚淵玄}\Book{Fate/Zero}\Book{PSYCHO-PASS}\Book{ALDNOAH.ZERO}
+
+\Noun{劉海洋}\Book{\LaTeX 入門}
+
+\def\NAME{%
+ \x{御坂美琴}\x{白井黑子}\x{戰場原緋多木}\x{阿良良木歷}%
+ \x{宿海仁太}\x{本間芽衣子}\x{瀧川吉野}\x{鎖部葉風}%
+ \x{衛宮切嗣}\x{言峰綺禮}\x{常守朱}\x{狡嚙慎也}%
+ \x{界塚伊奈帆}\x*{艾瑟依拉姆·沃斯·艾莉歐斯亞}}
+
+\let\x\Noun\NAME
+
+\let\x\Book\NAME
+
\end{document}
% \end{macrocode}
%
diff --git a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins
index 7ac58f7da5d..dd99474b02b 100644
--- a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins
+++ b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins
@@ -6,7 +6,7 @@
%%
%% xeCJK.dtx (with options: `install')
%%
-%% $Id: xeCJK.dtx 692 2014-06-20 12:25:35Z sobenlee $
+%% $Id: xeCJK.dtx 729 2014-11-05 13:46:36Z sobenlee@gmail.com $
%% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
%% -----------------------------------------------------------------
%% Author:
@@ -37,7 +37,7 @@
\askforoverwritefalse
\preamble
-$Id: xeCJK.dtx 692 2014-06-20 12:25:35Z sobenlee $
+$Id: xeCJK.dtx 729 2014-11-05 13:46:36Z sobenlee@gmail.com $
$URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
-----------------------------------------------------------------
Author:
@@ -105,9 +105,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\generate{
\usedir{source/xelatex/xecjk}
- \file{\jobname.ins}{\from{\jobname.dtx}{install}}
+ \file{xeCJK.ins}{\from{\jobname.dtx}{install}}
\usedir{tex/xelatex/xecjk}
- \file{\jobname.sty}{\from{\jobname.dtx}{package}}
+ \file{xeCJK.sty}{\from{\jobname.dtx}{package}}
\file{xeCJKfntef.sty}{\from{\jobname.dtx}{fntef}}
\file{xeCJK-listings.sty}{\from{\jobname.dtx}{listings}}
\file{xunicode-addon.sty}{\from{\jobname.dtx}{xunicode}}
@@ -115,18 +115,18 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $
\usepreamble\emptypreamble
\usepostamble\emptypostamble
\usedir{tex/xelatex/xecjk/config}
- \file{\jobname.cfg}{\from{\jobname.dtx}{config}}
+ \file{xeCJK.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}}
- \file{\jobname-example-CJKecglue.tex}{\from{\jobname.dtx}{ex-ecglue}}
- \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-IVS.tex}{\from{\jobname.dtx}{ex-IVS}}
- \file{\jobname-example-listings.tex}{\from{\jobname.dtx}{ex-listings}}
+ \file{xeCJK-example-autofake.tex}{\from{\jobname.dtx}{ex-autofake}}
+ \file{xeCJK-example-fallback.tex}{\from{\jobname.dtx}{ex-fallback}}
+ \file{xeCJK-example-subCJKblock.tex}{\from{\jobname.dtx}{ex-block}}
+ \file{xeCJK-example-CJKecglue.tex}{\from{\jobname.dtx}{ex-ecglue}}
+ \file{xeCJK-example-checksingle.tex}{\from{\jobname.dtx}{ex-single}}
+ \file{xeCJK-example-CJKfntef.tex}{\from{\jobname.dtx}{ex-fntef}}
+ \file{xeCJK-example-punctstyle.tex}{\from{\jobname.dtx}{ex-punctstyle}}
+ \file{xeCJK-example-verbatim.tex}{\from{\jobname.dtx}{ex-verb}}
+ \file{xeCJK-example-IVS.tex}{\from{\jobname.dtx}{ex-IVS}}
+ \file{xeCJK-example-listings.tex}{\from{\jobname.dtx}{ex-listings}}
\file{xunicode-symbols.tex}{\from{\jobname.dtx}{xunicode-symbols}}
\nopreamble\nopostamble
\usedir{doc/xelatex/xecjk}