texlive[67730] Master/texmf-dist: siunitx (25jul23)

commits+karl at tug.org commits+karl at tug.org
Tue Jul 25 21:34:11 CEST 2023


Revision: 67730
          http://tug.org/svn/texlive?view=revision&revision=67730
Author:   karl
Date:     2023-07-25 21:34:11 +0200 (Tue, 25 Jul 2023)
Log Message:
-----------
siunitx (25jul23)

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-compound.dtx
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx-print.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	2023-07-25 19:33:57 UTC (rev 67729)
+++ trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md	2023-07-25 19:34:11 UTC (rev 67730)
@@ -7,6 +7,13 @@
 
 ## [Unreleased]
 
+## [v3.2.8] - 2023-07-25
+
+### Fixed
+- Suppression of leading `1` when `per-mode = symbol` is used with
+  non-repeated units ranges (see issue
+  [\#677](https://github.com/josephwright/siunitx/issues/677))
+
 ## [v3.2.7] - 2023-07-20
 
 ### Fixed
@@ -1914,7 +1921,8 @@
 ### Added
 - First public testing release (as `si`)
 
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.2.7...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.2.8...HEAD
+[v3.2.8]: https://github.com/josephwright/siunitx/compare/v3.2.7...v3.2.8
 [v3.2.7]: https://github.com/josephwright/siunitx/compare/v3.2.6...v3.2.7
 [v3.2.6]: https://github.com/josephwright/siunitx/compare/v3.2.5...v3.2.6
 [v3.2.5]: https://github.com/josephwright/siunitx/compare/v3.2.4...v3.2.5

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-compound.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-compound.dtx	2023-07-25 19:33:57 UTC (rev 67729)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-compound.dtx	2023-07-25 19:34:11 UTC (rev 67730)
@@ -337,7 +337,6 @@
 %     \l_@@_exp_bracket_bool    ,
 %     \l_@@_exp_combine_bool    ,
 %     \l_@@_unit_bracket_bool   ,
-%     \l_@@_unit_repeat_bool    ,
 %     \l_@@_unit_repeat_bool
 %   }
 %   List options.
@@ -667,7 +666,9 @@
 %
 % \begin{macro}{\siunitx_compound_quantity:nn}
 %   For quantities, life is more complex as there are interactions between the
-%   options for exponents and units.
+%   options for exponents and units. The \cs{c_empty_tl} suppresses any
+%   leading \texttt{1} if the unit starts \cs{per}; the \pkg{siunitx-print}
+%   module will skip any printing in this case.
 %    \begin{macrocode}
 \cs_new_protected:Npn \siunitx_compound_quantity:nn #1#2
   {
@@ -698,7 +699,7 @@
               \siunitx_print_number:V \l_@@_bracket_close_tl
             }
             { \@@_print:N \siunitx_print_number:x }
-          \@@_print_quantity:n { }
+          \@@_print_quantity:n { \c_empty_tl }
         }
     \group_end:
   }

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx	2023-07-25 19:33:57 UTC (rev 67729)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx	2023-07-25 19:34:11 UTC (rev 67730)
@@ -2619,7 +2619,8 @@
 %   }
 %  \begin{macro}[EXP]{\@@_round_auxiv:nnN, \@@_round_auxv:nnN}
 %  \begin{macro}[EXP]{\@@_round_auxvi:nN}
-%  \begin{macro}[EXP]{\@@_round_auxvii:nnN, \@@_round_auxviii:nnN}
+%  \begin{macro}[EXP]{\@@_round_auxvii:nnTF}
+%  \begin{macro}[EXP]{\@@_round_auxviii:nnN, \@@_round_auxix:nnN}
 %  \begin{macro}[EXP]{\@@_round_final_integer:nnw, \@@_round_final_decimal:nnw}
 %  \begin{macro}[EXP]{\@@_round_final_signicant:n}
 %  \begin{macro}[EXP]{\@@_round_final_signicant:N}
@@ -2731,18 +2732,9 @@
         \@@_round_auxvi:nnN
           {#1} { } #2 \q_recursion_tail \q_recursion_stop
       }
