texlive[61515] Master/texmf-dist: siunitx (6jan22)

commits+karl at tug.org commits+karl at tug.org
Thu Jan 6 22:08:21 CET 2022


Revision: 61515
          http://tug.org/svn/texlive?view=revision&revision=61515
Author:   karl
Date:     2022-01-06 22:08:20 +0100 (Thu, 06 Jan 2022)
Log Message:
-----------
siunitx (6jan22)

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-complex.dtx
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.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	2022-01-06 21:08:04 UTC (rev 61514)
+++ trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md	2022-01-06 21:08:20 UTC (rev 61515)
@@ -7,6 +7,12 @@
 
 ## [Unreleased]
 
+## [v3.0.39]: 2022-01-05
+
+### Fixed
+- Differentiate unity- and missing mantissa values (see issue
+  [#565](https://github.com/josephwright/siunitx/issues/565))
+
 ## [v3.0.38]: 2022-01-04
 
 ### Changed
@@ -1643,7 +1649,8 @@
 ### Added
 - First public testing release (as `si`)
 
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.38...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.39...HEAD
+[v3.0.39]: https://github.com/josephwright/siunitx/compare/v3.0.38...v3.0.39
 [v3.0.38]: https://github.com/josephwright/siunitx/compare/v3.0.37...v3.0.38
 [v3.0.37]: https://github.com/josephwright/siunitx/compare/v3.0.36...v3.0.37
 [v3.0.36]: https://github.com/josephwright/siunitx/compare/v3.0.35...v3.0.36

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-complex.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx	2022-01-06 21:08:04 UTC (rev 61514)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-complex.dtx	2022-01-06 21:08:20 UTC (rev 61515)
@@ -603,7 +603,6 @@
 % \begin{macro}{\@@_format_sign:nnnnnnn}
 % \begin{macro}{\@@_extract_exponent:nw}
 % \begin{macro}{\@@_extract_exponent_aux:w}
-% \begin{macro}{\@@_format_unary:nnnnnnn}
 % \begin{macro}[EXP]{\@@_format_bracket:n}
 %   We start here checking that there is something to do.
 %    \begin{macrocode}
@@ -643,7 +642,6 @@
     \tl_if_empty:NF \l_@@_real_tl
       { \exp_after:wN \@@_drop_exponent:nnnnnnn \l_@@_real_tl }
     \exp_after:wN \@@_format_sign:nnnnnnn \l_@@_img_tl
-    \exp_after:wN \@@_format_unary:nnnnnnn \l_@@_img_tl
     \tl_set:Nx \l_@@_tmp_tl
       { \siunitx_number_output:NN \l_@@_img_tl \q_nil }
     \exp_after:wN \@@_extract_exponent:w \l_@@_tmp_tl \q_stop
@@ -708,6 +706,8 @@
   }
 %    \end{macrocode}
 %   Pull out the formatted exponent: we also need the sign.
+%   An imaginary part that is exactly $1$ is omitted, with only the complex
+%   root printed. That means checking and removing a lone $1$ here.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_extract_exponent:w
   #1 \q_nil #2 \q_nil #3 \q_nil #4 \q_nil #5 \q_nil #6 \q_nil #7 \q_nil #8
@@ -714,7 +714,12 @@
   \q_nil #9 \q_stop
   {
     \tl_set:Nn \l_@@_sign_tl {#1#2}
-    \@@_extract_exponent_aux:nw {#3#4#5#6#7#8} #9 \q_stop
+    \bool_lazy_and:nnTF
+      { \str_if_eq_p:nn {#3} { 1 } }
+      { \tl_if_blank_p:n {#5} }
+      { \@@_extract_exponent_aux:nw {#6#7#8} }
+      { \@@_extract_exponent_aux:nw {#3#4#5#6#7#8} }
+         #9 \q_stop
   }
 \cs_new:Npn \@@_extract_exponent_aux:nw
   #1#2 \q_nil #3 \q_nil #4 \q_stop
@@ -722,25 +727,6 @@
     \tl_set:Nn \l_@@_tmp_tl {#1#2}
     \tl_set:Nn \l_@@_exp_tl {#3#4}
   }
-%    \end{macrocode}
-%   An imaginary part that is exactly $1$ is omitted, with only the complex
-%   root printed. That means checking and removing a lone $1$ here.
-%    \begin{macrocode}
-\cs_new_protected:Npn \@@_format_unary:nnnnnnn #1#2#3#4#5#6#7
-  {
-    \tl_set:Nx \l_@@_img_tl
-      {
-        \exp_not:n { {#1} {#2} }
-        \tl_if_blank:nTF {#4}
-          {
-            \str_if_eq:nnTF {#3} { 1 }
-              { { } { } }
-              { \exp_not:n { {#3} {#4} } }
-          }
-          { \exp_not:n { {#3} {#4} } }
-        \exp_not:n { {#5} {#6} {#7} }
-      }
-  }
 \cs_new_protected:Npn \@@_format_bracket:n #1
   {
     \exp_not:V \l_@@_bracket_open_tl

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx	2022-01-06 21:08:04 UTC (rev 61514)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx	2022-01-06 21:08:20 UTC (rev 61515)
@@ -1196,8 +1196,8 @@
 %   Valid cases here are
 %   \begin{itemize}
 %     \item Entirely blank if the original input was for example |+e10|:
-%       simply clean up if in the integer part of issue an error if in
-%       a second part (complex number, \foreign{etc.}).
+%       simply clean up if in the integer part or issue an error if in
+%       a second part (uncertainty).
 %     \item An integer part digit: pass through to the main collection
 %       routine.
 %     \item A decimal marker: store an empty integer part and move to
@@ -1210,7 +1210,7 @@
     \quark_if_recursion_tail_stop_do:Nn #3
       {
         \bool_if:NTF #2
-          { \tl_put_right:Nn #1 { { 1 } { } { } } }
+          { \tl_put_right:Nn #1 { { } { } { } } }
           { \@@_parse_loop_break:wN \q_recursion_stop }
       }
     \tl_if_in:NnTF \l_@@_input_digit_tl {#3}
@@ -3198,9 +3198,9 @@
 %   }
 % \begin{macro}[rEXP]
 %   {
-%     \@@_output_exponent:nnnn       ,
-%     \@@_output_exponent_auxi:nnnn  ,
-%     \@@_output_exponent_auxii:nnnn
+%     \@@_output_exponent:nnnnn       ,
+%     \@@_output_exponent_auxi:nnnnn  ,
+%     \@@_output_exponent_auxii:nnnnn
 %   }
 % \begin{macro}[rEXP]{\@@_output_exponent_auxiii:nn}
 % \begin{macro}[rEXP]{\@@_output_end:}
@@ -3236,7 +3236,7 @@
     \@@_output_integer:nnn {#3} {#4} {#7}
     \@@_output_decimal:nn {#4} {#8}
     \@@_output_uncertainty:nnn {#5} {#4} {#8}
-    \@@_output_exponent:nnnn {#6} {#7} { #3 . #4 } {#8}
+    \@@_output_exponent:nnnnn {#6} {#7} {#3} {#4} {#8}
     \@@_output_end:
   }
 %    \end{macrocode}
@@ -3259,12 +3259,12 @@
       }
     \@@_output_bracket:w
   }
-\cs_new:Npn \@@_output_bracket:w #1 \@@_output_exponent:nnnn
+\cs_new:Npn \@@_output_bracket:w #1 \@@_output_exponent:nnnnn
   {
     \exp_not:V \l_@@_bracket_open_tl
     #1
     \exp_not:V \l_@@_bracket_close_tl
-    \@@_output_exponent:nnnn
+    \@@_output_exponent:nnnnn
   }
 %    \end{macrocode}
 %   As color for negative values applies to the \emph{whole} output, we have
@@ -3340,17 +3340,26 @@
 %    \begin{macrocode}
 \cs_new:Npn \@@_output_integer:nnn #1#2#3
   {
-    \bool_lazy_any:nT
+    \tl_if_blank:nTF {#1}
       {
-        { \l_@@_unity_mantissa_bool }
-        { ! \str_if_eq_p:nn { #1 . #2 } { 1. } }
-        {
-          \bool_lazy_and_p:nn
-            { \str_if_eq_p:nn {#3} { 0 } }
-            { ! \l_@@_zero_exponent_bool }
-        }
+        \bool_lazy_and:nnT
+          { \str_if_eq_p:nn {#3} { 0 } }
+          { ! \l_@@_zero_exponent_bool }
+          { \@@_output_digits:nn { integer } { 1 } }
       }
-      { \@@_output_digits:nn { integer } {#1} }
+      {
+        \bool_lazy_any:nT
+           {
+            { \l_@@_unity_mantissa_bool }
+            { ! \str_if_eq_p:nn { #1 . #2 } { 1. } }
+            {
+              \bool_lazy_and_p:nn
+                { \str_if_eq_p:nn {#3} { 0 } }
+                { ! \l_@@_zero_exponent_bool }
+            }
+          }
+          { \@@_output_digits:nn { integer } {#1} }
+      }
   }
 \cs_new:Npn \@@_output_decimal:nn #1#2
   {
@@ -3553,40 +3562,47 @@
 %   For signs, the auxiliary from the main sign routine can be used, but not
 %   the main function: negative exponents don't have special handling.
 %    \begin{macrocode}
-\cs_new:Npn \@@_output_exponent:nnnn #1#2#3#4
+\cs_new:Npn \@@_output_exponent:nnnnn #1#2#3#4#5
   {
-    \exp_not:n {#4}
+    \exp_not:n {#5}
     \bool_lazy_or:nnTF
       { \l_@@_zero_exponent_bool }
       { ! \str_if_eq_p:nn {#2} { 0 } }
       {
         \tl_if_empty:NTF \l_@@_output_exp_marker_tl
-          { \@@_output_exponent_auxi:nnnn }
-          { \@@_output_exponent_auxii:nnnn }
-            {#1} {#2} {#3} {#4}
+          { \@@_output_exponent_auxi:nnnnn }
+          { \@@_output_exponent_auxii:nnnnn }
+            {#1} {#2} {#3} {#4} {#5}
       }
-      { \exp_not:n {#4} }
+      { \exp_not:n {#5} }
   }
-\cs_new:Npn \@@_output_exponent_auxi:nnnn #1#2#3#4
+\cs_new:Npn \@@_output_exponent_auxi:nnnnn #1#2#3#4#5
   {
-    \bool_lazy_or:nnTF
-      { \l_@@_unity_mantissa_bool }
-      { ! \str_if_eq_p:nn {#3} { 1. } }
+    \bool_lazy_or:nnT
       {
+        \bool_lazy_and_p:nn
+          { \l_@@_unity_mantissa_bool }
+          { \str_if_eq_p:nn { #3 . #4 } { 1. } }
+      }
+      {
+        ! \bool_lazy_or_p:nn
+          { \str_if_eq_p:nn { #3 . #4 } { 1. } }
+          { \tl_if_blank_p:n {#3} }
+      }
+      {
         \bool_if:NTF \l_@@_tight_bool
           { \exp_not:N \mathord }
           { \use:n }
             { \exp_not:V \l_@@_exponent_product_tl }
-        \exp_not:n {#4}
       }
-      { \exp_not:n {#4} }
+    \exp_not:n {#5}
     \exp_not:V \l_@@_exponent_base_tl
     ^
       { \@@_output_exponent_auxiii:nn {#1} {#2} }
   }
-\cs_new:Npn \@@_output_exponent_auxii:nnnn #1#2#3#4
+\cs_new:Npn \@@_output_exponent_auxii:nnnnn #1#2#3#4#5
   {
-    \exp_not:n {#4}
+    \exp_not:n {#5}
     \exp_not:V \l_@@_output_exp_marker_tl
     \@@_output_exponent_auxiii:nn {#1} {#2}
   }

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2022-01-06 21:08:04 UTC (rev 61514)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2022-01-06 21:08:20 UTC (rev 61515)
@@ -121,7 +121,7 @@
 %
 % Identify the package and give the over all version information.
 %    \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2022-01-04} {3.0.38}
+\ProvidesExplPackage {siunitx} {2022-01-05} {3.0.39}
   {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	2022-01-06 21:08:04 UTC (rev 61514)
+++ trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty	2022-01-06 21:08:20 UTC (rev 61515)
@@ -42,7 +42,7 @@
       }%
     \endinput
   }%
-\ProvidesExplPackage {siunitx} {2022-01-04} {3.0.38}
+\ProvidesExplPackage {siunitx} {2022-01-05} {3.0.39}
   {A comprehensive (SI) units package}
 \msg_new:nnnn { siunitx } { incompatible-package }
   { Package~'#1'~incompatible. }
@@ -675,7 +675,6 @@
     \tl_if_empty:NF \l__siunitx_complex_real_tl
       { \exp_after:wN \__siunitx_complex_drop_exponent:nnnnnnn \l__siunitx_complex_real_tl }
     \exp_after:wN \__siunitx_complex_format_sign:nnnnnnn \l__siunitx_complex_img_tl
-    \exp_after:wN \__siunitx_complex_format_unary:nnnnnnn \l__siunitx_complex_img_tl
     \tl_set:Nx \l__siunitx_complex_tmp_tl
       { \siunitx_number_output:NN \l__siunitx_complex_img_tl \q_nil }
     \exp_after:wN \__siunitx_complex_extract_exponent:w \l__siunitx_complex_tmp_tl \q_stop
@@ -736,7 +735,12 @@
   \q_nil #9 \q_stop
   {
     \tl_set:Nn \l__siunitx_complex_sign_tl {#1#2}
-    \__siunitx_complex_extract_exponent_aux:nw {#3#4#5#6#7#8} #9 \q_stop
+    \bool_lazy_and:nnTF
+      { \str_if_eq_p:nn {#3} { 1 } }
+      { \tl_if_blank_p:n {#5} }
+      { \__siunitx_complex_extract_exponent_aux:nw {#6#7#8} }
+      { \__siunitx_complex_extract_exponent_aux:nw {#3#4#5#6#7#8} }
+         #9 \q_stop
   }
 \cs_new:Npn \__siunitx_complex_extract_exponent_aux:nw
   #1#2 \q_nil #3 \q_nil #4 \q_stop
@@ -744,21 +748,6 @@
     \tl_set:Nn \l__siunitx_complex_tmp_tl {#1#2}
     \tl_set:Nn \l__siunitx_complex_exp_tl {#3#4}
   }
-\cs_new_protected:Npn \__siunitx_complex_format_unary:nnnnnnn #1#2#3#4#5#6#7
-  {
-    \tl_set:Nx \l__siunitx_complex_img_tl
-      {
-        \exp_not:n { {#1} {#2} }
-        \tl_if_blank:nTF {#4}
-          {
-            \str_if_eq:nnTF {#3} { 1 }
-              { { } { } }
-              { \exp_not:n { {#3} {#4} } }
-          }
-          { \exp_not:n { {#3} {#4} } }
-        \exp_not:n { {#5} {#6} {#7} }
-      }
-  }
 \cs_new_protected:Npn \__siunitx_complex_format_bracket:n #1
   {
     \exp_not:V \l__siunitx_complex_bracket_open_tl
@@ -1873,7 +1862,7 @@
     \quark_if_recursion_tail_stop_do:Nn #3
       {
         \bool_if:NTF #2
-          { \tl_put_right:Nn #1 { { 1 } { } { } } }
+          { \tl_put_right:Nn #1 { { } { } { } } }
           { \__siunitx_number_parse_loop_break:wN \q_recursion_stop }
       }
     \tl_if_in:NnTF \l__siunitx_number_input_digit_tl {#3}
@@ -3221,7 +3210,7 @@
     \__siunitx_number_output_integer:nnn {#3} {#4} {#7}
     \__siunitx_number_output_decimal:nn {#4} {#8}
     \__siunitx_number_output_uncertainty:nnn {#5} {#4} {#8}
-    \__siunitx_number_output_exponent:nnnn {#6} {#7} { #3 . #4 } {#8}
+    \__siunitx_number_output_exponent:nnnnn {#6} {#7} {#3} {#4} {#8}
     \__siunitx_number_output_end:
   }
 \cs_new:Npn \__siunitx_number_output_bracket:nn #1#2
@@ -3239,12 +3228,12 @@
       }
     \__siunitx_number_output_bracket:w
   }
-\cs_new:Npn \__siunitx_number_output_bracket:w #1 \__siunitx_number_output_exponent:nnnn
+\cs_new:Npn \__siunitx_number_output_bracket:w #1 \__siunitx_number_output_exponent:nnnnn
   {
     \exp_not:V \l__siunitx_number_bracket_open_tl
     #1
     \exp_not:V \l__siunitx_number_bracket_close_tl
-    \__siunitx_number_output_exponent:nnnn
+    \__siunitx_number_output_exponent:nnnnn
   }
 \cs_new:Npn \__siunitx_number_output_color:n #1
   {
@@ -3299,17 +3288,26 @@
   }
 \cs_new:Npn \__siunitx_number_output_integer:nnn #1#2#3
   {
-    \bool_lazy_any:nT
+    \tl_if_blank:nTF {#1}
       {
-        { \l__siunitx_number_unity_mantissa_bool }
-        { ! \str_if_eq_p:nn { #1 . #2 } { 1. } }
-        {
-          \bool_lazy_and_p:nn
-            { \str_if_eq_p:nn {#3} { 0 } }
-            { ! \l__siunitx_number_zero_exponent_bool }
-        }
+        \bool_lazy_and:nnT
+          { \str_if_eq_p:nn {#3} { 0 } }
+          { ! \l__siunitx_number_zero_exponent_bool }
+          { \__siunitx_number_output_digits:nn { integer } { 1 } }
       }
-      { \__siunitx_number_output_digits:nn { integer } {#1} }
+      {
+        \bool_lazy_any:nT
+           {
+            { \l__siunitx_number_unity_mantissa_bool }
+            { ! \str_if_eq_p:nn { #1 . #2 } { 1. } }
+            {
+              \bool_lazy_and_p:nn
+                { \str_if_eq_p:nn {#3} { 0 } }
+                { ! \l__siunitx_number_zero_exponent_bool }
+            }
+          }
+          { \__siunitx_number_output_digits:nn { integer } {#1} }
+      }
   }
 \cs_new:Npn \__siunitx_number_output_decimal:nn #1#2
   {
@@ -3480,40 +3478,47 @@
       { \int_eval:n { \tl_count:n {#2} - \tl_count:n {#1} } }
       {#2} { }
   }
-\cs_new:Npn \__siunitx_number_output_exponent:nnnn #1#2#3#4
+\cs_new:Npn \__siunitx_number_output_exponent:nnnnn #1#2#3#4#5
   {
-    \exp_not:n {#4}
+    \exp_not:n {#5}
     \bool_lazy_or:nnTF
       { \l__siunitx_number_zero_exponent_bool }
       { ! \str_if_eq_p:nn {#2} { 0 } }
       {
         \tl_if_empty:NTF \l__siunitx_number_output_exp_marker_tl
-          { \__siunitx_number_output_exponent_auxi:nnnn }
-          { \__siunitx_number_output_exponent_auxii:nnnn }
-            {#1} {#2} {#3} {#4}
+          { \__siunitx_number_output_exponent_auxi:nnnnn }
+          { \__siunitx_number_output_exponent_auxii:nnnnn }
+            {#1} {#2} {#3} {#4} {#5}
       }
-      { \exp_not:n {#4} }
+      { \exp_not:n {#5} }
   }
-\cs_new:Npn \__siunitx_number_output_exponent_auxi:nnnn #1#2#3#4
+\cs_new:Npn \__siunitx_number_output_exponent_auxi:nnnnn #1#2#3#4#5
   {
-    \bool_lazy_or:nnTF
-      { \l__siunitx_number_unity_mantissa_bool }
-      { ! \str_if_eq_p:nn {#3} { 1. } }
+    \bool_lazy_or:nnT
       {
+        \bool_lazy_and_p:nn
+          { \l__siunitx_number_unity_mantissa_bool }
+          { \str_if_eq_p:nn { #3 . #4 } { 1. } }
+      }
+      {
+        ! \bool_lazy_or_p:nn
+          { \str_if_eq_p:nn { #3 . #4 } { 1. } }
+          { \tl_if_blank_p:n {#3} }
+      }
+      {
         \bool_if:NTF \l__siunitx_number_tight_bool
           { \exp_not:N \mathord }
           { \use:n }
             { \exp_not:V \l__siunitx_number_exponent_product_tl }
-        \exp_not:n {#4}
       }
-      { \exp_not:n {#4} }
+    \exp_not:n {#5}
     \exp_not:V \l__siunitx_number_exponent_base_tl
     ^
       { \__siunitx_number_output_exponent_auxiii:nn {#1} {#2} }
   }
-\cs_new:Npn \__siunitx_number_output_exponent_auxii:nnnn #1#2#3#4
+\cs_new:Npn \__siunitx_number_output_exponent_auxii:nnnnn #1#2#3#4#5
   {
-    \exp_not:n {#4}
+    \exp_not:n {#5}
     \exp_not:V \l__siunitx_number_output_exp_marker_tl
     \__siunitx_number_output_exponent_auxiii:nn {#1} {#2}
   }



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