diff options
author | Norbert Preining <norbert@preining.info> | 2024-02-16 03:01:49 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-02-16 03:01:49 +0000 |
commit | a6e02d45ad0d10cfc3256fc91abe80d6228325a4 (patch) | |
tree | 6d63cc33763dc264246cd1f7bcd9b8482acf956d /macros/latex/contrib/siunitx/siunitx-number.dtx | |
parent | 5b6839a58ea5468b40ebd52b579e680b8e62ff13 (diff) |
CTAN sync 202402160301
Diffstat (limited to 'macros/latex/contrib/siunitx/siunitx-number.dtx')
-rw-r--r-- | macros/latex/contrib/siunitx/siunitx-number.dtx | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/macros/latex/contrib/siunitx/siunitx-number.dtx b/macros/latex/contrib/siunitx/siunitx-number.dtx index 19e2c32e9b..8c94cefee4 100644 --- a/macros/latex/contrib/siunitx/siunitx-number.dtx +++ b/macros/latex/contrib/siunitx/siunitx-number.dtx @@ -764,9 +764,12 @@ \bool_if:NTF \l_siunitx_number_parse_bool { \siunitx_number_parse:nN {#1} \l_@@_parsed_tl - \siunitx_number_process:NN \l_@@_parsed_tl \l_@@_parsed_tl - \tl_set:Nx \l_@@_outputted_tl - { \siunitx_number_output:N \l_@@_parsed_tl } + \tl_if_empty:NF \l_@@_parsed_tl + { + \siunitx_number_process:NN \l_@@_parsed_tl \l_@@_parsed_tl + \tl_set:Nx \l_@@_outputted_tl + { \siunitx_number_output:N \l_@@_parsed_tl } + } } { \tl_set:Nn \l_@@_outputted_tl { \ensuremath {#1} } } \exp_args:NNNV \group_end: @@ -978,16 +981,16 @@ % % \begin{macro}{\siunitx_number_normalize_symbols:N} % \begin{macro}{\@@_normalize_aux:nN} -% \begin{macro}{\@@_normalize_sign:N} +% \begin{macro}{\@@_normalize_actives:N} % \begin{variable}{\c_@@_normalize_tl} -% There are two parts to the replacement code. First, any active -% hyphens signs are normalised: these can come up with some packages and +% There are two parts to the replacement code. First, any actives +% are normalised: these can come up with some packages and % cause issues. Multi-token signs then are converted to the single token % equivalents so that everything else can work on a one token basis. % \begin{macrocode} \cs_new_protected:Npn \siunitx_number_normalize_symbols:N #1 { - \@@_normalize_minus:N #1 + \@@_normalize_actives:N #1 \exp_after:wN \@@_normalize_aux:NnN \exp_after:wN #1 \c_@@_normalize_tl { ? } \q_recursion_tail @@ -1010,10 +1013,16 @@ } \group_begin: \char_set_catcode_active:N \- - \cs_new_protected:Npx \@@_normalize_minus:N #1 + \char_set_catcode_active:N \< + \char_set_catcode_active:N \> + \cs_new_protected:Npx \@@_normalize_actives:N #1 { \tl_replace_all:Nnn #1 { \exp_not:N - } { \token_to_str:N - } + \tl_replace_all:Nnn #1 + { \exp_not:N < } { \token_to_str:N < } + \tl_replace_all:Nnn #1 + { \exp_not:N > } { \token_to_str:N > } } \group_end: % \end{macrocode} @@ -1059,8 +1068,10 @@ \tl_map_inline:Nn \l_@@_input_ignore_tl { \tl_remove_all:Nn \l_@@_arg_tl {##1} } \tl_if_empty:NF \l_@@_arg_tl - { \@@_parse_comparator: } - \@@_parse_check: + { + \@@_parse_comparator: + \@@_parse_check: + } \exp_args:NNNV \group_end: \tl_set:Nn #2 \l_@@_parsed_tl } |