summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/siunitx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-05-26 03:05:34 +0000
committerNorbert Preining <norbert@preining.info>2021-05-26 03:05:34 +0000
commit8982c52e00ffb3fb5a913fc60913ebd9070f091a (patch)
tree6a395986e3502fefcf42364f8dd87519b45a2441 /macros/latex/contrib/siunitx
parent07dc96bc3bbd691fc52aca15a172eaf41a89d873 (diff)
CTAN sync 202105260305
Diffstat (limited to 'macros/latex/contrib/siunitx')
-rw-r--r--macros/latex/contrib/siunitx/CHANGELOG.md14
-rw-r--r--macros/latex/contrib/siunitx/siunitx-code.pdfbin1443594 -> 1444886 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx-number.dtx96
-rw-r--r--macros/latex/contrib/siunitx/siunitx-symbol.dtx1
-rw-r--r--macros/latex/contrib/siunitx/siunitx.dtx2
-rw-r--r--macros/latex/contrib/siunitx/siunitx.pdfbin598400 -> 598829 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx.tex14
7 files changed, 96 insertions, 31 deletions
diff --git a/macros/latex/contrib/siunitx/CHANGELOG.md b/macros/latex/contrib/siunitx/CHANGELOG.md
index a473e9cd49..0ff02b0443 100644
--- a/macros/latex/contrib/siunitx/CHANGELOG.md
+++ b/macros/latex/contrib/siunitx/CHANGELOG.md
@@ -7,6 +7,17 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
## [Unreleased]
+## [v3.0.6]
+
+### Changed
+- 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)
+
## [v3.0.5]
### Changed
@@ -1301,7 +1312,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.5...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.6...HEAD
+[v3.0.6]: https://github.com/josephwright/siunitx/compare/v3.0.5...v3.0.6
[v3.0.5]: https://github.com/josephwright/siunitx/compare/v3.0.4...v3.0.5
[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
diff --git a/macros/latex/contrib/siunitx/siunitx-code.pdf b/macros/latex/contrib/siunitx/siunitx-code.pdf
index d8f5d6536e..ec731faa3f 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-number.dtx b/macros/latex/contrib/siunitx/siunitx-number.dtx
index 67c9580ca6..22fff7cdb9 100644
--- a/macros/latex/contrib/siunitx/siunitx-number.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-number.dtx
@@ -2963,14 +2963,17 @@
% \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:nnn}
+% \begin{macro}[rEXP]{\@@_output_uncertainty:nnnn}
% \begin{macro}[rEXP]{\@@_output_uncertainty_unaligned:n}
-% \begin{macro}[rEXP]{\@@_output_uncert_S:nnnw}
+% \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_aux:nnn, \@@_output_uncert_S_aux:fnn}
+% {\@@_output_uncert_S_auxiv:nnn, \@@_output_uncert_S_auxiv:fnn}
% \begin{macro}[rEXP]
-% {\@@_output_uncert_S:nnnw, \@@_output_uncert_S:fnw}
-% \begin{macro}[rEXP]{\@@_output_uncert_S:nnw}
+% {\@@_output_uncert_S_auxv:nnnw, \@@_output_uncert_S_auxv:fnnw}
+% \begin{macro}[rEXP]{\@@_output_uncert_S_auxvi:nnw}
% \begin{macro}[rEXP]
% {
% \@@_output_uncert_S_compact:nn ,
@@ -3010,7 +3013,7 @@
\@@_output_sign:nnn {#1} {#2} {#8}
\@@_output_integer:nnn {#3} {#4} {#7}
\@@_output_decimal:nn {#4} {#8}
- \@@_output_uncertainty:nnn {#5} {#4} {#8}
+ \@@_output_uncertainty:nnnn {#5} {#3} {#4} {#8}
\@@_output_exponent:nnnn {#6} {#7} { #3 . #4 } {#8}
\@@_output_end:
}
@@ -3224,41 +3227,77 @@
% 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:nnn #1#2#3
+\cs_new:Npn \@@_output_uncertainty:nnnn #1#2#3#4
{
\tl_if_blank:nTF {#1}
- { \@@_output_uncertainty_unaligned:n {#3} }
+ { \@@_output_uncertainty_unaligned:n {#4} }
{
- \use:c { @@_output_uncert_ \tl_head:n {#1} :nnnw }
- {#2} {#3} #1
+ \use:c { @@_output_uncert_ \tl_head:n {#1} :nnnnw }
+ {#2} {#3} {#4} #1
}
}
\cs_new:Npn \@@_output_uncertainty_unaligned:n #1
{ \exp_not:n { #1 #1 #1 #1 } }
-\cs_new:Npn \@@_output_uncert_S:nnnw #1#2#3#4
+% \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
{
\str_if_eq:VnTF \l_@@_uncert_mode_tl { separate }
{
- \exp_not:n {#2}
+ \exp_not:n {#3}
\@@_output_sign:N \pm
- \exp_not:n {#2}
- \@@_output_uncert_S_aux:nnn
- { \int_eval:n { \tl_count:n {#4} - \tl_count:n {#1} } }
- {#4} {#2}
+ \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:V \l_@@_uncert_separator_tl
\exp_not:V \l_@@_output_uncert_open_tl
- \use:c { @@_output_uncert_S_ \l_@@_uncert_mode_tl :nn } {#1} {#4}
+ \use:c { @@_output_uncert_S_ \l_@@_uncert_mode_tl :nn } {#2} {#5}
\exp_not:V \l_@@_output_uncert_close_tl
- \@@_output_uncertainty_unaligned:n {#2}
+ \@@_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_uncert_S_auxii:nnN { 0 } {#2} }
}
-\cs_new:Npn \@@_output_uncert_S_aux:nnn #1#2#3
+\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
{
\int_compare:nNnTF {#1} > 0
{
- \@@_output_uncert_S_aux:fnnw
+ \@@_output_uncert_S_auxv:fnnw
{ \int_eval:n { #1 - 1 } }
{#3}
{ }
@@ -3274,23 +3313,23 @@
{#3}
}
}
-\cs_generate_variant:Nn \@@_output_uncert_S_aux:nnn { f }
-\cs_new:Npn \@@_output_uncert_S_aux:nnnw #1#2#3#4
+\cs_generate_variant:Nn \@@_output_uncert_S_auxiv:nnn { f }
+\cs_new:Npn \@@_output_uncert_S_auxv:nnnw #1#2#3#4
{
\quark_if_nil:NF #4
{
\int_compare:nNnTF {#1} = 0
- { \@@_output_uncert_S_aux:nnw {#3#4} {#2} }
+ { \@@_output_uncert_S_auxvi:nnw {#3#4} {#2} }
{
- \@@_output_uncert_S_aux:fnnw
+ \@@_output_uncert_S_auxv:fnnw
{ \int_eval:n { #1 - 1 } }
{#2}
{#3#4}
}
}
}
-\cs_generate_variant:Nn \@@_output_uncert_S_aux:nnnw { f }
-\cs_new:Npn \@@_output_uncert_S_aux:nnw #1#2#3 \q_nil
+\cs_generate_variant:Nn \@@_output_uncert_S_auxv:nnnw { f }
+\cs_new:Npn \@@_output_uncert_S_auxvi:nnw #1#2#3 \q_nil
{
\@@_output_digits:nn { integer } {#1}
\@@_output_decimal:nn {#3} {#2}
@@ -3312,7 +3351,7 @@
}
\cs_new:Npn \@@_output_uncert_S_full:nn #1#2
{
- \@@_output_uncert_S_aux:fnn
+ \@@_output_uncert_S_auxiv:fnn
{ \int_eval:n { \tl_count:n {#2} - \tl_count:n {#1} } }
{#2} { }
}
@@ -3395,6 +3434,9 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \subsection{Miscellaneous tools}
%
diff --git a/macros/latex/contrib/siunitx/siunitx-symbol.dtx b/macros/latex/contrib/siunitx/siunitx-symbol.dtx
index 1307e2ee0b..a517c4e34f 100644
--- a/macros/latex/contrib/siunitx/siunitx-symbol.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-symbol.dtx
@@ -292,6 +292,7 @@
{ \group_end: }
}
\group_begin:
+ \keys_set:nn { siunitx } { forbid-literal-units = false }
\tl_set:Nn \l_@@_tmpa_tl { \mathrm { m } \cdot \mathrm { s } }
\tl_set:Nn \l_siunitx_unit_font_tl { \mathrm }
\siunitx_unit_format:nN { m . s } \l_@@_tmpb_tl
diff --git a/macros/latex/contrib/siunitx/siunitx.dtx b/macros/latex/contrib/siunitx/siunitx.dtx
index 7c75d7a983..5c86624afb 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-24} {3.0.5}
+\ProvidesExplPackage {siunitx} {2021-05-25} {3.0.6}
{A comprehensive (SI) units package}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/siunitx/siunitx.pdf b/macros/latex/contrib/siunitx/siunitx.pdf
index 3632749811..a13fa3ea8b 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 8af64c2708..a45c979be1 100644
--- a/macros/latex/contrib/siunitx/siunitx.tex
+++ b/macros/latex/contrib/siunitx/siunitx.tex
@@ -2852,7 +2852,7 @@ Updating to the latest edition of the \acro{SI} Brochure means that a small
number of unit macros have been removed: of those accepted for use,
\cs{angstrom} is no longer present, whilst the units determined experimentally
are all no longer listed (\cs{atomicmassunit}, \cs{bohr}, \cs{clight},
-\cs{electronmass}, \cs{elementarycharge}, \cs{hartree}, \cs{plackbar}).
+\cs{electronmass}, \cs{elementarycharge}, \cs{hartree}, \cs{planckbar}).
It is possible to use the \LaTeXe{} kernel mechanism to load the last
version~$2$ release for documents that cannot be successfully processed using
@@ -2907,6 +2907,10 @@ A new approach has been taken to providing non-Latin symbols for use in
units: these are now handled directly where needed, for example in the
definition of the \cs{micro} prefix.
+Translation of fixed strings is now carried out using the \pkg{translations}
+package. If you have manually set up translations in version~$2$ using
+\pkg{translator}, you will need to load it manually.
+
The letter used for a numerical tabular column can now be selected by the
user: the letter |S| has been retained as the standard interface. The unit
column (|s|) has been removed from this release. It can be emulated using
@@ -3326,7 +3330,13 @@ rounding.
\end{LaTeXdemo}
Each extra entry should be a single token, and should either have a definition
which is safe in both math and text mode, or should only be used when the
-output mode is known.
+output mode is known. It may be necessary to make some tokens robust using
+\pkg{etoolbox} for this to work, for example
+\begin{LaTeXdemo}
+ \robustify\dots
+ \sisetup{input-digits = 0123456789\dots}%
+ \qty{0,4066\dots}{\metre\squared}
+\end{LaTeXdemo}
\subsection{Demonstrating prefixes
\label{sec:hint:prefixes}}