texlive[69915] Master/texmf-dist: siunitx (15feb24)

commits+karl at tug.org commits+karl at tug.org
Fri Feb 16 22:10:11 CET 2024


Revision: 69915
          https://tug.org/svn/texlive?view=revision&revision=69915
Author:   karl
Date:     2024-02-16 22:10:11 +0100 (Fri, 16 Feb 2024)
Log Message:
-----------
siunitx (15feb24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md
    trunk/Master/texmf-dist/doc/latex/siunitx/README.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-unit.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-02-16 21:10:01 UTC (rev 69914)
+++ trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md	2024-02-16 21:10:11 UTC (rev 69915)
@@ -7,6 +7,19 @@
 
 ## [Unreleased]
 
+## [v3.3.12] - 2024-02-15
+
+### Fixed
+- Normalize active `<`/`>`in numerical input (see issue
+  [\#355](https://github.com/josephwright/siunitx/issues/355))
+- Allow for `\protect` inside symbolic units (see issue
+  [\#443](https://github.com/josephwright/siunitx/issues/443))
+- Do not error for entirely empty numerical input (see issue
+  [\#539](https://github.com/josephwright/siunitx/issues/539))
+- Print all numerical material in math mode when
+  `parse-numbers = false` is set (see issue
+  [\#721](https://github.com/josephwright/siunitx/issues/721))
+
 ## [v3.3.11] - 2024-02-07
 
 ### Fixed
@@ -2067,7 +2080,8 @@
 ### Added
 - First public testing release (as `si`)
 
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.3.11...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.3.12...HEAD
+[v3.3.12]: https://github.com/josephwright/siunitx/compare/v3.3.11...v3.3.12
 [v3.3.11]: https://github.com/josephwright/siunitx/compare/v3.3.10...v3.3.11
 [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

Modified: trunk/Master/texmf-dist/doc/latex/siunitx/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/siunitx/README.md	2024-02-16 21:10:01 UTC (rev 69914)
+++ trunk/Master/texmf-dist/doc/latex/siunitx/README.md	2024-02-16 21:10:11 UTC (rev 69915)
@@ -21,4 +21,4 @@
 
 ## License
 
-Released under the LaTeX Project Public License v1.3c or later. See http://www.latex-project.org/lppl.txt
\ No newline at end of file
+Released under the LaTeX Project Public License v1.3c or later. See https://www.latex-project.org/lppl.txt
\ No newline at end of file

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-02-16 21:10:01 UTC (rev 69914)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx	2024-02-16 21:10:11 UTC (rev 69915)
@@ -764,9 +764,12 @@
       \bool_if:NTF \l_siunitx_number_parse_bool
         {
           \siunitx_number_parse:nN {#1} \l_@@_parsed_tl
-          \siunitx_number_process:NN \l_@@_parsed_tl \l_@@_parsed_tl
-          \tl_set:Nx \l_@@_outputted_tl
-            { \siunitx_number_output:N \l_@@_parsed_tl }
+          \tl_if_empty:NF \l_@@_parsed_tl
+            {
+              \siunitx_number_process:NN \l_@@_parsed_tl \l_@@_parsed_tl
+              \tl_set:Nx \l_@@_outputted_tl
+                { \siunitx_number_output:N \l_@@_parsed_tl }
+            }
         }
         { \tl_set:Nn \l_@@_outputted_tl { \ensuremath {#1} } }
     \exp_args:NNNV \group_end:
@@ -978,16 +981,16 @@
 %
 % \begin{macro}{\siunitx_number_normalize_symbols:N}
 % \begin{macro}{\@@_normalize_aux:nN}
-% \begin{macro}{\@@_normalize_sign:N}
+% \begin{macro}{\@@_normalize_actives:N}
 % \begin{variable}{\c_@@_normalize_tl}
-%   There are two parts to the replacement code. First, any active
-%   hyphens signs are normalised: these can come up with some packages and
+%   There are two parts to the replacement code. First, any actives
+%   are normalised: these can come up with some packages and
 %   cause issues. Multi-token signs then are converted to the single token
 %   equivalents so that everything else can work on a one token basis.
 %    \begin{macrocode}
 \cs_new_protected:Npn \siunitx_number_normalize_symbols:N #1
   {
-    \@@_normalize_minus:N #1
+    \@@_normalize_actives:N #1
     \exp_after:wN \@@_normalize_aux:NnN \exp_after:wN #1
       \c_@@_normalize_tl
       { ? } \q_recursion_tail
@@ -1010,10 +1013,16 @@
   }
 \group_begin:
   \char_set_catcode_active:N \-
-  \cs_new_protected:Npx \@@_normalize_minus:N #1
+  \char_set_catcode_active:N \<
+  \char_set_catcode_active:N \>
+  \cs_new_protected:Npx \@@_normalize_actives:N #1
     {
       \tl_replace_all:Nnn #1
         { \exp_not:N - }  { \token_to_str:N - }
+      \tl_replace_all:Nnn #1
+        { \exp_not:N < }  { \token_to_str:N < }
+      \tl_replace_all:Nnn #1
+        { \exp_not:N > }  { \token_to_str:N > }
     }
 \group_end:
 %    \end{macrocode}
@@ -1059,8 +1068,10 @@
       \tl_map_inline:Nn \l_@@_input_ignore_tl
         { \tl_remove_all:Nn \l_@@_arg_tl {##1} }
       \tl_if_empty:NF \l_@@_arg_tl
-        { \@@_parse_comparator: }
-      \@@_parse_check:
+        {
+          \@@_parse_comparator:
+          \@@_parse_check:
+        }
     \exp_args:NNNV \group_end:
     \tl_set:Nn #2 \l_@@_parsed_tl
   }

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx	2024-02-16 21:10:01 UTC (rev 69914)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx	2024-02-16 21:10:11 UTC (rev 69915)
@@ -344,8 +344,8 @@
 % Color support is always required; to avoid a potential clash we delay to
 % the start of the document.
 %    \begin{macrocode}
-\cs_if_exist:NTF \hook_gput_code:nnn
-  { \hook_gput_code:nnn { begindocument / before } { siunitx } }
+\cs_if_exist:NTF \AddToHook
+  { \AddToHook { begindocument / before } }
   { \AtBeginDocument }
     { \RequirePackage { color } }
 %    \end{macrocode}
@@ -466,6 +466,7 @@
 %       \siunitx_print_unit:o
 %   }
 % \begin{macro}{\@@_aux:nn}
+% \begin{macro}{\@@_number:n, \@@_unit:n}
 %   The main printing function doesn't actually need to do very much: just set
 %   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
@@ -485,19 +486,22 @@
         \tl_if_empty:cTF { l_@@_ #1 _color_tl }
           { \use:n }
           { \ExpandArgs { v } \textcolor { l_@@_ #1 _color_tl } }
-            {
-              \use:c
-                {
-                  siunitx_print_
-                  \tl_use:c { l_@@_ #1 _mode_tl } :n
-                }
-                  {#2}
-            }
+            { \use:c { @@ _ #1 :n } {#2} }
       }
   }
+\cs_new_protected:Npn \@@_number:n #1
+  {
+    \bool_if:NTF \l_siunitx_number_parse_bool
+      { \use:c { siunitx_print_ \l_@@_number_mode_tl :n } }
+      { \siunitx_print_math:n }
+        {#1}
+  }
+\cs_new_protected:Npn \@@_unit:n #1
+  { \use:c { siunitx_print_ \l_@@_unit_mode_tl :n } {#1} }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
+% \end{macro}
 %
 % \begin{macro}{\siunitx_print_match:n}
 %   When the \emph{output} mode should match the input, a simple selection of

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx	2024-02-16 21:10:01 UTC (rev 69914)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx	2024-02-16 21:10:11 UTC (rev 69915)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% File: siunitx-unit.dtx Copyright (C) 2014-2023 Joseph Wright
+% File: siunitx-unit.dtx 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
@@ -770,7 +770,11 @@
 %   the approach used is to set all of the symbolic unit commands expandable
 %   and to do nothing, with the few special cases handled manually. We expand
 %   the input here twice: this handles the case where there is a mapping or
-%   similar in |#1| which returns its result in \cs{exp_not:n}.
+%   similar in |#1| which returns its result in \cs{exp_not:n}. In the second
+%   \tn{protected at edef}, changing the meaning of \tn{@unexpandable at protect}
+%   allows removal of a literal \cs{protect} at the top level before
+%   known symbolic entries: this deals with the case where the user has
+%   put in a \cs{protect} for some edge cases.
 %    \begin{macrocode}
 \prg_new_protected_conditional:Npnn \@@_if_symbolic:n #1 { TF }
   {
@@ -777,6 +781,13 @@
     \group_begin:
       \bool_set_true:N \l_@@_test_bool
       \protected at edef \l_@@_tmp_tl {#1}
+      \cs_set_eq:NN \@@_saved_ at unexpandable@protect: \@unexpandable at protect
+      \cs_set_nopar:Npn \@unexpandable at protect ##1
+        {
+          \cs_if_exist:cF { @@_ \token_to_str:N ##1 :w }
+            { \@@_saved_ at unexpandable@protect: }
+              ##1
+        }
       \protected at edef \l_@@_tmp_tl { \l_@@_tmp_tl }
     \exp_args:NNV \group_end:
     \tl_if_blank:nTF \l_@@_tmp_tl

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2024-02-16 21:10:01 UTC (rev 69914)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2024-02-16 21:10:11 UTC (rev 69915)
@@ -121,7 +121,7 @@
 %
 % Identify the package and give the over all version information.
 %    \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2024-02-07} {3.3.11}
+\ProvidesExplPackage {siunitx} {2024-02-15} {3.3.12}
   {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-02-16 21:10:01 UTC (rev 69914)
+++ trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty	2024-02-16 21:10:11 UTC (rev 69915)
@@ -41,7 +41,7 @@
       }%
     \endinput
   }%
-\ProvidesExplPackage {siunitx} {2024-02-07} {3.3.11}
+\ProvidesExplPackage {siunitx} {2024-02-15} {3.3.12}
   {A comprehensive (SI) units package}
 \msg_new:nnnn { siunitx } { incompatible-package }
   { Package~'#1'~incompatible. }
@@ -81,9 +81,12 @@
       \bool_if:NTF \l_siunitx_number_parse_bool
         {
           \siunitx_number_parse:nN {#1} \l__siunitx_number_parsed_tl
-          \siunitx_number_process:NN \l__siunitx_number_parsed_tl \l__siunitx_number_parsed_tl
-          \tl_set:Nx \l__siunitx_number_outputted_tl
-            { \siunitx_number_output:N \l__siunitx_number_parsed_tl }
+          \tl_if_empty:NF \l__siunitx_number_parsed_tl
+            {
+              \siunitx_number_process:NN \l__siunitx_number_parsed_tl \l__siunitx_number_parsed_tl
+              \tl_set:Nx \l__siunitx_number_outputted_tl
+                { \siunitx_number_output:N \l__siunitx_number_parsed_tl }
+            }
         }
         { \tl_set:Nn \l__siunitx_number_outputted_tl { \ensuremath {#1} } }
     \exp_args:NNNV \group_end:
@@ -150,7 +153,7 @@
 \bool_new:N \l__siunitx_number_validate_bool
 \cs_new_protected:Npn \siunitx_number_normalize_symbols:N #1
   {
-    \__siunitx_number_normalize_minus:N #1
+    \__siunitx_number_normalize_actives:N #1
     \exp_after:wN \__siunitx_number_normalize_aux:NnN \exp_after:wN #1
       \c__siunitx_number_normalize_tl
       { ? } \q_recursion_tail
@@ -173,10 +176,16 @@
   }
 \group_begin:
   \char_set_catcode_active:N \-
-  \cs_new_protected:Npx \__siunitx_number_normalize_minus:N #1
+  \char_set_catcode_active:N \<
+  \char_set_catcode_active:N \>
+  \cs_new_protected:Npx \__siunitx_number_normalize_actives:N #1
     {
       \tl_replace_all:Nnn #1
         { \exp_not:N - }  { \token_to_str:N - }
+      \tl_replace_all:Nnn #1
+        { \exp_not:N < }  { \token_to_str:N < }
+      \tl_replace_all:Nnn #1
+        { \exp_not:N > }  { \token_to_str:N > }
     }
 \group_end:
 \cs_new_protected:Npn \siunitx_number_parse:nN #1#2
@@ -208,8 +217,10 @@
       \tl_map_inline:Nn \l__siunitx_number_input_ignore_tl
         { \tl_remove_all:Nn \l__siunitx_number_arg_tl {##1} }
       \tl_if_empty:NF \l__siunitx_number_arg_tl
-        { \__siunitx_number_parse_comparator: }
-      \__siunitx_number_parse_check:
+        {
+          \__siunitx_number_parse_comparator:
+          \__siunitx_number_parse_check:
+        }
     \exp_args:NNNV \group_end:
     \tl_set:Nn #2 \l__siunitx_number_parsed_tl
   }
@@ -4741,8 +4752,8 @@
   }
 \RequirePackage { amstext }
 \cs_new_eq:NN \__siunitx_print_ams_text:n \text
-\cs_if_exist:NTF \hook_gput_code:nnn
-  { \hook_gput_code:nnn { begindocument / before } { siunitx } }
+\cs_if_exist:NTF \AddToHook
+  { \AddToHook { begindocument / before } }
   { \AtBeginDocument }
     { \RequirePackage { color } }
 \cs_generate_variant:Nn \tl_replace_all:Nnn { NV }
@@ -4817,16 +4828,18 @@
         \tl_if_empty:cTF { l__siunitx_print_ #1 _color_tl }
           { \use:n }
           { \ExpandArgs { v } \textcolor { l__siunitx_print_ #1 _color_tl } }
-            {
-              \use:c
-                {
-                  siunitx_print_
-                  \tl_use:c { l__siunitx_print_ #1 _mode_tl } :n
-                }
-                  {#2}
-            }
+            { \use:c { __siunitx_print _ #1 :n } {#2} }
       }
   }
+\cs_new_protected:Npn \__siunitx_print_number:n #1
+  {
+    \bool_if:NTF \l_siunitx_number_parse_bool
+      { \use:c { siunitx_print_ \l__siunitx_print_number_mode_tl :n } }
+      { \siunitx_print_math:n }
+        {#1}
+  }
+\cs_new_protected:Npn \__siunitx_print_unit:n #1
+  { \use:c { siunitx_print_ \l__siunitx_print_unit_mode_tl :n } {#1} }
 \cs_new_protected:Npn \siunitx_print_match:n #1
   {
     \mode_if_math:TF
@@ -6247,6 +6260,13 @@
     \group_begin:
       \bool_set_true:N \l__siunitx_unit_test_bool
       \protected at edef \l__siunitx_unit_tmp_tl {#1}
+      \cs_set_eq:NN \__siunitx_unit_saved_ at unexpandable@protect: \@unexpandable at protect
+      \cs_set_nopar:Npn \@unexpandable at protect ##1
+        {
+          \cs_if_exist:cF { __siunitx_unit_ \token_to_str:N ##1 :w }
+            { \__siunitx_unit_saved_ at unexpandable@protect: }
+              ##1
+        }
       \protected at edef \l__siunitx_unit_tmp_tl { \l__siunitx_unit_tmp_tl }
     \exp_args:NNV \group_end:
     \tl_if_blank:nTF \l__siunitx_unit_tmp_tl



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