texlive[59308] Master/texmf-dist: siunitx (22may21)

commits+karl at tug.org commits+karl at tug.org
Sat May 22 22:16:01 CEST 2021


Revision: 59308
          http://tug.org/svn/texlive?view=revision&revision=59308
Author:   karl
Date:     2021-05-22 22:16:01 +0200 (Sat, 22 May 2021)
Log Message:
-----------
siunitx (22may21)

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-table.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	2021-05-22 20:15:43 UTC (rev 59307)
+++ trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md	2021-05-22 20:16:01 UTC (rev 59308)
@@ -7,6 +7,15 @@
 
 ## [Unreleased]
 
+## [v3.0.4]
+
+### Changed
+- Standardise and document the position of `\color` in negative values
+  within the code-level API
+
+### Fixed
+- Alignment of integers in tables when `parse-numbers = tables` (issue #442)
+
 ## [v3.0.3]
 
 ### Changed
@@ -1280,7 +1289,8 @@
 ### Added
 - First public testing release (as `si`)
 
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.3...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.4...HEAD
+[v3.0.4]: https://github.com/josephwright/siunitx/compare/v3.0.3...v3.0.4
 [v3.0.3]: https://github.com/josephwright/siunitx/compare/v3.0.2...v3.0.3
 [v3.0.2]: https://github.com/josephwright/siunitx/compare/v3.0.1...v3.0.2
 [v3.0.1]: https://github.com/josephwright/siunitx/compare/v3.0.0...v3.0.1

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	2021-05-22 20:15:43 UTC (rev 59307)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx	2021-05-22 20:16:01 UTC (rev 59308)
@@ -68,7 +68,9 @@
 % \cs{color} is assumed to be available. Where the latter may apply, numbers
 % should be printed inside a group: note that \TeX{} grouping is not added
 % \emph{within} formatted numbers as they may need to be decomposed into parts
-% (see \cs{siunitx_number_output:NN}).
+% (see \cs{siunitx_number_output:NN}). Such a color will be the \emph{first}
+% part of the result, meaning that a test for an initial |\color| and following
+% brace group may be used to detect/remove/adjust this part.
 %
 % \section{Formatting numbers}
 %
@@ -3008,6 +3010,7 @@
   }
 \cs_new:Npn \@@_output:nnnnnnn #1#2#3#4#5#6#7#8
   {
+    \@@_output_color:n {#2}
     \@@_output_comparator:nn {#1} {#8}
     \@@_output_bracket:nn {#5} {#7}
     \@@_output_sign:nnn {#1} {#2} {#8}
@@ -3045,6 +3048,17 @@
     \@@_output_exponent:nnnn
   }
 %    \end{macrocode}
+%   As color for negative values applies to the \emph{whole} output, we have
+%   to deal with it before anything else. 
+%    \begin{macrocode}
+\cs_new:Npn \@@_output_color:n #1
+  {
+    \bool_lazy_and:nnT
+      { \str_if_eq_p:nn {#1} { - } }
+      { ! \tl_if_empty_p:N \l_@@_negative_color_tl }
+      { \exp_not:N \color { \exp_not:V \l_@@_negative_color_tl } }
+  }
+%    \end{macrocode}
 %   To get the spacing correct this needs to be an ordinary math character.
 %    \begin{macrocode}
 \cs_new:Npn \@@_output_comparator:nn #1#2
@@ -3055,11 +3069,11 @@
   }
 %    \end{macrocode}
 %   Formatting signs has to deal with some additional formatting requirements
-%   for negative numbers. Both making such numbers a fixed color and bracketing
-%   them needs some rearrangement of the order of tokens, which is set up in
-%   the main formatting macro by the dedicated do-nothing end function. We
-%   also have the comparator passed here: if it is present, we need to deal
-%   with tighter spacing.
+%   for negative numbers. Making such numbers by bracketing them needs some
+%   rearrangement of the order of tokens, which is set up in the main
+%   formatting macro by the dedicated do-nothing end function. We also have
+%   the comparator passed here: if it is present, we need to deal with
+%   tighter spacing.
 %    \begin{macrocode}
 \cs_new:Npn \@@_output_sign:nnn #1#2#3
   {
@@ -3071,8 +3085,6 @@
       {
         \str_if_eq:nnTF {#2} { - }
           {
-            \tl_if_empty:NF \l_@@_negative_color_tl
-              { \@@_output_sign_color:w }
             \bool_if:NTF \l_@@_bracket_negative_bool
               { \@@_output_sign_brackets:w }
               { \@@_output_sign:nN {#1} #2 }
@@ -3094,13 +3106,6 @@
       { \exp_not:n {#1} }
   }
 \cs_new:Npn
-  \@@_output_sign_color:w #1 \@@_output_end:
-  {
-    \exp_not:N \color { \exp_not:V \l_@@_negative_color_tl }
-    #1
-    \@@_output_end:
-  }
-\cs_new:Npn
   \@@_output_sign_brackets:w #1 \@@_output_end:
   {
     \exp_not:V \l_@@_bracket_open_tl

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx	2021-05-22 20:15:43 UTC (rev 59307)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-table.dtx	2021-05-22 20:16:01 UTC (rev 59308)
@@ -671,10 +671,11 @@
 %    \end{macrocode}
 % \end{variable}
 %
-% \begin{macro}{\@@_fil:}
-%    A primitive renamed.
+% \begin{macro}{\@@_fil:, \@@_fill:}
+%    Primitives renamed.
 %    \begin{macrocode}
 \cs_new_eq:NN \@@_fil: \tex_hfil:D
+\cs_new_eq:NN \@@_fill: \tex_hfill:D
 %    \end{macrocode}
 % \end{macro}
 %
@@ -695,10 +696,10 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_color_check:N #1
   { \exp_after:wN \@@_color_check:w #1 \q_stop }
-\cs_new_protected:Npn \@@_color_check:w #1 \q_nil #2 \q_nil #3 \q_stop
+\cs_new_protected:Npn \@@_color_check:w #1 \q_nil #2 \q_stop
   {
-    \tl_if_head_eq_meaning:nNT {#2} \color
-      { \@@_color_check:Nnw #2 \q_stop }
+    \tl_if_head_eq_meaning:nNT {#1} \color
+      { \@@_color_check:Nnw #1 \q_stop }
   }
 \cs_new_protected:Npn \@@_color_check:Nnw #1#2#3 \q_stop
   { \keys_set:nn { siunitx } { number-color = #2 } }
@@ -958,7 +959,6 @@
   {
     \tl_set:Nx \l_@@_tmp_tl
       { \siunitx_number_output:NN \l_@@_model_tl \q_nil }
-    \@@_color_check:N \l_@@_tmp_tl
     \exp_after:wN \@@_direct_format_aux:w
       \l_@@_tmp_tl \q_stop
   }
@@ -979,7 +979,7 @@
           \char_set_active_eq:NN ##1 \@@_direct_format_switch:
           \char_set_mathcode:nn { `##1 } { "8000 }
         }
-      \@@_fil:
+      \@@_fill:
   }
 \cs_new_protected:Npn \@@_direct_format_switch:
   {

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2021-05-22 20:15:43 UTC (rev 59307)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2021-05-22 20:16:01 UTC (rev 59308)
@@ -121,7 +121,7 @@
 %
 % Identify the package and give the over all version information.
 %    \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2021-05-20} {3.0.3}
+\ProvidesExplPackage {siunitx} {2021-05-21} {3.0.4}
   {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	2021-05-22 20:15:43 UTC (rev 59307)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex	2021-05-22 20:16:01 UTC (rev 59308)
@@ -1693,7 +1693,7 @@
 can be corrected by adding brackets in the appropriate place, and is controlled
 by the \opt{bracket-ambiguous-numbers} switch. This option only applies to pure
 numbers: when formatting quantities, the need for brackets also depends on the
-placement of units, so is controlled by \opt{seperate-uncertainty-units}.
+placement of units, so is controlled by \opt{separate-uncertainty-units}.
 \begin{LaTeXdemo}
   \sisetup{separate-uncertainty}
   \num{1.2(3)e4} \\
@@ -3147,7 +3147,6 @@
         S[
           table-format = 5.0,
           parse-numbers = false,
-          input-digits = .0123456789,
           input-decimal-markers = x
         ]
         @{}
@@ -3393,9 +3392,9 @@
 All other units within the \acro{SI} system are regarded as \enquote{derived}
 from the seven base units. At the most basic, all other \acro{SI} units can be
 expressed as combinations of the base units. However, many units (listed in
-Tables~\ref{tab:unit:derived} and~\ref{tab:unit:accepted}) have a special name
-and symbol. Most of these units are simple combinations of one or more base
-units (raised to powers as appropriate).
+Table~\ref{tab:unit:derived}) have a special name and symbol. Most of these
+units are simple combinations of one or more base units (raised to powers as
+appropriate).
 
 A series of \acro{SI} prefixes for decimal multiples and sub-multiples are
 provided, and can be used as modifiers for any \acro{SI} unit (either base or
@@ -3525,7 +3524,7 @@
 expression $[a]$ is the dimensions of $a$, \foreign{i.e.}~length per time
 squared in this case.} Much better is to show division of all quantities by the
 unit, which leaves the entries as unitless ratios. This is illustrated in
-Tables~\ref{tab:xmpl:unitless} and~\ref{fig:xmpl:unitless}.
+Table~\ref{tab:xmpl:unitless} and Figure~\ref{fig:xmpl:unitless}.
 \begin{LaTeXdemo}[code and float]
   \begin{table}
     \caption{An example of table labelling.%
@@ -3580,7 +3579,7 @@
  the titles are followed by \enquote{\unit{\kilo\gram}}!
 \begin{LaTeXdemo}[code and float]
   \begin{table}
-    \caption{Good and bad columns.%
+    \caption{Bad and good columns.%
       \label{tab:good}}
     \sisetup{table-number-alignment = center}
     \begin{tabular}{
@@ -3618,7 +3617,7 @@
 
 The package requires \LaTeX3 support as provided in the \pkg{l3kernel} and
 \pkg{l3packages} bundles. Both of these are included in \TeX{} Live and
-MiK\TeX{}, or are again available in ready-to-install from \acro{CTAN}.
+MiK\TeX{}, or are again available in ready-to-install form from \acro{CTAN}.
 
 \section{Thanks}
 

Modified: trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty	2021-05-22 20:15:43 UTC (rev 59307)
+++ trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty	2021-05-22 20:16:01 UTC (rev 59308)
@@ -42,7 +42,7 @@
       }%
     \endinput
   }%
-\ProvidesExplPackage {siunitx} {2021-05-20} {3.0.3}
+\ProvidesExplPackage {siunitx} {2021-05-21} {3.0.4}
   {A comprehensive (SI) units package}
 \msg_new:nnnn { siunitx } { incompatible-package }
   { Package~'#1'~incompatible. }
@@ -2985,6 +2985,7 @@
   }
 \cs_new:Npn \__siunitx_number_output:nnnnnnn #1#2#3#4#5#6#7#8
   {
+    \__siunitx_number_output_color:n {#2}
     \__siunitx_number_output_comparator:nn {#1} {#8}
     \__siunitx_number_output_bracket:nn {#5} {#7}
     \__siunitx_number_output_sign:nnn {#1} {#2} {#8}
@@ -3016,6 +3017,13 @@
     \exp_not:V \l__siunitx_number_bracket_close_tl
     \__siunitx_number_output_exponent:nnnn
   }
+\cs_new:Npn \__siunitx_number_output_color:n #1
+  {
+    \bool_lazy_and:nnT
+      { \str_if_eq_p:nn {#1} { - } }
+      { ! \tl_if_empty_p:N \l__siunitx_number_negative_color_tl }
+      { \exp_not:N \color { \exp_not:V \l__siunitx_number_negative_color_tl } }
+  }
 \cs_new:Npn \__siunitx_number_output_comparator:nn #1#2
   {
     \tl_if_blank:nF {#1}
@@ -3032,8 +3040,6 @@
       {
         \str_if_eq:nnTF {#2} { - }
           {
-            \tl_if_empty:NF \l__siunitx_number_negative_color_tl
-              { \__siunitx_number_output_sign_color:w }
             \bool_if:NTF \l__siunitx_number_bracket_negative_bool
               { \__siunitx_number_output_sign_brackets:w }
               { \__siunitx_number_output_sign:nN {#1} #2 }
@@ -3055,13 +3061,6 @@
       { \exp_not:n {#1} }
   }
 \cs_new:Npn
-  \__siunitx_number_output_sign_color:w #1 \__siunitx_number_output_end:
-  {
-    \exp_not:N \color { \exp_not:V \l__siunitx_number_negative_color_tl }
-    #1
-    \__siunitx_number_output_end:
-  }
-\cs_new:Npn
   \__siunitx_number_output_sign_brackets:w #1 \__siunitx_number_output_end:
   {
     \exp_not:V \l__siunitx_number_bracket_open_tl
@@ -4060,15 +4059,16 @@
 \box_new:N \l__siunitx_table_integer_box
 \box_new:N \l__siunitx_table_decimal_box
 \cs_new_eq:NN \__siunitx_table_fil: \tex_hfil:D
+\cs_new_eq:NN \__siunitx_table_fill: \tex_hfill:D
 \cs_new:Npn \__siunitx_table_cleanup_decimal:w
   #1 \q_nil #2 \q_nil #3 \q_nil #4 \q_nil #5 \q_nil #6 \q_nil #7 \q_nil
   { #1#2#3#4#5#6#7 }
 \cs_new_protected:Npn \__siunitx_table_color_check:N #1
   { \exp_after:wN \__siunitx_table_color_check:w #1 \q_stop }
-\cs_new_protected:Npn \__siunitx_table_color_check:w #1 \q_nil #2 \q_nil #3 \q_stop
+\cs_new_protected:Npn \__siunitx_table_color_check:w #1 \q_nil #2 \q_stop
   {
-    \tl_if_head_eq_meaning:nNT {#2} \color
-      { \__siunitx_table_color_check:Nnw #2 \q_stop }
+    \tl_if_head_eq_meaning:nNT {#1} \color
+      { \__siunitx_table_color_check:Nnw #1 \q_stop }
   }
 \cs_new_protected:Npn \__siunitx_table_color_check:Nnw #1#2#3 \q_stop
   { \keys_set:nn { siunitx } { number-color = #2 } }
@@ -4245,7 +4245,6 @@
   {
     \tl_set:Nx \l__siunitx_table_tmp_tl
       { \siunitx_number_output:NN \l__siunitx_table_model_tl \q_nil }
-    \__siunitx_table_color_check:N \l__siunitx_table_tmp_tl
     \exp_after:wN \__siunitx_table_direct_format_aux:w
       \l__siunitx_table_tmp_tl \q_stop
   }
@@ -4266,7 +4265,7 @@
           \char_set_active_eq:NN ##1 \__siunitx_table_direct_format_switch:
           \char_set_mathcode:nn { `##1 } { "8000 }
         }
-      \__siunitx_table_fil:
+      \__siunitx_table_fill:
   }
 \cs_new_protected:Npn \__siunitx_table_direct_format_switch:
   {



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