summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-02-03 23:03:09 +0000
committerKarl Berry <karl@freefriends.org>2016-02-03 23:03:09 +0000
commit863ce92b4332ab5f92ba66276c388bbb99e59be5 (patch)
tree2427618218b303838385730c3367b3d37ffedd4c /Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
parentd7e7feec5992a359e08cb62c8bb2a53b59b7112f (diff)
xecjk (2feb16)
git-svn-id: svn://tug.org/texlive/trunk@39568 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx')
-rw-r--r--Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx253
1 files changed, 152 insertions, 101 deletions
diff --git a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
index 4d90a151a17..605160b3509 100644
--- a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
+++ b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
@@ -143,9 +143,9 @@ CJK scripts fonts (TrueType or OpenType).
Leo Liu <leoliu.pku@gmail.com>
Qing Lee <sobenlee@gmail.com>
- Copyright (C) 2007--2015 Wenchang Sun
- (C) 2009--2015 Leo Liu
- (C) 2012--2015 Qing Lee
+ Copyright (C) 2007--2010 Wenchang Sun
+ (C) 2009--2016 Leo Liu
+ (C) 2012--2016 Qing Lee
This file may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
@@ -268,7 +268,7 @@ CJK scripts fonts (TrueType or OpenType).
%<fntef> {xeCJKfntef}
%<listings> {xeCJK-listings}
%<xunicode> {xunicode-addon}
- {\ExplFileDate}{3.3.2}{\ExplFileDescription}
+ {\ExplFileDate}{3.3.3}{\ExplFileDescription}
%<xunextra>\ExplSyntaxOff
%<*driver>
\let\xeCJKrevnum\ExplFileVersion
@@ -320,12 +320,17 @@ CJK scripts fonts (TrueType or OpenType).
\def\ctexkit{\href{https://github.com/CTeX-org/ctex-kit/}{\texttt{ctex-kit}}}
\def\ctexkitrev#1{%
\href{https://github.com/CTeX-org/ctex-kit/commit/#1}{\texttt{ctex-kit} rev. #1}}
-\DeclareDocumentCommand\package{om}{%
- \begingroup\edef\x{\endgroup\lowercase{%
- \noexpand\href{http://www.ctan.org/pkg/\IfNoValueTF{#1}{#2}{#1}}}}%
- \x{\pkg{#2}}}
\makeatletter
\ExplSyntaxOn
+\DeclareDocumentCommand \package { o m }
+ {
+ \exp_args:Nx \href
+ {
+ http \token_to_str:N : //www.ctan.org/pkg/
+ \IfNoValueTF {#1} { \str_fold_case:n {#2} } {#1}
+ }
+ { \pkg {#2} }
+ }
\NewDocumentCommand \PrintPunctList { O{7} m m }
{
\par
@@ -446,8 +451,9 @@ CJK scripts fonts (TrueType or OpenType).
% \changes{v3.2.4}{2013/07/02}{遵循 \hologo{LaTeX3} 变量需要预先声明的原则。}
% \changes{v3.2.6}{2013/07/29}{\texttt{case} 类函数的用法与 \hologo{LaTeX3} 同步。}
% \changes{v3.3.2}{2015/05/15}{随 Unicode 7.0.0 更新简繁汉字映射。}
+% \changes{v3.3.3}{2015/09/25}{更新 \hologo{LaTeX3} 代码。}
%
-% \CheckSum{9799}
+% \CheckSum{9814}
% \GetFileInfo{\jobname.dtx}
%
% \title{\bfseries\pkg{xeCJK} 宏包}
@@ -604,7 +610,7 @@ CJK scripts fonts (TrueType or OpenType).
% CJKecglue = \Arg{glue}
% \end{syntax}
% 设置 CJK 文字与西文、CJK 文字与行内数学公式之间的间距,默认值是一个空格。使用这个
-% 选项设置的 |glue| 最好也要用一定的弹性。请注意,这里设置的 |glue| 只影响
+% 选项设置的 \meta{glue} 最好也要用一定的弹性。请注意,这里设置的 \meta{glue} 只影响
% \pkg{xeCJK} 根据需要自动添加的空白,源文件中直接输入的 CJK 文字与西文之间的空格不
% 受影响(直接输出)。有时候 \pkg{xeCJK} 可能不能正确地调整间距,需要手动加空格。
% \end{function}
@@ -734,7 +740,7 @@ CJK scripts fonts (TrueType or OpenType).
%
% \begin{function}[EXP]{LongPunct,LongPunct+,LongPunct-}
% \begin{syntax}
-% LongPunct = \Arg{( — ― ─ ‥ … )}
+% LongPunct = \Arg{( — ‥ … )}
% \end{syntax}
% 设置长标点,例如破折号“——”与省略号“……”,允许在长标点前后
% 断行,但是禁止在它们之间断行。
@@ -742,7 +748,7 @@ CJK scripts fonts (TrueType or OpenType).
%
% \begin{function}[EXP]{MiddlePunct,MiddlePunct+,MiddlePunct-}
% \begin{syntax}
-% MiddlePunct = \Arg{( — ― ─ · · ・ )}
+% MiddlePunct = \Arg{( – — · · ・ )}
% \end{syntax}
% 设置居中显示的标点,例如间隔号“\textbf{·}”。对于在 CJK 文字之间的居中标点,
% \pkg{xeCJK} 会根据不同的标点处理格式,调整居中标点与前后文字之间的空白,保证
@@ -1733,7 +1739,7 @@ CJK scripts fonts (TrueType or OpenType).
instead~of~plain~"latex"~or~"pdflatex"~or~"lualatex".\\
Loading~xeCJK~will~abort!
}
-\xetex_if_engine:F { \msg_critical:nn { xeCJK } { Require-XeTeX } }
+\sys_if_engine_xetex:F { \msg_critical:nn { xeCJK } { Require-XeTeX } }
% \end{macrocode}
%
% 应该使用较新版本的 \pkg{expl3} 宏包。
@@ -1746,7 +1752,7 @@ CJK scripts fonts (TrueType or OpenType).
using~your~TeX~package~manager~or~from~CTAN.\\
\str_if_eq:nnT {#1} { expl3 } { Loading~xeCJK~will~abort! }
}
-\@ifpackagelater { expl3 } { 2014/07/20 } { }
+\@ifpackagelater { expl3 } { 2015/09/24 } { }
{ \msg_critical:nnn { xeCJK } { l3-too-old } { expl3 } }
% \end{macrocode}
%
@@ -1856,15 +1862,15 @@ CJK scripts fonts (TrueType or OpenType).
}
{
\AtBeginDocument { \g_@@_after_preamble_hook_tl }
- \cs_new_protected_nopar:Npn \@@_document_left_hook:
+ \cs_new_protected_nopar:Npn \xeCJK@document@left@hook
{ \group_end: \g_@@_at_end_preamble_hook_tl \group_begin: }
- \cs_new_protected_nopar:Npn \@@_document_right_hook:
+ \cs_new_protected_nopar:Npn \xeCJK@document@right@hook
{ \scan_stop: \g_@@_after_end_preamble_hook_tl \tex_ignorespaces:D }
\cs_gset_nopar:Npx \document
{
- \@@_document_left_hook:
+ \xeCJK@document@left@hook
\exp_not:o { \document }
- \@@_document_right_hook:
+ \xeCJK@document@right@hook
}
}
% \end{macrocode}
@@ -2169,7 +2175,7 @@ CJK scripts fonts (TrueType or OpenType).
% 的显性或隐性记号。
% \begin{macrocode}
\cs_new_nopar:Npn \xeCJK_token_value_class:N #1
- { \XeTeXcharclass \xeCJK_token_value_charcode:N #1 }
+ { \xetex_charclass:D \xeCJK_token_value_charcode:N #1 }
% \end{macrocode}
% \end{macro}
%
@@ -2179,8 +2185,8 @@ CJK scripts fonts (TrueType or OpenType).
% 当记号 |#1| 的 \texttt{charcode} 大于等于 \texttt{0x10000} 时,\XeTeX\
% \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 的 \tn{meaning}
+% \url{http://tex.stackexchange.com/a/64848}。},需要特别处理。
+% \texttt{0.9999.0} 版以后的 \XeTeX 的 \tn{meaning}
% 对于超出 BMP 的字符,会返回两个字符,分别对应于其 UTF-16 编码的首尾代理^^A
% \footnote{参见 \url{http://tug.org/pipermail/xetex/2013-June/024543.html}。}。
% 这一 Bug 在 TeX Live 2015 的 \texttt{0.99992} 版中得到修复^^A
@@ -2195,7 +2201,6 @@ CJK scripts fonts (TrueType or OpenType).
{
\cs_new_nopar:Npn \@@_get_charcode:w ##1 ~ ##2 ~ ##3 \q_stop
{ \int_eval:n { `##3 } }
- \cs_new_eq:NN \xeCJK_xetex_mathcode:w \Umathcode
}
{
\tl_if_empty:nTF {#5}
@@ -2209,12 +2214,10 @@ CJK scripts fonts (TrueType or OpenType).
{ ( `##3 - "D800 ) * "400 + ( `##4 - "DC00 ) + "10000 }
}
}
- \cs_new_eq:NN \xeCJK_xetex_mathcode:w \Umathcode
}
{
\cs_new_nopar:Npn \@@_get_charcode:w ##1 ~ ##2 ~ ##3##4 \q_stop
{ \int_eval:n { \tl_if_empty:nTF { ##4 } { `##3 } { "20000 } } }
- \cs_new_eq:NN \xeCJK_xetex_mathcode:w \XeTeXmathcode
}
}
}
@@ -2266,8 +2269,8 @@ CJK scripts fonts (TrueType or OpenType).
%
% \begin{macro}[internal]{\makexeCJKactive, \makexeCJKinactive}
% \begin{macrocode}
-\NewDocumentCommand \makexeCJKactive { } { \XeTeXinterchartokenstate = \c_one }
-\NewDocumentCommand \makexeCJKinactive { } { \XeTeXinterchartokenstate = \c_zero }
+\NewDocumentCommand \makexeCJKactive { } { \xetex_interchartokenstate:D = \c_one }
+\NewDocumentCommand \makexeCJKinactive { } { \xetex_interchartokenstate:D = \c_zero }
% \end{macrocode}
% \end{macro}
%
@@ -2361,14 +2364,25 @@ CJK scripts fonts (TrueType or OpenType).
% \end{tabular}
% \end{center}
%
+% \changes{v3.3.3}{2016/01/20}{兼容 \LaTeXe{} 2016/02/01 的字符类设置。}
% \begin{macro}[internal]{Default,CJK,FullLeft,FullRight,Boundary}
-% 这五类是 \XeTeX\ 预定义的类别。
+% \LaTeXe{} 2016/02/01 不再预设置 CJK 字符类。
% \begin{macrocode}
\xeCJK_save_class:nn { Default } { \c_zero }
-\xeCJK_save_class:nn { CJK } { \c_one }
-\xeCJK_save_class:nn { FullLeft } { \c_two }
-\xeCJK_save_class:nn { FullRight } { \c_three }
\xeCJK_save_class:nn { Boundary } { \c_two_hundred_fifty_five }
+\int_compare:nNnTF { \xetex_charclass:D "4E00 } = \c_one
+ {
+ \xeCJK_save_class:nn { CJK } { \c_one }
+ \xeCJK_save_class:nn { FullLeft } { \c_two }
+ \xeCJK_save_class:nn { FullRight } { \c_three }
+ \int_const:Nn \c_@@_class_begin_int { \c_three }
+ }
+ {
+ \xeCJK_new_class:n { CJK }
+ \xeCJK_new_class:n { FullLeft }
+ \xeCJK_new_class:n { FullRight }
+ \int_const:Nn \c_@@_class_begin_int { \c_zero }
+ }
% \end{macrocode}
% \end{macro}
%
@@ -2399,7 +2413,7 @@ CJK scripts fonts (TrueType or OpenType).
{ "28 , "5B , "60 , "7B , "2329 }
\clist_const:Nn \c_@@_HalfRight_chars_clist
{ "21 , "22 , "25 , "27 , "29 , "2C , "2E , "3A , "3B , "3F , "5D , "7D , "232A }
-\clist_const:Nn \c_@@_NormalSpace_chars_clist { "2D , "2F , "5C , "2013 }
+\clist_const:Nn \c_@@_NormalSpace_chars_clist { "2D , "2F , "5C }
% \end{macrocode}
% \end{macro}
%
@@ -2445,6 +2459,11 @@ CJK scripts fonts (TrueType or OpenType).
% \end{macrocode}
% \end{macro}
%
+% \changes{v3.3.3}{2015/12/12}
+% {把 EN DASH(\texttt{U+2013})作为半字线连接号归入 \texttt{FullRight} 类。}
+% \changes{v3.3.3}{2015/12/12}
+% {不再把 \texttt{U+2015} 和 \texttt{U+2500} 归入 \texttt{FullRight} 类。}
+%
% \begin{macro}[var,internal]{\c_@@_CL_chars_clist}
% Close Punctuation (CL)
% \PrintPunctList{CL}{Close Punctuation}
@@ -2452,7 +2471,7 @@ CJK scripts fonts (TrueType or OpenType).
% \begin{macrocode}
\clist_const:Nn \c_@@_CL_chars_clist
{
- "00B7 , "2019 , "201D , "2014 , "2015 , "2025 , "2026 , "2027 , "2500 ,
+ "00B7 , "2019 , "201D , "2013 , "2014 , "2025 , "2026 , "2027 ,
"3001 , "3002 , "3009 , "300B , "300D , "300F , "3011 , "3015 , "3017 , "3019 ,
"301B , "301E , "301F , "FE11 , "FE12 , "FE18 , "FE36 , "FE38 , "FE3A , "FE3C ,
"FE3E , "FE40 , "FE42 , "FE44 , "FE48 , "FE50 , "FE52 , "FE5A , "FE5C , "FE5E ,
@@ -2542,6 +2561,7 @@ CJK scripts fonts (TrueType or OpenType).
% \end{macro}
%
% \begin{macro}[var,internal]{\c_@@_CJK_chars_clist}
+% \changes{v3.3.3}{2015/06/25}{补充 Ext-E。}
% CJK 字符类,包括文字和标点符号。
% \begin{macrocode}
\clist_const:Nn \c_@@_CJK_chars_clist
@@ -2664,6 +2684,10 @@ CJK scripts fonts (TrueType or OpenType).
% \begin{macrocode}
"2B740 -> "2B81F ,
% \end{macrocode}
+% \item CJK Unified Ideographs Extension-E (中日韩统一表意文字扩展 E)
+% \begin{macrocode}
+ "2B820 -> "2CEA1 ,
+% \end{macrocode}
% \item CJK Compatibility Ideographs Supplement (中日韩兼容表意文字增补)
% \begin{macrocode}
"2F800 -> "2FA1F
@@ -2826,12 +2850,15 @@ CJK scripts fonts (TrueType or OpenType).
% \changes{v3.2.7}{2013/08/29}{修正 \file{unicode-letters.tex} 中谚文符号
% \tn{catcode} 不准的问题。}
% \begin{macrocode}
-\int_set:Nn \l_@@_begin_int { "AC00 }
-\int_set:Nn \l_@@_end_int { "D7A3 }
-\xeCJK_int_until_do:nn { \l_@@_begin_int > \l_@@_end_int }
+\token_if_letter:NF ^^^^ac00
{
- \char_set_catcode_letter:n { \l_@@_begin_int }
- \int_incr:N \l_@@_begin_int
+ \int_set:Nn \l_@@_begin_int { "AC00 }
+ \int_set:Nn \l_@@_end_int { "D7A3 }
+ \xeCJK_int_until_do:nn { \l_@@_begin_int > \l_@@_end_int }
+ {
+ \char_set_catcode_letter:n { \l_@@_begin_int }
+ \int_incr:N \l_@@_begin_int
+ }
}
% \end{macrocode}
%
@@ -2845,7 +2872,7 @@ CJK scripts fonts (TrueType or OpenType).
\int_set:Nn \l_@@_tmp_int {#3}
\xeCJK_int_until_do:nn { \l_@@_begin_int > \l_@@_end_int }
{
- \XeTeXcharclass \l_@@_begin_int = \l_@@_tmp_int
+ \xetex_charclass:D \l_@@_begin_int = \l_@@_tmp_int
\int_incr:N \l_@@_begin_int
}
}
@@ -2861,7 +2888,7 @@ CJK scripts fonts (TrueType or OpenType).
{
\int_set:Nn \l_@@_tmp_int { \xeCJK_class_num:n {#2} }
\clist_map_inline:cn { c_@@_#1_chars_clist }
- { \XeTeXcharclass ##1 = \l_@@_tmp_int }
+ { \xetex_charclass:D ##1 = \l_@@_tmp_int }
}
% \end{macrocode}
% \end{macro}
@@ -2872,7 +2899,7 @@ CJK scripts fonts (TrueType or OpenType).
\NewDocumentCommand \normalspacedchars { m }
{
\tl_map_inline:nn {#1}
- { \XeTeXcharclass `##1 = \xeCJK_class_num:n { NormalSpace } }
+ { \xetex_charclass:D `##1 = \xeCJK_class_num:n { NormalSpace } }
}
% \end{macrocode}
% \end{macro}
@@ -2914,7 +2941,7 @@ CJK scripts fonts (TrueType or OpenType).
% 在相邻类别之间插入内容。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \xeCJK_inter_class_toks:nnn #1#2#3
- { \XeTeXinterchartoks \xeCJK_class_num:n {#1} ~ \xeCJK_class_num:n {#2} = {#3} }
+ { \xetex_interchartoks:D \xeCJK_class_num:n {#1} ~ \xeCJK_class_num:n {#2} = {#3} }
\cs_generate_variant:Nn \xeCJK_inter_class_toks:nnn { nnc , nnx }
% \end{macrocode}
% \end{macro}
@@ -2923,7 +2950,7 @@ CJK scripts fonts (TrueType or OpenType).
% 取出相邻类别之间的内容。
% \begin{macrocode}
\cs_new_nopar:Npn \xeCJK_get_inter_class_toks:nn #1#2
- { \tex_the:D \XeTeXinterchartoks \xeCJK_class_num:n {#1} ~ \xeCJK_class_num:n {#2} }
+ { \tex_the:D \xetex_interchartoks:D \xeCJK_class_num:n {#1} ~ \xeCJK_class_num:n {#2} }
% \end{macrocode}
% \end{macro}
%
@@ -4610,14 +4637,14 @@ CJK scripts fonts (TrueType or OpenType).
%
% \changes{v3.2.7}{2013/08/22}{实现自定义行首/尾标点符号宽度功能。}
%
-% \tn{XeTeXglyphbouds} 可以得到一个字符的左右边距,用于标点压缩。如果它不可用,则
+% \tn{XeTeXglyphbounds} 可以得到一个字符的左右边距,用于标点压缩。如果它不可用,则
% 在文档中只能使用 |plain| 这一标点格式原样输出标点。
% \begin{macrocode}
-\cs_if_exist:NF \XeTeXglyphbounds
+\cs_if_exist:NF \xetex_glyphbounds:D
{
\@@_msg_new:nn { XeTeX-too-old }
{
- \token_to_str:N \XeTeXglyphbounds \ is~not~defined.\\
+ \token_to_str:N \xetex_glyphbounds:D \ is~not~defined.\\
CJK~punctuation~kerning~will~not~be~available.\\\\
You~have~to~update~XeTeX~to~the~version~0.9995.0~or~later.
}
@@ -5329,8 +5356,8 @@ CJK scripts fonts (TrueType or OpenType).
% \begin{macrocode}
\cs_new_nopar:Npn \xeCJK_glyph_bounds:NN #1#2
{
- \dim_use:N \XeTeXglyphbounds #1 ~
- \XeTeXcharglyph \xeCJK_token_value_charcode:N #2 \exp_stop_f:
+ \dim_use:N \xetex_glyphbounds:D #1 ~
+ \xetex_charglyph:D \xeCJK_token_value_charcode:N #2 \exp_stop_f:
}
% \end{macrocode}
% \end{macro}
@@ -6540,7 +6567,7 @@ CJK scripts fonts (TrueType or OpenType).
\@@_check_num_range:nnNN {#1} {#2} \l_@@_begin_int \l_@@_end_int
\xeCJK_int_until_do:nn { \l_@@_begin_int > \l_@@_end_int }
{
- \tex_global:D \xeCJK_xetex_mathcode:w
+ \tex_global:D \utex_mathcode:D
\l_@@_begin_int = #3 ~ #4 \l_@@_begin_int
\int_incr:N \l_@@_begin_int
}
@@ -6761,7 +6788,7 @@ CJK scripts fonts (TrueType or OpenType).
{
\int_set:Nn \l_@@_tmp_int { \xeCJK_class_num:n {#1} }
\clist_map_inline:cn { c_@@_#1_chars_clist }
- { \XeTeXcharclass ##1 = \l_@@_tmp_int }
+ { \xetex_charclass:D ##1 = \l_@@_tmp_int }
}
\bool_new:N \l_@@_verb_addon_bool
\cs_new_eq:NN \CJKfixedspacing \xeCJKVerbAddon
@@ -6866,7 +6893,7 @@ CJK scripts fonts (TrueType or OpenType).
\xeCJK_glyph_if_exist:NTF { ^^^^2423 }
{ ^^^^2423 }
{
- \int_compare:nNnTF { \XeTeXfonttype \tex_font:D } = \c_zero
+ \int_compare:nNnTF { \xetex_fonttype:D \tex_font:D } = \c_zero
{
\str_if_eq_x:nnTF { \f@family } { \ttdefault }
{ \c_catcode_other_space_tl }
@@ -7049,13 +7076,19 @@ CJK scripts fonts (TrueType or OpenType).
WidowPenalty = \c_ten_thousand ,
NoBreakCS = { \footnote \footnotemark \nobreak } ,
KaiMingPunct = { ^^^^3002 ^^^^ff0e ^^^^ff1f ^^^^ff01 } ,
- LongPunct = { ^^^^2014 ^^^^2015 ^^^^2500 ^^^^2025 ^^^^2026 } ,
- MiddlePunct = { ^^^^2014 ^^^^2015 ^^^^2027 ^^^^2500 ^^^^00b7 ^^^^30fb ^^^^ff65 } ,
+ LongPunct = { ^^^^2014 ^^^^2025 ^^^^2026 } ,
+ MiddlePunct = { ^^^^2013 ^^^^2014 ^^^^2027 ^^^^00b7 ^^^^30fb ^^^^ff65 } ,
AllowBreakBetweenPuncts = false
}
\defaultCJKfontfeatures { Script = CJK }
% \end{macrocode}
%
+% 半字线连接号\footnote{见\href{http://www.moe.gov.cn/ewebeditor/uploadfile/2015/01/13/20150113092346124.pdf}
+% {《夹用英文的中文文本的标点符号用法(草案)》5.13 节。}}应为半角宽度。
+% \begin{macrocode}
+\xeCJKsetwidth{^^^^2013}{0.5em}
+% \end{macrocode}
+%
% 执行宏包选项,并载入 \pkg{fontspec} 宏包和 \pkg{xunicode-addon}。
% \begin{macrocode}
\ProcessKeysOptions { xeCJK / options }
@@ -7450,7 +7483,7 @@ CJK scripts fonts (TrueType or OpenType).
% \begin{macrocode}
\cs_new_protected_nopar:Npn \xeCJK@italiccorr
{
- \int_compare:nNnTF \XeTeXinterchartokenstate > \c_zero
+ \int_compare:nNnTF \xetex_interchartokenstate:D > \c_zero
{
\xeCJK_if_last_node:nTF { default }
{
@@ -7513,10 +7546,11 @@ CJK scripts fonts (TrueType or OpenType).
\@@_after_end_preamble:n
{
\int_compare:nNnF
- { \c_three + \seq_count:N \g_@@_new_class_seq } =
+ { \c_@@_class_begin_int + \seq_count:N \g_@@_new_class_seq } =
{ \g_@@_xetex_allocator_int }
{
- \int_step_inline:nnnn \c_four \c_one \g_@@_xetex_allocator_int
+ \int_step_inline:nnnn
+ { \c_@@_class_begin_int + \c_one } \c_one \g_@@_xetex_allocator_int
{
\seq_if_in:NnF \g_@@_new_class_seq {#1}
{ \@@_set_others_toks:n {#1} }
@@ -7565,9 +7599,9 @@ CJK scripts fonts (TrueType or OpenType).
% \begin{macrocode}
\tl_map_inline:nn
{
- \textellipsis \textemdash \textperiodcentered \textcentereddot
- \textquoteleft \textquoteright \textquotedblleft \textquotedblright
- \textcdot \textgrq \textgrqq
+ \textellipsis \textendash \textemdash \textperiodcentered
+ \textcentereddot \textquoteleft \textquoteright \textquotedblleft
+ \textquotedblright \textcdot \textgrq \textgrqq
}
{
\AtBeginUTFCommand [#1] { \@@_group_begin: \makexeCJKinactive }
@@ -7598,9 +7632,9 @@ CJK scripts fonts (TrueType or OpenType).
% 符号命令,它的输入方式为 |>`w| 或者 |\accpsilivaria{w}|。前者比较特殊,如果
% 与 \pkg{xeCJK} 一起使用,\XeTeX\ 会出现如下错误。
% \begin{verbatim}
-% ! Cannot use \XeTeXglyphbounds with grmn1000; not a native platform font.
-% \xeCJK_glyph_bounds:NN ...use:N \XeTeXglyphbounds
-% #1 \XeTeXcharglyph \xeCJK_...
+% ! Cannot use \xetex_glyphbounds:D with grmn1000; not a native platform font.
+% \xeCJK_glyph_bounds:NN ...use:N \xetex_glyphbounds:D
+% #1 \xetex_charglyph:D \xeCJK_...
% \end{verbatim}
% 这个不好处理,只修改后者。
% \begin{macrocode}
@@ -7638,7 +7672,7 @@ CJK scripts fonts (TrueType or OpenType).
\char_set_catcode_other:n { 183 }
\cs_new_protected_nopar:Npn \@@_Default_Bxii:
{
- \int_compare:nNnTF \XeTeXinterchartokenstate > \c_zero
+ \int_compare:nNnTF \xetex_interchartokenstate:D > \c_zero
{ \@@_group_begin: \makexeCJKinactive ^^b7 \@@_group_end: }
{ ^^b7 }
}
@@ -7742,14 +7776,21 @@ CJK scripts fonts (TrueType or OpenType).
}
% \end{macrocode}
%
-% 由于 \pkg{xeCJK} 假装 \pkg{CJK} 已经被引入了,导致 \pkg{everysel} 判断错误,
-% 从而给出 \tn{selectfont} 已经被修改的警告,并加入不必要的内容。需要在它判断
-% 之前取消定义。
+%
+% \changes{v3.3.3}{2015/12/12}{解决与 \pkg{microtype} 宏包的兼容问题。}
+% 由于 \pkg{xeCJK} 假装 \pkg{CJK} 已经被引入了,这回导致 \pkg{everysel} 和
+% \pkg{microtype} 等宏包判断错误。需要在它们判断之前取消定义。
% \begin{macrocode}
\@@_at_end_preamble:n
{
- \xeCJK_if_package_loaded:nT { everysel }
- { \cs_undefine:c { ver@CJK . \c_@@_package_ext_tl } }
+ \clist_map_inline:nn { everysel , microtype }
+ {
+ \xeCJK_if_package_loaded:nT {#1}
+ {
+ \cs_undefine:c { ver@CJK . \c_@@_package_ext_tl }
+ \clist_map_break:
+ }
+ }
}
% \end{macrocode}
%
@@ -7779,11 +7820,10 @@ CJK scripts fonts (TrueType or OpenType).
{ \cs_new_eq:NN \Unicode \xeCJK_unicode_char:nn }
}
}
-\str_if_eq_x:nnTF
- { \token_to_str:N \Ucharcat } { \token_to_meaning:N \Ucharcat }
+\cs_if_exist:NTF \utex_charcat:D
{
\cs_new_protected_nopar:Npn \xeCJK_char_from_charcode:Nn #1#2
- { \tl_const:Nx #1 { \Ucharcat \int_eval:n {#2} ~ \c_eleven } }
+ { \tl_const:Nx #1 { \char_generate:nn {#2} { \c_eleven } } }
}
{
\cs_new_protected_nopar:Npn \xeCJK_char_from_charcode:Nn #1#2
@@ -9059,8 +9099,9 @@ CJK scripts fonts (TrueType or OpenType).
% \end{macro}
%
%
-% \begin{macro}[internal]{CJKfilltwosides}
+% \begin{macro}{CJKfilltwosides}
% \changes{v3.2.4}{2012/06/26}{改用 \texttt{minipage} 和 \LaTeX 表格(\texttt{tabular})来实现。}
+% \changes{v3.3.3}{2015/05/30}{确保进入水平模式。}
% 使用 \texttt{minipage} 和 \LaTeX 表格(\texttt{tabular})来定义 |CJKfilltwosides| 环境。
% 可选参数 |#1| 表示环境的垂直对齐位置,默认居中;参数 |#2| 表示环境的宽度。
% 带星号的环境,如果 |#2| 不大于零或者不大于环境最长文本行的宽度,则取环境的自然宽度。
@@ -9076,6 +9117,7 @@ CJK scripts fonts (TrueType or OpenType).
}
\NewEnviron { CJKfilltwosides* } [ 2 ] [ c ]
{
+ \xeCJK_leave_vmode:
\cs_set_eq:NN \CJKglue \xeCJK_fntef_hfilll:
\tl_set:Nn \arraystretch { 1 }
\cs_if_free:NF \extrarowheight
@@ -9594,15 +9636,19 @@ CJK scripts fonts (TrueType or OpenType).
% 些符号命令的默认设置。
%
% \begin{macrocode}
-\pdftex_if_engine:T
+\bool_if:nF
+ {
+ \sys_if_engine_xetex_p: ||
+ \sys_if_engine_luatex_p:
+ }
{
- \msg_new:nnnn { xunicode-addon } { cannot-use-pdftex }
+ \msg_new:nnnn { xunicode-addon } { xetex-luatex }
{ This~package~requires~either~XeTeX~or~LuaTeX~to~function.}
{
You~must~change~your~typesetting~engine~to,~e.g.,\\
"xelatex"~or~"lualatex"~instead~of~plain~"latex"~or~"pdflatex".
}
- \msg_critical:nn { xunicode-addon } { cannot-use-pdftex }
+ \msg_critical:nn { xunicode-addon } { xetex-luatex }
}
\RequirePackage { xparse }
% \end{macrocode}
@@ -9611,28 +9657,34 @@ CJK scripts fonts (TrueType or OpenType).
%
% \begin{macrocode}
\clist_new:N \g_@@_encname_clist
+\tl_if_exist:NT \UTFencname
+ { \clist_gput_right:Nx \g_@@_encname_clist { \UTFencname } }
\DeclareOption*
- { \clist_gput_left:NV \g_@@_encname_clist \CurrentOption }
+ { \clist_gput_right:NV \g_@@_encname_clist \CurrentOption }
\ProcessOptions \scan_stop:
-\tl_if_exist:NT \UTFencname
- { \clist_gput_left:Nx \g_@@_encname_clist { \UTFencname } }
% \end{macrocode}
%
% 若 \pkg{xunicode} 已经被调用,则在宏包结束的时候,重新设置 \tn{UTFencname}
% 对应的编码命令。否则设置 \tn{UTFencname},如果使用的是 \hologo{LuaLaTeX},则
% 需要作一些设置,使得 \pkg{xunicode} 可用。
%
+% \changes{v3.3.3}{2016/02/01}{使用新的 Unicode 编码名称 \texttt{TU}。}
+%
% \begin{macrocode}
\@ifpackageloaded { xunicode } { }
{
\clist_get:NNF \g_@@_encname_clist \UTFencname
{
- \xetex_if_engine:TF
- { \tl_set:Nn \UTFencname { EU1 } }
- { \tl_set:Nn \UTFencname { EU2 } }
- \clist_set_eq:NN \g_@@_encname_clist \UTFencname
+ \file_if_exist:nTF { tuenc.def }
+ { \tl_set:Nn \UTFencname { TU } }
+ {
+ \sys_if_engine_xetex:TF
+ { \tl_set:Nn \UTFencname { EU1 } }
+ { \tl_set:Nn \UTFencname { EU2 } }
+ }
+ \clist_gset_eq:NN \g_@@_encname_clist \UTFencname
}
- \xetex_if_engine:TF
+ \sys_if_engine_xetex:TF
{ \RequirePackage { xunicode } }
{
\cs_set_eq:NN \@@_tmp:w \XeTeXpicfile
@@ -9641,7 +9693,7 @@ CJK scripts fonts (TrueType or OpenType).
\cs_set_eq:NN \XeTeXpicfile \@@_tmp:w
}
}
-\AtEndOfPackage { \ReloadXunicode { \g_@@_encname_clist } }
+\AtEndOfPackage { \@@_reload:N \g_@@_encname_clist }
% \end{macrocode}
%
% \begin{macro}[internal]{\ReloadXunicode}
@@ -9651,42 +9703,42 @@ CJK scripts fonts (TrueType or OpenType).
\RenewDocumentCommand \ReloadXunicode { m }
{
\clist_set:Nx \l_@@_encname_clist {#1}
- \clist_remove_duplicates:N \l_@@_encname_clist
+ \@@_reload:N \l_@@_encname_clist
+ }
+\cs_new_protected:Npn \@@_reload:N #1
+ {
+ \cs_set_eq:NN \@@_tmp:w \iftipaonetoken
+ \cs_set_eq:NN \iftipaonetoken \scan_stop:
\use:x
{
\ExplSyntaxOff
\char_set_catcode_letter:n { 64 }
- \@@_reload:N \exp_not:N \l_@@_encname_clist
+ \exp_not:N \clist_map_function:NN \exp_not:N #1 \@@_reload_aux:n
\bool_if:NTF \l__kernel_expl_bool
{ \ExplSyntaxOn }
{ \ExplSyntaxOff }
\char_set_catcode:nn { 64 } { \char_value_catcode:n { 64 } }
}
+ \cs_set_eq:NN \iftipaonetoken \@@_tmp:w
}
-\cs_new_protected:Npn \@@_reload:N #1
+\cs_new_protected:Npn \@@_reload_aux:n #1
{
- \cs_set_eq:NN \@@_tmp:w \iftipaonetoken
- \cs_set_eq:NN \iftipaonetoken \scan_stop:
- \clist_map_inline:Nn #1
+ \cs_if_exist:cTF { T@ #1 }
{
- \cs_if_exist:cTF { T@ ##1 }
- {
- \tl_set:Nx \UTFencname {##1}
- \clist_gput_right:Nx \g_@@_encname_clist {##1}
- \file_input:n { xunicode.sty }
- \file_input:n { xunicode-extra.def }
- }
- { \msg_error:nnn { xunicode-addon } { encoding-unknown } {##1} }
+ \tl_set:Nn \UTFencname {#1}
+ \clist_if_in:NnF \g_@@_encname_clist {#1}
+ { \clist_gput_right:Nn \g_@@_encname_clist {#1} }
+ \file_input:n { xunicode.sty }
+ \file_input:n { xunicode-extra.def }
}
- \cs_set_eq:NN \iftipaonetoken \@@_tmp:w
- \clist_gremove_duplicates:N \g_@@_encname_clist
+ { \msg_error:nnn { xunicode-addon } { encoding-unknown } {#1} }
}
\clist_new:N \l_@@_encname_clist
\msg_new:nnnn { xunicode-addon } { encoding-unknown }
{ Encoding~scheme~"#1"~unknown. }
{
You~may~use \\\\
- \token_to_str:N \usepackage [ #1 , \encodingdefault ] {fontenc} \\\\
+ \token_to_str:N \usepackage [ #1 , \encodingdefault ] \{fontenc\} \\\\
before~xunicode-addon~or~xunicode.
}
% \end{macrocode}
@@ -12563,7 +12615,6 @@ int main()
\usepackage[margin=2cm]{geometry}
\usepackage{fontspec}
\usepackage{xunicode-addon}
-\usepackage{l3str}
\usepackage{longtable,tabu,booktabs}
\usepackage{zref-base}