diff options
author | Norbert Preining <norbert@preining.info> | 2022-01-05 03:00:57 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-01-05 03:00:57 +0000 |
commit | c03c0d515f1bfbd111d40e78805db4696e080fb8 (patch) | |
tree | 4d72d1df66079b3937776da41a78d71189719dad /macros/latex/contrib/siunitx/siunitx-compound.dtx | |
parent | 1903b598f8dda613f5c584bb18ccfd2fd8c278bb (diff) |
CTAN sync 202201050300
Diffstat (limited to 'macros/latex/contrib/siunitx/siunitx-compound.dtx')
-rw-r--r-- | macros/latex/contrib/siunitx/siunitx-compound.dtx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/macros/latex/contrib/siunitx/siunitx-compound.dtx b/macros/latex/contrib/siunitx/siunitx-compound.dtx index 5f119f1372..a11121a4ac 100644 --- a/macros/latex/contrib/siunitx/siunitx-compound.dtx +++ b/macros/latex/contrib/siunitx/siunitx-compound.dtx @@ -447,6 +447,15 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_format:nnn #1#2#3 { + \tl_if_blank:nTF {#1} + { + \tl_if_blank:nF {#2} + { \@@_format:nn {#2} {#3} } + } + { \@@_format_aux:nnn {#1} {#2} {#3} } + } +\cs_new_protected:Npn \@@_format_aux:nnn #1#2#3 + { \siunitx_number_parse:nN {#1} \l_@@_tmp_tl \bool_if:NTF \l_@@_unit_bool { \@@_format_units:nn {#2} {#3} } @@ -522,11 +531,16 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\@@_parsed:n, \@@_unparsed:n} +% \begin{macro}{\@@_parsed:n, \@@_parsed_aux:n, \@@_unparsed:n} % The simple cases for parsing (or not) all entries. % \begin{macrocode} \cs_new_protected:Npn \@@_parsed:n #1 { + \tl_if_blank:nF {#1} + { \@@_parsed_aux:n {#1} } + } +\cs_new_protected:Npn \@@_parsed_aux:n #1 + { \bool_if:NTF \l_@@_unit_bool { \siunitx_number_parse:nN {#1} \l_@@_tmp_tl @@ -541,7 +555,8 @@ } \cs_new_protected:Npn \@@_unparsed:n #1 { - \seq_put_right:Nn \l_@@_tmp_seq { \ensuremath {#1} } + \tl_if_blank:nF {#1} + { \seq_put_right:Nn \l_@@_tmp_seq { \ensuremath {#1} } } } % \end{macrocode} % \end{macro} |