From 76c3969dec172742a7c66023447ba9e08446af74 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 12 Jun 2023 20:15:23 +0000 Subject: siunitx (12jun23) git-svn-id: svn://tug.org/texlive/trunk@67346 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/siunitx/siunitx-complex.dtx | 40 ++++++++++++++++------ .../source/latex/siunitx/siunitx-print.dtx | 11 +++--- .../source/latex/siunitx/siunitx-table.dtx | 2 +- Master/texmf-dist/source/latex/siunitx/siunitx.dtx | 2 +- 4 files changed, 39 insertions(+), 16 deletions(-) (limited to 'Master/texmf-dist/source/latex/siunitx') diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx index fe235989503..21a8fa3be9b 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx @@ -650,7 +650,9 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_parse_polar:nn #1#2 { - \siunitx_number_parse:nN {#1} \l_@@_mag_tl + \bool_if:NTF \l_siunitx_number_parse_bool + { \siunitx_number_parse:nN {#1} \l_@@_mag_tl } + { \tl_set:Nn \l_@@_mag_tl { \ensuremath {#1} } } \group_begin: \keys_set:nn { siunitx } { @@ -693,7 +695,9 @@ % \begin{macrocode} \cs_new_protected:Npn \siunitx_complex_number:n #1 { - \bool_if:NTF \l_@@_force_polar_bool + \bool_lazy_and:nnTF + { \l_@@_force_polar_bool } + { \l_siunitx_number_parse_bool } { \use:e { @@ -726,7 +730,9 @@ } \cs_new_protected:Npn \@@_number:nn #1#2 { - \bool_if:NTF \l_@@_force_cartesian_bool + \bool_lazy_and:nnTF + { \l_@@_force_cartesian_bool } + { \l_siunitx_number_parse_bool } { \exp_args:Ne \siunitx_complex_number:n { \@@_convert_cartesian:nn {#1} {#2} } @@ -738,7 +744,9 @@ } \cs_new_protected:Npn \siunitx_complex_quantity:nn #1#2 { - \bool_if:NTF \l_@@_force_polar_bool + \bool_lazy_and:nnTF + { \l_@@_force_polar_bool } + { \l_siunitx_number_parse_bool } { \use:e { @@ -769,7 +777,9 @@ } \cs_new_protected:Npn \@@_quantity:nnn #1#2#3 { - \bool_if:NTF \l_@@_force_cartesian_bool + \bool_lazy_and:nnTF + { \l_@@_force_cartesian_bool } + { \l_siunitx_number_parse_bool } { \exp_args:Ne \siunitx_complex_quantity:nn { \@@_convert_cartesian:nn {#1} {#2} } @@ -1019,14 +1029,23 @@ \cs_new_protected:Npn \@@_format_polar:n #1 { \tl_if_blank:nTF {#1} - { \siunitx_number_process:NN \l_@@_mag_tl \l_@@_mag_tl } { - \use:c - { @@_format_polar_ \l_siunitx_quantity_prefix_mode_tl :n } {#1} + \bool_if:NT \l_siunitx_number_parse_bool + { \siunitx_number_process:NN \l_@@_mag_tl \l_@@_mag_tl } + } + { + \bool_if:NTF \l_siunitx_number_parse_bool + { + \use:c + { @@_format_polar_ \l_siunitx_quantity_prefix_mode_tl :n } {#1} + } + { \@@_format_polar_input:n {#1} } } \tl_set:Nx \l_@@_tmp_tl { - \siunitx_number_output:N \l_@@_mag_tl + \bool_if:NTF \l_siunitx_number_parse_bool + { \siunitx_number_output:N \l_@@_mag_tl } + { \exp_not:V \l_@@_mag_tl } \exp_not:V \l_@@_symbol_angle_tl \mathord % TEMP \exp_not:V \l_@@_angle_tl @@ -1058,7 +1077,8 @@ } \cs_new_protected:Npn \@@_format_polar_input:n #1 { - \siunitx_number_process:NN \l_@@_mag_tl \l_@@_mag_tl + \bool_if:NT \l_siunitx_number_parse_bool + { \siunitx_number_process:NN \l_@@_mag_tl \l_@@_mag_tl } \siunitx_unit_format:nN {#1} \l_@@_unit_tl } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx index 236cbbab80e..0e8277cd93f 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx @@ -865,21 +865,18 @@ { \exp_after:wN \cs_set_eq:NN \l_siunitx_unit_font_tl \use:n } \cs_set:Npn \mathord ##1 { \@@_text_replace_first:N ##1 } - \group_begin: - \cs_set:Npn \pm { \: \exp_not:N \textpm \: } + \group_begin: \tl_map_inline:nn { \mp \approx \sim \ge \le \geq \leq \gg \ll \angle } { \cs_set:Npn ##1 { \exp_not:N \ensuremath { \exp_not:N ##1 } } } - \cs_set:Npn \cdot { \: \exp_not:N \textperiodcentered \: } \cs_set:Npn \sqrt ##1 { \exp_not:N \ensuremath { \exp_not:N \sqrt { \exp_not:N \text {##1} } } } - \cs_set:Npn \times { \: \exp_not:N \texttimes \: } \protected@edef \l_@@_tmp_tl { \exp_after:wN \@@_text_replace_first:N \l_@@_tmp_tl } \exp_args:NNNV \group_end: @@ -910,6 +907,12 @@ { \exp_not:N \@@_text_sub:n } ^ { \exp_not:N \@@_text_super:n } + \exp_not:N \cdot + { \exp_not:N \: \exp_not:N \textperiodcentered \exp_not:N \: } + \exp_not:N \pm + { \exp_not:N \: \exp_not:N \textpm \exp_not:N \: } + \exp_not:N \times + { \exp_not:N \: \exp_not:N \texttimes \exp_not:N \: } \exp_not:N \q_recursion_tail { ? } \exp_not:N \q_recursion_stop diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx index 4b7cd9ea9f9..6e81d1b7c52 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx @@ -1513,7 +1513,7 @@ + \box_wd:N \l_@@_tmp_box } { - \box_use:N \l_@@_uncert_box + \hbox_unpack:N \l_@@_uncert_box \tl_if_blank:nF {#2#5} { \siunitx_print_number:n {#4#5} } \@@_fil: diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx index 84e10ad678b..e8652f875a9 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx @@ -122,7 +122,7 @@ % % Identify the package and give the over all version information. % \begin{macrocode} -\ProvidesExplPackage {siunitx} {2023-04-13} {3.2.5} +\ProvidesExplPackage {siunitx} {2023-06-12} {3.2.6} {A comprehensive (SI) units package} % \end{macrocode} % -- cgit v1.2.3