diff options
author | Karl Berry <karl@freefriends.org> | 2016-02-03 23:02:34 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-02-03 23:02:34 +0000 |
commit | d7e7feec5992a359e08cb62c8bb2a53b59b7112f (patch) | |
tree | 382490c4e07b4ab12dfa6c15c3ace2012b847ad9 /Master/texmf-dist/tex | |
parent | f4a543aed2bbfaec5c3f8dbfee5985322cd1b938 (diff) |
zhnumber (2feb16)
git-svn-id: svn://tug.org/texlive/trunk@39567 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
4 files changed, 57 insertions, 60 deletions
diff --git a/Master/texmf-dist/tex/latex/zhnumber/zhnumber-big5.cfg b/Master/texmf-dist/tex/latex/zhnumber/zhnumber-big5.cfg index f74aee2d3d5..f62be008da2 100644 --- a/Master/texmf-dist/tex/latex/zhnumber/zhnumber-big5.cfg +++ b/Master/texmf-dist/tex/latex/zhnumber/zhnumber-big5.cfg @@ -6,7 +6,7 @@ %% %% zhnumber.dtx (with options: `config,big5') %% -%% Copyright (C) 2012, 2014, 2015 by Qing Lee <sobenlee@gmail.com> +%% Copyright (C) 2012, 2014-2016 by Qing Lee <sobenlee@gmail.com> %% -------------------------------------------------------------------------- %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -19,11 +19,11 @@ %% This work has the LPPL maintenance status "maintained". %% The Current Maintainer of this work is Qing Lee. %% -\GetIdInfo$Id: zhnumber.dtx 42dbb38 2015-05-21 23:20:32 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: zhnumber.dtx 9686fd1 2016-02-02 16:55:41 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese numerals with Big5 encoding} \ProvidesExplFile {\ExplFileName-big5.cfg} - {\ExplFileDate}{2.2}{\ExplFileDescription} + {\ExplFileDate}{2.3}{\ExplFileDescription} \zhnum_set_digits_map:nn { minus } { t } \zhnum_set_digits_map:nn { 0 } { ¹s } \zhnum_set_digits_map:nn { null } { ¡³ } diff --git a/Master/texmf-dist/tex/latex/zhnumber/zhnumber-gbk.cfg b/Master/texmf-dist/tex/latex/zhnumber/zhnumber-gbk.cfg index 2f6dd172f76..57e1af8dbf9 100644 --- a/Master/texmf-dist/tex/latex/zhnumber/zhnumber-gbk.cfg +++ b/Master/texmf-dist/tex/latex/zhnumber/zhnumber-gbk.cfg @@ -6,7 +6,7 @@ %% %% zhnumber.dtx (with options: `config,gbk') %% -%% Copyright (C) 2012, 2014, 2015 by Qing Lee <sobenlee@gmail.com> +%% Copyright (C) 2012, 2014-2016 by Qing Lee <sobenlee@gmail.com> %% -------------------------------------------------------------------------- %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -19,11 +19,11 @@ %% This work has the LPPL maintenance status "maintained". %% The Current Maintainer of this work is Qing Lee. %% -\GetIdInfo$Id: zhnumber.dtx 42dbb38 2015-05-21 23:20:32 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: zhnumber.dtx 9686fd1 2016-02-02 16:55:41 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese numerals with GBK encoding} \ProvidesExplFile {\ExplFileName-gbk.cfg} - {\ExplFileDate}{2.2}{\ExplFileDescription} + {\ExplFileDate}{2.3}{\ExplFileDescription} \zhnum_set_digits_map:nnn { minus } { simp } { ¸º } \zhnum_set_digits_map:nnn { minus } { trad } { Ø“ } \zhnum_set_digits_map:nn { 0 } { Áã } diff --git a/Master/texmf-dist/tex/latex/zhnumber/zhnumber-utf8.cfg b/Master/texmf-dist/tex/latex/zhnumber/zhnumber-utf8.cfg index b006f7b0b2b..d8f110df755 100644 --- a/Master/texmf-dist/tex/latex/zhnumber/zhnumber-utf8.cfg +++ b/Master/texmf-dist/tex/latex/zhnumber/zhnumber-utf8.cfg @@ -6,7 +6,7 @@ %% %% zhnumber.dtx (with options: `config,utf8') %% -%% Copyright (C) 2012, 2014, 2015 by Qing Lee <sobenlee@gmail.com> +%% Copyright (C) 2012, 2014-2016 by Qing Lee <sobenlee@gmail.com> %% -------------------------------------------------------------------------- %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -19,11 +19,11 @@ %% This work has the LPPL maintenance status "maintained". %% The Current Maintainer of this work is Qing Lee. %% -\GetIdInfo$Id: zhnumber.dtx 42dbb38 2015-05-21 23:20:32 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: zhnumber.dtx 9686fd1 2016-02-02 16:55:41 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese numerals with UTF8 encoding} \ProvidesExplFile {\ExplFileName-utf8.cfg} - {\ExplFileDate}{2.2}{\ExplFileDescription} + {\ExplFileDate}{2.3}{\ExplFileDescription} \zhnum_set_digits_map:nnn { minus } { simp } { è´Ÿ } \zhnum_set_digits_map:nnn { minus } { trad } { è² } \zhnum_set_digits_map:nn { 0 } { 零 } diff --git a/Master/texmf-dist/tex/latex/zhnumber/zhnumber.sty b/Master/texmf-dist/tex/latex/zhnumber/zhnumber.sty index 4223c0743d7..3945d1cfc98 100644 --- a/Master/texmf-dist/tex/latex/zhnumber/zhnumber.sty +++ b/Master/texmf-dist/tex/latex/zhnumber/zhnumber.sty @@ -6,7 +6,7 @@ %% %% zhnumber.dtx (with options: `package') %% -%% Copyright (C) 2012, 2014, 2015 by Qing Lee <sobenlee@gmail.com> +%% Copyright (C) 2012, 2014-2016 by Qing Lee <sobenlee@gmail.com> %% -------------------------------------------------------------------------- %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -21,11 +21,11 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: zhnumber.dtx 42dbb38 2015-05-21 23:20:32 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: zhnumber.dtx 9686fd1 2016-02-02 16:55:41 +0800 Qing Lee <sobenlee@gmail.com> $ {Typesetting numbers with Chinese glyphs} \ProvidesExplPackage {\ExplFileName} - {\ExplFileDate}{2.2}{\ExplFileDescription} + {\ExplFileDate}{2.3}{\ExplFileDescription} \msg_new:nnn { zhnumber } { l3-too-old } { Support~package~'expl3'~too~old. \\\\ @@ -33,7 +33,7 @@ 'l3kernel'~and~'l3packages'\\\\ using~your~TeX~package~manager~or~from~CTAN. } -\@ifpackagelater { expl3 } { 2014/08/25 } { } +\@ifpackagelater { expl3 } { 2015/09/24 } { } { \msg_error:nn { zhnumber } { l3-too-old } } \RequirePackage { xparse , l3keys2e } \DeclareExpandableDocumentCommand \zhnumber { +o +m } @@ -118,7 +118,9 @@ { \__zhnum_counter_error:n {#1} } } \cs_new:Npn \__zhnum_counter_error:n #1 - { \__msg_expandable_error:n { `#1'~is~not~a~LaTeX~counter. } } + { \msg_expandable_error:nnn { zhnumber } { not-counter } {#1} } +\msg_new:nnn { zhnumber } { not-counter } + { `#1'~is~not~a~LaTeX~counter. } \cs_new:Npn \zhnum_int:n #1 { \int_compare:nNnTF {#1} > \c_zero @@ -138,7 +140,7 @@ \exp_after:wN \__zhnum_read_integer:www \tex_number:D \exp_after:wN \__zhnum_read_sign_loop:N - \tex_romannumeral:D -`0 \use:n + \exp:w \exp_end_continue_f:w \use:n #1 \exp_stop_f: \q_recursion_tail \q_recursion_stop \__zhnum_result:nn { \c_zero } { } ; } @@ -146,10 +148,10 @@ { \if:w + \if:w - \exp_not:N #1 + \fi: \exp_not:N #1 \exp_after:wN \__zhnum_read_sign_loop:N - \tex_romannumeral:D -`0 \exp_after:wN \use:n + \exp:w \exp_end_continue_f:w \exp_after:wN \use:n \else: 1 \exp_after:wN ; - \tex_romannumeral:D -`0 + \exp:w \exp_end_continue_f:w \exp_after:wN \__zhnum_read_zeros_loop:N \exp_after:wN #1 \fi: @@ -158,7 +160,7 @@ { \if:w 0 \exp_not:N #1 \exp_after:wN \__zhnum_read_zeros_loop:N - \tex_romannumeral:D -`0 \exp_after:wN \use:n + \exp:w \exp_end_continue_f:w \exp_after:wN \use:n \else: \exp_after:wN \__zhnum_read_abs_loop:Nw \exp_after:wN #1 @@ -170,7 +172,7 @@ { \__zhnum_output:nnwnn { + \c_one } #1 } { \quark_if_recursion_tail_stop_do:Nn #1 { \__zhnum_loop_end:wnn } } \exp_after:wN \__zhnum_read_abs_loop:Nw - \tex_romannumeral:D -`0 \use:n #2 \q_recursion_stop + \exp:w \exp_end_continue_f:w \use:n #2 \q_recursion_stop } \cs_new:Npn \__zhnum_output:nnwnn #1#2#3 \__zhnum_result:nn #4#5 { #3 \__zhnum_result:nn { #4#1 } { #5#2 } } @@ -304,14 +306,14 @@ \exp_after:wN \__zhnum_read_digits:w \tex_number:D \exp_after:wN \__zhnum_read_sign_loop:NN \exp_after:wN #1 - \tex_romannumeral:D -`0 \use:n + \exp:w \exp_end_continue_f:w \use:n #2 \exp_stop_f: \q_recursion_tail \q_recursion_stop } \cs_new:Npn \__zhnum_read_sign_loop:NN #1#2 { \if:w + \if:w - \exp_not:N #2 + \fi: \exp_not:N #2 \exp_after:wN \__zhnum_read_sign_loop:NN \exp_after:wN #1 - \tex_romannumeral:D -`0 \exp_after:wN \use:n + \exp:w \exp_end_continue_f:w \exp_after:wN \use:n \else: 1 \exp_after:wN ; \exp_after:wN \__zhnum_read_digits_loop:NN @@ -328,7 +330,7 @@ \if:w .\exp_not:N #2 \exp_after:wN \c__zhnum_dot_tl \fi: } \exp_after:wN \__zhnum_read_digits_loop:NN \exp_after:wN #1 - \tex_romannumeral:D -`0 \use:n + \exp:w \exp_end_continue_f:w \use:n } \cs_new:Npn \__zhnum_read_digits:w #1 ; { @@ -427,16 +429,13 @@ } \cs_new:Npn \zhtime #1 { \__zhnum_time:ww #1 \q_stop } -\group_begin: -\char_set_lccode:nn { `\; } { `\: } -\tl_to_lowercase:n +\use:x { - \group_end: - \cs_new:Npn \__zhnum_time:ww #1 ; #2 \q_stop - { - \zhnum_check_time:Nn \zhnum_int:n {#1} \c__zhnum_hour_tl - \zhnum_check_time:Nn \zhnum_int:n {#2} \c__zhnum_minute_tl - } + \cs_new:Npn \exp_not:N \__zhnum_time:ww ##1 \c_colon_str ##2 \exp_not:N \q_stop + } + { + \zhnum_check_time:Nn \zhnum_int:n {#1} \c__zhnum_hour_tl + \zhnum_check_time:Nn \zhnum_int:n {#2} \c__zhnum_minute_tl } \cs_new_nopar:Npn \zhcurrtime { @@ -733,16 +732,16 @@ { \cs_set_eq:NN \zhnum_set_alias:NN \tl_set_eq:NN } \cs_new_protected:Npn \zhnum_load_cfg:n #1 { - \zhnum_set_cfg_name:Nn \l__zhnum_cfg_tl {#1} - \tl_if_eq:NNF \l__zhnum_cfg_tl \l__zhnum_last_cfg_tl + \zhnum_set_cfg_name:Nn \l__zhnum_cfg_str {#1} + \str_if_eq:NNF \l__zhnum_cfg_str \l__zhnum_last_cfg_str { \zhnum_update_cfg:n {#1} } \zhnum_parse_config: } \cs_generate_variant:Nn \zhnum_load_cfg:n { o } \cs_new_protected:Npn \zhnum_update_cfg:n #1 { - \prop_if_exist:cTF { g__zhnum_cfg_ \l__zhnum_cfg_tl _prop } - { \tl_set_eq:NN \l__zhnum_last_cfg_tl \l__zhnum_cfg_tl } + \prop_if_exist:cTF { g__zhnum_cfg_ \l__zhnum_cfg_str _prop } + { \str_set_eq:NN \l__zhnum_last_cfg_str \l__zhnum_cfg_str } { \zhnum_input_cfg:n {#1} } \__zhnum_update_cfg_prop:N \prop_set_eq:Nc } @@ -764,10 +763,10 @@ } \cs_new_protected:Npn \__zhnum_update_cfg_prop:N #1 { - #1 \l__zhnum_cfg_map_prop { g__zhnum_cfg_ \l__zhnum_cfg_tl _prop } - #1 \l__zhnum_cfg_map_var_prop { g__zhnum_cfg_var_ \l__zhnum_cfg_tl _prop } - #1 \l__zhnum_cfg_map_finan_prop { g__zhnum_cfg_finan_ \l__zhnum_cfg_tl _prop } - #1 \l__zhnum_cfg_map_ganzhi_prop { g__zhnum_cfg_ganzhi_ \l__zhnum_cfg_tl _prop } + #1 \l__zhnum_cfg_map_prop { g__zhnum_cfg_ \l__zhnum_cfg_str _prop } + #1 \l__zhnum_cfg_map_var_prop { g__zhnum_cfg_var_ \l__zhnum_cfg_str _prop } + #1 \l__zhnum_cfg_map_finan_prop { g__zhnum_cfg_finan_ \l__zhnum_cfg_str _prop } + #1 \l__zhnum_cfg_map_ganzhi_prop { g__zhnum_cfg_ganzhi_ \l__zhnum_cfg_str _prop } } \cs_new_protected:Npn \__zhnum_prop_initial:Nn #1#2 { @@ -776,8 +775,8 @@ } \cs_new_protected:Npn \__zhnum_prop_gset_eq:Nn #1#2 { \prop_gset_eq:cN {#2} #1 } -\tl_new:N \l__zhnum_cfg_tl -\tl_new:N \l__zhnum_last_cfg_tl +\str_new:N \l__zhnum_cfg_str +\str_new:N \l__zhnum_last_cfg_str \bool_new:N \l__zhnum_reset_bool \msg_new:nnnn { zhnumber } { file-not-found } { File~`#1'~not~found. } @@ -785,13 +784,12 @@ The~requested~file~could~not~be~found~in~the~current~directory,~ in~the~TeX~search~path~or~in~the~LaTeX~search~path. } -\pdftex_if_engine:TF +\bool_if:nTF { - \str_if_eq_x:nnTF - { \token_to_str:N \kchar } - { \token_to_meaning:N \kchar } + \sys_if_engine_xetex_p: || + \sys_if_engine_luatex_p: || + \sys_if_engine_uptex_p: } - { \use_i:nn } { \cs_new_eq:NN \zhnum_if_unicode_engine_p: \c_true_bool \cs_new_eq:NN \zhnum_if_unicode_engine:TF \use_i:nn @@ -804,8 +802,8 @@ \cs_new_eq:NN \zhnum_set_catcode: \prg_do_nothing: \cs_new_protected:Npn \zhnum_set_cfg_name:Nn #1#2 { - \tl_set:Nx \l__zhnum_encoding_tl {#2} - \tl_set:Nx #1 { \tl_to_str:N \l__zhnum_encoding_tl } + \str_set:Nx \l__zhnum_encoding_str {#2} + \str_set_eq:NN #1 \l__zhnum_encoding_str } \cs_new_eq:NN \zhnum_reset_config: \zhnum_parse_config: \else: @@ -813,7 +811,7 @@ { \bool_if:NT \l__zhnum_active_char_bool { \zhnum_set_active: } } \cs_new_protected_nopar:Npn \zhnum_set_active: { - \str_case:onTF { \l__zhnum_encoding_tl } + \str_case:onTF { \l__zhnum_encoding_str } { { gbk } { \int_set:Nn \l__zhnum_byte_min_int { "81 } } { big5 } { \int_set:Nn \l__zhnum_byte_min_int { "A1 } } @@ -831,16 +829,15 @@ \int_new:N \l__zhnum_byte_max_int \cs_new_protected:Npn \zhnum_set_cfg_name:Nn #1#2 { - \tl_set:Nx \l__zhnum_encoding_tl {#2} - \tl_set:Nx #1 + \str_set:Nx \l__zhnum_encoding_str {#2} + \str_set:Nx #1 { - \tl_to_str:N \l__zhnum_encoding_tl - \bool_if:NT \l__zhnum_active_char_bool - { \tl_to_str:n { _active } } + \l__zhnum_encoding_str + \bool_if:NT \l__zhnum_active_char_bool { _active } } } \cs_new_protected_nopar:Npn \zhnum_reset_config: - { \zhnum_load_cfg:o { \l__zhnum_encoding_tl } } + { \zhnum_load_cfg:o { \l__zhnum_encoding_str } } \bool_new:N \l__zhnum_active_char_bool \bool_set_true:N \l__zhnum_active_char_bool \fi: @@ -849,9 +846,9 @@ encoding .choices:nn = { UTF8 , GBK , Big5 } { - \exp_args:Nx \tex_lowercase:D - { \tl_set:Nn \exp_not:N \l__zhnum_encoding_tl { \l_keys_choice_tl } } - \zhnum_load_cfg:o { \l__zhnum_encoding_tl } + \str_set:Nx \l__zhnum_encoding_str + { \str_fold_case:V \l_keys_choice_tl } + \zhnum_load_cfg:o { \l__zhnum_encoding_str } } , encoding .default:n = { GBK } , encoding / Bg5 .meta:n = { encoding = Big5 } , @@ -890,7 +887,7 @@ { \cs_set_eq:NN \zhnum_ganzhi:nnn \zhnum_ganzhi_normal:nnn } , ganzhi-cyclic .default:n = { true } , } -\tl_new:N \l__zhnum_encoding_tl +\str_new:N \l__zhnum_encoding_str \msg_new:nnnn { zhnumber } { encoding-invalid } { The~encoding~`#1'~is~invalid. } { Available~encodings~are~`UTF8',~`GBK'~and~`Big5'. } @@ -901,7 +898,7 @@ } \keys_set:nn { zhnum / options } { style , time } \ProcessKeysOptions { zhnum / options } -\tl_if_empty:NT \l__zhnum_encoding_tl +\str_if_empty:NT \l__zhnum_encoding_str { \zhnum_if_unicode_engine:TF { \keys_set:nn { zhnum / options } { encoding = UTF8 } } |