summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/zhnumber/zhnumber.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-02-03 23:02:34 +0000
committerKarl Berry <karl@freefriends.org>2016-02-03 23:02:34 +0000
commitd7e7feec5992a359e08cb62c8bb2a53b59b7112f (patch)
tree382490c4e07b4ab12dfa6c15c3ace2012b847ad9 /Master/texmf-dist/source/latex/zhnumber/zhnumber.dtx
parentf4a543aed2bbfaec5c3f8dbfee5985322cd1b938 (diff)
zhnumber (2feb16)
git-svn-id: svn://tug.org/texlive/trunk@39567 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/zhnumber/zhnumber.dtx')
-rw-r--r--Master/texmf-dist/source/latex/zhnumber/zhnumber.dtx102
1 files changed, 49 insertions, 53 deletions
diff --git a/Master/texmf-dist/source/latex/zhnumber/zhnumber.dtx b/Master/texmf-dist/source/latex/zhnumber/zhnumber.dtx
index 218c0fee1e7..3fa1919271a 100644
--- a/Master/texmf-dist/source/latex/zhnumber/zhnumber.dtx
+++ b/Master/texmf-dist/source/latex/zhnumber/zhnumber.dtx
@@ -130,7 +130,7 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
\askforoverwritefalse
\preamble
- 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
@@ -200,7 +200,7 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
%<config&utf8> {\ExplFileName-utf8.cfg}
%<config&big5> {\ExplFileName-big5.cfg}
%<config&gbk> {\ExplFileName-gbk.cfg}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
%</driver|package|config>
%<*driver>
\ExplSyntaxOff
@@ -309,7 +309,7 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
%</driver>
% \fi
%
-% \CheckSum{1194}
+% \CheckSum{1193}
% \GetFileInfo{\jobname.sty}
%
% \title{\bfseries\pkg{zhnumber} 宏包}
@@ -627,7 +627,7 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
'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 } }
% \end{macrocode}
%
@@ -770,7 +770,9 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
{ \@@_counter_error:n {#1} }
}
\cs_new:Npn \@@_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
@@ -798,7 +800,7 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
\exp_after:wN \@@_read_integer:www
\tex_number:D
\exp_after:wN \@@_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
\@@_result:nn { \c_zero } { } ;
}
@@ -806,10 +808,10 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
{
\if:w + \if:w - \exp_not:N #1 + \fi: \exp_not:N #1
\exp_after:wN \@@_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 \@@_read_zeros_loop:N
\exp_after:wN #1
\fi:
@@ -818,7 +820,7 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
{
\if:w 0 \exp_not:N #1
\exp_after:wN \@@_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 \@@_read_abs_loop:Nw
\exp_after:wN #1
@@ -840,7 +842,7 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
{ \@@_output:nnwnn { + \c_one } #1 }
{ \quark_if_recursion_tail_stop_do:Nn #1 { \@@_loop_end:wnn } }
\exp_after:wN \@@_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 \@@_output:nnwnn #1#2#3 \@@_result:nn #4#5
{ #3 \@@_result:nn { #4#1 } { #5#2 } }
@@ -1037,14 +1039,14 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
\exp_after:wN \@@_read_digits:w
\tex_number:D
\exp_after:wN \@@_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 \@@_read_sign_loop:NN #1#2
{
\if:w + \if:w - \exp_not:N #2 + \fi: \exp_not:N #2
\exp_after:wN \@@_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 \@@_read_digits_loop:NN
@@ -1061,7 +1063,7 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
\if:w .\exp_not:N #2 \exp_after:wN \c_@@_dot_tl \fi:
}
\exp_after:wN \@@_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 \@@_read_digits:w #1 ;
{
@@ -1225,16 +1227,13 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
% \begin{macrocode}
\cs_new:Npn \zhtime #1
{ \@@_time:ww #1 \q_stop }
-\group_begin:
-\char_set_lccode:nn { `\; } { `\: }
-\tl_to_lowercase:n
+\use:x
{
- \group_end:
- \cs_new:Npn \@@_time:ww #1 ; #2 \q_stop
- {
- \zhnum_check_time:Nn \zhnum_int:n {#1} \c_@@_hour_tl
- \zhnum_check_time:Nn \zhnum_int:n {#2} \c_@@_minute_tl
- }
+ \cs_new:Npn \exp_not:N \@@_time:ww ##1 \c_colon_str ##2 \exp_not:N \q_stop
+ }
+ {
+ \zhnum_check_time:Nn \zhnum_int:n {#1} \c_@@_hour_tl
+ \zhnum_check_time:Nn \zhnum_int:n {#2} \c_@@_minute_tl
}
% \end{macrocode}
% \end{macro}
@@ -1657,16 +1656,16 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
% \begin{macrocode}
\cs_new_protected:Npn \zhnum_load_cfg:n #1
{
- \zhnum_set_cfg_name:Nn \l_@@_cfg_tl {#1}
- \tl_if_eq:NNF \l_@@_cfg_tl \l_@@_last_cfg_tl
+ \zhnum_set_cfg_name:Nn \l_@@_cfg_str {#1}
+ \str_if_eq:NNF \l_@@_cfg_str \l_@@_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_@@_cfg_ \l_@@_cfg_tl _prop }
- { \tl_set_eq:NN \l_@@_last_cfg_tl \l_@@_cfg_tl }
+ \prop_if_exist:cTF { g_@@_cfg_ \l_@@_cfg_str _prop }
+ { \str_set_eq:NN \l_@@_last_cfg_str \l_@@_cfg_str }
{ \zhnum_input_cfg:n {#1} }
\@@_update_cfg_prop:N \prop_set_eq:Nc
}
@@ -1688,10 +1687,10 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
}
\cs_new_protected:Npn \@@_update_cfg_prop:N #1
{
- #1 \l_@@_cfg_map_prop { g_@@_cfg_ \l_@@_cfg_tl _prop }
- #1 \l_@@_cfg_map_var_prop { g_@@_cfg_var_ \l_@@_cfg_tl _prop }
- #1 \l_@@_cfg_map_finan_prop { g_@@_cfg_finan_ \l_@@_cfg_tl _prop }
- #1 \l_@@_cfg_map_ganzhi_prop { g_@@_cfg_ganzhi_ \l_@@_cfg_tl _prop }
+ #1 \l_@@_cfg_map_prop { g_@@_cfg_ \l_@@_cfg_str _prop }
+ #1 \l_@@_cfg_map_var_prop { g_@@_cfg_var_ \l_@@_cfg_str _prop }
+ #1 \l_@@_cfg_map_finan_prop { g_@@_cfg_finan_ \l_@@_cfg_str _prop }
+ #1 \l_@@_cfg_map_ganzhi_prop { g_@@_cfg_ganzhi_ \l_@@_cfg_str _prop }
}
\cs_new_protected:Npn \@@_prop_initial:Nn #1#2
{
@@ -1700,8 +1699,8 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
}
\cs_new_protected:Npn \@@_prop_gset_eq:Nn #1#2
{ \prop_gset_eq:cN {#2} #1 }
-\tl_new:N \l_@@_cfg_tl
-\tl_new:N \l_@@_last_cfg_tl
+\str_new:N \l_@@_cfg_str
+\str_new:N \l_@@_last_cfg_str
\bool_new:N \l_@@_reset_bool
\msg_new:nnnn { zhnumber } { file-not-found }
{ File~`#1'~not~found. }
@@ -1714,16 +1713,14 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
%
% \begin{macro}[internal,pTF]{\zhnum_if_unicode_engine:}
% 使用 \upTeX{} 的时候,也不必将汉字的首字符设置为活动字符。判断 |^^^^0021| 是否为
-% 单个记号的办法对 \upTeX{} 不适用。因此,参考 \pkg{ifuptex} 宏包,通过 \tn{kchar}
-% 是否为 primitive 来判断。
+% 单个记号的办法对 \upTeX{} 不适用。
% \begin{macrocode}
-\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
@@ -1747,8 +1744,8 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
\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_@@_encoding_tl {#2}
- \tl_set:Nx #1 { \tl_to_str:N \l_@@_encoding_tl }
+ \str_set:Nx \l_@@_encoding_str {#2}
+ \str_set_eq:NN #1 \l_@@_encoding_str
}
\cs_new_eq:NN \zhnum_reset_config: \zhnum_parse_config:
\else:
@@ -1756,7 +1753,7 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
{ \bool_if:NT \l_@@_active_char_bool { \zhnum_set_active: } }
\cs_new_protected_nopar:Npn \zhnum_set_active:
{
- \str_case:onTF { \l_@@_encoding_tl }
+ \str_case:onTF { \l_@@_encoding_str }
{
{ gbk } { \int_set:Nn \l_@@_byte_min_int { "81 } }
{ big5 } { \int_set:Nn \l_@@_byte_min_int { "A1 } }
@@ -1774,16 +1771,15 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
\int_new:N \l_@@_byte_max_int
\cs_new_protected:Npn \zhnum_set_cfg_name:Nn #1#2
{
- \tl_set:Nx \l_@@_encoding_tl {#2}
- \tl_set:Nx #1
+ \str_set:Nx \l_@@_encoding_str {#2}
+ \str_set:Nx #1
{
- \tl_to_str:N \l_@@_encoding_tl
- \bool_if:NT \l_@@_active_char_bool
- { \tl_to_str:n { _active } }
+ \l_@@_encoding_str
+ \bool_if:NT \l_@@_active_char_bool { _active }
}
}
\cs_new_protected_nopar:Npn \zhnum_reset_config:
- { \zhnum_load_cfg:o { \l_@@_encoding_tl } }
+ { \zhnum_load_cfg:o { \l_@@_encoding_str } }
\bool_new:N \l_@@_active_char_bool
\bool_set_true:N \l_@@_active_char_bool
\fi:
@@ -1798,9 +1794,9 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
encoding .choices:nn =
{ UTF8 , GBK , Big5 }
{
- \exp_args:Nx \tex_lowercase:D
- { \tl_set:Nn \exp_not:N \l_@@_encoding_tl { \l_keys_choice_tl } }
- \zhnum_load_cfg:o { \l_@@_encoding_tl }
+ \str_set:Nx \l_@@_encoding_str
+ { \str_fold_case:V \l_keys_choice_tl }
+ \zhnum_load_cfg:o { \l_@@_encoding_str }
} ,
encoding .default:n = { GBK } ,
encoding / Bg5 .meta:n = { encoding = Big5 } ,
@@ -1839,7 +1835,7 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
{ \cs_set_eq:NN \zhnum_ganzhi:nnn \zhnum_ganzhi_normal:nnn } ,
ganzhi-cyclic .default:n = { true } ,
}
-\tl_new:N \l_@@_encoding_tl
+\str_new:N \l_@@_encoding_str
\msg_new:nnnn { zhnumber } { encoding-invalid }
{ The~encoding~`#1'~is~invalid. }
{ Available~encodings~are~`UTF8',~`GBK'~and~`Big5'. }
@@ -1865,7 +1861,7 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
%
% 如果没有选定编码,则根据引擎自动设置编码。
% \begin{macrocode}
-\tl_if_empty:NT \l_@@_encoding_tl
+\str_if_empty:NT \l_@@_encoding_str
{
\zhnum_if_unicode_engine:TF
{ \keys_set:nn { zhnum / options } { encoding = UTF8 } }