-    \bool_lazy_or:nnTF
-      { \int_compare_p:nNn { 0 \tl_head:n {#1} } < 5 }
-      {
-        \bool_lazy_all_p:n
-          {
-            { \l_@@_round_half_even_bool }
-            { ! \int_if_odd_p:n {#3} }
-            { \@@_round_if_half_p:n {#1} }
-          }
-      }
+    \@@_round_auxvii:nnTF {#1} {#3}
       { \@@_round_final_decimal:nnw }
-      { \@@_round_auxvii:nnN }
+      { \@@_round_auxviii:nnN }
         {#2} { } #3
   }
 \cs_new:Npn \@@_round_auxvi:nnN #1#2#3
@@ -2749,6 +2741,13 @@
   {
     \quark_if_recursion_tail_stop_do:Nn #3
       { { 0 } { } }
+    \@@_round_auxvii:nnTF {#1} {#3}
+      { \@@_round_final_integer:nnw }
+      { \@@_round_auxix:nnN }
+        { } {#2} #3
+  }
+\cs_new:Npn \@@_round_auxvii:nnTF #1#2
+  {
     \bool_lazy_or:nnTF
       { \int_compare_p:nNn { 0 \tl_head:n {#1} } < 5 }
       {
@@ -2755,13 +2754,10 @@
         \bool_lazy_all_p:n
           {
             { \l_@@_round_half_even_bool }
-            { ! \int_if_odd_p:n {#3} }
+            { ! \int_if_odd_p:n {#2} }
             { \@@_round_if_half_p:n {#1} }
           }
       }
-      { \@@_round_final_integer:nnw }
-      { \@@_round_auxviii:nnN }
-        { } {#2} #3
   }
 %    \end{macrocode}
 %   The main rounding routines. These are only every called when there is
@@ -2771,7 +2767,7 @@
 %   where a zero is rounded up: that automatically means a need to trim
 %   the other end.
 %    \begin{macrocode}
-\cs_new:Npn \@@_round_auxvii:nnN #1#2#3
+\cs_new:Npn \@@_round_auxviii:nnN #1#2#3
   {
     \quark_if_recursion_tail_stop_do:Nn #3
       {
@@ -2782,12 +2778,12 @@
               { \@@_round_truncate:n {#2} }
           }
           {
-            \@@_round_auxviii:nnN {#2} { } #1
+            \@@_round_auxix:nnN {#2} { } #1
               \q_recursion_tail \q_recursion_stop
           }
       }
     \int_compare:nNnTF {#3} = 9
-      { \@@_round_auxvii:nnN {#1} { 0 #2 } }
+      { \@@_round_auxviii:nnN {#1} { 0 #2 } }
       {
         \int_compare:nNnTF {#3} = 0
           {
@@ -2810,7 +2806,7 @@
           }
       }
   }
-\cs_new:Npn \@@_round_auxviii:nnN #1#2#3
+\cs_new:Npn \@@_round_auxix:nnN #1#2#3
   {
     \quark_if_recursion_tail_stop_do:Nn #3
       {
@@ -2830,7 +2826,7 @@
           }
       }
     \int_compare:nNnTF {#3} = 9
-      { \@@_round_auxviii:nnN {#1} { 0 #2 } }
+      { \@@_round_auxix:nnN {#1} { 0 #2 } }
       {
         \@@_round_final:fn
           { \int_eval:n { #3 + 1 } }
@@ -2985,6 +2981,7 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
+% \end{macro}
 %
 % \begin{macro}[EXP]{\@@_round_if_half_p:n}
 % \begin{macro}[EXP]{\@@_round_if_half:N}

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx	2023-07-25 19:33:57 UTC (rev 67729)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx	2023-07-25 19:34:11 UTC (rev 67730)
@@ -106,7 +106,8 @@
 %   roman font, and |^| and |_| will typically be used to indicate super- and
 %   subscripts, respectively. These elements will be correctly handled when
 %   printing for example using |\mathsf| in math mode, or using only text
-%   fonts.
+%   fonts. No printing takes place if the \cs{material} is entirely empty
+%   after a single expansion.
 % \end{function}
 %
 % \begin{function}
@@ -120,7 +121,8 @@
 %   with a fixed text or math mode output. The printing does \emph{not} set
 %   color (which is managed on a |unit|/|number| basis), but otherwise sets
 %   the font as described above. The |match| function uses either the prevailing
-%   math or text mode.
+%   math or text mode. No printing takes place if the \cs{material} is entirely
+%   empty after a single expansion.
 % \end{function}
 %
 % \subsection{Key--value options}
@@ -449,7 +451,10 @@
 %   }
 % \begin{macro}{\@@_aux:nn}
 %   The main printing function doesn't actually need to do very much: just set
-%   the color and select the correct sub-function.
+%   the color and select the correct sub-function. The \cs{tl_if_empty:oF} is
+%   needed to allow a leading \texttt{1} to be omitted in the case of a unit
+%   starting \cs{per} in cases where we can't simply use an entirely empty
+%   value: see the \pkg{siunitx-compound} submodule.
 %    \begin{macrocode}
 \cs_new_protected:Npn \siunitx_print_number:n #1
   { \@@_aux:nn { number } {#1} }
@@ -459,17 +464,20 @@
 \cs_generate_variant:Nn \siunitx_print_unit:n { V , x }
 \cs_new_protected:Npn \@@_aux:nn #1#2
   {
-    \tl_if_empty:cTF { l_@@_ #1 _color_tl }
-      { \use:n }
-      { \exp_args:Nv \textcolor { l_@@_ #1 _color_tl } }
-        {
-          \use:c
+    \tl_if_empty:oF {#2}
+      {
+        \tl_if_empty:cTF { l_@@_ #1 _color_tl }
+          { \use:n }
+          { \exp_args:Nv \textcolor { l_@@_ #1 _color_tl } }
             {
-              siunitx_print_
-              \tl_use:c { l_@@_ #1 _mode_tl } :n
+              \use:c
+                {
+                  siunitx_print_
+                  \tl_use:c { l_@@_ #1 _mode_tl } :n
+                }
+                  {#2}
             }
-              {#2}
-        }
+      }
   }
 %    \end{macrocode}
 % \end{macro}

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2023-07-25 19:33:57 UTC (rev 67729)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2023-07-25 19:34:11 UTC (rev 67730)
@@ -122,7 +122,7 @@
 %
 % Identify the package and give the over all version information.
 %    \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2023-07-20} {3.2.7}
+\ProvidesExplPackage {siunitx} {2023-07-25} {3.2.8}
   {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	2023-07-25 19:33:57 UTC (rev 67729)
+++ trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty	2023-07-25 19:34:11 UTC (rev 67730)
@@ -42,7 +42,7 @@
       }%
     \endinput
   }%
-\ProvidesExplPackage {siunitx} {2023-07-20} {3.2.7}
+\ProvidesExplPackage {siunitx} {2023-07-25} {3.2.8}
   {A comprehensive (SI) units package}
 \msg_new:nnnn { siunitx } { incompatible-package }
   { Package~'#1'~incompatible. }
@@ -1398,7 +1398,7 @@
               \siunitx_print_number:V \l__siunitx_compound_bracket_close_tl
             }
             { \__siunitx_compound_print:N \siunitx_print_number:x }
-          \__siunitx_compound_print_quantity:n { }
+          \__siunitx_compound_print_quantity:n { \c_empty_tl }
         }
     \group_end:
   }
@@ -3056,18 +3056,9 @@
         \__siunitx_number_round_auxvi:nnN
           {#1} { } #2 \q_recursion_tail \q_recursion_stop
       }
-    \bool_lazy_or:nnTF
-      { \int_compare_p:nNn { 0 \tl_head:n {#1} } < 5 }
-      {
-        \bool_lazy_all_p:n
-          {
-            { \l__siunitx_number_round_half_even_bool }
-            { ! \int_if_odd_p:n {#3} }
-            { \__siunitx_number_round_if_half_p:n {#1} }
-          }
-      }
+    \__siunitx_number_round_auxvii:nnTF {#1} {#3}
       { \__siunitx_number_round_final_decimal:nnw }
-      { \__siunitx_number_round_auxvii:nnN }
+      { \__siunitx_number_round_auxviii:nnN }
         {#2} { } #3
   }
 \cs_new:Npn \__siunitx_number_round_auxvi:nnN #1#2#3
@@ -3074,6 +3065,13 @@
   {
     \quark_if_recursion_tail_stop_do:Nn #3
       { { 0 } { } }
+    \__siunitx_number_round_auxvii:nnTF {#1} {#3}
+      { \__siunitx_number_round_final_integer:nnw }
+      { \__siunitx_number_round_auxix:nnN }
+        { } {#2} #3
+  }
+\cs_new:Npn \__siunitx_number_round_auxvii:nnTF #1#2
+  {
     \bool_lazy_or:nnTF
       { \int_compare_p:nNn { 0 \tl_head:n {#1} } < 5 }
       {
@@ -3080,15 +3078,12 @@
         \bool_lazy_all_p:n
           {
             { \l__siunitx_number_round_half_even_bool }
-            { ! \int_if_odd_p:n {#3} }
+            { ! \int_if_odd_p:n {#2} }
             { \__siunitx_number_round_if_half_p:n {#1} }
           }
       }
-      { \__siunitx_number_round_final_integer:nnw }
-      { \__siunitx_number_round_auxviii:nnN }
-        { } {#2} #3
   }
-\cs_new:Npn \__siunitx_number_round_auxvii:nnN #1#2#3
+\cs_new:Npn \__siunitx_number_round_auxviii:nnN #1#2#3
   {
     \quark_if_recursion_tail_stop_do:Nn #3
       {
@@ -3099,12 +3094,12 @@
               { \__siunitx_number_round_truncate:n {#2} }
           }
           {
-            \__siunitx_number_round_auxviii:nnN {#2} { } #1
+            \__siunitx_number_round_auxix:nnN {#2} { } #1
               \q_recursion_tail \q_recursion_stop
           }
       }
     \int_compare:nNnTF {#3} = 9
-      { \__siunitx_number_round_auxvii:nnN {#1} { 0 #2 } }
+      { \__siunitx_number_round_auxviii:nnN {#1} { 0 #2 } }
       {
         \int_compare:nNnTF {#3} = 0
           {
@@ -3127,7 +3122,7 @@
           }
       }
   }
-\cs_new:Npn \__siunitx_number_round_auxviii:nnN #1#2#3
+\cs_new:Npn \__siunitx_number_round_auxix:nnN #1#2#3
   {
     \quark_if_recursion_tail_stop_do:Nn #3
       {
@@ -3147,7 +3142,7 @@
           }
       }
     \int_compare:nNnTF {#3} = 9
-      { \__siunitx_number_round_auxviii:nnN {#1} { 0 #2 } }
+      { \__siunitx_number_round_auxix:nnN {#1} { 0 #2 } }
       {
         \__siunitx_number_round_final:fn
           { \int_eval:n { #3 + 1 } }
@@ -4513,17 +4508,20 @@
 \cs_generate_variant:Nn \siunitx_print_unit:n { V , x }
 \cs_new_protected:Npn \__siunitx_print_aux:nn #1#2
   {
-    \tl_if_empty:cTF { l__siunitx_print_ #1 _color_tl }
-      { \use:n }
-      { \exp_args:Nv \textcolor { l__siunitx_print_ #1 _color_tl } }
-        {
-          \use:c
+    \tl_if_empty:oF {#2}
+      {
+        \tl_if_empty:cTF { l__siunitx_print_ #1 _color_tl }
+          { \use:n }
+          { \exp_args:Nv \textcolor { l__siunitx_print_ #1 _color_tl } }
             {
-              siunitx_print_
-              \tl_use:c { l__siunitx_print_ #1 _mode_tl } :n
+              \use:c
+                {
+                  siunitx_print_
+                  \tl_use:c { l__siunitx_print_ #1 _mode_tl } :n
+                }
+                  {#2}
             }
-              {#2}
-        }
+      }
   }
 \cs_new_protected:Npn \siunitx_print_match:n #1
   {



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