summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/siunitx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-06-02 03:04:23 +0000
committerNorbert Preining <norbert@preining.info>2021-06-02 03:04:23 +0000
commit138d0a6cfd5f2187973fb6b83ad2fb0dcf5a8348 (patch)
treea95fba7d01d57bba550f5114c936ec76d57a49ac /macros/latex/contrib/siunitx
parent0f69e2fd4a9928663f0cc64b8cac1f0d8baee9d6 (diff)
CTAN sync 202106020304
Diffstat (limited to 'macros/latex/contrib/siunitx')
-rw-r--r--macros/latex/contrib/siunitx/CHANGELOG.md40
-rw-r--r--macros/latex/contrib/siunitx/siunitx-code.pdfbin1447215 -> 1447170 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx-compound.dtx7
-rw-r--r--macros/latex/contrib/siunitx/siunitx-emulation.dtx1
-rw-r--r--macros/latex/contrib/siunitx/siunitx-number.dtx139
-rw-r--r--macros/latex/contrib/siunitx/siunitx-table.dtx58
-rw-r--r--macros/latex/contrib/siunitx/siunitx-table.pdfbin0 -> 475888 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx-unit.dtx20
-rw-r--r--macros/latex/contrib/siunitx/siunitx.dtx2
-rw-r--r--macros/latex/contrib/siunitx/siunitx.pdfbin603229 -> 607150 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx.tex59
11 files changed, 206 insertions, 120 deletions
diff --git a/macros/latex/contrib/siunitx/CHANGELOG.md b/macros/latex/contrib/siunitx/CHANGELOG.md
index 2e71ec3eca..6cde2cdc72 100644
--- a/macros/latex/contrib/siunitx/CHANGELOG.md
+++ b/macros/latex/contrib/siunitx/CHANGELOG.md
@@ -7,12 +7,25 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
## [Unreleased]
+## [v3.0.9]
+
+### Changed
+- Documentation improvements
+- Add a hint for formatting regression tables
+
+### Fixed
+- Suppress some spurious overfull box warnings
+- Issue an error with `output-product`
+- Rounding of uncertainties falling in the integer part (issue #454)
+- Printing in text mode for compound quantities (issue #463)
+- Correctly handle `\protect` in literal units (issue #464)
+- Interpretation of uncertainties in integers (issue #465)
+
## [v3.0.8]
### Changed
- Documentation improvements
-- Add `\barn`, `\knot`, `\mmHg`, `\nauticalmile` to list of
- deprecated units
+- Add `\barn`, `\knot`, `\mmHg`, `\nauticalmile` to list of deprecated units
- Provide a fallback route for deprecated units
### Fixed
@@ -23,10 +36,9 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
### Fixed
- Formatting of some literal units (issue #449)
-- Issue a warning for removed option `load-configurations`
- (issue #455)
-- Printing of `\times` and `\cdot` in text mode when using a
- locale (issue #457)
+- Issue a warning for removed option `load-configurations` (issue #455)
+- Printing of `\times` and `\cdot` in text mode when using a locale
+ (issue #457)
- Implement missing `output-exponent-marker` (issue #458)
## [v3.0.6]
@@ -35,10 +47,9 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
- Documentation improvements
### Fixed
-- Avoid error if `forbid-literal-units` is set in the preamble
- (issue #452)
-- Format separate uncertainty correctly where it falls purely
- in the integer part (issue #454)
+- Avoid error if `forbid-literal-units` is set in the preamble (issue #452)
+- Format separate uncertainty correctly where it falls purely in the integer
+ part (issue #454)
## [v3.0.5]
@@ -46,8 +57,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
- Documentation improvements
### Fixed
-- Bracket separate uncertainties in compound quantities
- (issue #441)
+- Bracket separate uncertainties in compound quantities (issue #441)
- Color negative values in table cells correctly (issue #444)
- Avoid consumption of any math alphabets (issue #445)
- Mark `\bar` as removed (issue #448)
@@ -98,8 +108,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
### Fixed
- Printing of fractional units in text mode (issue #418)
-- Include `siunitx-abbreviations.cfg` in fallback v2 files
- (issue #419)
+- Include `siunitx-abbreviations.cfg` in fallback v2 files (issue #419)
- French translation of 'to' for ranges (issue #421)
## [v3.0.0]
@@ -1334,7 +1343,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.8...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.9...HEAD
+[v3.0.9]: https://github.com/josephwright/siunitx/compare/v3.0.8...v3.0.9
[v3.0.8]: https://github.com/josephwright/siunitx/compare/v3.0.7...v3.0.8
[v3.0.7]: https://github.com/josephwright/siunitx/compare/v3.0.6...v3.0.7
[v3.0.6]: https://github.com/josephwright/siunitx/compare/v3.0.5...v3.0.6
diff --git a/macros/latex/contrib/siunitx/siunitx-code.pdf b/macros/latex/contrib/siunitx/siunitx-code.pdf
index 6ba4bd131f..3c20dfb0f6 100644
--- a/macros/latex/contrib/siunitx/siunitx-code.pdf
+++ b/macros/latex/contrib/siunitx/siunitx-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/siunitx/siunitx-compound.dtx b/macros/latex/contrib/siunitx/siunitx-compound.dtx
index a164d883b7..f377585b78 100644
--- a/macros/latex/contrib/siunitx/siunitx-compound.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-compound.dtx
@@ -669,7 +669,7 @@
\str_if_eq:VnT \l_siunitx_quantity_prefix_mode_tl { combine-exponent }
{ \tl_clear:N \l_@@_exp_tl }
\bool_if:NTF \l_@@_unit_repeat_bool
- { \@@_print:N \@@_print_quantity:n }
+ { \@@_print:N \@@_print_quantity:x }
{
\bool_lazy_and:nnTF
{ \l_@@_unit_bracket_bool }
@@ -692,6 +692,8 @@
% \begin{macro}{\@@_print:nnnN}
% \begin{macro}{\@@_print_aux:n}
% \begin{macro}{\@@_print_aux:nn}
+% \begin{macro}{\@@_print_quantity:n, \@@_print_quantity:x}
+% \begin{macro}{\@@_print_separator:n, \@@_print_separator:V}
% We now need to know how many entries there are: the reason we don't use
% \cs{seq_use:Nnnn} is that we want to be able to insert
% \cs{siunitx_print_\dots:n} in a controlled way.
@@ -794,6 +796,7 @@
}
\cs_new_protected:Npn \@@_print_quantity:n #1
{ \siunitx_quantity_print:nV {#1} \l_@@_unit_tl }
+\cs_generate_variant:Nn \@@_print_quantity:n { x }
\cs_new_protected:Npn \@@_print_separator:n #1
{
\bool_if:NTF \l_@@_separator_text_bool
@@ -807,6 +810,8 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}[EXP]{\@@_uncert_bracket:N}
% \begin{macro}[EXP]{\@@_uncert_bracket:w}
diff --git a/macros/latex/contrib/siunitx/siunitx-emulation.dtx b/macros/latex/contrib/siunitx/siunitx-emulation.dtx
index 0878c37d74..3d2e0370f1 100644
--- a/macros/latex/contrib/siunitx/siunitx-emulation.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-emulation.dtx
@@ -393,6 +393,7 @@
{
input-protect-tokens ,
input-quotient ,
+ output-product ,
quotient-mode
}
{
diff --git a/macros/latex/contrib/siunitx/siunitx-number.dtx b/macros/latex/contrib/siunitx/siunitx-number.dtx
index 070b9c5e9d..b304a573c9 100644
--- a/macros/latex/contrib/siunitx/siunitx-number.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-number.dtx
@@ -2708,7 +2708,8 @@
%
% \begin{macro}[EXP]{\@@_round_uncertainty:nnnnnnn}
% \begin{macro}[EXP]{\@@_round_uncertainty:nnn}
-% \begin{macro}[EXP]{\@@_round_uncertainty:nnnnn}
+% \begin{macro}[EXP]{\@@_round_uncertainty:nnnnn, \@@_round_uncertainty_aux:nnnnn}
+% \begin{macro}[EXP]{\@@_round_uncertainty_aux:nnnnnn}
% Rounding to an uncertainty can only happen where the result will have some
% uncertainty left: otherwise we simply drop the uncertainty entirely. Only
% |S|-type uncertainties can be used for rounding.
@@ -2740,28 +2741,54 @@
\exp_last_unbraced:Nf \@@_round_uncertainty:nnnnn
{
\@@_round:fnn
- { \tl_count:n {#3} - \l_@@_round_precision_int } { } {#3}
+ {
+ \int_eval:n
+ { \tl_count:n {#3} - \l_@@_round_precision_int }
+ }
+ { } {#3}
}
{#1} {#2} {#3}
}
\cs_new:Npn \@@_round_uncertainty:nnnnn #1#2#3#4#5
{
- \tl_if_blank:nTF {#1}
+ \exp_args:Nf \@@_round_uncertainty_aux:nnnnn
+ { \int_eval:n { \tl_count:n {#5} - \tl_count:n {#2} } }
+ {#1} {#2} {#3} {#4}
+ }
+% \end{macrocode}
+% The first argument here deals with the case where we've lost digits
+% in the uncertainty and it's purely located in the integer part.
+% \begin{macrocode}
+\cs_new:Npn \@@_round_uncertainty_aux:nnnnn #1#2#3#4#5
+ {
+ \exp_args:Nf \@@_round_uncertainty_aux:nnnnnn
{
- \@@_round:fnn
- { \tl_count:n {#5} - \tl_count:n {#2} } {#3} {#4}
- { { S } {#2} }
+ \tl_if_blank:nT {#5}
+ { \prg_replicate:nn {#1} { 0 } }
+ }
+ {#1} {#2} {#3} {#4} {#5}
+ }
+\cs_new:Npn \@@_round_uncertainty_aux:nnnnnn #1#2#3#4#5#6
+ {
+ \tl_if_blank:nTF {#3}
+ {
+ \@@_round:nnn
+ {#2}
+ {#5} {#6}
+ { { S } { #4 #1 } }
}
{
\@@_round:fnn
- { \tl_count:n {#5} - \tl_count:n {#2} + 1 } {#3} {#4}
- { { S } { #1 \@@_round_truncate_direct:n {#2} } }
+ { \int_eval:n { #2 + 1 } }
+ {#5} {#6}
+ { { S } { #3 \@@_round_truncate_direct:n {#4} #1 } }
}
}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@@_zero_decimal:NN}
% \begin{macro}[EXP]{\@@_zero_decimal:nnnnnnn}
@@ -2966,17 +2993,14 @@
% \begin{macro}[rEXP]{\@@_output_decimal_loop:NNNN}
% \begin{macro}[rEXP]{\@@_output_integer_first:nnNN}
% \begin{macro}[rEXP]{\@@_output_integer_loop:NNNN}
-% \begin{macro}[rEXP]{\@@_output_uncertainty:nnnn}
+% \begin{macro}[rEXP]{\@@_output_uncertainty:nnn}
% \begin{macro}[rEXP]{\@@_output_uncertainty_unaligned:n}
-% \begin{macro}[rEXP]{\@@_output_uncert_S:nnnnw}
-% \begin{macro}[rEXP]{\@@_output_uncert_S_auxi:nn}
-% \begin{macro}[rEXP]{\@@_output_uncert_S_auxii:nnN}
-% \begin{macro}[rEXP]{\@@_output_uncert_S_auxiii:nnn}
+% \begin{macro}[rEXP]{\@@_output_uncert_S:nnnw}
% \begin{macro}[rEXP]
-% {\@@_output_uncert_S_auxiv:nnn, \@@_output_uncert_S_auxiv:fnn}
+% {\@@_output_uncert_S_aux:nnn, \@@_output_uncert_S_aux:fnn}
% \begin{macro}[rEXP]
-% {\@@_output_uncert_S_auxv:nnnw, \@@_output_uncert_S_auxv:fnnw}
-% \begin{macro}[rEXP]{\@@_output_uncert_S_auxvi:nnw}
+% {\@@_output_uncert_S:nnnw, \@@_output_uncert_S:fnw}
+% \begin{macro}[rEXP]{\@@_output_uncert_S:nnw}
% \begin{macro}[rEXP]
% {
% \@@_output_uncert_S_compact:nn ,
@@ -3022,7 +3046,7 @@
\@@_output_sign:nnn {#1} {#2} {#8}
\@@_output_integer:nnn {#3} {#4} {#7}
\@@_output_decimal:nn {#4} {#8}
- \@@_output_uncertainty:nnnn {#5} {#3} {#4} {#8}
+ \@@_output_uncertainty:nnn {#5} {#4} {#8}
\@@_output_exponent:nnnn {#6} {#7} { #3 . #4 } {#8}
\@@_output_end:
}
@@ -3232,77 +3256,41 @@
% digit tokens need to be removed from the start of the uncertainty and
% the split result sent to the appropriate auxiliaries.
% \begin{macrocode}
-\cs_new:Npn \@@_output_uncertainty:nnnn #1#2#3#4
+\cs_new:Npn \@@_output_uncertainty:nnn #1#2#3
{
\tl_if_blank:nTF {#1}
- { \@@_output_uncertainty_unaligned:n {#4} }
+ { \@@_output_uncertainty_unaligned:n {#3} }
{
- \use:c { @@_output_uncert_ \tl_head:n {#1} :nnnnw }
- {#2} {#3} {#4} #1
+ \use:c { @@_output_uncert_ \tl_head:n {#1} :nnnw }
+ {#2} {#3} #1
}
}
\cs_new:Npn \@@_output_uncertainty_unaligned:n #1
{ \exp_not:n { #1 #1 #1 #1 } }
-% \end{macrocode}
-% There is a bit more to do here if the uncertainty is purely in the integer
-% part and printed separately. We need to pad it by the number of
-% non-significant figures, then pass on to allow digit separation.
-% \begin{macrocode}
-\cs_new:Npn \@@_output_uncert_S:nnnnw #1#2#3#4#5
+\cs_new:Npn \@@_output_uncert_S:nnnw #1#2#3#4
{
\str_if_eq:VnTF \l_@@_uncert_mode_tl { separate }
{
- \exp_not:n {#3}
+ \exp_not:n {#2}
\@@_output_sign:N \pm
- \exp_not:n {#3}
- \tl_if_blank:nTF {#2}
- { \@@_output_uncert_S_auxi:nnn {#1} {#5} {#3} }
- {
- \@@_output_uncert_S_auxiv:fnn
- { \int_eval:n { \tl_count:n {#5} - \tl_count:n {#2} } }
- {#5} {#3}
- }
+ \exp_not:n {#2}
+ \@@_output_uncert_S_aux:nnn
+ { \int_eval:n { \tl_count:n {#4} - \tl_count:n {#1} } }
+ {#4} {#2}
}
{
\exp_not:V \l_@@_uncert_separator_tl
\exp_not:V \l_@@_output_uncert_open_tl
- \use:c { @@_output_uncert_S_ \l_@@_uncert_mode_tl :nn } {#2} {#5}
+ \use:c { @@_output_uncert_S_ \l_@@_uncert_mode_tl :nn } {#1} {#4}
\exp_not:V \l_@@_output_uncert_close_tl
- \@@_output_uncertainty_unaligned:n {#3}
- }
- }
-\cs_new:Npn \@@_output_uncert_S_auxi:nnn #1#2#3
- {
- \@@_output_uncert_S_auxii:nnN { 0 } {#2} #1
- \q_recursion_tail \q_recursion_stop {#3}
- }
-\cs_new:Npn \@@_output_uncert_S_auxii:nnN #1#2#3
- {
- \quark_if_recursion_tail_stop_do:Nn #3
- {
- \exp_args:Nf \@@_output_uncert_S_auxiii:nnn
- { \prg_replicate:nn {#1} { 0 } } {#2}
- }
- \str_if_eq:nnTF {#3} { 0 }
- {
- \exp_args:Nf \@@_output_uncert_S_auxii:nnN
- { \int_eval:n { #1 + 1 } } {#2}
+ \@@_output_uncertainty_unaligned:n {#2}
}
- { \@@_output_uncert_S_auxii:nnN { 0 } {#2} }
}
-\cs_new:Npn \@@_output_uncert_S_auxiii:nnn #1#2#3
- {
- \@@_output_uncert_S_auxiv:fnn
- { \int_eval:n { \tl_count:n {#2#1} } } {#2#1} {#3}
- }
-% \end{macrocode}
-% All separated uncertainties bring us to here.
-% \begin{macrocode}
-\cs_new:Npn \@@_output_uncert_S_auxiv:nnn #1#2#3
+\cs_new:Npn \@@_output_uncert_S_aux:nnn #1#2#3
{
\int_compare:nNnTF {#1} > 0
{
- \@@_output_uncert_S_auxv:fnnw
+ \@@_output_uncert_S_aux:fnnw
{ \int_eval:n { #1 - 1 } }
{#3}
{ }
@@ -3318,23 +3306,23 @@
{#3}
}
}
-\cs_generate_variant:Nn \@@_output_uncert_S_auxiv:nnn { f }
-\cs_new:Npn \@@_output_uncert_S_auxv:nnnw #1#2#3#4
+\cs_generate_variant:Nn \@@_output_uncert_S_aux:nnn { f }
+\cs_new:Npn \@@_output_uncert_S_aux:nnnw #1#2#3#4
{
\quark_if_nil:NF #4
{
\int_compare:nNnTF {#1} = 0
- { \@@_output_uncert_S_auxvi:nnw {#3#4} {#2} }
+ { \@@_output_uncert_S_aux:nnw {#3#4} {#2} }
{
- \@@_output_uncert_S_auxv:fnnw
+ \@@_output_uncert_S_aux:fnnw
{ \int_eval:n { #1 - 1 } }
{#2}
{#3#4}
}
}
}
-\cs_generate_variant:Nn \@@_output_uncert_S_auxv:nnnw { f }
-\cs_new:Npn \@@_output_uncert_S_auxvi:nnw #1#2#3 \q_nil
+\cs_generate_variant:Nn \@@_output_uncert_S_aux:nnnw { f }
+\cs_new:Npn \@@_output_uncert_S_aux:nnw #1#2#3 \q_nil
{
\@@_output_digits:nn { integer } {#1}
\@@_output_decimal:nn {#3} {#2}
@@ -3356,7 +3344,7 @@
}
\cs_new:Npn \@@_output_uncert_S_full:nn #1#2
{
- \@@_output_uncert_S_auxiv:fnn
+ \@@_output_uncert_S_aux:fnn
{ \int_eval:n { \tl_count:n {#2} - \tl_count:n {#1} } }
{#2} { }
}
@@ -3455,9 +3443,6 @@
% \end{macro}
% \end{macro}
% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
%
% \subsection{Miscellaneous tools}
%
diff --git a/macros/latex/contrib/siunitx/siunitx-table.dtx b/macros/latex/contrib/siunitx/siunitx-table.dtx
index c033090022..269015d857 100644
--- a/macros/latex/contrib/siunitx/siunitx-table.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-table.dtx
@@ -1027,6 +1027,15 @@
% \end{macrocode}
% \end{variable}
%
+% \begin{variable}{\l_@@_before_dim}
+% Space reserved for any non-numerical text before the number: as we need
+% to allow for this to be available after setting the integer part, we need
+% to carry it along for a bit.
+% \begin{macrocode}
+\dim_new:N \l_@@_before_dim
+% \end{macrocode}
+% \end{variable}
+%
% \begin{variable}{\l_@@_carry_dim}
% Used to \enquote{carry forward} the amount of white space which needs to
% be inserted after the decimal marker.
@@ -1067,14 +1076,19 @@
% \begin{macro}{\@@_print_marker:w}
% \begin{macro}[EXP]{\@@_print_marker_aux:w}
% \begin{macro}{\@@_print_format:nnn}
+% \begin{macro}[EXP]{\@@_print_format:nnnnnn}
% \begin{macro}
% {
-% \@@_print_marker_auxi:w,
-% \@@_print_marker_auxii:w,
-% \@@_print_marker_auxiii:w
+% \@@_print_format_auxi:w ,
+% \@@_print_format_auxii:w ,
+% \@@_print_format_auxiii:w ,
+% \@@_print_format_auxiv:w ,
+% \@@_print_format_auxv:w ,
+% \@@_print_format_auxvi:w ,
+% \@@_print_format_auxvii:w
% }
-% \begin{macro}{\@@_print_format_after:N}
% \begin{macro}{\@@_print_format_box:Nn}
+% \begin{macro}{\@@_print_format_after:N}
% \begin{macro}{\@@_print_none:nnn}
% \begin{macrocode}
\cs_new_protected:Npn \@@_print:nnn #1#2#3
@@ -1157,7 +1171,9 @@
% are a number of alignment points to get right. As for the |marker| approach,
% first we check if the material before the numerical content is of zero
% width. Next we need to format the model and content numbers, before
-% starting an auxiliary chain to pick out the various parts in order.
+% starting an auxiliary chain to pick out the various parts in order. We have
+% to carry the amount of space for the non-numerical material before the cell
+% forward: this may end up being enlarged by unused parts of the integer.
% \begin{macrocode}
\cs_new_protected:Npn \@@_print_format:nnn #1#2#3
{
@@ -1168,12 +1184,7 @@
\box_clear:N \l_@@_before_box
#1
}
- \hbox_set_to_wd:Nnn \l_@@_before_box
- { \box_wd:N \l_@@_tmp_box }
- {
- \@@_fil:
- \hbox_unpack:N \l_@@_before_box
- }
+ \dim_set:Nn \l_@@_before_dim { \box_wd:N \l_@@_tmp_box }
\siunitx_number_parse:nN {#2} \l_@@_tmp_tl
\group_begin:
\bool_if:NT \l_@@_auto_round_bool
@@ -1239,16 +1250,11 @@
}
{
\@@_print_format_box:Nn \l_@@_integer_box {#3}
- \hbox_set_to_wd:Nnn \l_@@_before_box
+ \dim_add:Nn \l_@@_before_dim
{
- \box_wd:N \l_@@_before_box
- + \box_wd:N \l_@@_tmp_box
+ \box_wd:N \l_@@_tmp_box
- \box_wd:N \l_@@_integer_box
}
- {
- \@@_fil:
- \hbox_unpack:N \l_@@_before_box
- }
}
\@@_print_format_auxii:w #2 \q_mark #4 \q_stop
}
@@ -1259,6 +1265,9 @@
% much \emph{extra} material has been added. To avoid using more boxes
% or re-setting, we do that by recording sizes before and after the change.
% (In effect, \cs{l_@@_tmp_dim} is here \enquote{l_@@_comparator_dim}.)
+% As the integer part is completed here, we are able to finalise the width
+% of the pre-numeral part, reboxing it to have the correct width and possibly
+% to force a single overfull warning if appropriate.
% \begin{macrocode}
\cs_new_protected:Npn \@@_print_format_auxii:w
#1 \q_nil #2 \q_nil #3 \q_mark #4 \q_nil #5 \q_nil #6 \q_stop
@@ -1301,19 +1310,19 @@
\hbox_unpack:N \l_@@_integer_box
\siunitx_print_number:n {#4#5}
}
- \hbox_set_to_wd:Nnn \l_@@_before_box
+ \dim_add:Nn \l_@@_before_dim
{
- \box_wd:N \l_@@_before_box
+ \box_wd:N \l_@@_tmp_box
+ \l_@@_tmp_dim
- \box_wd:N \l_@@_integer_box
}
- {
- \@@_fil:
- \hbox_unpack:N \l_@@_before_box
- }
}
}
+ \hbox_set_to_wd:Nnn \l_@@_before_box \l_@@_before_dim
+ {
+ \@@_fil:
+ \hbox_unpack:N \l_@@_before_box
+ }
\@@_print_format_auxiii:w #3 \q_mark #6 \q_stop
}
% \end{macrocode}
@@ -1458,6 +1467,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \subsection{Standard settings for module options}
%
diff --git a/macros/latex/contrib/siunitx/siunitx-table.pdf b/macros/latex/contrib/siunitx/siunitx-table.pdf
new file mode 100644
index 0000000000..6c241941b5
--- /dev/null
+++ b/macros/latex/contrib/siunitx/siunitx-table.pdf
Binary files differ
diff --git a/macros/latex/contrib/siunitx/siunitx-unit.dtx b/macros/latex/contrib/siunitx/siunitx-unit.dtx
index 604883dfa6..782ac23dcf 100644
--- a/macros/latex/contrib/siunitx/siunitx-unit.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-unit.dtx
@@ -1181,7 +1181,12 @@
% \begin{macro}{\@@_format_literal_auxiii:w}
% \begin{macro}{\@@_format_literal_auxiv:n}
% \begin{macro}{\@@_format_literal_auxv:nw}
-% \begin{macro}{\@@_format_literal_auxvi:nN}
+% \begin{macro}
+% {
+% \@@_format_literal_auxvi:nN ,
+% \@@_format_literal_auxvii:nN ,
+% \@@_format_literal_auxviii:nN
+% }
% \begin{macro}{\@@_format_literal_super:nn, \@@_format_literal_sub:nn}
% \begin{macro}{\@@_format_literal_add:n}
% \begin{macro}{\@@_format_literal_auxvii:nn}
@@ -1293,9 +1298,20 @@
\exp_not:N \token_if_eq_meaning:NNTF
#2 \c_@@_math_subscript_tl
{ \exp_not:N \@@_format_literal_sub:nn {#1} }
- { \exp_not:N \@@_format_literal_auxvi:nN {#1#2} }
+ { \exp_not:N \@@_format_literal_auxvii:nN {#1} #2 }
}
}
+% \end{macrocode}
+% We need to make sure |\protect| sticks with the next token.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_format_literal_auxvii:nN #1#2
+ {
+ \str_if_eq:nnTF {#2} { \protect }
+ { \@@_format_literal_auxviii:nN {#1} }
+ { \@@_format_literal_auxvi:nN {#1#2} }
+ }
+\cs_new_protected:Npn \@@_format_literal_auxviii:nN #1#2
+ { \@@_format_literal_auxv:nw { #1 \protect #2 } }
\cs_new_protected:Npn \@@_format_literal_super:nn #1#2
{
\quark_if_recursion_tail_stop:n {#2}
diff --git a/macros/latex/contrib/siunitx/siunitx.dtx b/macros/latex/contrib/siunitx/siunitx.dtx
index 33b6776591..cd0c5ca2c9 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-31} {3.0.8}
+\ProvidesExplPackage {siunitx} {2021-06-01} {3.0.9}
{A comprehensive (SI) units package}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/siunitx/siunitx.pdf b/macros/latex/contrib/siunitx/siunitx.pdf
index 4388753d2f..356fee236b 100644
--- a/macros/latex/contrib/siunitx/siunitx.pdf
+++ b/macros/latex/contrib/siunitx/siunitx.pdf
Binary files differ
diff --git a/macros/latex/contrib/siunitx/siunitx.tex b/macros/latex/contrib/siunitx/siunitx.tex
index 76afc34861..86db9afa6c 100644
--- a/macros/latex/contrib/siunitx/siunitx.tex
+++ b/macros/latex/contrib/siunitx/siunitx.tex
@@ -3219,6 +3219,54 @@ also be done using \pkg{siunitx} (Table~\ref{tbl:xmpl:unrel}).
\end{table}
\end{LaTeXdemo}
+\subsection{Regression tables%
+ \label{sec:hint:regression}}
+
+In some subject areas, it is common to present regression values or similar,
+which feature an uncertainty value in parenthesis on the line below the main
+value. As these are separate cells, they cannot be entered using \pkg{siunitx}
+in one value. There are a couple of ways of formatting them using the package,
+depending on whether the values also need to be parsed.
+
+Where parsing is not required, the most straight-forward method is available:
+provide a model format allowing space for an extra \enquote{digit} at each end,
+which will then allow for the parenthesis. If a sign is applied to the number,
+it may not be necessary to add a \enquote{digit} for the leading bracket. If
+parsing is also required, this approach cannot be employed. Instead, the
+parsing needs to be adjusted such that |(| and |)| are not treated as part of
+the number, and \opt{table-align-text-pre} is set to |false| such that these
+will be placed next to the numerical part. These methods are illustrated in
+Table~\ref{tab:regression}.
+
+\begin{LaTeXdemo}[code and float]
+ \begin{table}
+ \caption{Regression tables%
+ \label{tab:regression}
+ }
+ \begin{tabular}
+ {
+ @{}
+ S[table-format = 2.4, parse-numbers = false]
+ S[table-format = +1.4, parse-numbers = false]
+ S[
+ input-open-uncertainty = ,
+ input-close-uncertainty = ,
+ minimum-decimal-digits = 3, % (
+ table-format = +1.3),
+ table-align-text-pre = false
+ ]
+ @{}
+ }
+ \toprule
+ {Header} &{Header} & {Header} \\
+ \midrule
+ 1.234 & -1.234 & -1.23 \\
+ (0.053) & (0.053) & (0.053) \\
+ \bottomrule
+ \end{tabular}
+ \end{table}
+\end{LaTeXdemo}
+
\subsection{Maximising performance%
\label{sec:hint:performance}}
@@ -3235,6 +3283,17 @@ systems:
]{7.3}{\Hz}
\end{LaTeXdemo}
+For tables, any settings that can be given before the table are only parsed once,
+whereas given in the optional argument to |S| they are read in ever cell. As such,
+you should favour
+\begin{LaTeXdemo}[code only]
+ \begin{table}
+ \sisetup{...}
+ \begin{tabular}{S}
+ ...
+\end{LaTeXdemo}
+for common settings.
+
\subsection{Special considerations for the \cs{kWh} unit%
\label{sec:hint:kWh}}