diff options
author | Karl Berry <karl@freefriends.org> | 2014-01-04 23:42:43 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-01-04 23:42:43 +0000 |
commit | 8c5c1f73c2baa1475314d9ac23b6361e1a70e5e9 (patch) | |
tree | 74bb21325f84f71c682953f9a352f23637e92b81 /Master/texmf-dist/source/latex | |
parent | fa28f277e827ba009ea0d21228315f5e6e20340e (diff) |
xpinyin (4jan14)
git-svn-id: svn://tug.org/texlive/trunk@32572 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r-- | Master/texmf-dist/source/latex/xpinyin/xpinyin.dtx | 56 |
1 files changed, 34 insertions, 22 deletions
diff --git a/Master/texmf-dist/source/latex/xpinyin/xpinyin.dtx b/Master/texmf-dist/source/latex/xpinyin/xpinyin.dtx index 4a5221a7ded..0b17b767ef5 100644 --- a/Master/texmf-dist/source/latex/xpinyin/xpinyin.dtx +++ b/Master/texmf-dist/source/latex/xpinyin/xpinyin.dtx @@ -119,13 +119,13 @@ and some specific Chinese Simplified fonts (TrueType or OpenType). %<*driver|package> \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xpinyin.dtx 526 2013-11-12 00:16:04Z sobenlee $ +\GetIdInfo$Id: xpinyin.dtx 539 2014-01-04 08:07:32Z sobenlee $ {Automatically add pinyin to Chinese characters} %<*driver> \ProvidesExplFile{\ExplFileName.\ExplFileExtension} %</driver> %<package>\ProvidesExplPackage{\ExplFileName} - {\ExplFileDate}{1.5}{\ExplFileDescription} + {\ExplFileDate}{1.6}{\ExplFileDescription} %<*driver> \ExplSyntaxOff %</driver> @@ -186,7 +186,7 @@ and some specific Chinese Simplified fonts (TrueType or OpenType). %</driver> % \fi % -% \CheckSum{616} +% \CheckSum{623} % \GetFileInfo{\jobname.dtx} % % \title{\bfseries\pkg{xpinyin} 宏包} @@ -649,12 +649,22 @@ and some specific Chinese Simplified fonts (TrueType or OpenType). % \begin{macrocode} \cs_new_protected_nopar:Npn \@@_single_aux:nn #1#2 { - \@@_single_hook:n - { \cs_set_eq:NN \@@_save_CJKsymbol:n \use:n } - \cs_set_eq:NN \@@_to_unicode:n \@@_char_to_unicode:n - \@@_make_box:nn {#1} { \@@_pinyin:n {#2} } + \@@_single_hook:n { \@@_replace_CJKsymbol: } + \@@_replace_CJKsymbol_single:n {#2} + #1 \group_end: } +\cs_new_protected_nopar:Npn \@@_replace_CJKsymbol_single_aux:n #1 + { + \cs_set_protected_nopar:Npn \CJKsymbol ##1 + { \@@_single_CJKsymbol:nn {##1} {#1} } + } +\cs_new_protected_nopar:Npn \@@_single_CJKsymbol:nn #1#2 + { + \@@_make_pinyin_box:nnn + { \@@_to_unicode:n {#1} } {#1} { \@@_pinyin:n {#2} } + \@@_save_CJKsymbol:n {#1} + } % \end{macrocode} % \end{macro} % @@ -674,13 +684,7 @@ and some specific Chinese Simplified fonts (TrueType or OpenType). % \begin{macro}[internal]{\@@_single_hook_aux:n} % \begin{macrocode} \cs_new_protected_nopar:Npn \@@_single_hook_aux:n - { - \cs_if_eq:NNTF \CJKsymbol \@@_CJKsymbol:n - { - \cs_set_eq:NN \CJKsymbol \@@_save_CJKsymbol:n - \cs_set_eq:NN \@@_save_CJKsymbol:n \use:n - } - } + { \cs_if_eq:NNF \CJKsymbol \@@_CJKsymbol:n } % \end{macrocode} % \end{macro} % @@ -757,13 +761,15 @@ and some specific Chinese Simplified fonts (TrueType or OpenType). \cs_new_eq:NN \@@_to_unicode:n \@@_to_unicode_xetex:n \cs_new_eq:NN \@@_char_to_unicode:n \@@_to_unicode:n \cs_new_eq:NN \@@_replace_CJKsymbol: \@@_replace_CJKsymbol_aux: + \cs_new_eq:NN \@@_replace_CJKsymbol_single:n + \@@_replace_CJKsymbol_single_aux:n \tl_gset:Nn \l_@@_coor_tl { (\cs_meaning:N \l_@@_font_tl)/\l_xeCJK_current_font_tl/\l_@@_ratio_tl } \cs_new_eq:NN \@@_leavevmode: \prg_do_nothing: \cs_new_protected_nopar:Npn \@@_CJKsymbol_hook: { \makexeCJKinactive \xeCJK_select_font: } \cs_new_protected_nopar:Npn \@@_single_hook:n - { \cs_if_eq:NNTF \CJKsymbol \@@_CJKsymbol:n { \cs_set_eq:NN \CJKsymbol \use:n } } + { \cs_if_eq:NNF \CJKsymbol \@@_CJKsymbol:n } } % \end{macrocode} % \end{macro} @@ -789,12 +795,15 @@ and some specific Chinese Simplified fonts (TrueType or OpenType). { \cs_new_eq:NN \@@_single_hook:n \@@_single_hook_aux:n \cs_new_eq:NN \@@_replace_CJKsymbol: \@@_replace_CJKsymbol_aux: + \cs_new_eq:NN \@@_replace_CJKsymbol_single:n + \@@_replace_CJKsymbol_single_aux:n \AtBeginDocument { \@ifpackageloaded { CJKpunct } { \cs_undefine:N \@@_single_hook:n \cs_undefine:N \@@_replace_CJKsymbol: + \cs_undefine:N \@@_replace_CJKsymbol_single:n \@@_adjust_CJKpunct_hook: } { } } @@ -819,18 +828,21 @@ and some specific Chinese Simplified fonts (TrueType or OpenType). } } } - \cs_new_protected_nopar:Npn \@@_single_hook:n + \cs_new_protected_nopar:Npn \@@_replace_CJKsymbol_single:n ##1 { \int_compare:nNnTF { \CJKpunct@punctstyle } = { \CJKpunct@ps@plain } - { \@@_single_hook_aux:n } + { \@@_replace_CJKsymbol_single_aux:n {##1} } { - \cs_if_eq:NNTF \CJKosymbol \@@_CJKsymbol:n - { - \cs_set_eq:NN \CJKosymbol \@@_save_CJKsymbol:n - \cs_set_eq:NN \@@_save_CJKsymbol:n \use:n - } + \cs_set_protected_nopar:Npn \CJKosymbol ####1 + { \@@_single_CJKsymbol:nn {####1} {##1} } } } + \cs_new_protected_nopar:Npn \@@_single_hook:n + { + \int_compare:nNnTF { \CJKpunct@punctstyle } = { \CJKpunct@ps@plain } + { \@@_single_hook_aux:n } + { \cs_if_eq:NNF \CJKosymbol \@@_CJKsymbol:n } + } } % \end{macrocode} % \end{macro} |