From 998cf23369852d6b42db0795f58ec5ca31cfc446 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 7 Apr 2019 21:27:48 +0000 Subject: zhnumber (7apr19) git-svn-id: svn://tug.org/texlive/trunk@50850 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/zhnumber/zhnumber-big5.cfg | 6 +- .../texmf-dist/tex/latex/zhnumber/zhnumber-gbk.cfg | 6 +- .../tex/latex/zhnumber/zhnumber-utf8.cfg | 6 +- Master/texmf-dist/tex/latex/zhnumber/zhnumber.sty | 116 ++++++++++----------- 4 files changed, 67 insertions(+), 67 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/zhnumber/zhnumber-big5.cfg b/Master/texmf-dist/tex/latex/zhnumber/zhnumber-big5.cfg index fe1519a4463..be0806e1b77 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-2018 by Qing Lee +%% Copyright (C) 2012, 2014-2019 by Qing Lee %% -------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -25,10 +25,10 @@ %% %% -------------------------------------------------------------------------- %% -\GetIdInfo$Id: zhnumber.dtx 7e641ff 2018-01-28 19:08:57 +0800 Qing Lee $ +\GetIdInfo$Id: zhnumber.dtx 311c61d 2019-04-07 23:29:51 +0800 Qing Lee $ {Chinese numerals with Big5 encoding} \ProvidesExplFile{\ExplFileName-big5.cfg} - {\ExplFileDate}{2.6}{\ExplFileDescription} + {\ExplFileDate}{2.7}{\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 9a305d6b9c1..d54b53c8165 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-2018 by Qing Lee +%% Copyright (C) 2012, 2014-2019 by Qing Lee %% -------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -25,10 +25,10 @@ %% %% -------------------------------------------------------------------------- %% -\GetIdInfo$Id: zhnumber.dtx 7e641ff 2018-01-28 19:08:57 +0800 Qing Lee $ +\GetIdInfo$Id: zhnumber.dtx 311c61d 2019-04-07 23:29:51 +0800 Qing Lee $ {Chinese numerals with GBK encoding} \ProvidesExplFile{\ExplFileName-gbk.cfg} - {\ExplFileDate}{2.6}{\ExplFileDescription} + {\ExplFileDate}{2.7}{\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 5c61674579d..0791c6df18f 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-2018 by Qing Lee +%% Copyright (C) 2012, 2014-2019 by Qing Lee %% -------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -25,10 +25,10 @@ %% %% -------------------------------------------------------------------------- %% -\GetIdInfo$Id: zhnumber.dtx 7e641ff 2018-01-28 19:08:57 +0800 Qing Lee $ +\GetIdInfo$Id: zhnumber.dtx 311c61d 2019-04-07 23:29:51 +0800 Qing Lee $ {Chinese numerals with UTF8 encoding} \ProvidesExplFile{\ExplFileName-utf8.cfg} - {\ExplFileDate}{2.6}{\ExplFileDescription} + {\ExplFileDate}{2.7}{\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 79edc8a72ae..474d5320eba 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-2018 by Qing Lee +%% Copyright (C) 2012, 2014-2019 by Qing Lee %% -------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -27,10 +27,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: zhnumber.dtx 7e641ff 2018-01-28 19:08:57 +0800 Qing Lee $ +\GetIdInfo$Id: zhnumber.dtx 311c61d 2019-04-07 23:29:51 +0800 Qing Lee $ {Typesetting numbers with Chinese glyphs} \ProvidesExplPackage{\ExplFileName} - {\ExplFileDate}{2.6}{\ExplFileDescription} + {\ExplFileDate}{2.7}{\ExplFileDescription} \msg_new:nnn { zhnumber } { 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/12/16 } { } +\@ifpackagelater { expl3 } { 2019/03/05 } { } { \msg_error:nn { zhnumber } { l3-too-old } } \RequirePackage { xparse , l3keys2e } \DeclareExpandableDocumentCommand \zhnumber { +o +m } @@ -128,10 +128,10 @@ { `#1'~is~not~a~LaTeX~counter. } \cs_new:Npn \zhnum_int:n #1 { - \int_compare:nNnTF {#1} > \c_zero + \int_compare:nNnTF {#1} > \c_zero_int { \zhnum_parse_number:f { \int_eval:n {#1} } } { - \int_compare:nNnTF {#1} < \c_zero + \int_compare:nNnTF {#1} < \c_zero_int { \c__zhnum_minus_tl \zhnum_parse_number:f { \int_eval:n { - #1 } } @@ -143,11 +143,11 @@ \cs_new:Npn \zhnum_integer:n #1 { \exp_after:wN \__zhnum_read_integer:www - \tex_number:D + \int_value:w \exp_after:wN \__zhnum_read_sign_loop: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 } { } ; + \__zhnum_result:nn { \c_zero_int } { } ; } \cs_new:Npn \__zhnum_read_sign_loop:N #1 { @@ -174,7 +174,7 @@ \cs_new:Npn \__zhnum_read_abs_loop:Nw #1#2 \q_recursion_stop { \zhnum_if_digit:NTF #1 - { \__zhnum_output:nnwnn { + \c_one } #1 } + { \__zhnum_output:nnwnn { + 1 } #1 } { \quark_if_recursion_tail_stop_do:Nn #1 { \__zhnum_loop_end:wnn } } \exp_after:wN \__zhnum_read_abs_loop:Nw \exp:w \exp_end_continue_f:w \use:n #2 \q_recursion_stop @@ -185,17 +185,17 @@ { \int_eval:n {#2} ; #3 } \cs_new:Npn \__zhnum_read_integer:www #1 ; #2 ; #3 ; { - \int_compare:nNnTF {#2} = \c_zero + \int_compare:nNnTF {#2} = \c_zero_int { \c__zhnum_zero_tl } { - \int_compare:nNnF {#1} = \c_one + \int_compare:nNnF {#1} = \c_one_int { \c__zhnum_minus_tl } \zhnum_parse_number:nn {#2} {#3} } } \cs_new:Npn \zhnum_if_digit:NTF #1 { - \if_int_compare:w \c_nine < 1 \exp_not:N #1 \exp_stop_f: + \if_int_compare:w 9 < 1 \exp_not:N #1 \exp_stop_f: \exp_after:wN \use_i:nn \else: \exp_after:wN \use_ii:nn @@ -204,14 +204,14 @@ \cs_new:Npn \zhnum_parse_number:n #1 { \exp_args:Nf \zhnum_parse_number:nn { \tl_count:n {#1} } {#1} } \cs_new:Npn \zhnum_parse_number:nn #1 - { \exp_args:Nf \__zhnum_parse_number:nnn { \int_mod:nn {#1} \c_four } {#1} } + { \exp_args:Nf \__zhnum_parse_number:nnn { \int_mod:nn {#1} { 4 } } {#1} } \cs_new:Npn \__zhnum_parse_number:nnn #1#2 { - \int_compare:nNnTF {#2} < \c_two + \int_compare:nNnTF {#2} < 2 { \zhnum_digit_map:n } { - \int_compare:nNnTF {#1} = \c_zero - { \zhnum_split_number:fn { \int_eval:n { #2 / \c_four - \c_one } } } + \int_compare:nNnTF {#1} = \c_zero_int + { \zhnum_split_number:fn { \int_eval:n { #2 / 4 - 1 } } } { \__zhnum_split_number_aux:nnn {#1} {#2} } } } @@ -219,7 +219,7 @@ \cs_new:Npn \__zhnum_split_number_aux:nnn #1#2 { \exp_after:wN \__zhnum_split_number_aux:wwn - \tex_number:D \int_div_truncate:nn {#2} \c_four + \int_value:w \int_div_truncate:nn {#2} { 4 } \if_case:w #1 \exp_stop_f: \or: \exp_after:wN \use:n \or: \exp_after:wN \use_i_ii:nnn @@ -238,53 +238,53 @@ \cs_new:Npn \zhnum_split_number:NNnNNNNw #1#2#3#4#5#6#7 { \quark_if_recursion_tail_stop:N #4 - \int_compare:nNnTF { #4#5#6#7 } = \c_zero + \int_compare:nNnTF { #4#5#6#7 } = \c_zero_int { \use_i:nn } { \bool_if:NF #1 { \c__zhnum_zero_tl } \zhnum_process_number:NNNNNN #4#5#6#7#1#2 \zhnum_scale_map:n {#3} - \int_compare:nNnTF {#7} = \c_zero + \int_compare:nNnTF {#7} = \c_zero_int } { \zhnum_split_number:NNfNNNNw \c_false_bool \c_true_bool } { \zhnum_split_number:NNfNNNNw \c_true_bool \c_false_bool } - { \int_eval:n { #3 - \c_one } } + { \int_eval:n { #3 - 1 } } } \cs_generate_variant:Nn \zhnum_split_number:NNnNNNNw { NNf } \cs_new:Npn \zhnum_process_number:NNNNNN #1#2#3#4#5#6 { - \int_compare:nNnTF {#1} = \c_zero + \int_compare:nNnTF {#1} = \c_zero_int { \bool_if:NF #6 { \c__zhnum_zero_tl } } { \zhnum_digit_map:n {#1} \c__zhnum_thousand_tl } - \int_compare:nNnTF {#2} = \c_zero - { \int_compare:nNnF { #1 * (#3#4) } = \c_zero { \c__zhnum_zero_tl } } + \int_compare:nNnTF {#2} = \c_zero_int + { \int_compare:nNnF { #1 * (#3#4) } = \c_zero_int { \c__zhnum_zero_tl } } { \bool_lazy_and:nnTF { \l__zhnum_ancient_bool } - { \int_compare_p:nNn {#2} = \c_two } + { \int_compare_p:nNn {#2} = 2 } { \zhnum_digit_map:n { #2 00 } } { \zhnum_digit_map:n {#2} \c__zhnum_hundred_tl } } - \int_compare:nNnTF {#3} = \c_zero - { \int_compare:nNnF { #2 * #4 } = \c_zero { \c__zhnum_zero_tl } } + \int_compare:nNnTF {#3} = \c_zero_int + { \int_compare:nNnF { #2 * #4 } = \c_zero_int { \c__zhnum_zero_tl } } { \bool_lazy_all:nF { - { \int_compare_p:nNn {#3} = \c_one } - { \int_compare_p:nNn {#1#2} = \c_zero } + { \int_compare_p:nNn {#3} = \c_one_int } + { \int_compare_p:nNn {#1#2} = \c_zero_int } {#6} {#5} } { \bool_lazy_and:nnTF { \l__zhnum_ancient_bool } - { \int_compare_p:n { \c_one < #3 < \c_five } } + { \int_compare_p:n { 1 < #3 < 5 } } { \zhnum_digit_map:n { #3 0 } \use_none:n } { \zhnum_digit_map:n {#3} } } \c__zhnum_ten_tl } - \int_compare:nNnF {#4} = \c_zero { \zhnum_digit_map:n {#4} } + \int_compare:nNnF {#4} = \c_zero_int { \zhnum_digit_map:n {#4} } } \DeclareExpandableDocumentCommand \zhdig { +o +m } { @@ -329,7 +329,7 @@ \cs_new:Npn \zhnum_digits:Nn #1#2 { \exp_after:wN \__zhnum_read_digits:w - \tex_number:D + \int_value:w \exp_after:wN \__zhnum_read_sign_loop:NN \exp_after:wN #1 \exp:w \exp_end_continue_f:w \use:n #2 \exp_stop_f: \q_recursion_tail \q_recursion_stop @@ -359,14 +359,14 @@ } \cs_new:Npn \__zhnum_read_digits:w #1 ; { - \int_compare:nNnF {#1} = \c_one + \int_compare:nNnF {#1} = \c_one_int { \c__zhnum_minus_tl } } \cs_new:Npn \__zhnum_output_digits:NN #1#2 { \cs:w c__zhnum_ - \if_int_compare:w #2 = \c_zero + \if_int_compare:w #2 = \c_zero_int \IfBooleanTF #1 { zero } { null } \else: #2 @@ -423,13 +423,13 @@ } \cs_new:Npn \__zhnum_Zeller_aux:Nnnn #1#2#3#4 { - \int_compare:nNnTF {#3} < \c_three - { #1 { #2 - \c_one } { #3 + \c_twelve } {#4} } + \int_compare:nNnTF {#3} < 3 + { #1 { #2 - 1 } { #3 + 12 } {#4} } { #1 {#2} {#3} {#4} } } \cs_new:Npn \zhnum_two_digits:n #1 { - \int_compare:nNnT {#1} < \c_ten { 0 } + \int_compare:nNnT {#1} < { 10 } { 0 } \int_eval:n {#1} } \cs_new:Npn \zhnum_Zeller_Gregorian:nnn #1#2#3 @@ -437,25 +437,25 @@ \int_mod:nn { (#3) - + \int_div_truncate:nn { 26 * ( #2 + \c_one ) } \c_ten + + \int_div_truncate:nn { 26 * ( #2 + 1 ) } { 10 } + (#1) - + \int_div_truncate:nn {#1} \c_four - + \c_six * \int_div_truncate:nn {#1} \c_one_hundred + + \int_div_truncate:nn {#1} { 4 } + + 6 * \int_div_truncate:nn {#1} { 100 } + \int_div_truncate:nn {#1} { 400 } } - { \c_seven } + { 7 } } \cs_new:Npn \zhnum_Zeller_Julian:nnn #1#2#3 { \int_mod:nn { (#3) - + \int_div_truncate:nn { 26 * ( #2 + \c_one ) } \c_ten + + \int_div_truncate:nn { 26 * ( #2 + 1 ) } { 10 } + (#1) - + \int_div_truncate:nn {#1} \c_four - + \c_five + + \int_div_truncate:nn {#1} { 4 } + + 5 } - { \c_seven } + { 7 } } \cs_new:Npn \zhtime #1 { \__zhnum_time:ww #1 \q_stop } @@ -492,7 +492,7 @@ { \zhnum_scale_map:n { \int_mod:nn {#1} \l__zhnum_scale_int } } \cs_generate_variant:Nn \zhnum_scale_map:n { f } \int_new:N \l__zhnum_scale_int -\int_set_eq:NN \l__zhnum_scale_int \c_eleven +\int_set:Nn \l__zhnum_scale_int { 11 } \cs_new_eq:NN \zhnum_scale_map_hook:n \zhnum_scale_map_loop:n \tl_const:cn { c__zhnum_s0_tl } { } \NewDocumentCommand \zhnumExtendScaleMap { > { \TrimSpaces } +o +m } @@ -506,19 +506,19 @@ { \int_incr:N \l_tmpa_int \tl_set:Nx \l_tmpa_tl - { c__zhnum_s \int_eval:n { \l_tmpa_int + \c_eleven } _tl } + { c__zhnum_s \int_eval:n { \l_tmpa_int + 11 } _tl } \tl_if_exist:cF { \l_tmpa_tl } { \int_incr:N \l__zhnum_scale_int } \tl_set:cn { \l_tmpa_tl } {#1} } \cs_new:Npn \zhnum_ganzhi_normal:nnn #1#2#3 { - \int_compare:nNnF {#1} < \c_one + \int_compare:nNnF {#1} < \c_one_int { \cs_if_exist_use:c { c__zhnum_ #2 _ #1 _tl } } } \cs_new:Npn \zhnum_ganzhi_cyclic:nnn #1#2#3 { - \int_compare:nNnF {#1} = \c_zero + \int_compare:nNnF {#1} = \c_zero_int { \cs_if_exist_use:cF { c__zhnum_ #2 _ #1 _tl } { @@ -529,10 +529,10 @@ } \cs_new:Npn \__zhnum_ganzhi_cyclic_mod:nnnn #1#2#3#4 { - \int_compare:nNnTF {#2} > \c_zero + \int_compare:nNnTF {#2} > \c_zero_int { \use:c { c__zhnum_ #3 _ #1 _tl } } { - \int_compare:nNnTF {#1} = \c_zero + \int_compare:nNnTF {#1} = \c_zero_int { \use:c { c__zhnum_ #3 _ 1 _tl } } { \use:c { c__zhnum_ #3 _ \int_eval:n { #1 + #4 + 1 } _tl } } } @@ -550,10 +550,10 @@ { \zhnum_ganzhi_nian:f { \int_eval:n {#1} } } \cs_new:Npn \zhnum_ganzhi_nian:n #1 { - \int_compare:nNnTF {#1} > \c_zero + \int_compare:nNnTF {#1} > \c_zero_int { \use:c { c__zhnum_ganzhi_ \int_mod:nn { #1 + 57 } { 60 } _tl } } { - \int_compare:nNnF {#1} = \c_zero + \int_compare:nNnF {#1} = \c_zero_int { \use:c { @@ -581,7 +581,7 @@ D12 .tl_set:N = \exp_not:c { l__zhnum_dizhi_ 12 _tl } , E44 .tl_set:N = \exp_not:c { l__zhnum_ s11 _tl } , } - \int_step_inline:nnnn { 1 } { 1 } { 10 } + \int_step_inline:nn { 10 } { \tl_put_right:Nx \l_tmpa_tl { @@ -594,7 +594,7 @@ .tl_set:N = \exp_not:c { l__zhnum_ s#1 _tl } , } } - \int_step_inline:nnnn { 11 } { 1 } { 60 } + \int_step_inline:nnn { 11 } { 60 } { \tl_put_right:Nx \l_tmpa_tl { GZ#1 .tl_set:N = \exp_not:c { l__zhnum_ganzhi_ #1 _tl } , } @@ -733,8 +733,8 @@ \cs_new:Npn \zhnum_zero_mod:nn #1#2 { \exp_args:Nf \__zhnum_zero_mod_aux:nn { \int_mod:nn {#1} {#2} } {#2} } \cs_new:Npn \__zhnum_zero_mod_aux:nn #1#2 - { \int_compare:nNnTF {#1} = \c_zero {#2} {#1} } -\int_step_inline:nnnn { 1 } { 1 } { 60 } + { \int_compare:nNnTF {#1} = \c_zero_int {#2} {#1} } +\int_step_inline:nn { 60 } { \tl_const:cx { c__zhnum_ganzhi_ #1 _tl } { \exp_not:c { l__zhnum_ganzhi_ #1 _tl } } \tl_set:cx { l__zhnum_ganzhi_ #1 _tl } @@ -856,8 +856,8 @@ \int_set:Nn \l__zhnum_byte_min_int { "E0 } \int_set:Nn \l__zhnum_byte_max_int { "EF } } - \int_step_function:nnnN - { \l__zhnum_byte_min_int } { \c_one } + \int_step_function:nnN + { \l__zhnum_byte_min_int } { \l__zhnum_byte_max_int } \char_set_catcode_active:n } \int_new:N \l__zhnum_byte_min_int -- cgit v1.2.3