From 58aa1ac09b1d9e4769d0a0661cf12e2b2db41b14 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 22 May 2021 03:00:53 +0000 Subject: CTAN sync 202105220300 --- macros/latex/contrib/siunitx/CHANGELOG.md | 12 +++++++- macros/latex/contrib/siunitx/siunitx-code.pdf | Bin 1441368 -> 1441845 bytes macros/latex/contrib/siunitx/siunitx-number.dtx | 35 ++++++++++++++---------- macros/latex/contrib/siunitx/siunitx-table.dtx | 14 +++++----- macros/latex/contrib/siunitx/siunitx.dtx | 2 +- macros/latex/contrib/siunitx/siunitx.pdf | Bin 605429 -> 605308 bytes macros/latex/contrib/siunitx/siunitx.tex | 15 +++++----- 7 files changed, 46 insertions(+), 32 deletions(-) (limited to 'macros/latex/contrib/siunitx') diff --git a/macros/latex/contrib/siunitx/CHANGELOG.md b/macros/latex/contrib/siunitx/CHANGELOG.md index 3215c8926b..093b87bada 100644 --- a/macros/latex/contrib/siunitx/CHANGELOG.md +++ b/macros/latex/contrib/siunitx/CHANGELOG.md @@ -7,6 +7,15 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ## [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 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ### 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 diff --git a/macros/latex/contrib/siunitx/siunitx-code.pdf b/macros/latex/contrib/siunitx/siunitx-code.pdf index 16510233a4..718aeef446 100644 Binary files a/macros/latex/contrib/siunitx/siunitx-code.pdf and b/macros/latex/contrib/siunitx/siunitx-code.pdf differ diff --git a/macros/latex/contrib/siunitx/siunitx-number.dtx b/macros/latex/contrib/siunitx/siunitx-number.dtx index 3bedf3794c..dec433df02 100644 --- a/macros/latex/contrib/siunitx/siunitx-number.dtx +++ b/macros/latex/contrib/siunitx/siunitx-number.dtx @@ -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 } @@ -3093,13 +3105,6 @@ { \exp_not:n { \mathord {#1} } } { \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: { diff --git a/macros/latex/contrib/siunitx/siunitx-table.dtx b/macros/latex/contrib/siunitx/siunitx-table.dtx index f4ca1ec529..3f8673c2fc 100644 --- a/macros/latex/contrib/siunitx/siunitx-table.dtx +++ b/macros/latex/contrib/siunitx/siunitx-table.dtx @@ -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: { diff --git a/macros/latex/contrib/siunitx/siunitx.dtx b/macros/latex/contrib/siunitx/siunitx.dtx index b8b6b79b02..40ba293d81 100644 --- a/macros/latex/contrib/siunitx/siunitx.dtx +++ b/macros/latex/contrib/siunitx/siunitx.dtx @@ -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} % diff --git a/macros/latex/contrib/siunitx/siunitx.pdf b/macros/latex/contrib/siunitx/siunitx.pdf index 2c3c742c94..3a8e7d0277 100644 Binary files a/macros/latex/contrib/siunitx/siunitx.pdf and b/macros/latex/contrib/siunitx/siunitx.pdf differ diff --git a/macros/latex/contrib/siunitx/siunitx.tex b/macros/latex/contrib/siunitx/siunitx.tex index 191e619490..857a1569a6 100644 --- a/macros/latex/contrib/siunitx/siunitx.tex +++ b/macros/latex/contrib/siunitx/siunitx.tex @@ -1693,7 +1693,7 @@ There are certain combinations of numerical input which can be ambiguous. This 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 @@ also be done using \pkg{siunitx} (Table~\ref{tbl:xmpl:unrel}). S[ table-format = 5.0, parse-numbers = false, - input-digits = .0123456789, input-decimal-markers = x ] @{} @@ -3393,9 +3392,9 @@ these units, needing no others and with no redundancy. 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 @@ but mathematically poor.\footnote{For example, for an acceleration \(a\), the 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 @@ Tables~\ref{tab:xmpl:unitless} and~\ref{fig:xmpl:unitless}. 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 @@ unzip this in your local \path{texmf} directory. 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} -- cgit v1.2.3