texlive[69590] Master/texmf-dist: siunitx (25jan24)

commits+karl at tug.org commits+karl at tug.org
Thu Jan 25 22:22:29 CET 2024


Revision: 69590
          https://tug.org/svn/texlive?view=revision&revision=69590
Author:   karl
Date:     2024-01-25 22:22:29 +0100 (Thu, 25 Jan 2024)
Log Message:
-----------
siunitx (25jan24)

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-print.dtx
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex
    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-01-25 21:22:18 UTC (rev 69589)
+++ trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md	2024-01-25 21:22:29 UTC (rev 69590)
@@ -7,6 +7,17 @@
 
 ## [Unreleased]
 
+## [v3.3.10] - 2024-01-25
+
+### Changed
+- Load `color` package in `begindocument/before` hook
+- Normalize exponents when `exponent-mode = threshold` (see issue
+  [\#716](https://github.com/josephwright/siunitx/issues/711))
+
+### Fixed
+- Prevent accidental expansion of `\mathord` (see issue
+  [\#716](https://github.com/josephwright/siunitx/issues/716))
+
 ## [v3.3.9] - 2023-11-14
 
 ### Fixed
@@ -2049,7 +2060,8 @@
 ### Added
 - First public testing release (as `si`)
 
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.3.9...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.3.10...HEAD
+[v3.3.10]: https://github.com/josephwright/siunitx/compare/v3.3.9...v3.3.10
 [v3.3.9]: https://github.com/josephwright/siunitx/compare/v3.3.8...v3.3.9
 [v3.3.8]: https://github.com/josephwright/siunitx/compare/v3.3.7...v3.3.8
 [v3.3.7]: https://github.com/josephwright/siunitx/compare/v3.3.6...v3.3.7

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-01-25 21:22:18 UTC (rev 69589)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx	2024-01-25 21:22:29 UTC (rev 69590)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% File: siunitx-number.dtx Copyright (C) 2014-2019,2021-2023 Joseph Wright
+% File: siunitx-number.dtx Copyright (C) 2014-2019,2021-2024 Joseph Wright
 %
 % It may be distributed and/or modified under the conditions of the
 % LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -2273,9 +2273,9 @@
 %  \begin{macro}[EXP]{\@@_exponent_engineering:nnNw}
 %  \begin{macro}[EXP]{\@@_exponent_engineering_uncert:nn}
 %  \begin{macro}[EXP]{\@@_exponent_engineering_uncert_S:nnn}
-%  \begin{macro}[EXP]{\@@_exponent_threshold:nnnnnnn}
-%  \begin{macro}[EXP]{\@@_exponent_threshold:nn, \@@_exponent_threshold:en}
-%  \begin{macro}[EXP]{\@@_exponent_threshold:nnnnnnnn}
+%  \begin{macro}[EXP]
+%    {\@@_exponent_threshold:nnnnnnn, \@@_exponent_threshold_aux:nnnnnnn}
+%  \begin{macro}[EXP]{\@@_exponent_threshold:n, \@@_exponent_threshold:e}
 %   Manipulating an exponent is done using a single expansion function
 %   \emph{unless} dealing with engineering-style output. The latter is easier
 %   to handle by first converting to scientific output, then post-processing.
@@ -2582,22 +2582,27 @@
 %    \begin{macrocode}
 \cs_new:Npn \@@_exponent_threshold:nnnnnnn #1#2#3#4#5#6#7
   {
-    \@@_exponent_threshold:en
+    \@@_exponent_threshold:e
       {
         \@@_exponent_scientific:nnnnnnn
           {#1} {#2} {#3} {#4} {#5} {#6} {#7}
       }
-      { {#1} {#2} {#3} {#4} {#5} {#6} {#7} }
   }
-\cs_new:Npn \@@_exponent_threshold:nn #1#2
-  { \@@_exponent_threshold:nnnnnnnn #1 {#2} }
-\cs_generate_variant:Nn \@@_exponent_threshold:nn { e }
-\cs_new:Npn \@@_exponent_threshold:nnnnnnnn #1#2#3#4#5#6#7#8
+\cs_new:Npn \@@_exponent_threshold:n #1
+  { \@@_exponent_threshold_aux:nnnnnnn #1 }
+\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 }
-      { \exp_not:n {#8} }
+      {
+        \exp_not:n { {#1} {#2} }
+        \@@_exponent_shift:nnn { -#6#7 } {#3} {#4}
+        \@@_exponent_uncert:n {#5}
+        { }
+        { 0 }
+      }
       { \exp_not:n { {#1} {#2} {#3} {#4} {#5} {#6} {#7} } }
   }
 %    \end{macrocode}
@@ -2623,7 +2628,6 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
-% \end{macro}
 %
 % \begin{macro}{\@@_digits:NN}
 % \begin{macro}[EXP]{\@@_digits:nnnnnnn}
@@ -4117,7 +4121,7 @@
   {
     \tl_if_blank:nTF {#1}
       { \use:n }
-      { \mathord }
+      { \exp_not:N \mathord }
         { \exp_not:n {#2} }
   }
 \cs_new:Npn
@@ -4520,7 +4524,7 @@
   {
     \exp_not:n {#2}
     \bool_if:NTF \l_@@_tight_bool
-      { \mathord }
+      { \exp_not:N \mathord }
       { \use:n }
         { \exp_not:n { \pm } }
     \exp_not:n {#2}

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx	2024-01-25 21:22:18 UTC (rev 69589)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx	2024-01-25 21:22:29 UTC (rev 69590)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% File: siunitx-print.dtx Copyright (C) 2016-2019,2021-2023 Joseph Wright
+% File: siunitx-print.dtx Copyright (C) 2016-2019,2021-2024 Joseph Wright
 %
 % It may be distributed and/or modified under the conditions of the
 % LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -344,7 +344,10 @@
 % Color support is always required; to avoid a potential clash we delay to
 % the start of the document.
 %    \begin{macrocode}
-\AtBeginDocument { \RequirePackage { color } }
+\cs_if_exist:NTF \hook_gput_code:nnn
+  { \hook_gput_code:nnn { begindocument / before } { siunitx } }
+  { \AtBeginDocument }
+    { \RequirePackage { color } }
 %    \end{macrocode}
 %
 %   Required variants.

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2024-01-25 21:22:18 UTC (rev 69589)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2024-01-25 21:22:29 UTC (rev 69590)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% File: siunitx.dtx Copyright (C) 2008-2019,2021-2023 Joseph Wright
+% File: siunitx.dtx Copyright (C) 2008-2019,2021-2024 Joseph Wright
 %
 % It may be distributed and/or modified under the conditions of the
 % LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -121,7 +121,7 @@
 %
 % Identify the package and give the over all version information.
 %    \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2023-11-14} {3.3.9}
+\ProvidesExplPackage {siunitx} {2024-01-25} {3.3.10}
   {A comprehensive (SI) units package}
 %    \end{macrocode}
 %

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex	2024-01-25 21:22:18 UTC (rev 69589)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex	2024-01-25 21:22:29 UTC (rev 69590)
@@ -1,6 +1,6 @@
 \iffalse meta-comment
 
-File: siunitx.tex Copyright (C) 2014-2023 Joseph Wright
+File: siunitx.tex Copyright (C) 2014-2024 Joseph Wright
 
 It may be distributed and/or modified under the conditions of the
 LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -475,7 +475,7 @@
     \cs{qtyproduct}\oarg{options}\marg{numbers}\marg{unit}
   \end{syntax}
 \end{function}
-Runs of products of of numbers with units can be handled using the
+Runs of products of numbers with units can be handled using the
 \cs{qtyproduct} function. The behaviour of this function is similar to
 \cs{numproduct}, but with the addition of a unit to each number.
 \begin{LaTeXdemo}
@@ -1527,11 +1527,9 @@
 \end{LaTeXdemo}
 \DescribeOption{exponent-thresholds}
 When the \opt{exponent-mode} is set to \opt{threshold}, values outside of a
-threshold range for the exponent are always printed in scientific form. Within
-the threshold, they are printed as-given in the input: typically this would be
-without an exponent. The threshold range itself is controlled by
-\opt{exponent-thresholds}, which is given as
-\texttt{\meta{min}:\meta{max}} (Table~\ref{tab:threshold}).
+threshold range for the exponent are always printed in scientific form. The
+threshold range itself is controlled by \opt{exponent-thresholds}, which is
+given as \texttt{\meta{min}:\meta{max}} (Table~\ref{tab:threshold}).
 \begin{LaTeXdemo}[code and float]
   \begin{table}
     \caption{Thresholds for exponents.%

Modified: trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty	2024-01-25 21:22:18 UTC (rev 69589)
+++ trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty	2024-01-25 21:22:29 UTC (rev 69590)
@@ -41,7 +41,7 @@
       }%
     \endinput
   }%
-\ProvidesExplPackage {siunitx} {2023-11-14} {3.3.9}
+\ProvidesExplPackage {siunitx} {2024-01-25} {3.3.10}
   {A comprehensive (SI) units package}
 \msg_new:nnnn { siunitx } { incompatible-package }
   { Package~'#1'~incompatible. }
@@ -1229,22 +1229,27 @@
   }
 \cs_new:Npn \__siunitx_number_exponent_threshold:nnnnnnn #1#2#3#4#5#6#7
   {
-    \__siunitx_number_exponent_threshold:en
+    \__siunitx_number_exponent_threshold:e
       {
         \__siunitx_number_exponent_scientific:nnnnnnn
           {#1} {#2} {#3} {#4} {#5} {#6} {#7}
       }
-      { {#1} {#2} {#3} {#4} {#5} {#6} {#7} }
   }
-\cs_new:Npn \__siunitx_number_exponent_threshold:nn #1#2
-  { \__siunitx_number_exponent_threshold:nnnnnnnn #1 {#2} }
-\cs_generate_variant:Nn \__siunitx_number_exponent_threshold:nn { e }
-\cs_new:Npn \__siunitx_number_exponent_threshold:nnnnnnnn #1#2#3#4#5#6#7#8
+\cs_new:Npn \__siunitx_number_exponent_threshold:n #1
+  { \__siunitx_number_exponent_threshold_aux:nnnnnnn #1 }
+\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 }
-      { \exp_not:n {#8} }
+      {
+        \exp_not:n { {#1} {#2} }
+        \__siunitx_number_exponent_shift:nnn { -#6#7 } {#3} {#4}
+        \__siunitx_number_exponent_uncert:n {#5}
+        { }
+        { 0 }
+      }
       { \exp_not:n { {#1} {#2} {#3} {#4} {#5} {#6} {#7} } }
   }
 \cs_new_protected:Npn \__siunitx_number_digits:NN #1#2
@@ -2240,7 +2245,7 @@
   {
     \tl_if_blank:nTF {#1}
       { \use:n }
-      { \mathord }
+      { \exp_not:N \mathord }
         { \exp_not:n {#2} }
   }
 \cs_new:Npn
@@ -2585,7 +2590,7 @@
   {
     \exp_not:n {#2}
     \bool_if:NTF \l__siunitx_number_tight_bool
-      { \mathord }
+      { \exp_not:N \mathord }
       { \use:n }
         { \exp_not:n { \pm } }
     \exp_not:n {#2}
@@ -4733,7 +4738,10 @@
   }
 \RequirePackage { amstext }
 \cs_new_eq:NN \__siunitx_print_ams_text:n \text
-\AtBeginDocument { \RequirePackage { color } }
+\cs_if_exist:NTF \hook_gput_code:nnn
+  { \hook_gput_code:nnn { begindocument / before } { siunitx } }
+  { \AtBeginDocument }
+    { \RequirePackage { color } }
 \cs_generate_variant:Nn \tl_replace_all:Nnn { NV }
 \tl_new:N \l__siunitx_print_tmp_tl
 \tl_new:N \l__siunitx_print_number_mode_tl



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