From 5267058a04749cee1879abed85f720e4c43fdaac Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 27 May 2013 04:45:33 +0000 Subject: xeCJK update (5/27) git-svn-id: svn://tug.org/texlive/trunk@30719 c570f23f-e606-0410-a88d-b1316a301751 --- .../xelatex/xecjk/example/xeCJK-example-IVS.tex | 42 ++ Master/texmf-dist/doc/xelatex/xecjk/xeCJK.pdf | Bin 784396 -> 785705 bytes Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx | 451 ++++++++++++++++----- Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins | 5 +- .../texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg | 4 +- Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty | 243 ++++++++--- Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty | 6 +- 7 files changed, 596 insertions(+), 155 deletions(-) create mode 100644 Master/texmf-dist/doc/xelatex/xecjk/example/xeCJK-example-IVS.tex (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/xelatex/xecjk/example/xeCJK-example-IVS.tex b/Master/texmf-dist/doc/xelatex/xecjk/example/xeCJK-example-IVS.tex new file mode 100644 index 00000000000..8ede24432de --- /dev/null +++ b/Master/texmf-dist/doc/xelatex/xecjk/example/xeCJK-example-IVS.tex @@ -0,0 +1,42 @@ +%% +%% This is file `xeCJK-example-IVS.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xeCJK.dtx (with options: `ex-IVS') +%% +\documentclass{article} +\usepackage{xeCJK} +\usepackage{hologo} + +\setCJKmainfont{HanaMinA} %% http://fonts.jp/hanazono/ + +\begin{document} + +\hologo{XeTeX} でIVSを使うテスト。 + +消󠄀化󠄀器󠄂 / 消󠄁火器󠄃 / 消󠄂化󠄁器󠄄 + +消󠄃火器󠄅 / 消化󠄂器󠄆 / 消火器󠄇 + +消化󠄃器󠄈 / 消火器󠄉 / 辻󠄂辻󠄃辻󠄄辻󠄅  + +\CJKfontspec{Meiryo} + +か + +がか゚ + +ぼぽ + +ぼぽ + +ばぱ + +ばぱ + +\end{document} +%% +%% +%% End of file `xeCJK-example-IVS.tex'. diff --git a/Master/texmf-dist/doc/xelatex/xecjk/xeCJK.pdf b/Master/texmf-dist/doc/xelatex/xecjk/xeCJK.pdf index f55ec635f32..6daac7cba28 100644 Binary files a/Master/texmf-dist/doc/xelatex/xecjk/xeCJK.pdf and b/Master/texmf-dist/doc/xelatex/xecjk/xeCJK.pdf differ diff --git a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx index 17583f57357..f82b10e469f 100644 --- a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx +++ b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx @@ -78,7 +78,7 @@ CJK scripts fonts (TrueType or OpenType). \askforoverwritefalse \preamble -$Id: xeCJK.dtx 399 2013-01-11 14:57:50Z sobenlee $ +$Id: xeCJK.dtx 416 2013-05-25 08:44:28Z sobenlee $ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ ----------------------------------------------------------------- Author: @@ -146,6 +146,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \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}} \nopreamble\nopostamble \usedir{doc/xelatex/xecjk} \file{README.txt}{\from{\jobname.dtx}{readme}} @@ -161,7 +162,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} % -\GetIdInfo$Id: xeCJK.dtx 399 2013-01-11 14:57:50Z sobenlee $ +\GetIdInfo$Id: xeCJK.dtx 416 2013-05-25 08:44:28Z sobenlee $ %<*!config&!fntef> {Typesetting CJK scripts with XeLaTeX} % @@ -177,9 +178,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ %\ProvidesExplPackage % {\ExplFileName} % {xeCJKfntef} - {\ExplFileDate}{3.1.2}{\ExplFileDescription} + {\ExplFileDate}{3.2.0}{\ExplFileDescription} %<*driver> -\def\xeCJKversion{3.1.2} +\def\xeCJKversion{3.2.0} \let\xeCJKdate\ExplFileDate \let\xeCJKrevnum\ExplFileVersion \ExplSyntaxOff @@ -272,7 +273,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % % \fi % -% \CheckSum{3869} +% \CheckSum{4017} % \changes{v3.1.0}{2012/11/13}{放弃对 \cs{outer} 宏的特殊处理。} % \changes{v3.1.1}{2012/12/07}{不再依赖 \pkg{xpatch} 宏包。} % @@ -621,6 +622,16 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % 在这些控制序列前面加上 \ref{subsec:others}~节介绍的 \cs{xeCJKnobreak}。 % \end{function} % +% \begin{function}[added=2013-04-15]{Verb} +% \begin{syntax} +% Verb = \meta{\TF\orvar\defaultvar{env}} +% \end{syntax} +% 是否调整中文在标准 \LaTeX 抄录环境下的间距以保持代码的对齐。其中 \texttt{env} +% 选项只在 \texttt{verbatim} 环境里调整间距,而不调整 \cs{verb} 里的中文间距。 +% 这个选项对使用到 \cs{verbatim@font} 命令的情形均有效,更一般的情况可以使用 +% \ref{subsec:others}~节介绍的 \cs{xeCJKVerbAddon}。 +% \end{function} +% % \subsection{字体设置与选择} % \label{subsec:fontset} % @@ -1178,13 +1189,12 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \cs{xeCJKVerbAddon} % \end{syntax} % 调整文字间距以便于让 CJK 字符占的宽度等于西文等宽字体中两个空格的宽度。这有利于 -% 等宽字体的代码对齐等情形。抄录 |(verbatim)| 环境将自动使用 \cs{xeCJKVerbAddon} -% 的效果。需要注意的是,\cs{xeCJKVerbAddon} 对 \pkg{xeCJK} 的内部进行了比较大的 -% 修改,使用它之后,关于标点符号的禁则将会丢失。所以不能单独使用,应该放在分组里 -% 限制其作用域,否则是无效的。当然它可以和其它关于代码抄录的宏包配合使用。例如, -% 可以使用于 \package{fancyvrb} 宏包的 |formatcom| 选项。此时设置的西文字体应该 -% 确实是等宽的以保证对齐。若西文等宽字体发生变动(包括字体大小),则需要在其后面 -% 使用 \cs{xeCJKVerbAddon},重新计算间距的宽度。 +% 等宽字体的代码对齐等情形。需要注意的是,\cs{xeCJKVerbAddon} 对 \pkg{xeCJK} 的内 +% 部进行了比较大的修改,使用它之后,关于标点符号的禁则将会丢失。所以不能单独使用,^^A +% 应该放在分组里限制其作用域,否则是无效的。当然它可以和其它关于代码抄录的宏包配 +% 合使用。例如,可以使用于 \package{fancyvrb} 宏包的 |formatcom| 选项。此时设置的 +% 西文字体应该确实是等宽的以保证对齐。若西文等宽字体发生变动(包括字体大小),则 +% 需要在其后面使用 \cs{xeCJKVerbAddon},重新计算间距的宽度。 % \end{function} % % \begin{function}[added=2012-12-03]{\xeCJKnobreak} @@ -1230,13 +1240,6 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \pkg{polyglossia})可能会存在大小不一的冲突。\pkg{xeCJK} 虽然为此作了一些处理,但与 % 它们共同使用时应该小心。 % -% 基于历史原因,\package{xltxtra} 宏包引入的 \package{realscripts} 定义了 \cs{dim_max:nn} -% 和 \cs{dim_min:nn} 这两个已经在当前版本的 \pkg{expl3} 中定义了的函数。但是 -% \pkg{realscripts} 中的定义并不好,并且会覆盖 \pkg{expl3} 中的定义,因此破坏了 -% \pkg{xeCJK} 中的相关计算。\pkg{xltxtra} 并没有什么实际功能,完全可以不使用它。 -% 如果原来通过 \pkg{xltxtra} 得到 \XeLaTeX 这个 Logo,现在可以改用更完善的 -% \package{hologo}。如果坚持使用 \pkg{xltxtra},请把它放在 \pkg{xeCJK} 之后载入。 -% %\end{documentation} % % @@ -1455,19 +1458,66 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % % \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} 的情况。} % 当前字体状态下,一个字间空格产生的 |glue| 的长度,包括伸展和收缩部分。 -% 没有考虑到 \cs{xspaceskip} 和 \cs{spacefactor} 的情况。 % \begin{macrocode} \tl_const:Nn \c_xeCJK_space_skip_tl { - \skip_if_eq:nnTF \tex_spaceskip:D \c_zero_skip + \int_compare:nNnTF \g_@@_spacefactor_int = \c_one_thousand + { + \skip_if_eq:nnTF \tex_spaceskip:D \c_zero_skip + { + \tex_fontdimen:D \c_two \tex_font:D + plus \tex_fontdimen:D \c_three \tex_font:D + minus \tex_fontdimen:D \c_four \tex_font:D + } + { \tex_spaceskip:D } + } { - \tex_fontdimen:D \c_two \tex_font:D - plus \tex_fontdimen:D \c_three \tex_font:D - minus \tex_fontdimen:D \c_four \tex_font:D + \skip_if_eq:nnTF \tex_spaceskip:D \c_zero_skip + { + \int_compare:nNnTF \g_@@_spacefactor_int < { 2000 } + { \_@@_space_skip_scale:nnn { \tex_fontdimen:D \c_two \tex_font:D } } + { + \skip_if_eq:nnTF \tex_xspaceskip:D \c_zero_skip + { + \_@@_space_skip_scale:nnn + { + \tex_fontdimen:D \c_two \tex_font:D + + \tex_fontdimen:D \c_seven \tex_font:D + } + } + { \tex_xspaceskip:D \use_none:nn } + } + { \tex_fontdimen:D \c_three \tex_font:D } + { \tex_fontdimen:D \c_four \tex_font:D } + } + { + \int_compare:nNnTF \g_@@_spacefactor_int < { 2000 } + { \_@@_space_skip_scale:nnn { \tex_spaceskip:D } } + { + \skip_if_eq:nnTF \tex_xspaceskip:D \c_zero_skip + { + \_@@_space_skip_scale:nnn + { \tex_spaceskip:D + \tex_fontdimen:D \c_seven \tex_font:D } + } + { \tex_xspaceskip:D \use_none:nn } + } + { \etex_gluestretch:D \tex_spaceskip:D } + { \etex_glueshrink:D \tex_spaceskip:D } + } } - { \tex_spaceskip:D } } +\cs_new_nopar:Npn \_@@_space_skip_scale:nnn #1#2#3 + { + \dim_eval:n {#1} + plus \fp_eval:n { \g_@@_spacefactor_int / 1000 } #2 + minus + \int_div_truncate:nn + { 1000 * \tex_number:D #3 } { \g_@@_spacefactor_int } sp + } +\int_new:N \g_@@_spacefactor_int +\int_gset_eq:NN \g_@@_spacefactor_int \c_one_thousand % \end{macrocode} % \end{macro} % @@ -1577,26 +1627,29 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % % \begin{macro}[internal]{\xeCJK_token_value_charcode:N} % \changes{v3.1.2}{2013/01/08}{考虑 \texttt{charcode} 大于等于 \texttt{0x10000} 的情况。} -% 当记号 |#1| 的 \texttt{charcode} 大于等于 \texttt{0x10000} 时,\XeTeX -% \texttt{0.9999} 版以前的 \cs{meaning} 的返回结果比较特殊\footnote{参见 +% 当记号 |#1| 的 \texttt{charcode} 大于等于 \texttt{0x10000} 时,\XeTeX\ +% \texttt{0.9999.0} 版以前的 \cs{meaning} 的返回结果比较特殊\footnote{参见 % \url{http://tug.org/pipermail/xetex/2013-January/023967.html} 和 -% \url{http://tex.stackexchange.com/a/64848}。},需要特别处理。 +% \url{http://tex.stackexchange.com/a/64848}。},需要特别处理。同时使用较新版本中 +% 提供的原语设置 \texttt{mathcode}。 % \begin{macrocode} \cs_new_nopar:Npn \xeCJK_token_value_charcode:N #1 { \exp_after:wN \@@_token_value_charcode:w \token_to_meaning:N #1 \q_stop } -\fp_compare:nNnTF { \int_use:N \xetex_XeTeXversion:D \XeTeXrevision } > { 0.9998 } +\str_if_eq_x:nnTF { \token_to_str:N \Umathcode } { \token_to_meaning:N \Umathcode } { \cs_new_nopar:Npn \@@_token_value_charcode:w #1 ~ #2 ~ #3 \q_stop { `#3 } + \cs_new_eq:NN \xeCJK_xetex_mathcode:w \Umathcode } { \cs_new_nopar:Npn \@@_token_value_charcode:w #1 ~ #2 ~ #3#4 \q_stop { \tl_if_empty:nTF {#4} { `#3 } { "20000 } } + \cs_new_eq:NN \xeCJK_xetex_mathcode:w \XeTeXmathcode } % \end{macrocode} % \end{macro} % -% \begin{macro}[pTF]{\xeCJK_if_CJK_class:N} +% \begin{macro}[pTF,internal]{\xeCJK_if_CJK_class:N} % 判断字符 |#1| 是否为 CJK 字符类,包括文字和标点符号。 % \begin{macrocode} \prg_new_conditional:Npnn \xeCJK_if_CJK_class:N #1 { p , T , F , TF } @@ -1707,9 +1760,14 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \end{macrocode} % \end{macro} % +% \changes{v3.2.0}{2013/05/20}{增加 \texttt{IVS} 字符类用于处理异体字选择符。} +% % \pkg{xeCJK} 需要以下字符类别用于字符输出。其中 |Default|、|CJK|、|FullLeft|、 % |FullRight|、|Boundary| 为 \XeTeX\ 中预定义的类别,\pkg{xeCJK} 新增加了\ -% |HalfLeft|、|HalfRight|、|NormalSpace|。 +% |HalfLeft|、|HalfRight|、|NormalSpace| 和 |IVS|。其中异体字选择符 +% (Ideographic Variation Selectors)\footnote{\url{http://www.unicode.org/reports/tr37/}} +% 需要 \XeTeX\ |0.9999.0| 以上的版本^^A +% \footnote{\url{http://tug.org/pipermail/xetex/2013-March/024118.html}}和相关字体的支持。 % \begin{center}\xeCJKsetup{PunctStyle=plain} % \begin{tabular}{cll} % \toprule @@ -1722,6 +1780,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % |HalfRight| & 半角右标点 & , . ? ) ] \} \\ % |NormalSpace| & 前后原始间距的符号 & / \\ % |Boundary| & 边界 & 空格 \\ +% |IVS| & 异体字选择符 & “回字有四样写法”\\ % \bottomrule % \end{tabular} % \end{center} @@ -1737,18 +1796,20 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{HalfLeft,HalfRight,NormalSpace} -% 新增西文半角左/右标点和前后原始间距的符号类。 +% \begin{macro}[internal]{HalfLeft,HalfRight,NormalSpace,IVS} +% 新增西文半角左/右标点、前后原始间距的符号和异体字选择符类。 % \begin{macrocode} \xeCJK_new_class:n { HalfLeft } \xeCJK_new_class:n { HalfRight } \xeCJK_new_class:n { NormalSpace } +\xeCJK_new_class:n { IVS } % \end{macrocode} % \end{macro} % % \begin{macro}[var,internal] % {\c_@@_HalfLeft_chars_clist,\c_@@_HalfRight_chars_clist,\c_@@_NormalSpace_chars_clist, -% \c_@@_FullLeft_chars_clist,\c_@@_FullRight_chars_clist,\c_@@_CJK_chars_clist} +% \c_@@_FullLeft_chars_clist,\c_@@_FullRight_chars_clist,\c_@@_CJK_chars_clist, +% \c_@@_IVS_chars_clist} % \hypertarget{CJKcharclass}{\pkg{xeCJK} 设置的基本字符类的默认范围。} % \begin{macrocode} \clist_const:Nn \c_@@_HalfLeft_chars_clist @@ -1758,14 +1819,14 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \clist_const:Nn \c_@@_NormalSpace_chars_clist { "2F } \clist_const:Nn \c_@@_FullLeft_chars_clist { - "2018 , "201C , "2116 , "3008 , "300A , "300C , "300E , "3010 , "3012 , - "3014 , "3016 , "3018 , "301A , "301D , "3036 , "E76C , "FE59 , "FE5B , - "FE5D , "FE5F , "FE60 , "FE69 , "FE6B , "FF03 , "FF04 , "FF08 , "FF20 , - "FF3B , "FF5B , "FFE0 , "FFE1 , "FFE5 , "FFE6 + "2018 , "201C , "3008 , "300A , "300C , "300E , "3010 , "3012 , "3014 , + "3016 , "3018 , "301A , "301D , "3036 , "FE59 , "FE5B , "FE5D , "FE5F , + "FE60 , "FE69 , "FE6B , "FF03 , "FF04 , "FF08 , "FF20 , "FF3B , "FF5B , + "FFE0 , "FFE1 , "FFE5 , "FFE6 } \clist_const:Nn \c_@@_FullRight_chars_clist { - "00B7 , "2019 , "201D , "2014 , "2015 , "2025 , "2026 , "2030 , "2500 , + "00B7 , "2019 , "201D , "2014 , "2015 , "2025 , "2026 , "2027 , "2500 , "3001 , "3002 , "3005 , "3006 , "3009 , "300B , "300D , "300F , "3011 , "3015 , "3017 , "3019 , "301B , "301E , "301F , "3041 , "3043 , "3045 , "3047 , "3049 , "3063 , "3083 , "3085 , "3087 , "308E , "309B , "309C , @@ -1869,10 +1930,6 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macrocode} "AC00 -> "D7AF , % \end{macrocode} -% \item Kana Supplement (日文假名增补) -% \begin{macrocode} - "B000 -> "B0FF , -% \end{macrocode} % \item Hangul Jamo Extended-B (谚文扩展 B) % \begin{macrocode} "D7B0 -> "D7FF , @@ -1881,6 +1938,10 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macrocode} "F900 -> "FAFF , % \end{macrocode} +% \item Vertical Forms (竖排形式) +% \begin{macrocode} + "FE10 -> "FE1F , +% \end{macrocode} % \item CJK Compatibility Forms (中日韩兼容形式) % \begin{macrocode} "FE30 -> "FE4F , @@ -1889,6 +1950,14 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macrocode} "FF00 -> "FFEF , % \end{macrocode} +% \item Kana Supplement (日文假名增补) +% \begin{macrocode} + "1B000 -> "1B0FF , +% \end{macrocode} +% \item Enclosed Ideographic Supplement (带圈表意文字增补) +% \begin{macrocode} + "1F200 -> "1F2FF , +% \end{macrocode} % \item CJK Unified Ideographs Extension-B (中日韩统一表意文字扩展 B) % \begin{macrocode} "20000 -> "2A6DF , @@ -1906,6 +1975,29 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ "2F800 -> "2FA1F % \end{macrocode} % \end{itemize} +% \begin{macrocode} + } +\clist_const:Nn \c_@@_IVS_chars_clist + { +% \end{macrocode} +% \begin{itemize}[nosep,leftmargin=0pt] +% \item COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK +% \begin{macrocode} + "3099 , +% \end{macrocode} +% \item COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK +% \begin{macrocode} + "309A , +% \end{macrocode} +% \item Variation Selectors (异体字选择符) +% \begin{macrocode} + "FE00 -> "FE0F , +% \end{macrocode} +% \item Variation Selectors Supplement (异体字选择符增补) +% \begin{macrocode} + "E0100 -> "E01EF +% \end{macrocode} +% \end{itemize} % \begin{macrocode} } % \end{macrocode} @@ -1927,7 +2019,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \seq_gput_right:Nn \g_@@_CJK_class_seq {#1} \tl_const:cn { \@@_CJK_class_tl:c { \@@_class_csname:n {#1} } } {#1} } -\clist_map_function:nN { CJK , FullLeft , FullRight } \@@_save_CJK_class:n +\clist_map_function:nN { CJK , FullLeft , FullRight , IVS } \@@_save_CJK_class:n % \end{macrocode} % \end{macro} % @@ -2088,6 +2180,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ { \xeCJK_declare_char_class:nV { CJK } \c_@@_CJK_chars_clist \xeCJK_declare_char_class:nV { NormalSpace } \c_@@_NormalSpace_chars_clist + \xeCJK_declare_char_class:nV { IVS } \c_@@_IVS_chars_clist \xeCJKResetPunctClass } % \end{macrocode} @@ -2103,7 +2196,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \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} } -\cs_generate_variant:Nn \xeCJK_inter_class_toks:nnn { nnc , nnv , nnx } +\cs_generate_variant:Nn \xeCJK_inter_class_toks:nnn { nnc , nnx } % \end{macrocode} % \end{macro} % @@ -2152,8 +2245,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macrocode} \cs_new_protected_nopar:Npn \xeCJK_copy_inter_class_toks:nnnn #1#2#3#4 { - \xeCJK_inter_class_toks:nnx {#1} {#2} - { \xeCJK_get_inter_class_toks:nn {#3} {#4} } + \tl_set:Nx \l_@@_tmpa_tl { \xeCJK_get_inter_class_toks:nn {#3} {#4} } + \tl_if_empty:NF \l_@@_tmpa_tl + { \xeCJK_inter_class_toks:nnx {#1} {#2} { \exp_not:V \l_@@_tmpa_tl } } } % \end{macrocode} % \end{macro} @@ -2164,8 +2258,11 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \cs_new_protected_nopar:Npn \xeCJK_replace_inter_class_toks:nnnn #1#2#3#4 { \tl_set:Nx \l_@@_tmpa_tl { \xeCJK_get_inter_class_toks:nn {#1} {#2} } - \tl_replace_all:Nnn \l_@@_tmpa_tl {#3} {#4} - \xeCJK_inter_class_toks:nnx {#1} {#2} { \exp_not:V \l_@@_tmpa_tl } + \tl_if_empty:NF \l_@@_tmpa_tl + { + \tl_replace_all:Nnn \l_@@_tmpa_tl {#3} {#4} + \xeCJK_inter_class_toks:nnx {#1} {#2} { \exp_not:V \l_@@_tmpa_tl } + } } % \end{macrocode} % \end{macro} @@ -2183,10 +2280,10 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \subsection{字符输出规则} % % \begin{center} -% \begin{tabular}{l*8c} +% \begin{tabular}{l*9c} % \toprule % & |Default| & |CJK| & |FullL| & |FullR| & |HalfL| -% & |HalfR| & |Normal| & |Bound| \\ \midrule +% & |HalfR| & |Normal| & |Bound| & |IVS| \\ \midrule % |Default| % & % & \tokslink{def-cjk} @@ -2195,7 +2292,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % & % & % & -% & \tokslink{def-bound}\\ +% & \tokslink{def-bound} +% & \tokslink{def-IVS}\\ % |CJK| % & \tokslink{def-cjk} % & \tokslink{cjk-cjk} @@ -2204,7 +2302,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % & \tokslink{def-cjk} % & \tokslink{def-cjk} % & \tokslink{def-cjk} -% & \tokslink{cjk-bound}\\ +% & \tokslink{cjk-bound} +% &\\ % |FullLeft| % & \tokslink{def-cjk} % & \tokslink{fl-fr-others} @@ -2213,7 +2312,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % & \tokslink{def-cjk} % & \tokslink{def-cjk} % & \tokslink{def-cjk} -% & \tokslink{fl-fr-bound}\\ +% & \tokslink{fl-fr-bound} +% & \tokslink{def-IVS}\\ % |FullRight| % & \tokslink{def-cjk} % & \tokslink{fl-fr-others} @@ -2222,12 +2322,18 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % & \tokslink{def-cjk} % & \tokslink{def-cjk} % & \tokslink{def-cjk} -% & \tokslink{fl-fr-bound}\\ +% & \tokslink{fl-fr-bound} +% & \tokslink{def-IVS}\\ % |HalfLeft| % & % & \tokslink{def-cjk} % & \tokslink{def-cjk} -% & \tokslink{def-cjk} \\ +% & \tokslink{def-cjk} +% & +% & +% & +% & +% & \tokslink{def-IVS}\\ % |HalfRight| % & % & \tokslink{def-cjk} @@ -2236,7 +2342,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % & % & % & -% & \tokslink{def-bound} \\ +% & \tokslink{def-bound} +% & \tokslink{def-IVS}\\ % |NormalSpace| % & % & \tokslink{def-cjk} @@ -2245,7 +2352,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % & % & % & -% & \tokslink{def-bound}\\ +% & \tokslink{def-bound} +% & \tokslink{def-IVS}\\ % |Boundary| % & \tokslink{bound-def} % & \tokslink{bound-cjk} @@ -2253,7 +2361,19 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % & \tokslink{bound-fl-fr} % & \tokslink{bound-def} % & -% & \tokslink{bound-def}\\ +% & \tokslink{bound-def} +% & +% & \tokslink{def-IVS}\\ +% |IVS| +% & \tokslink{def-IVS} +% & \tokslink{def-IVS} +% & \tokslink{def-IVS} +% & \tokslink{def-IVS} +% & \tokslink{def-IVS} +% & \tokslink{def-IVS} +% & \tokslink{def-IVS} +% & \tokslink{def-IVS} +% & \tokslink{def-IVS}\\ % \bottomrule % \end{tabular} % \end{center} @@ -2265,6 +2385,24 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \end{macrocode} % \end{macro} % +% \hypertarget{def-IVS}{\texttt{IVS}} 字符类与 |CJK| 字符类基本相同,只是从 |CJK| +% 转移到 |IVS| 时,不加入任何内容。 +% \begin{macrocode} +\AtEndOfPackage + { + \seq_map_inline:Nn \g_@@_class_seq + { + \str_if_eq:nnTF {#1} { IVS } + { \xeCJK_copy_inter_class_toks:nnnn { IVS } {#1} { CJK } { CJK } } + { + \xeCJK_copy_inter_class_toks:nnnn { IVS } {#1} { CJK } {#1} + \str_if_eq:nnF {#1} { CJK } + { \xeCJK_copy_inter_class_toks:nnnn {#1} { IVS } {#1} { CJK } } + } + } + } +% \end{macrocode} +% % \hypertarget{def-cjk}{} % \begin{macrocode} \clist_map_inline:nn { Default , HalfLeft , HalfRight , NormalSpace } @@ -2290,6 +2428,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \bool_if:nTF { \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 } { @@ -2317,6 +2456,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ { \xeCJK_inter_class_toks:nnn {#1} { Boundary } { + \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 } } } { @@ -2360,6 +2500,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \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 ) } @@ -2641,6 +2782,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \end{macro} % % \begin{macro}[internal]{\xeCJK_FullLeft_and_Default:} +% \changes{v3.2.0}{2013/05/20}{修正 \pkg{xeCJK} 使西文在部分情况下无法断词的问题。} % \begin{macrocode} \cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_Default: { @@ -2650,7 +2792,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \xeCJK_class_group_end: \xeCJK_no_break: \@@_punct_glue:NN \c_@@_left_tl \g_@@_last_punct_tl } - { \xeCJK_class_group_end: \xeCJK_no_break: } + { \xeCJK_class_group_end: \xeCJK_no_break: \skip_horizontal:N \c_zero_skip } } % \end{macrocode} % \end{macro} @@ -2712,6 +2854,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \end{macro} % % \begin{macro}[internal]{\xeCJK_Boundary_and_FullLeft:N} +% \changes{v3.2.0}{2013/05/22}{当全角左标点前面是 \texttt{hlist}、\texttt{none}、 +% \texttt{glue} 和 \texttt{penalty} 等节点时,压缩其左空白。} % \begin{macrocode} \cs_new_protected_nopar:Npn \xeCJK_Boundary_and_FullLeft:N #1 { @@ -2726,7 +2870,13 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ } \cs_new_protected_nopar:Npn \@@_Boundary_and_FullLeft_glue:N #1 { - \int_compare:nNnF \etex_lastnodetype:D = \c_one + \int_case:nnn { \etex_lastnodetype:D } + { + { \c_one } { \skip_horizontal:N \c_zero_skip } + { \c_minus_one } { } + { \c_eleven } { } + { \c_thirteen } { } + } { \@@_punct_glue:NN \c_@@_left_tl {#1} } } % \end{macrocode} @@ -2791,7 +2941,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ { \@@_punct_if_middle:NTF {#1} { \xeCJK_no_break: \@@_punct_glue:NN \c_@@_right_tl {#1} } - { \xeCJK_no_break: } + { \xeCJK_no_break: \skip_horizontal:N \c_zero_skip } } } \cs_new_eq:NN \@@_Default_and_FullRight_glue:N \@@_CJK_and_FullRight_glue:N @@ -3193,7 +3343,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_update_inline_env_case_tl:} +% \begin{macro}[internal]{\@@_update_inline_env_case_tl:} % \begin{macrocode} \cs_new_protected:Npn \@@_update_inline_env_case_tl: { @@ -4817,9 +4967,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % % \begin{macro}[var,internal]{\l_xeCJK_family_tl} % 用于保存文档当前正在使用的 CJK 字体族。 +% \changes{v3.2.0}{2013/04/14}{不将其初始化为 \cs{CJKfamilydefault}。} % \begin{macrocode} \tl_new:N \l_xeCJK_family_tl -\tl_set:Nn \l_xeCJK_family_tl { \CJKfamilydefault } % \end{macrocode} % \end{macro} % @@ -4890,14 +5040,24 @@ $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}。} % \begin{macrocode} \NewDocumentCommand \setCJKmainfont { O{} m } - { \xeCJK_set_family:xxx { \CJKrmdefault } {#1} {#2} } + { + \xeCJK_set_family:xxx { \CJKrmdefault } {#1} {#2} + \normalfont + } \cs_new_eq:NN \setCJKromanfont \setCJKmainfont \NewDocumentCommand \setCJKsansfont { O{} m } - { \xeCJK_set_family:xxx { \CJKsfdefault } {#1} {#2} } + { + \xeCJK_set_family:xxx { \CJKsfdefault } {#1} {#2} + \normalfont + } \NewDocumentCommand \setCJKmonofont { O{} m } - { \xeCJK_set_family:xxx { \CJKttdefault } {#1} {#2} } + { + \xeCJK_set_family:xxx { \CJKttdefault } {#1} {#2} + \normalfont + } % \end{macrocode} % \end{macro} % @@ -5135,7 +5295,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \@@_check_num_range:nnNN {#1} {#2} \l_@@_tmpa_int \l_@@_tmpb_int \xeCJK_int_until_do:nn { \l_@@_tmpa_int > \l_@@_tmpb_int } { - \tex_global:D \XeTeXmathcode \l_@@_tmpa_int = #3 ~ #4 \l_@@_tmpa_int + \tex_global:D \xeCJK_xetex_mathcode:w + \l_@@_tmpa_int = #3 ~ #4 \l_@@_tmpa_int \int_incr:N \l_@@_tmpa_int } } @@ -5147,6 +5308,47 @@ $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} 选项。} +% +% \begin{macro}{Verb} +% 如果设置为 \texttt{env},则只在 \LaTeX 的抄录环境里使用 \cs{xeCJKVerbAddon},^^A +% 而不包括 \cs{verb}。对当前使用环境的判断基于在标准 \LaTeX 的 \cs{verb} 定义里 +% 使用 \cs{bgrop} 和 \cs{egrop} 来分组。 +% \begin{macrocode} +\keys_define:nn { xeCJK / options } + { + Verb .choice: , + Verb / true .code:n = + { + \bool_set_true:N \l_@@_verb_use_bool + \int_set_eq:NN \l_@@_verb_level_int \c_zero + } , + Verb / false .code:n = { \bool_set_false:N \l_@@_verb_use_bool } , + Verb / env .code:n = + { + \bool_set_true:N \l_@@_verb_use_bool + \int_set_eq:NN \l_@@_verb_level_int \c_one + } , + Verb .default:n = { true } + } +\bool_new:N \l_@@_verb_use_bool +\int_new:N \l_@@_verb_level_int +\@@_after_preamble:n + { + \tl_put_right:Nn \verbatim@font + { + \bool_if:nTF + { + \l_@@_verb_use_bool && + \int_compare_p:nNn \etex_currentgrouptype:D > \l_@@_verb_level_int + } + { \@@_set_verb_exspace: } + { \skip_zero:N \g_@@_verb_exspace_skip } + \@@_verb_addon: + } + } +% \end{macrocode} +% \end{macro} % % \begin{macro}{\xeCJKVerbAddon} % \changes{v3.1.0}{2012/11/19}{新增 \cs{xeCJKVerbAddon} 用于抄录环境中的间距调整。} @@ -5159,23 +5361,27 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \int_compare:nNnF \etex_currentgrouplevel:D = \c_zero { \@@_set_verb_exspace: - \bool_if:NF \l_@@_verb_addon_bool - { - \bool_set_true:N \l_@@_verb_addon_bool - \@@_set_char_class_eq:nn { FullLeft } { CJK } - \@@_set_char_class_eq:nn { FullRight } { CJK } - \@@_set_char_class_eq:nn { HalfLeft } { Default } - \@@_set_char_class_eq:nn { HalfRight } { Default } - \@@_set_char_class_eq:nn { NormalSpace } { Default } - \xeCJKsetup { xCJKecglue = false } - \cs_set_protected_nopar:Npn \CJKglue - { \skip_horizontal:N \g_@@_verb_exspace_skip } - \cs_set_protected_nopar:Npn \CJKecglue - { \skip_horizontal:n { 0.5 \g_@@_verb_exspace_skip } } - \cs_set_eq:NN \xeCJK_check_for_glue: \CJKecglue - \cs_set_eq:NN \xeCJK_ignore_spaces:w \CJKecglue - \skip_set:Nn \tex_rightskip:D { \c_zero_dim plus 1 fil } - } + \@@_verb_addon: + } + } +\cs_new_protected_nopar:Npn \@@_verb_addon: + { + \bool_if:NF \l@@_verb_addon_bool + { + \bool_set_true:N \l@@_verb_addon_bool + \@@_set_char_class_eq:nn { FullLeft } { CJK } + \@@_set_char_class_eq:nn { FullRight } { CJK } + \@@_set_char_class_eq:nn { HalfLeft } { Default } + \@@_set_char_class_eq:nn { HalfRight } { Default } + \@@_set_char_class_eq:nn { NormalSpace } { Default } + \xeCJKsetup { xCJKecglue = false } + \cs_set_protected_nopar:Npn \CJKglue + { \skip_horizontal:N \g@@_verb_exspace_skip } + \cs_set_protected_nopar:Npn \CJKecglue + { \skip_horizontal:n { 0.5 \g@@_verb_exspace_skip } } + \cs_set_eq:NN \xeCJK_check_for_glue: \CJKecglue + \cs_set_eq:NN \xeCJK_ignore_spaces:w \CJKecglue + \skip_set:Nn \tex_rightskip:D { \c_zero_dim plus 1 fil } } } \bool_new:N \l_@@_verb_addon_bool @@ -5183,12 +5389,6 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \end{macrocode} % \end{macro} % -% 总是在 \LaTeX 的抄录环境(包括 \cs{verb})里使用 \cs{xeCJKVerbAddon},以保证代码 -% 的对齐。 -% \begin{macrocode} -\@@_after_preamble:n { \tl_put_right:Nn \verbatim@font { \xeCJKVerbAddon } } -% \end{macrocode} -% % \begin{macro}[internal]{\@@_set_verb_exspace:} % \changes{v3.1.1}{2012/12/08}{调整间距的计算方法。} % 在抄录环境中,CJK 文字之间的间距为当前西文字体两个空格的宽度与当前字体大小之差, @@ -5381,6 +5581,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ xeCJKactive = true , LocalConfig = true , indentfirst = true , + Verb = env , EmboldenFactor = 4 , SlantFactor = 0.167 , PunctStyle = quanjiao , @@ -5389,7 +5590,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ NoBreakCS = { \footnote \footnotemark \nobreak } , KaiMingPunct = { ^^^^3002 ^^^^ff0e ^^^^ff1f ^^^^ff01 } , LongPunct = { ^^^^2014 ^^^^2015 ^^^^2500 ^^^^2025 ^^^^2026 } , - MiddlePunct = { ^^^^2014 ^^^^2015 ^^^^2500 ^^^^00b7 ^^^^30fb ^^^^ff65 } , + MiddlePunct = { ^^^^2014 ^^^^2015 ^^^^2027 ^^^^2500 ^^^^00b7 ^^^^30fb ^^^^ff65 } , AllowBreakBetweenPuncts = false } \defaultCJKfontfeatures { Script = CJK } @@ -5555,8 +5756,9 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macrocode} \@@_msg_new:nn { conflict-package } { - The~`#1'~package~is~in~conflict~with~xeCJK. \\ - Please~do~not~use~it~or~load~it~after~xeCJK. + The~`#1'~package~is~too~old. \\ + Please~update~an~up~to~date~version~of~it\\ + using~your~TeX~package~manager~or~from~CTAN. } \xeCJK_if_package_loaded:nTF { realscripts } { @@ -5730,6 +5932,14 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \end{macrocode} % \end{macro} % +% \begin{macro}[internal]{\@@_group_begin:,\@@_group_end:} +% 用于保护下面歧义宽度标点的分组。 +% \begin{macrocode} +\cs_new_eq:NN \@@_group_begin: \group_begin: +\cs_new_eq:NN \@@_group_end: \group_end: +% \end{macrocode} +% \end{macro} +% % 单独处理宽度有分歧的几个标点:包括省略号、破折号、间隔号、引号等中西文混用的 % 符号, 保证其命令形式输出的是西文字体。并对一些编码的符号宏包做特殊处理。 % \begin{macrocode} @@ -5740,7 +5950,10 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \textellipsis \textemdash \textperiodcentered \textcentereddot \textquoteleft \textquoteright \textquotedblleft \textquotedblright } - { \cs_gset_nopar:Npx #1 { { \makexeCJKinactive \exp_not:o {#1} } } } + { + \cs_gset_nopar:Npx #1 + { \@@_group_begin: \makexeCJKinactive \exp_not:o {#1} \@@_group_end: } + } \tl_put_left:Nn \tipaencoding { \makexeCJKinactive } \cs_new_eq:NN \@@_aux_r:n \r \cs_set_nopar:Npn \r #1 { { \makexeCJKinactive \@@_aux_r:n {#1} } } @@ -5758,10 +5971,12 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ { \xeCJK_if_package_loaded:nT { hyperref } { - \tl_gput_right:Nn \pdfstringdefPreHook + \pdfstringdefDisableCommands { \@@_gobble_CJKfamily: \xeCJK_cs_clear:N \makexeCJKinactive + \xeCJK_cs_clear:N \@@_group_begin: + \xeCJK_cs_clear:N \@@_group_end: } } } @@ -6832,6 +7047,50 @@ lang_set = { % % \end{macrocode} % +% \subsection{\pkg{xeCJK-example-IVS.tex}} +% +% \begin{macrocode} +%<*ex-IVS> +% \end{macrocode} +% +% \begin{macrocode} +\documentclass{article} +\usepackage{xeCJK} +\usepackage{hologo} + +\setCJKmainfont{HanaMinA} %% http://fonts.jp/hanazono/ + +\begin{document} + +\hologo{XeTeX} でIVSを使うテスト。 + +消󠄀化󠄀器󠄂 / 消󠄁火器󠄃 / 消󠄂化󠄁器󠄄 + +消󠄃火器󠄅 / 消化󠄂器󠄆 / 消火器󠄇 + +消化󠄃器󠄈 / 消火器󠄉 / 辻󠄂辻󠄃辻󠄄辻󠄅  + +\CJKfontspec{Meiryo} + +か + +がか゚ + +ぼぽ + +ぼぽ + +ばぱ + +ばぱ + +\end{document} +% \end{macrocode} +% +% \begin{macrocode} +% +% \end{macrocode} +% % \fi % % \end{implementation} diff --git a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins index 4ab58ad723a..6164cb6b5a4 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 399 2013-01-11 14:57:50Z sobenlee $ +%% $Id: xeCJK.dtx 416 2013-05-25 08:44:28Z sobenlee $ %% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ %% ----------------------------------------------------------------- %% Author: @@ -37,7 +37,7 @@ \askforoverwritefalse \preamble -$Id: xeCJK.dtx 399 2013-01-11 14:57:50Z sobenlee $ +$Id: xeCJK.dtx 416 2013-05-25 08:44:28Z sobenlee $ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ ----------------------------------------------------------------- Author: @@ -105,6 +105,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \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}} \nopreamble\nopostamble \usedir{doc/xelatex/xecjk} \file{README.txt}{\from{\jobname.dtx}{readme}} diff --git a/Master/texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg b/Master/texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg index f2b2567279c..638b8158337 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg +++ b/Master/texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg @@ -6,11 +6,11 @@ %% %% xeCJK.dtx (with options: `config') %% -\GetIdInfo$Id: xeCJK.dtx 399 2013-01-11 14:57:50Z sobenlee $ +\GetIdInfo$Id: xeCJK.dtx 416 2013-05-25 08:44:28Z sobenlee $ {Configuration file for xeCJK package} \ProvidesExplFile {\ExplFileName.cfg} - {\ExplFileDate}{3.1.2}{\ExplFileDescription} + {\ExplFileDate}{3.2.0}{\ExplFileDescription} %% %% diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty index 4040fcc7d79..1b2b032c75e 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty +++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty @@ -6,7 +6,7 @@ %% %% xeCJK.dtx (with options: `package') %% -%% $Id: xeCJK.dtx 399 2013-01-11 14:57:50Z sobenlee $ +%% $Id: xeCJK.dtx 416 2013-05-25 08:44:28Z sobenlee $ %% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ %% ----------------------------------------------------------------- %% Author: @@ -33,11 +33,11 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 399 2013-01-11 14:57:50Z sobenlee $ +\GetIdInfo$Id: xeCJK.dtx 416 2013-05-25 08:44:28Z sobenlee $ {Typesetting CJK scripts with XeLaTeX} \ProvidesExplPackage {\ExplFileName} - {\ExplFileDate}{3.1.2}{\ExplFileDescription} + {\ExplFileDate}{3.2.0}{\ExplFileDescription} \msg_new:nnn { xeCJK } { Require-XeTeX } { The~xeCJK~package~requires~XeTeX~to~function.\\\\ @@ -148,14 +148,61 @@ } \tl_const:Nn \c_xeCJK_space_skip_tl { - \skip_if_eq:nnTF \tex_spaceskip:D \c_zero_skip + \int_compare:nNnTF \g__xeCJK_spacefactor_int = \c_one_thousand { - \tex_fontdimen:D \c_two \tex_font:D - plus \tex_fontdimen:D \c_three \tex_font:D - minus \tex_fontdimen:D \c_four \tex_font:D + \skip_if_eq:nnTF \tex_spaceskip:D \c_zero_skip + { + \tex_fontdimen:D \c_two \tex_font:D + plus \tex_fontdimen:D \c_three \tex_font:D + minus \tex_fontdimen:D \c_four \tex_font:D + } + { \tex_spaceskip:D } + } + { + \skip_if_eq:nnTF \tex_spaceskip:D \c_zero_skip + { + \int_compare:nNnTF \g__xeCJK_spacefactor_int < { 2000 } + { \__xeCJK_space_skip_scale:nnn { \tex_fontdimen:D \c_two \tex_font:D } } + { + \skip_if_eq:nnTF \tex_xspaceskip:D \c_zero_skip + { + \__xeCJK_space_skip_scale:nnn + { + \tex_fontdimen:D \c_two \tex_font:D + + \tex_fontdimen:D \c_seven \tex_font:D + } + } + { \tex_xspaceskip:D \use_none:nn } + } + { \tex_fontdimen:D \c_three \tex_font:D } + { \tex_fontdimen:D \c_four \tex_font:D } + } + { + \int_compare:nNnTF \g__xeCJK_spacefactor_int < { 2000 } + { \__xeCJK_space_skip_scale:nnn { \tex_spaceskip:D } } + { + \skip_if_eq:nnTF \tex_xspaceskip:D \c_zero_skip + { + \__xeCJK_space_skip_scale:nnn + { \tex_spaceskip:D + \tex_fontdimen:D \c_seven \tex_font:D } + } + { \tex_xspaceskip:D \use_none:nn } + } + { \etex_gluestretch:D \tex_spaceskip:D } + { \etex_glueshrink:D \tex_spaceskip:D } + } } - { \tex_spaceskip:D } } +\cs_new_nopar:Npn \__xeCJK_space_skip_scale:nnn #1#2#3 + { + \dim_eval:n {#1} + plus \fp_eval:n { \g__xeCJK_spacefactor_int / 1000 } #2 + minus + \int_div_truncate:nn + { 1000 * \tex_number:D #3 } { \g__xeCJK_spacefactor_int } sp + } +\int_new:N \g__xeCJK_spacefactor_int +\int_gset_eq:NN \g__xeCJK_spacefactor_int \c_one_thousand \cs_new_protected_nopar:Npn \xeCJK_glue_to_skip:nN #1#2 { \hbox_set:Nn \l__xeCJK_tmp_box { #1 \scan_stop: \exp_after:wN } \exp_after:wN @@ -222,14 +269,16 @@ { \XeTeXcharclass \xeCJK_token_value_charcode:N #1 } \cs_new_nopar:Npn \xeCJK_token_value_charcode:N #1 { \exp_after:wN \__xeCJK_token_value_charcode:w \token_to_meaning:N #1 \q_stop } -\fp_compare:nNnTF { \int_use:N \xetex_XeTeXversion:D \XeTeXrevision } > { 0.9998 } +\str_if_eq_x:nnTF { \token_to_str:N \Umathcode } { \token_to_meaning:N \Umathcode } { \cs_new_nopar:Npn \__xeCJK_token_value_charcode:w #1 ~ #2 ~ #3 \q_stop { `#3 } + \cs_new_eq:NN \xeCJK_xetex_mathcode:w \Umathcode } { \cs_new_nopar:Npn \__xeCJK_token_value_charcode:w #1 ~ #2 ~ #3#4 \q_stop { \tl_if_empty:nTF {#4} { `#3 } { "20000 } } + \cs_new_eq:NN \xeCJK_xetex_mathcode:w \XeTeXmathcode } \prg_new_conditional:Npnn \xeCJK_if_CJK_class:N #1 { p , T , F , TF } { @@ -293,6 +342,7 @@ \xeCJK_new_class:n { HalfLeft } \xeCJK_new_class:n { HalfRight } \xeCJK_new_class:n { NormalSpace } +\xeCJK_new_class:n { IVS } \clist_const:Nn \c__xeCJK_HalfLeft_chars_clist { "28 , "2D , "5B , "60 , "7B } \clist_const:Nn \c__xeCJK_HalfRight_chars_clist @@ -300,14 +350,14 @@ \clist_const:Nn \c__xeCJK_NormalSpace_chars_clist { "2F } \clist_const:Nn \c__xeCJK_FullLeft_chars_clist { - "2018 , "201C , "2116 , "3008 , "300A , "300C , "300E , "3010 , "3012 , - "3014 , "3016 , "3018 , "301A , "301D , "3036 , "E76C , "FE59 , "FE5B , - "FE5D , "FE5F , "FE60 , "FE69 , "FE6B , "FF03 , "FF04 , "FF08 , "FF20 , - "FF3B , "FF5B , "FFE0 , "FFE1 , "FFE5 , "FFE6 + "2018 , "201C , "3008 , "300A , "300C , "300E , "3010 , "3012 , "3014 , + "3016 , "3018 , "301A , "301D , "3036 , "FE59 , "FE5B , "FE5D , "FE5F , + "FE60 , "FE69 , "FE6B , "FF03 , "FF04 , "FF08 , "FF20 , "FF3B , "FF5B , + "FFE0 , "FFE1 , "FFE5 , "FFE6 } \clist_const:Nn \c__xeCJK_FullRight_chars_clist { - "00B7 , "2019 , "201D , "2014 , "2015 , "2025 , "2026 , "2030 , "2500 , + "00B7 , "2019 , "201D , "2014 , "2015 , "2025 , "2026 , "2027 , "2500 , "3001 , "3002 , "3005 , "3006 , "3009 , "300B , "300D , "300F , "3011 , "3015 , "3017 , "3019 , "301B , "301E , "301F , "3041 , "3043 , "3045 , "3047 , "3049 , "3063 , "3083 , "3085 , "3087 , "308E , "309B , "309C , @@ -343,16 +393,25 @@ "A490 -> "A4CF , "A960 -> "A97F , "AC00 -> "D7AF , - "B000 -> "B0FF , "D7B0 -> "D7FF , "F900 -> "FAFF , + "FE10 -> "FE1F , "FE30 -> "FE4F , "FF00 -> "FFEF , + "1B000 -> "1B0FF , + "1F200 -> "1F2FF , "20000 -> "2A6DF , "2A700 -> "2B73F , "2B740 -> "2B81F , "2F800 -> "2FA1F } +\clist_const:Nn \c__xeCJK_IVS_chars_clist + { + "3099 , + "309A , + "FE00 -> "FE0F , + "E0100 -> "E01EF + } \seq_new:N \g__xeCJK_base_class_seq \seq_gset_eq:NN \g__xeCJK_base_class_seq \g__xeCJK_class_seq \seq_new:N \g__xeCJK_non_CJK_class_seq @@ -364,7 +423,7 @@ \seq_gput_right:Nn \g__xeCJK_CJK_class_seq {#1} \tl_const:cn { \__xeCJK_CJK_class_tl:c { \__xeCJK_class_csname:n {#1} } } {#1} } -\clist_map_function:nN { CJK , FullLeft , FullRight } \__xeCJK_save_CJK_class:n +\clist_map_function:nN { CJK , FullLeft , FullRight , IVS } \__xeCJK_save_CJK_class:n \cs_new_nopar:Npn \xeCJK_class_num:n #1 { \use:c { \__xeCJK_class_csname:n {#1} } } \NewDocumentCommand \xeCJKDeclareCharClass { s > { \TrimSpaces } m m } { @@ -451,12 +510,13 @@ { \xeCJK_declare_char_class:nV { CJK } \c__xeCJK_CJK_chars_clist \xeCJK_declare_char_class:nV { NormalSpace } \c__xeCJK_NormalSpace_chars_clist + \xeCJK_declare_char_class:nV { IVS } \c__xeCJK_IVS_chars_clist \xeCJKResetPunctClass } \xeCJKResetCharClass \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} } -\cs_generate_variant:Nn \xeCJK_inter_class_toks:nnn { nnc , nnv , nnx } +\cs_generate_variant:Nn \xeCJK_inter_class_toks:nnn { nnc , nnx } \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} } \cs_new_protected_nopar:Npn \xeCJK_clear_inter_class_toks:nn #1#2 @@ -475,14 +535,18 @@ \cs_generate_variant:Nn \xeCJK_app_inter_class_toks:nnn { nnc , nnx } \cs_new_protected_nopar:Npn \xeCJK_copy_inter_class_toks:nnnn #1#2#3#4 { - \xeCJK_inter_class_toks:nnx {#1} {#2} - { \xeCJK_get_inter_class_toks:nn {#3} {#4} } + \tl_set:Nx \l__xeCJK_tmpa_tl { \xeCJK_get_inter_class_toks:nn {#3} {#4} } + \tl_if_empty:NF \l__xeCJK_tmpa_tl + { \xeCJK_inter_class_toks:nnx {#1} {#2} { \exp_not:V \l__xeCJK_tmpa_tl } } } \cs_new_protected_nopar:Npn \xeCJK_replace_inter_class_toks:nnnn #1#2#3#4 { \tl_set:Nx \l__xeCJK_tmpa_tl { \xeCJK_get_inter_class_toks:nn {#1} {#2} } - \tl_replace_all:Nnn \l__xeCJK_tmpa_tl {#3} {#4} - \xeCJK_inter_class_toks:nnx {#1} {#2} { \exp_not:V \l__xeCJK_tmpa_tl } + \tl_if_empty:NF \l__xeCJK_tmpa_tl + { + \tl_replace_all:Nnn \l__xeCJK_tmpa_tl {#3} {#4} + \xeCJK_inter_class_toks:nnx {#1} {#2} { \exp_not:V \l__xeCJK_tmpa_tl } + } } \cs_new_protected_nopar:Npn \xeCJK_clear_Boundary_and_CJK_toks: { \seq_map_function:NN \g__xeCJK_CJK_class_seq \__xeCJK_clear_Boundary_and_CJK_toks:n } @@ -490,6 +554,19 @@ { \xeCJK_clear_inter_class_toks:nn { Boundary } {#1} } \cs_new_eq:NN \xeCJK_class_group_begin: \c_group_begin_token \cs_new_eq:NN \xeCJK_class_group_end: \c_group_end_token +\AtEndOfPackage + { + \seq_map_inline:Nn \g__xeCJK_class_seq + { + \str_if_eq:nnTF {#1} { IVS } + { \xeCJK_copy_inter_class_toks:nnnn { IVS } {#1} { CJK } { CJK } } + { + \xeCJK_copy_inter_class_toks:nnnn { IVS } {#1} { CJK } {#1} + \str_if_eq:nnF {#1} { CJK } + { \xeCJK_copy_inter_class_toks:nnnn {#1} { IVS } {#1} { CJK } } + } + } + } \clist_map_inline:nn { Default , HalfLeft , HalfRight , NormalSpace } { \xeCJK_inter_class_toks:nnn {#1} { CJK } @@ -509,6 +586,7 @@ \bool_if:nTF { \l__xeCJK_xecglue_bool && + \int_compare_p:nNn \etex_lastnodetype:D = \c_eleven && \skip_if_eq_p:nn \tex_lastskip:D \c_xeCJK_space_skip_tl } { @@ -532,6 +610,7 @@ { \xeCJK_inter_class_toks:nnn {#1} { Boundary } { + \int_gset_eq:NN \g__xeCJK_spacefactor_int \tex_spacefactor:D \peek_meaning_remove:NTF \tex_italiccorrection:D { \tex_italiccorrection:D { \xeCJK_make_node:n { default } } } { @@ -567,6 +646,7 @@ \bool_if:nT { \l__xeCJK_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__xeCJK_ecglue_skip ) } @@ -751,7 +831,7 @@ \xeCJK_class_group_end: \xeCJK_no_break: \__xeCJK_punct_glue:NN \c__xeCJK_left_tl \g__xeCJK_last_punct_tl } - { \xeCJK_class_group_end: \xeCJK_no_break: } + { \xeCJK_class_group_end: \xeCJK_no_break: \skip_horizontal:N \c_zero_skip } } \cs_new_protected_nopar:Npn \xeCJK_FullRight_and_CJK: { @@ -802,7 +882,13 @@ } \cs_new_protected_nopar:Npn \__xeCJK_Boundary_and_FullLeft_glue:N #1 { - \int_compare:nNnF \etex_lastnodetype:D = \c_one + \int_case:nnn { \etex_lastnodetype:D } + { + { \c_one } { \skip_horizontal:N \c_zero_skip } + { \c_minus_one } { } + { \c_eleven } { } + { \c_thirteen } { } + } { \__xeCJK_punct_glue:NN \c__xeCJK_left_tl {#1} } } \cs_new_protected_nopar:Npn \xeCJK_Default_and_FullRight:nN #1#2 @@ -846,7 +932,7 @@ { \__xeCJK_punct_if_middle:NTF {#1} { \xeCJK_no_break: \__xeCJK_punct_glue:NN \c__xeCJK_right_tl {#1} } - { \xeCJK_no_break: } + { \xeCJK_no_break: \skip_horizontal:N \c_zero_skip } } } \cs_new_eq:NN \__xeCJK_Default_and_FullRight_glue:N \__xeCJK_CJK_and_FullRight_glue:N @@ -2318,7 +2404,6 @@ \tex_ignorespaces:D } \tl_new:N \l_xeCJK_family_tl -\tl_set:Nn \l_xeCJK_family_tl { \CJKfamilydefault } \cs_new_protected_nopar:Npn \__xeCJK_gobble_CJKfamily: { \cs_set_eq:NN \CJKfamily \__xeCJK_gobble_CJKfamily:wn } \DeclareExpandableDocumentCommand \__xeCJK_gobble_CJKfamily:wn { t+ t- m } { } @@ -2368,12 +2453,21 @@ {#1} } \NewDocumentCommand \setCJKmainfont { O{} m } - { \xeCJK_set_family:xxx { \CJKrmdefault } {#1} {#2} } + { + \xeCJK_set_family:xxx { \CJKrmdefault } {#1} {#2} + \normalfont + } \cs_new_eq:NN \setCJKromanfont \setCJKmainfont \NewDocumentCommand \setCJKsansfont { O{} m } - { \xeCJK_set_family:xxx { \CJKsfdefault } {#1} {#2} } + { + \xeCJK_set_family:xxx { \CJKsfdefault } {#1} {#2} + \normalfont + } \NewDocumentCommand \setCJKmonofont { O{} m } - { \xeCJK_set_family:xxx { \CJKttdefault } {#1} {#2} } + { + \xeCJK_set_family:xxx { \CJKttdefault } {#1} {#2} + \normalfont + } \@onlypreamble \setCJKmainfont \@onlypreamble \setCJKmathfont \@onlypreamble \setCJKsansfont @@ -2546,37 +2640,73 @@ \__xeCJK_check_num_range:nnNN {#1} {#2} \l__xeCJK_tmpa_int \l__xeCJK_tmpb_int \xeCJK_int_until_do:nn { \l__xeCJK_tmpa_int > \l__xeCJK_tmpb_int } { - \tex_global:D \XeTeXmathcode \l__xeCJK_tmpa_int = #3 ~ #4 \l__xeCJK_tmpa_int + \tex_global:D \xeCJK_xetex_mathcode:w + \l__xeCJK_tmpa_int = #3 ~ #4 \l__xeCJK_tmpa_int \int_incr:N \l__xeCJK_tmpa_int } } +\keys_define:nn { xeCJK / options } + { + Verb .choice: , + Verb / true .code:n = + { + \bool_set_true:N \l__xeCJK_verb_use_bool + \int_set_eq:NN \l__xeCJK_verb_level_int \c_zero + } , + Verb / false .code:n = { \bool_set_false:N \l__xeCJK_verb_use_bool } , + Verb / env .code:n = + { + \bool_set_true:N \l__xeCJK_verb_use_bool + \int_set_eq:NN \l__xeCJK_verb_level_int \c_one + } , + Verb .default:n = { true } + } +\bool_new:N \l__xeCJK_verb_use_bool +\int_new:N \l__xeCJK_verb_level_int +\__xeCJK_after_preamble:n + { + \tl_put_right:Nn \verbatim@font + { + \bool_if:nTF + { + \l__xeCJK_verb_use_bool && + \int_compare_p:nNn \etex_currentgrouptype:D > \l__xeCJK_verb_level_int + } + { \__xeCJK_set_verb_exspace: } + { \skip_zero:N \g__xeCJK_verb_exspace_skip } + \__xeCJK_verb_addon: + } + } \NewDocumentCommand \xeCJKVerbAddon { } { \int_compare:nNnF \etex_currentgrouplevel:D = \c_zero { \__xeCJK_set_verb_exspace: - \bool_if:NF \l__xeCJK_verb_addon_bool - { - \bool_set_true:N \l__xeCJK_verb_addon_bool - \__xeCJK_set_char_class_eq:nn { FullLeft } { CJK } - \__xeCJK_set_char_class_eq:nn { FullRight } { CJK } - \__xeCJK_set_char_class_eq:nn { HalfLeft } { Default } - \__xeCJK_set_char_class_eq:nn { HalfRight } { Default } - \__xeCJK_set_char_class_eq:nn { NormalSpace } { Default } - \xeCJKsetup { xCJKecglue = false } - \cs_set_protected_nopar:Npn \CJKglue - { \skip_horizontal:N \g__xeCJK_verb_exspace_skip } - \cs_set_protected_nopar:Npn \CJKecglue - { \skip_horizontal:n { 0.5 \g__xeCJK_verb_exspace_skip } } - \cs_set_eq:NN \xeCJK_check_for_glue: \CJKecglue - \cs_set_eq:NN \xeCJK_ignore_spaces:w \CJKecglue - \skip_set:Nn \tex_rightskip:D { \c_zero_dim plus 1 fil } - } + \__xeCJK_verb_addon: + } + } +\cs_new_protected_nopar:Npn \__xeCJK_verb_addon: + { + \bool_if:NF \l__xeCJK_verb_addon_bool + { + \bool_set_true:N \l__xeCJK_verb_addon_bool + \__xeCJK_set_char_class_eq:nn { FullLeft } { CJK } + \__xeCJK_set_char_class_eq:nn { FullRight } { CJK } + \__xeCJK_set_char_class_eq:nn { HalfLeft } { Default } + \__xeCJK_set_char_class_eq:nn { HalfRight } { Default } + \__xeCJK_set_char_class_eq:nn { NormalSpace } { Default } + \xeCJKsetup { xCJKecglue = false } + \cs_set_protected_nopar:Npn \CJKglue + { \skip_horizontal:N \g__xeCJK_verb_exspace_skip } + \cs_set_protected_nopar:Npn \CJKecglue + { \skip_horizontal:n { 0.5 \g__xeCJK_verb_exspace_skip } } + \cs_set_eq:NN \xeCJK_check_for_glue: \CJKecglue + \cs_set_eq:NN \xeCJK_ignore_spaces:w \CJKecglue + \skip_set:Nn \tex_rightskip:D { \c_zero_dim plus 1 fil } } } \bool_new:N \l__xeCJK_verb_addon_bool \cs_new_eq:NN \CJKfixedspacing \xeCJKVerbAddon -\__xeCJK_after_preamble:n { \tl_put_right:Nn \verbatim@font { \xeCJKVerbAddon } } \cs_new_protected_nopar:Npn \__xeCJK_set_verb_exspace: { \tl_if_exist:cF { xeCJK/verb/\l_xeCJK_family_tl/\curr@fontshape/\f@size } @@ -2707,6 +2837,7 @@ xeCJKactive = true , LocalConfig = true , indentfirst = true , + Verb = env , EmboldenFactor = 4 , SlantFactor = 0.167 , PunctStyle = quanjiao , @@ -2715,7 +2846,7 @@ NoBreakCS = { \footnote \footnotemark \nobreak } , KaiMingPunct = { ^^^^3002 ^^^^ff0e ^^^^ff1f ^^^^ff01 } , LongPunct = { ^^^^2014 ^^^^2015 ^^^^2500 ^^^^2025 ^^^^2026 } , - MiddlePunct = { ^^^^2014 ^^^^2015 ^^^^2500 ^^^^00b7 ^^^^30fb ^^^^ff65 } , + MiddlePunct = { ^^^^2014 ^^^^2015 ^^^^2027 ^^^^2500 ^^^^00b7 ^^^^30fb ^^^^ff65 } , AllowBreakBetweenPuncts = false } \defaultCJKfontfeatures { Script = CJK } @@ -2785,8 +2916,9 @@ } \__xeCJK_msg_new:nn { conflict-package } { - The~`#1'~package~is~in~conflict~with~xeCJK. \\ - Please~do~not~use~it~or~load~it~after~xeCJK. + The~`#1'~package~is~too~old. \\ + Please~update~an~up~to~date~version~of~it\\ + using~your~TeX~package~manager~or~from~CTAN. } \xeCJK_if_package_loaded:nTF { realscripts } { @@ -2906,6 +3038,8 @@ } } } +\cs_new_eq:NN \__xeCJK_group_begin: \group_begin: +\cs_new_eq:NN \__xeCJK_group_end: \group_end: \__xeCJK_after_preamble:n { \tl_map_inline:nn @@ -2913,7 +3047,10 @@ \textellipsis \textemdash \textperiodcentered \textcentereddot \textquoteleft \textquoteright \textquotedblleft \textquotedblright } - { \cs_gset_nopar:Npx #1 { { \makexeCJKinactive \exp_not:o {#1} } } } + { + \cs_gset_nopar:Npx #1 + { \__xeCJK_group_begin: \makexeCJKinactive \exp_not:o {#1} \__xeCJK_group_end: } + } \tl_put_left:Nn \tipaencoding { \makexeCJKinactive } \cs_new_eq:NN \__xeCJK_aux_r:n \r \cs_set_nopar:Npn \r #1 { { \makexeCJKinactive \__xeCJK_aux_r:n {#1} } } @@ -2927,10 +3064,12 @@ { \xeCJK_if_package_loaded:nT { hyperref } { - \tl_gput_right:Nn \pdfstringdefPreHook + \pdfstringdefDisableCommands { \__xeCJK_gobble_CJKfamily: \xeCJK_cs_clear:N \makexeCJKinactive + \xeCJK_cs_clear:N \__xeCJK_group_begin: + \xeCJK_cs_clear:N \__xeCJK_group_end: } } } diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty index 9df832c901d..ab6c22c369a 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty +++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty @@ -6,7 +6,7 @@ %% %% xeCJK.dtx (with options: `fntef') %% -%% $Id: xeCJK.dtx 399 2013-01-11 14:57:50Z sobenlee $ +%% $Id: xeCJK.dtx 416 2013-05-25 08:44:28Z sobenlee $ %% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ %% ----------------------------------------------------------------- %% Author: @@ -33,11 +33,11 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 399 2013-01-11 14:57:50Z sobenlee $ +\GetIdInfo$Id: xeCJK.dtx 416 2013-05-25 08:44:28Z sobenlee $ {xeCJK patch file for ulem/CJKfntef} \ProvidesExplPackage {xeCJKfntef} - {\ExplFileDate}{3.1.2}{\ExplFileDescription} + {\ExplFileDate}{3.2.0}{\ExplFileDescription} \PassOptionsToPackage { normalem } { ulem } \DeclareOption* { \PassOptionsToPackage { \CurrentOption } { ulem } } \ProcessOptions \scan_stop: -- cgit v1.2.3