texlive[72859] Master/texmf-dist: siunitx (15nov24)

commits+karl at tug.org commits+karl at tug.org
Fri Nov 15 23:11:07 CET 2024


Revision: 72859
          https://tug.org/svn/texlive?view=revision&revision=72859
Author:   karl
Date:     2024-11-15 23:11:07 +0100 (Fri, 15 Nov 2024)
Log Message:
-----------
siunitx (15nov24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md
    trunk/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf
    trunk/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
    trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty

Modified: trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md	2024-11-15 22:10:55 UTC (rev 72858)
+++ trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md	2024-11-15 22:11:07 UTC (rev 72859)
@@ -7,6 +7,23 @@
 
 ## [Unreleased]
 
+## [v3.3.23] - 2024-11-15
+
+### Changed
+- Adjust `colortbl` support to allow for `tabularray` (see
+  https://github.com/lvjr/tabularray/issues/512)
+
+### Fixed
+- Infinite loop with mixed uncertainties for quantities (see issue
+  [\#754](https://github.com/josephwright/siunitx/issues/754))
+- Allow for combination of exponent threshold and uncertainty which is rounded
+  exceeding main value (see issue
+  [\#755](https://github.com/josephwright/siunitx/issues/755))
+- Ignore `drop-zero-decimnal` for values with an uncertainty (see issue
+  [\#756](https://github.com/josephwright/siunitx/issues/756))
+- Output of `\ohm` with `mathastext` (see issue
+  [\#757](https://github.com/josephwright/siunitx/issues/757))
+
 ## [v3.3.22] - 2024-09-30
 
 ### Fixed
@@ -2143,7 +2160,8 @@
 ### Added
 - First public testing release (as `si`)
 
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.3.22...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.3.23...HEAD
+[v3.3.23]: https://github.com/josephwright/siunitx/compare/v3.3.22...v3.3.23
 [v3.3.22]: https://github.com/josephwright/siunitx/compare/v3.3.21...v3.3.22
 [v3.3.21]: https://github.com/josephwright/siunitx/compare/v3.3.20...v3.3.21
 [v3.3.20]: https://github.com/josephwright/siunitx/compare/v3.3.19...v3.3.20

Modified: trunk/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx	2024-11-15 22:10:55 UTC (rev 72858)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx	2024-11-15 22:11:07 UTC (rev 72859)
@@ -2217,6 +2217,20 @@
 % \end{macro}
 % \end{macro}
 %
+% \begin{macro}[pTF]{\@@_if_threshold_exceeded:n}
+%   A short auxiliary.
+%    \begin{macrocode}
+\prg_new_conditional:Npnn \@@_if_threshold_exceeded:n #1 { T , F , TF , p }
+  {
+    \bool_lazy_and:nnTF
+      { \int_compare_p:nNn {#1} > \l_@@_lower_threshold_int }
+      { \int_compare_p:nNn {#1} < \l_@@_upper_threshold_int }
+        \prg_return_true:
+        \prg_return_false:
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\siunitx_number_process:NN, \siunitx_number_process:cc}
 % \begin{macro}{\@@_process:nnnnnnnNN}
 %   A top-level interface for the processing tools. Rounding happens in all
@@ -2613,9 +2627,7 @@
 \cs_generate_variant:Nn \@@_exponent_threshold:n { e }
 \cs_new:Npn \@@_exponent_threshold_aux:nnnnnnn #1#2#3#4#5#6#7
   {
-    \bool_lazy_and:nnTF
-      { \int_compare_p:nNn {#6#7} > \l_@@_lower_threshold_int }
-      { \int_compare_p:nNn {#6#7} < \l_@@_upper_threshold_int }
+    \@@_if_threshold_exceeded:nTF {#6#7}
       {
         \exp_not:n { {#1} {#2} }
         \@@_exponent_shift:nnn { -#6#7 } {#3} {#4}
@@ -2849,7 +2861,8 @@
 %      \@@_round_engineering:nn ,
 %      \@@_round_fixed:nn       ,
 %      \@@_round_input:nn       ,
-%      \@@_round_scientific:nn
+%      \@@_round_scientific:nn  ,
+%      \@@_round_threshold:nn
 %    }
 %  \begin{macro}[EXP]{\@@_round_engineering:NNNNn}
 %  \begin{macro}[EXP]{\@@_round_engineering:nnN, \@@_round_engineering:VnN}
@@ -3177,6 +3190,13 @@
       }
     \@@_round_final_shift:Nw 1
   }
+\cs_new:Npn \@@_round_threshold:nn #1#2
+  {
+    \@@_if_threshold_exceeded:nTF {#1}
+      { \@@_round_input:nn }
+      { \@@_round_scientific:nn }
+        {#1} {#2}
+  }
 \cs_new:Npn \@@_round_final_shift:Nw #1#2 \@@_round_end:nnn #3#4#5
   {
     \exp_not:n { {#3} }
@@ -3642,17 +3662,7 @@
         {
           \bool_lazy_and_p:nn
             { \str_if_eq_p:Vn \l_@@_exponent_mode_tl { threshold } }
-            {
-              ! \bool_lazy_or_p:nn
-                {
-                  \int_compare_p:nNn {#5#6} >
-                    \l_@@_lower_threshold_int
-                }
-                {
-                  \int_compare_p:nNn {#5#6} <
-                    \l_@@_upper_threshold_int
-                }
-            }
+            { ! \@@_if_threshold_exceeded_p:n {#5#6} }
           }
         }
         {
@@ -3710,9 +3720,7 @@
 %    \begin{macrocode}
 \cs_new:Npn \@@_round_uncertainty_threshold:nnn #1#2#3
   {
-    \bool_lazy_and:nnTF
-      { \int_compare_p:nNn {#2#3} > \l_@@_lower_threshold_int }
-      { \int_compare_p:nNn {#2#3} < \l_@@_upper_threshold_int }
+    \@@_if_threshold_exceeded:nTF {#2#3}
       { \@@_round_uncertainty_input:nnn }
       { \@@_round_uncertainty_scientific:nnn }
         {#1} {#2} {#3}
@@ -3747,9 +3755,13 @@
 \cs_new:Npn \@@_zero_decimal:nnnnnnn #1#2#3#4#5#6#7
   {
     \exp_not:n { {#1} {#2} {#3} }
-    \str_if_eq:eeTF
-      { \exp_not:n {#4} }
-      { \prg_replicate:nn { \tl_count:n {#4} } { 0 } }
+    \bool_lazy_and:nnTF
+      { \tl_if_empty_p:n {#5} }
+      {
+        \str_if_eq_p:ee
+          { \exp_not:n {#4} }
+          { \prg_replicate:nn { \tl_count:n {#4} } { 0 } }
+      }
       { { } }
       { \exp_not:n { {#4} } }
     \exp_not:n { {#5} {#6} {#7} }
@@ -3987,7 +3999,7 @@
 % \begin{macro}[EXP]{\@@_output_uncertainty_unaligned:n}
 % \begin{macro}[EXP]{\@@_output_uncert:nnnn}
 % \begin{macro}[EXP]{\@@_output_uncert:nnnnn, \@@_output_uncert:Vnnnn}
-% \begin{macro}[EXP]{\@@_output_uncert_loop:nnN}
+% \begin{macro}[EXP]{\@@_output_uncert_first:nnN, \@@_output_uncert_loop:nnN}
 % \begin{macro}[EXP]{\@@_output_uncert_loop:nnNw}
 % \begin{macro}[EXP]
 %   {
@@ -4437,14 +4449,16 @@
   }
 \cs_new:Npn \@@_output_uncert:nnnnn #1#2#3#4#5
   {
-    \@@_output_uncert_loop:nnN {#2} {#3}
+    \@@_output_uncert_first:nnN {#2} {#3}
       #4 \q_recursion_tail #1 , \q_recursion_stop {#5}
   }
 \cs_generate_variant:Nn \@@_output_uncert:nnnnn { V }
+\cs_new:Npn \@@_output_uncert_first:nnN #1#2#3
+  { \@@_output_uncert_loop:nnNw {#1} {#2} #3 }
 \cs_new:Npn \@@_output_uncert_loop:nnN #1#2#3
   {
     \quark_if_recursion_tail_stop:N #3
-    \@@_output_uncert_loop:nnNw {#1} {#2} #3
+    \@@_output_uncert_loop:nnNw {#1} { } #3
   }
 \cs_new:Npn \@@_output_uncert_loop:nnNw
   #1#2#3#4 \q_recursion_tail #5 , #6 \q_recursion_stop #7

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx	2024-11-15 22:10:55 UTC (rev 72858)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx	2024-11-15 22:11:07 UTC (rev 72859)
@@ -243,17 +243,24 @@
                     \@ifpackageloaded { fontspec }
                       { \exp_not:V \l_@@_tmpb_tl }
                       {
-                        \bool_lazy_or:nnTF
+                        \bool_lazy_any:nTF
                           {
-                            \@ifclassloaded { beamer }
-                              \c_true_bool
-                              \c_false_bool
+                            {
+                              \@ifclassloaded { beamer }
+                                \c_true_bool
+                                \c_false_bool
+                             }
+                             {
+                               \@ifpackageloaded { kmath }
+                                 \c_true_bool
+                                 \c_false_bool
+                              }
+                             {
+                               \@ifpackageloaded { mathastext }
+                                 \c_true_bool
+                                 \c_false_bool
+                              }
                           }
-                          {
-                            \@ifpackageloaded { kmath }
-                              \c_true_bool
-                              \c_false_bool
-                          }
                           { \exp_not:V \l_@@_tmpb_tl }
                           { \exp_not:V \l_@@_tmpa_tl }
                       }

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx	2024-11-15 22:10:55 UTC (rev 72858)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx	2024-11-15 22:11:07 UTC (rev 72859)
@@ -639,12 +639,15 @@
 %
 % \begin{macro}
 %   {\@@_align_center:n, \@@_align_left:n, \@@_align_right:n, \@@_align_none:n}
-% \begin{macro}{\@@_align_auxi:nn, \@@_align_auxii:nn}
+% \begin{macro}{\@@_align_auxi:nn, \@@_align_auxii:nn, \@@_align_auxiii:nn}
 %   The beginning and end of each table cell have to adjust the position of
 %   the content using glue. When \pkg{colortbl} is loaded the glue is done in
 %   two parts: one for our positioning and one to explicitly override that from
 %   the package. Using a two-step auxiliary chain avoids needing to repeat any
-%   code and the impact of the extra expansion should be trivial.
+%   code and the impact of the extra expansion should be trivial. There is a
+%   further wrinkle, in that if \pkg{tabularray} is being used, we need to skip
+%   the \pkg{colortbl} fix (see
+%   \url{https://github.com/lvjr/tabularray/issues/512}).
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_align_center:n #1
   { \@@_align_auxi:nn {#1} { 0pt~plus~0.5fill } }
@@ -677,12 +680,29 @@
         \cs_new_eq:NN
           \@@_align_auxii:nn
           \@@_align_auxi:nn
-        \cs_set_protected:Npn \@@_align_auxi:nn #1#2
+        \cs_gset_protected:Npn \@@_align_auxi:nn #1#2
           {
             \@@_skip:n{ 0pt~plus~-0.5fill }
             \@@_align_auxii:nn {#1} {#2}
             \@@_skip:n { 0pt~plus~-0.5fill }
           }
+        \@ifpackageloaded { tabularray }
+          {
+            \cs_new_eq:NN
+              \@@_align_auxiii:nn
+              \@@_align_auxii:nn
+            \cs_gset_eq:NN
+              \@@_align_auxii:nn
+              \@@_align_auxi:nn
+            \cs_gset_protected:Npn \@@_align_auxi:nn #1#2
+              {
+                \int_compare:nNnTF \g_tblr_level_int = 0
+                  { \@@_align_auxii:nn }
+                  { \@@_align_auxiii:nn }
+                    {#1} {#2}
+              }
+          }
+          { }
       }
       { }
   }

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2024-11-15 22:10:55 UTC (rev 72858)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2024-11-15 22:11:07 UTC (rev 72859)
@@ -124,7 +124,7 @@
 %
 % Identify the package and give the over all version information.
 %    \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2024-09-30} {3.3.22}
+\ProvidesExplPackage {siunitx} {2024-11-15} {3.3.23}
   {A comprehensive (SI) units package}
 %    \end{macrocode}
 %

Modified: trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty	2024-11-15 22:10:55 UTC (rev 72858)
+++ trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty	2024-11-15 22:11:07 UTC (rev 72859)
@@ -41,7 +41,7 @@
       }%
     \endinput
   }%
-\ProvidesExplPackage {siunitx} {2024-09-30} {3.3.22}
+\ProvidesExplPackage {siunitx} {2024-11-15} {3.3.23}
   {A comprehensive (SI) units package}
 \msg_new:nnnn { siunitx } { incompatible-package }
   { Package~'#1'~incompatible. }
@@ -958,6 +958,14 @@
   }
 \cs_new_protected:Npn \__siunitx_number_set_threshold:nn #1#2
   { \int_set:cn { l__siunitx_number_ #1 _threshold_int } { 0 #2 } }
+\prg_new_conditional:Npnn \__siunitx_number_if_threshold_exceeded:n #1 { T , F , TF , p }
+  {
+    \bool_lazy_and:nnTF
+      { \int_compare_p:nNn {#1} > \l__siunitx_number_lower_threshold_int }
+      { \int_compare_p:nNn {#1} < \l__siunitx_number_upper_threshold_int }
+        \prg_return_true:
+        \prg_return_false:
+  }
 \cs_new_protected:Npn \siunitx_number_process:NN #1#2
   {
     \tl_if_empty:NTF #1
@@ -1257,9 +1265,7 @@
 \cs_generate_variant:Nn \__siunitx_number_exponent_threshold:n { e }
 \cs_new:Npn \__siunitx_number_exponent_threshold_aux:nnnnnnn #1#2#3#4#5#6#7
   {
-    \bool_lazy_and:nnTF
-      { \int_compare_p:nNn {#6#7} > \l__siunitx_number_lower_threshold_int }
-      { \int_compare_p:nNn {#6#7} < \l__siunitx_number_upper_threshold_int }
+    \__siunitx_number_if_threshold_exceeded:nTF {#6#7}
       {
         \exp_not:n { {#1} {#2} }
         \__siunitx_number_exponent_shift:nnn { -#6#7 } {#3} {#4}
@@ -1656,6 +1662,13 @@
       }
     \__siunitx_number_round_final_shift:Nw 1
   }
+\cs_new:Npn \__siunitx_number_round_threshold:nn #1#2
+  {
+    \__siunitx_number_if_threshold_exceeded:nTF {#1}
+      { \__siunitx_number_round_input:nn }
+      { \__siunitx_number_round_scientific:nn }
+        {#1} {#2}
+  }
 \cs_new:Npn \__siunitx_number_round_final_shift:Nw #1#2 \__siunitx_number_round_end:nnn #3#4#5
   {
     \exp_not:n { {#3} }
@@ -1963,17 +1976,7 @@
         {
           \bool_lazy_and_p:nn
             { \str_if_eq_p:Vn \l__siunitx_number_exponent_mode_tl { threshold } }
-            {
-              ! \bool_lazy_or_p:nn
-                {
-                  \int_compare_p:nNn {#5#6} >
-                    \l__siunitx_number_lower_threshold_int
-                }
-                {
-                  \int_compare_p:nNn {#5#6} <
-                    \l__siunitx_number_upper_threshold_int
-                }
-            }
+            { ! \__siunitx_number_if_threshold_exceeded_p:n {#5#6} }
           }
         }
         {
@@ -2028,9 +2031,7 @@
   }
 \cs_new:Npn \__siunitx_number_round_uncertainty_threshold:nnn #1#2#3
   {
-    \bool_lazy_and:nnTF
-      { \int_compare_p:nNn {#2#3} > \l__siunitx_number_lower_threshold_int }
-      { \int_compare_p:nNn {#2#3} < \l__siunitx_number_upper_threshold_int }
+    \__siunitx_number_if_threshold_exceeded:nTF {#2#3}
       { \__siunitx_number_round_uncertainty_input:nnn }
       { \__siunitx_number_round_uncertainty_scientific:nnn }
         {#1} {#2} {#3}
@@ -2046,9 +2047,13 @@
 \cs_new:Npn \__siunitx_number_zero_decimal:nnnnnnn #1#2#3#4#5#6#7
   {
     \exp_not:n { {#1} {#2} {#3} }
-    \str_if_eq:eeTF
-      { \exp_not:n {#4} }
-      { \prg_replicate:nn { \tl_count:n {#4} } { 0 } }
+    \bool_lazy_and:nnTF
+      { \tl_if_empty_p:n {#5} }
+      {
+        \str_if_eq_p:ee
+          { \exp_not:n {#4} }
+          { \prg_replicate:nn { \tl_count:n {#4} } { 0 } }
+      }
       { { } }
       { \exp_not:n { {#4} } }
     \exp_not:n { {#5} {#6} {#7} }
@@ -2516,14 +2521,16 @@
   }
 \cs_new:Npn \__siunitx_number_output_uncert:nnnnn #1#2#3#4#5
   {
-    \__siunitx_number_output_uncert_loop:nnN {#2} {#3}
+    \__siunitx_number_output_uncert_first:nnN {#2} {#3}
       #4 \q_recursion_tail #1 , \q_recursion_stop {#5}
   }
 \cs_generate_variant:Nn \__siunitx_number_output_uncert:nnnnn { V }
+\cs_new:Npn \__siunitx_number_output_uncert_first:nnN #1#2#3
+  { \__siunitx_number_output_uncert_loop:nnNw {#1} {#2} #3 }
 \cs_new:Npn \__siunitx_number_output_uncert_loop:nnN #1#2#3
   {
     \quark_if_recursion_tail_stop:N #3
-    \__siunitx_number_output_uncert_loop:nnNw {#1} {#2} #3
+    \__siunitx_number_output_uncert_loop:nnNw {#1} { } #3
   }
 \cs_new:Npn \__siunitx_number_output_uncert_loop:nnNw
   #1#2#3#4 \q_recursion_tail #5 , #6 \q_recursion_stop #7
@@ -5576,12 +5583,29 @@
         \cs_new_eq:NN
           \__siunitx_table_align_auxii:nn
           \__siunitx_table_align_auxi:nn
-        \cs_set_protected:Npn \__siunitx_table_align_auxi:nn #1#2
+        \cs_gset_protected:Npn \__siunitx_table_align_auxi:nn #1#2
           {
             \__siunitx_table_skip:n{ 0pt~plus~-0.5fill }
             \__siunitx_table_align_auxii:nn {#1} {#2}
             \__siunitx_table_skip:n { 0pt~plus~-0.5fill }
           }
+        \@ifpackageloaded { tabularray }
+          {
+            \cs_new_eq:NN
+              \__siunitx_table_align_auxiii:nn
+              \__siunitx_table_align_auxii:nn
+            \cs_gset_eq:NN
+              \__siunitx_table_align_auxii:nn
+              \__siunitx_table_align_auxi:nn
+            \cs_gset_protected:Npn \__siunitx_table_align_auxi:nn #1#2
+              {
+                \int_compare:nNnTF \g_tblr_level_int = 0
+                  { \__siunitx_table_align_auxii:nn }
+                  { \__siunitx_table_align_auxiii:nn }
+                    {#1} {#2}
+              }
+          }
+          { }
       }
       { }
   }
@@ -7857,17 +7881,24 @@
                     \@ifpackageloaded { fontspec }
                       { \exp_not:V \l__siunitx_symbol_tmpb_tl }
                       {
-                        \bool_lazy_or:nnTF
+                        \bool_lazy_any:nTF
                           {
-                            \@ifclassloaded { beamer }
-                              \c_true_bool
-                              \c_false_bool
+                            {
+                              \@ifclassloaded { beamer }
+                                \c_true_bool
+                                \c_false_bool
+                             }
+                             {
+                               \@ifpackageloaded { kmath }
+                                 \c_true_bool
+                                 \c_false_bool
+                              }
+                             {
+                               \@ifpackageloaded { mathastext }
+                                 \c_true_bool
+                                 \c_false_bool
+                              }
                           }
-                          {
-                            \@ifpackageloaded { kmath }
-                              \c_true_bool
-                              \c_false_bool
-                          }
                           { \exp_not:V \l__siunitx_symbol_tmpb_tl }
                           { \exp_not:V \l__siunitx_symbol_tmpa_tl }
                       }



More information about the tex-live-commits mailing list.