diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/xpinyin/xpinyin-database.def | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/xpinyin/xpinyin.sty | 102 |
2 files changed, 55 insertions, 53 deletions
diff --git a/Master/texmf-dist/tex/latex/xpinyin/xpinyin-database.def b/Master/texmf-dist/tex/latex/xpinyin/xpinyin-database.def index 954bea32078..e1fb64ca19e 100644 --- a/Master/texmf-dist/tex/latex/xpinyin/xpinyin-database.def +++ b/Master/texmf-dist/tex/latex/xpinyin/xpinyin-database.def @@ -7,7 +7,7 @@ %% xpinyin.dtx (with options: `database') %% xpinyin.db %% -%% Copyright (C) 2012-2017 by Qing Lee <sobenlee@gmail.com> +%% Copyright (C) 2012-2018 by Qing Lee <sobenlee@gmail.com> %% -------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -27,7 +27,7 @@ %% -------------------------------------------------------------------------- %% \ProvidesFile{xpinyin-database.def}% - [2017/08/07 v2.5 xpinyin database] + [2018/01/28 v2.6 xpinyin database] %% %% Do not edit this file! %% Created from Unihan database: @@ -36,7 +36,7 @@ %% Date: 2017-05-14 07:01:48 GMT [JHJ] %% Unicode version: 10.0.0 %% -%% by "texlua xpinyin.lua" on 2017-08-07 17:10:33 +0800 +%% by "texlua xpinyin.lua" on 2018-01-28 19:21:49 +0800 %% \XPYU{〇}{12295}{líng} \XPYU{㐀}{13312}{qiū} diff --git a/Master/texmf-dist/tex/latex/xpinyin/xpinyin.sty b/Master/texmf-dist/tex/latex/xpinyin/xpinyin.sty index f47a873d1e0..4472e79ca81 100644 --- a/Master/texmf-dist/tex/latex/xpinyin/xpinyin.sty +++ b/Master/texmf-dist/tex/latex/xpinyin/xpinyin.sty @@ -6,7 +6,7 @@ %% %% xpinyin.dtx (with options: `package') %% -%% Copyright (C) 2012-2017 by Qing Lee <sobenlee@gmail.com> +%% Copyright (C) 2012-2018 by Qing Lee <sobenlee@gmail.com> %% -------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -27,10 +27,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xpinyin.dtx 52c78f6 2017-08-07 17:04:25 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: xpinyin.dtx fafc2d9 2018-01-28 19:09:20 +0800 Qing Lee <sobenlee@gmail.com> $ {Automatically add pinyin to Chinese characters} \ProvidesExplPackage{\ExplFileName} - {\ExplFileDate}{2.5}{\ExplFileDescription} + {\ExplFileDate}{2.6}{\ExplFileDescription} \msg_new:nnn { xpinyin } { l3-too-old } { Support~package~'expl3'~too~old. \\\\ @@ -38,7 +38,7 @@ 'l3kernel'~and~'l3packages'\\\\ using~your~TeX~package~manager~or~from~CTAN. } -\@ifpackagelater { expl3 } { 2017/07/19 } { } +\@ifpackagelater { expl3 } { 2017/12/16 } { } { \msg_error:nn { xpinyin } { l3-too-old } } \msg_new:nnn { xpinyin } { engine-not-supported } { Engine~`\c_sys_engine_str'~is~not~yet~supported,~xpinyin~will~abort! } @@ -48,26 +48,38 @@ { \msg_critical:nn { xpinyin } { engine-not-supported } } \RequirePackage { xparse } \RequirePackage { l3keys2e } -\prop_new:N \c__xpinyin_tone_prop -\clist_map_inline:nn - { - { ā }{ \@tabacckludge= a } , { á }{ \@tabacckludge' a } , - { ǎ }{ \v a } , { à }{ \@tabacckludge` a } , - { ō }{ \@tabacckludge= o } , { ó }{ \@tabacckludge' o } , - { ǒ }{ \v o } , { ò }{ \@tabacckludge` o } , - { ē }{ \@tabacckludge= e } , { é }{ \@tabacckludge' e } , - { ě }{ \v e } , { è }{ \@tabacckludge` e } , - { ū }{ \@tabacckludge= u } , { ú }{ \@tabacckludge' u } , - { ǔ }{ \v u } , { ù }{ \@tabacckludge` u } , - { ḿ }{ \@tabacckludge' m } , { ń }{ \@tabacckludge' n } , - { ň }{ \v n } , { ǹ }{ \@tabacckludge` n } , - { ī }{ \@tabacckludge= { \i } } , { í }{ \@tabacckludge' { \i } } , - { ǐ }{ \v { \i } } , { ì }{ \@tabacckludge` { \i } } , - { ü }{ \" u } , - { ǖ }{ \@tabacckludge= { \" u } } , { ǘ }{ \@tabacckludge' { \" u } } , - { ǚ }{ \v { \" u } } , { ǜ }{ \@tabacckludge` { \" u } } - } - { \prop_gput:Nnn \c__xpinyin_tone_prop #1 } +\prop_const_from_keyval:Nn \c__xpinyin_tone_prop + { + { ā } = { \@tabacckludge= a } , + { á } = { \@tabacckludge' a } , + { ǎ } = { \v a } , + { à } = { \@tabacckludge` a } , + { ō } = { \@tabacckludge= o } , + { ó } = { \@tabacckludge' o } , + { ǒ } = { \v o } , + { ò } = { \@tabacckludge` o } , + { ē } = { \@tabacckludge= e } , + { é } = { \@tabacckludge' e } , + { ě } = { \v e } , + { è } = { \@tabacckludge` e } , + { ū } = { \@tabacckludge= u } , + { ú } = { \@tabacckludge' u } , + { ǔ } = { \v u } , + { ù } = { \@tabacckludge` u } , + { ḿ } = { \@tabacckludge' m } , + { ń } = { \@tabacckludge' n } , + { ň } = { \v n } , + { ǹ } = { \@tabacckludge` n } , + { ī } = { \@tabacckludge= { \i } } , + { í } = { \@tabacckludge' { \i } } , + { ǐ } = { \v { \i } } , + { ì } = { \@tabacckludge` { \i } } , + { ü } = { \" u } , + { ǖ } = { \@tabacckludge= { \" u } } , + { ǘ } = { \@tabacckludge' { \" u } } , + { ǚ } = { \v { \" u } } , + { ǜ } = { \@tabacckludge` { \" u } } + } \cs_new_protected_nopar:Npn \__xpinyin_UTF_char:nn #1#2 { \cs_if_exist:cF { u8:#1 } @@ -164,16 +176,6 @@ \hbox_set:Nn \l__xpinyin_tmpa_box {#2} #1 = \box_wd:N \l__xpinyin_tmpa_box } -\cs_if_exist:NTF \pdftex_quitvmode:D - { \cs_new_eq:NN \__xpinyin_quit_vmode: \pdftex_quitvmode:D } - { - \cs_new_protected_nopar:Npn \__xpinyin_quit_vmode: - { - \if_mode_vertical: - \exp_after:wN \tex_indent:D - \fi: - } - } \cs_new_protected_nopar:Npn \__xpinyin_make_pinyin_box:nnn #1#2#3 { \__xpinyin_leavevmode: @@ -196,14 +198,14 @@ { \box_wd:N \l__xpinyin_tmpb_box } > { \box_wd:N \l__xpinyin_tmpa_box + \l__xpinyin_CJKglue_dim } { - \box_resize:Nnn \l__xpinyin_tmpb_box + \box_resize_to_wd_and_ht:Nnn \l__xpinyin_tmpb_box { \box_wd:N \l__xpinyin_tmpa_box + \l__xpinyin_CJKglue_dim } - { \box_ht:N \l__xpinyin_tmpb_box + \box_dp:N \l__xpinyin_tmpb_box } + { \box_ht:N \l__xpinyin_tmpb_box } } \box_move_up:nn { \l__xpinyin_vsep_tl } { \hbox_to_wd:nn { \box_wd:N \l__xpinyin_tmpa_box } - { \tex_hss:D \box_use_clear:N \l__xpinyin_tmpb_box \tex_hss:D } + { \tex_hss:D \box_use_drop:N \l__xpinyin_tmpb_box \tex_hss:D } } } } @@ -230,21 +232,21 @@ { } \NewDocumentCommand \xpinyin { s O { } m } { + \mode_leave_vertical: \IfBooleanTF {#1} { \group_begin: - \keys_set:nn { xpinyin } {#2} - \enablepinyin - #3 + \keys_set:nn { xpinyin } {#2} + \enablepinyin + #3 \group_end: } { \group_begin: - \keys_set:nn { xpinyin } {#2} - \bool_if:NF \l__xpinyin_enable_bool - { \__xpinyin_width:Nn \l__xpinyin_CJKglue_dim { \CJKglue } } - \__xpinyin_quit_vmode: - \__xpinyin_single_aux:nn {#3} + \keys_set:nn { xpinyin } {#2} + \bool_if:NF \l__xpinyin_enable_bool + { \__xpinyin_width:Nn \l__xpinyin_CJKglue_dim { \CJKglue } } + \__xpinyin_single_aux:nn {#3} } } \bool_new:N \l__xpinyin_enable_bool @@ -289,8 +291,8 @@ \dim_new:N \l__xpinyin_CJKglue_dim \cs_new_protected_nopar:Npn \__xpinyin_single_aux:nn #1#2 { - \__xpinyin_replace_CJKsymbol_single:n {#2} - #1 + \__xpinyin_replace_CJKsymbol_single:n {#2} + #1 \group_end: } \cs_new_protected_nopar:Npn \__xpinyin_replace_CJKsymbol_single_aux:n #1 @@ -397,7 +399,7 @@ \cs_new_eq:NN \__xpinyin_char_to_unicode:n \__xpinyin_UTFchar_to_unicode:n } \cs_new_eq:NN \__xpinyin_select_font: \__xpinyin_select_font_aux: - \cs_new_eq:NN \__xpinyin_leavevmode: \__xpinyin_quit_vmode: + \cs_new_eq:NN \__xpinyin_leavevmode: \mode_leave_vertical: \cs_new_eq:NN \__xpinyin_CJKsymbol_hook: \prg_do_nothing: \@ifpackageloaded { CJKpunct } { \__xpinyin_adjust_CJKpunct_hook: } @@ -496,9 +498,9 @@ } \__xpinyin_pinyin_aux:n } -\cs_new_protected_nopar:Npn \__xpinyin_tone:Nn #1#2 +\cs_new_protected_nopar:Npn \__xpinyin_tone:nn #1#2 { \use:c { __xpinyin_num_to_tone_ #1 :Nn } {#1} {#2} } -\cs_generate_variant:Nn \__xpinyin_tone:Nn { V } +\cs_generate_variant:Nn \__xpinyin_tone:nn { V } \cs_new_nopar:Npn \__xpinyin_replace_v:n #1 { \str_if_eq:nnTF {#1} { v } |