diff options
author | Karl Berry <karl@freefriends.org> | 2016-05-14 22:03:58 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-05-14 22:03:58 +0000 |
commit | 762dec7ad6e5083c542b5697ce206634feb3dd06 (patch) | |
tree | 98017462b3bac903e8133b04f697bba62187a487 /Master/texmf-dist/tex/latex/zhnumber | |
parent | 8a897397d1ef31d60c60a663186a8a5c0be00aa2 (diff) |
zhnumber (14may16)
git-svn-id: svn://tug.org/texlive/trunk@41123 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/zhnumber')
4 files changed, 161 insertions, 106 deletions
diff --git a/Master/texmf-dist/tex/latex/zhnumber/zhnumber-big5.cfg b/Master/texmf-dist/tex/latex/zhnumber/zhnumber-big5.cfg index f62be008da2..e215fbf1aa0 100644 --- a/Master/texmf-dist/tex/latex/zhnumber/zhnumber-big5.cfg +++ b/Master/texmf-dist/tex/latex/zhnumber/zhnumber-big5.cfg @@ -6,24 +6,29 @@ %% %% zhnumber.dtx (with options: `config,big5') %% -%% Copyright (C) 2012, 2014-2016 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 -%% of this license or (at your option) any later version. -%% The latest version of this license is in -%% http://www.latex-project.org/lppl.txt -%% and version 1.3 or later is part of all distributions of LaTeX -%% version 2005/12/01 or later. %% -%% This work has the LPPL maintenance status "maintained". -%% The Current Maintainer of this work is Qing Lee. +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. %% -\GetIdInfo$Id: zhnumber.dtx 9686fd1 2016-02-02 16:55:41 +0800 Qing Lee <sobenlee@gmail.com> $ +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Qing Lee. +%% +%% -------------------------------------------------------------------------- +%% +\GetIdInfo$Id: zhnumber.dtx e19bfb4 2016-05-14 12:23:34 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese numerals with Big5 encoding} -\ProvidesExplFile - {\ExplFileName-big5.cfg} - {\ExplFileDate}{2.3}{\ExplFileDescription} +\ProvidesExplFile{\ExplFileName-big5.cfg} + {\ExplFileDate}{2.4}{\ExplFileDescription} \zhnum_set_digits_map:nn { minus } { t } \zhnum_set_digits_map:nn { 0 } { ¹s } \zhnum_set_digits_map:nn { null } { ¡³ } @@ -100,13 +105,13 @@ \zhnum_set_dizhi_map:nn { 11 } { ¦¦ } \zhnum_set_dizhi_map:nn { 12 } { ¥è } %% -%% This package consists of the file zhnumber.dtx, -%% and the derived files zhnumber.pdf, -%% zhnumber.sty, -%% zhnumber-utf8.cfg, -%% zhnumber-gbk.cfg, -%% zhnumber-big5.cfg, -%% zhnumber.ins and -%% README. +%% This package consists of the file zhnumber.dtx, +%% and the derived files zhnumber.pdf, +%% zhnumber.sty, +%% zhnumber-utf8.cfg, +%% zhnumber-gbk.cfg, +%% zhnumber-big5.cfg, +%% zhnumber.ins and +%% README.md. %% %% End of file `zhnumber-big5.cfg'. diff --git a/Master/texmf-dist/tex/latex/zhnumber/zhnumber-gbk.cfg b/Master/texmf-dist/tex/latex/zhnumber/zhnumber-gbk.cfg index 57e1af8dbf9..c0b35fdd2d6 100644 --- a/Master/texmf-dist/tex/latex/zhnumber/zhnumber-gbk.cfg +++ b/Master/texmf-dist/tex/latex/zhnumber/zhnumber-gbk.cfg @@ -6,24 +6,29 @@ %% %% zhnumber.dtx (with options: `config,gbk') %% -%% Copyright (C) 2012, 2014-2016 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 -%% of this license or (at your option) any later version. -%% The latest version of this license is in -%% http://www.latex-project.org/lppl.txt -%% and version 1.3 or later is part of all distributions of LaTeX -%% version 2005/12/01 or later. %% -%% This work has the LPPL maintenance status "maintained". -%% The Current Maintainer of this work is Qing Lee. +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. %% -\GetIdInfo$Id: zhnumber.dtx 9686fd1 2016-02-02 16:55:41 +0800 Qing Lee <sobenlee@gmail.com> $ +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Qing Lee. +%% +%% -------------------------------------------------------------------------- +%% +\GetIdInfo$Id: zhnumber.dtx e19bfb4 2016-05-14 12:23:34 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese numerals with GBK encoding} -\ProvidesExplFile - {\ExplFileName-gbk.cfg} - {\ExplFileDate}{2.3}{\ExplFileDescription} +\ProvidesExplFile{\ExplFileName-gbk.cfg} + {\ExplFileDate}{2.4}{\ExplFileDescription} \zhnum_set_digits_map:nnn { minus } { simp } { ¸º } \zhnum_set_digits_map:nnn { minus } { trad } { Ø“ } \zhnum_set_digits_map:nn { 0 } { Áã } @@ -110,13 +115,13 @@ \zhnum_set_dizhi_map:nn { 11 } { Ðç } \zhnum_set_dizhi_map:nn { 12 } { º¥ } %% -%% This package consists of the file zhnumber.dtx, -%% and the derived files zhnumber.pdf, -%% zhnumber.sty, -%% zhnumber-utf8.cfg, -%% zhnumber-gbk.cfg, -%% zhnumber-big5.cfg, -%% zhnumber.ins and -%% README. +%% This package consists of the file zhnumber.dtx, +%% and the derived files zhnumber.pdf, +%% zhnumber.sty, +%% zhnumber-utf8.cfg, +%% zhnumber-gbk.cfg, +%% zhnumber-big5.cfg, +%% zhnumber.ins and +%% README.md. %% %% End of file `zhnumber-gbk.cfg'. diff --git a/Master/texmf-dist/tex/latex/zhnumber/zhnumber-utf8.cfg b/Master/texmf-dist/tex/latex/zhnumber/zhnumber-utf8.cfg index d8f110df755..59c223f1323 100644 --- a/Master/texmf-dist/tex/latex/zhnumber/zhnumber-utf8.cfg +++ b/Master/texmf-dist/tex/latex/zhnumber/zhnumber-utf8.cfg @@ -6,24 +6,29 @@ %% %% zhnumber.dtx (with options: `config,utf8') %% -%% Copyright (C) 2012, 2014-2016 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 -%% of this license or (at your option) any later version. -%% The latest version of this license is in -%% http://www.latex-project.org/lppl.txt -%% and version 1.3 or later is part of all distributions of LaTeX -%% version 2005/12/01 or later. %% -%% This work has the LPPL maintenance status "maintained". -%% The Current Maintainer of this work is Qing Lee. +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. %% -\GetIdInfo$Id: zhnumber.dtx 9686fd1 2016-02-02 16:55:41 +0800 Qing Lee <sobenlee@gmail.com> $ +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Qing Lee. +%% +%% -------------------------------------------------------------------------- +%% +\GetIdInfo$Id: zhnumber.dtx e19bfb4 2016-05-14 12:23:34 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese numerals with UTF8 encoding} -\ProvidesExplFile - {\ExplFileName-utf8.cfg} - {\ExplFileDate}{2.3}{\ExplFileDescription} +\ProvidesExplFile{\ExplFileName-utf8.cfg} + {\ExplFileDate}{2.4}{\ExplFileDescription} \zhnum_set_digits_map:nnn { minus } { simp } { è´Ÿ } \zhnum_set_digits_map:nnn { minus } { trad } { è² } \zhnum_set_digits_map:nn { 0 } { 零 } @@ -110,13 +115,13 @@ \zhnum_set_dizhi_map:nn { 11 } { 戌 } \zhnum_set_dizhi_map:nn { 12 } { 亥 } %% -%% This package consists of the file zhnumber.dtx, -%% and the derived files zhnumber.pdf, -%% zhnumber.sty, -%% zhnumber-utf8.cfg, -%% zhnumber-gbk.cfg, -%% zhnumber-big5.cfg, -%% zhnumber.ins and -%% README. +%% This package consists of the file zhnumber.dtx, +%% and the derived files zhnumber.pdf, +%% zhnumber.sty, +%% zhnumber-utf8.cfg, +%% zhnumber-gbk.cfg, +%% zhnumber-big5.cfg, +%% zhnumber.ins and +%% README.md. %% %% End of file `zhnumber-utf8.cfg'. diff --git a/Master/texmf-dist/tex/latex/zhnumber/zhnumber.sty b/Master/texmf-dist/tex/latex/zhnumber/zhnumber.sty index 3945d1cfc98..9a7b55f861c 100644 --- a/Master/texmf-dist/tex/latex/zhnumber/zhnumber.sty +++ b/Master/texmf-dist/tex/latex/zhnumber/zhnumber.sty @@ -6,26 +6,31 @@ %% %% zhnumber.dtx (with options: `package') %% -%% Copyright (C) 2012, 2014-2016 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 -%% of this license or (at your option) any later version. -%% The latest version of this license is in -%% http://www.latex-project.org/lppl.txt -%% and version 1.3 or later is part of all distributions of LaTeX -%% version 2005/12/01 or later. %% -%% This work has the LPPL maintenance status "maintained". -%% The Current Maintainer of this work is Qing Lee. +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Qing Lee. +%% +%% -------------------------------------------------------------------------- %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: zhnumber.dtx 9686fd1 2016-02-02 16:55:41 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: zhnumber.dtx e19bfb4 2016-05-14 12:23:34 +0800 Qing Lee <sobenlee@gmail.com> $ {Typesetting numbers with Chinese glyphs} -\ProvidesExplPackage - {\ExplFileName} - {\ExplFileDate}{2.3}{\ExplFileDescription} +\ProvidesExplPackage{\ExplFileName} + {\ExplFileDate}{2.4}{\ExplFileDescription} \msg_new:nnn { zhnumber } { l3-too-old } { Support~package~'expl3'~too~old. \\\\ @@ -135,6 +140,7 @@ } } \cs_generate_variant:Nn \zhnum_int:n { c } +\cs_new_nopar:Npn \@zhnum { \zhnum_int:n } \cs_new:Npn \zhnum_integer:n #1 { \exp_after:wN \__zhnum_read_integer:www @@ -282,6 +288,27 @@ } \int_compare:nNnF {#4} = \c_zero { \zhnum_digit_map:n {#4} } } +\DeclareExpandableDocumentCommand \zhdig { +o +m } + { + \IfNoValueTF {#1} + { \zhnum_digits_counter:n } + { \zhdigwithoptions {#1} } + {#2} + } +\NewDocumentCommand \zhdigwithoptions { +m +m } + { + \group_begin: + \keys_set:nn { zhnum / options } {#1} + \zhnum_digits_counter:n #1 {#2} + \group_end: + } +\cs_new:Npn \zhnum_digits_counter:n #1 + { + \int_if_exist:cTF { c@#1 } + { \zhnum_digits_null:v { c@#1 } } + { \__zhnum_counter_error:n {#1} } + } +\cs_new_nopar:Npn \@zhdig #1 { \zhnum_digits_null:f { \int_eval:n {#1} } } \DeclareExpandableDocumentCommand \zhdigits { +s +o +m } { \IfNoValueTF {#2} @@ -300,7 +327,7 @@ { \zhnum_digits:Nn \BooleanTrue } \cs_new_nopar:Npn \zhnum_digits_null:n { \zhnum_digits:Nn \BooleanFalse } -\cs_generate_variant:Nn \zhnum_digits_null:n { V } +\cs_generate_variant:Nn \zhnum_digits_null:n { V , v , f } \cs_new:Npn \zhnum_digits:Nn #1#2 { \exp_after:wN \__zhnum_read_digits:w @@ -356,19 +383,24 @@ { \__zhnum_week_day:www #2 \q_stop } } \cs_new:Npn \__zhnum_date:www #1/#2/#3 \q_stop + { \__zhnum_date_aux:nnn {#1} {#2} {#3} } +\cs_new_nopar:Npn \zhtoday + { \__zhnum_date_aux:Vnn \tex_year:D \tex_month:D \tex_day:D } +\cs_new_nopar:Npn \__zhnum_date_aux:nnn { - \zhnum_check_time:Nn \zhnum_digits_null:n {#1} \c__zhnum_year_tl - \zhnum_check_time:Nn \zhnum_int:n {#2} \c__zhnum_month_tl - \zhnum_check_time:Nn \zhnum_int:n {#3} \c__zhnum_day_tl + \bool_if:NTF \l__zhnum_time_bool + { \__zhnum_date_aux:NNnnnn \zhnum_digits_null:n \zhnum_int:n { } } + { \__zhnum_date_aux:Nnnnn \int_to_arabic:n { \l__zhnum_arabic_sep_tl } } } -\cs_new_nopar:Npn \zhtoday +\cs_new:Npn \__zhnum_date_aux:Nnnnn #1 + { \__zhnum_date_aux:NNnnnn #1#1 } +\cs_new:Npn \__zhnum_date_aux:NNnnnn #1#2#3#4#5#6 { - \zhnum_check_time:Nn \zhnum_digits_null:V \tex_year:D \c__zhnum_year_tl - \zhnum_check_time:Nn \zhnum_int:n \tex_month:D \c__zhnum_month_tl - \zhnum_check_time:Nn \zhnum_int:n \tex_day:D \c__zhnum_day_tl + #1 {#4} #3 \c__zhnum_year_tl #3 + #2 {#5} #3 \c__zhnum_month_tl #3 + #2 {#6} #3 \c__zhnum_day_tl } -\cs_new:Npn \zhnum_check_time:Nn #1 - { \bool_if:NTF \l__zhnum_time_bool {#1} { \int_to_arabic:n } } +\cs_generate_variant:Nn \__zhnum_date_aux:nnn { V } \cs_new:Npn \zhweekday #1 { \__zhnum_week_day:www #1 \q_stop } \cs_new:Npn \__zhnum_week_day:www #1/#2/#3 \q_stop @@ -433,16 +465,23 @@ { \cs_new:Npn \exp_not:N \__zhnum_time:ww ##1 \c_colon_str ##2 \exp_not:N \q_stop } + { \__zhnum_time_aux:nn {#1} {#2} } +\cs_new_nopar:Npn \zhcurrtime { - \zhnum_check_time:Nn \zhnum_int:n {#1} \c__zhnum_hour_tl - \zhnum_check_time:Nn \zhnum_int:n {#2} \c__zhnum_minute_tl + \__zhnum_time_aux:nn + { \int_div_truncate:nn \tex_time:D { 60 } } + { \int_mod:nn \tex_time:D { 60 } } } -\cs_new_nopar:Npn \zhcurrtime +\cs_new_nopar:Npn \__zhnum_time_aux:nn + { + \bool_if:NTF \l__zhnum_time_bool + { \__zhnum_time_aux:Nnnn \zhnum_int:n { } } + { \__zhnum_time_aux:Nnnn \int_to_arabic:n { \l__zhnum_arabic_sep_tl } } + } +\cs_new:Npn \__zhnum_time_aux:Nnnn #1#2#3#4 { - \zhnum_check_time:Nn \zhnum_int:n - { \int_div_truncate:nn \tex_time:D { 60 } } \c__zhnum_hour_tl - \zhnum_check_time:Nn \zhnum_int:n - { \int_mod:nn \tex_time:D { 60 } } \c__zhnum_minute_tl + #1 {#3} #2 \c__zhnum_hour_tl #2 + #1 {#4} #2 \c__zhnum_minute_tl } \cs_new:Npn \zhnum_digit_map:n #1 { \use:c { c__zhnum_ #1 _tl } } @@ -886,6 +925,7 @@ ganzhi-cyclic / false.code:n = { \cs_set_eq:NN \zhnum_ganzhi:nnn \zhnum_ganzhi_normal:nnn } , ganzhi-cyclic .default:n = { true } , + arabicsep .tl_set:N = \l__zhnum_arabic_sep_tl } \str_new:N \l__zhnum_encoding_str \msg_new:nnnn { zhnumber } { encoding-invalid } @@ -896,7 +936,7 @@ \keys_set:nn { zhnum / options } {#1} \tex_ignorespaces:D } -\keys_set:nn { zhnum / options } { style , time } +\keys_set:nn { zhnum / options } { style , time , arabicsep = { ~ } } \ProcessKeysOptions { zhnum / options } \str_if_empty:NT \l__zhnum_encoding_str { @@ -905,13 +945,13 @@ { \keys_set:nn { zhnum / options } { encoding = GBK } } } %% -%% This package consists of the file zhnumber.dtx, -%% and the derived files zhnumber.pdf, -%% zhnumber.sty, -%% zhnumber-utf8.cfg, -%% zhnumber-gbk.cfg, -%% zhnumber-big5.cfg, -%% zhnumber.ins and -%% README. +%% This package consists of the file zhnumber.dtx, +%% and the derived files zhnumber.pdf, +%% zhnumber.sty, +%% zhnumber-utf8.cfg, +%% zhnumber-gbk.cfg, +%% zhnumber-big5.cfg, +%% zhnumber.ins and +%% README.md. %% %% End of file `zhnumber.sty'. |