From 7273365c115cd3b4ad4f6da7341fec0332645336 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 9 Jun 2021 20:33:44 +0000 Subject: siunitx (9jun21) git-svn-id: svn://tug.org/texlive/trunk@59534 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md | 10 +++++++++- .../texmf-dist/doc/latex/siunitx/siunitx-code.pdf | Bin 1485621 -> 1486326 bytes Master/texmf-dist/doc/latex/siunitx/siunitx.pdf | Bin 634770 -> 634773 bytes .../source/latex/siunitx/siunitx-emulation.dtx | 4 ++-- .../source/latex/siunitx/siunitx-number.dtx | 22 +++++++++++++++++---- .../source/latex/siunitx/siunitx-symbol.dtx | 1 - Master/texmf-dist/source/latex/siunitx/siunitx.dtx | 2 +- Master/texmf-dist/source/latex/siunitx/siunitx.tex | 2 +- Master/texmf-dist/tex/latex/siunitx/siunitx.sty | 21 +++++++++++++++----- 9 files changed, 47 insertions(+), 15 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md b/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md index a465aea145e..364058db974 100644 --- a/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md +++ b/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md @@ -7,6 +7,13 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ## [Unreleased] +## [v3.0.12] + +### Fixed +- Modify warning message (fixes #476) +- Rounding zero values to a fixed number of places (issue #477) +- Remove stray debug code in symbol allocation (issue #478) + ## [v3.0.11] ### Changed @@ -1361,7 +1368,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.11...HEAD +[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.12...HEAD +[v3.0.12]: https://github.com/josephwright/siunitx/compare/v3.0.11...v3.0.12 [v3.0.11]: https://github.com/josephwright/siunitx/compare/v3.0.10...v3.0.11 [v3.0.10]: https://github.com/josephwright/siunitx/compare/v3.0.9...v3.0.10 [v3.0.9]: https://github.com/josephwright/siunitx/compare/v3.0.8...v3.0.9 diff --git a/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf b/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf index d4f36b226f6..b62b22632dc 100644 Binary files a/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf and b/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf differ diff --git a/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf index 62115e10046..36c97918d0b 100644 Binary files a/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf and b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf differ diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx index 9d0133affba..8e11abda621 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx @@ -1025,8 +1025,8 @@ Unit~macro~#1~has~been~deprecated~in~this~release. \\ \\ The~BIPM~have~removed~this~unit~from~the~SI~Brochure.~ You~should~define~it~yourself~using~\token_to_str:N \DeclareSIUnit\ % - in~your~source. The~current~definition~is\\ \\ - \token_to_str:N \DeclareSIUnit \{ #2 \} + in~your~source.~The~current~definition~is\\ \\ + \token_to_str:N \DeclareSIUnit #1 \{ #2 \} } \cs_gset_protected:Npn \@@_tmp:w #1#2 { diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx index b304a573c9d..2dfa66374c8 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx @@ -1691,7 +1691,8 @@ % % \begin{macro}{\siunitx_number_process:NN} % \begin{macro}{\@@_process:nnnnnnnNN} -% A top-level interface for the processing tools. +% A top-level interface for the processing tools. Rounding happens in all +% cases, but exponents are only processed if the value is not $0$. % \begin{macrocode} \cs_new_protected:Npn \siunitx_number_process:NN #1#2 { @@ -1707,12 +1708,13 @@ } \cs_new_protected:Npn \@@_process:nnnnnnnNN #1#2#3#4#5#6#7#8#9 { - \bool_lazy_and:nnF + \bool_lazy_and:nnTF { \str_if_eq_p:nn {#3} { 0 } } { \str_if_eq_p:ee { \exp_not:n {#4} } { \prg_replicate:nn { \tl_count:n {#4} } { 0 } } } + { \@@_round:NN #8 #9 } { \@@_exponent:NN #8 #9 \@@_round:NN #9 #9 @@ -2547,14 +2549,26 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[EXP]{\@@_round_figures:nnnnnnn} +% \begin{macro}[EXP]{\@@_round_figures:nnnnnnn, \@@_round_figures_aux:nnnnnnn} % \begin{macro}[EXP]{\@@_round_figures_count:nnN} % \begin{macro}[EXP]{\@@_round_figures_count:nnnN} -% Rounding to a fixed number of significant figures starts by checking that +% Rounding to figures only makes sense if the number is not $0$, so we start +% by filtering out that case. We then check that % there is no uncertainty, and that the number of figures requested is % positive: if not, the result is always fixed at zero. % \begin{macrocode} \cs_new:Npn \@@_round_figures:nnnnnnn #1#2#3#4#5#6#7 + { + \bool_lazy_and:nnTF + { \str_if_eq_p:nn {#3} { 0 } } + { + \str_if_eq_p:ee + { \exp_not:n {#4} } { \prg_replicate:nn { \tl_count:n {#4} } { 0 } } + } + { \exp_not:n { {#1} {#2} {#3} {#4} {#5} {#6} {#7} } } + { \@@_round_figures_aux:nnnnnnn {#1} {#2} {#3} {#4} {#5} {#6} {#7} } + } +\cs_new:Npn \@@_round_figures_aux:nnnnnnn #1#2#3#4#5#6#7 { \tl_if_blank:nTF {#5} { diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx index 251d257c4b4..6c7154d7513 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx @@ -149,7 +149,6 @@ \prg_return_true: } { - \show\l_@@_tmpa_tl \show\l_@@_tmpb_tl \group_end: \prg_return_false: } diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx index 03d06b4cb30..53cfbd8426b 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx @@ -121,7 +121,7 @@ % % Identify the package and give the over all version information. % \begin{macrocode} -\ProvidesExplPackage {siunitx} {2021-06-07} {3.0.11} +\ProvidesExplPackage {siunitx} {2021-06-09} {3.0.12} {A comprehensive (SI) units package} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.tex b/Master/texmf-dist/source/latex/siunitx/siunitx.tex index 360a395e6f3..28eaa37b2c0 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx.tex +++ b/Master/texmf-dist/source/latex/siunitx/siunitx.tex @@ -3044,7 +3044,7 @@ adjust the appearance of litres: both \enquote{\unit{l}} and \enquote{\unit{L}} are commonly used. The recommended approach to adjustment is to re-declare the \cs{litre} macro, as \cs{liter} will follow automatically. \begin{LaTeXdemo}[code only] - \DeclareSIUnit\liter{l} + \DeclareSIUnit\litre{l} \end{LaTeXdemo} \subsection{Ensuring text or math output% diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty index 0cbaae91a00..3d9fa8db1a4 100644 --- a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty +++ b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty @@ -42,7 +42,7 @@ }% \endinput }% -\ProvidesExplPackage {siunitx} {2021-06-07} {3.0.11} +\ProvidesExplPackage {siunitx} {2021-06-09} {3.0.12} {A comprehensive (SI) units package} \msg_new:nnnn { siunitx } { incompatible-package } { Package~'#1'~incompatible. } @@ -2156,12 +2156,13 @@ } \cs_new_protected:Npn \__siunitx_number_process:nnnnnnnNN #1#2#3#4#5#6#7#8#9 { - \bool_lazy_and:nnF + \bool_lazy_and:nnTF { \str_if_eq_p:nn {#3} { 0 } } { \str_if_eq_p:ee { \exp_not:n {#4} } { \prg_replicate:nn { \tl_count:n {#4} } { 0 } } } + { \__siunitx_number_round:NN #8 #9 } { \__siunitx_number_exponent:NN #8 #9 \__siunitx_number_round:NN #9 #9 @@ -2744,6 +2745,17 @@ } } \cs_new:Npn \__siunitx_number_round_figures:nnnnnnn #1#2#3#4#5#6#7 + { + \bool_lazy_and:nnTF + { \str_if_eq_p:nn {#3} { 0 } } + { + \str_if_eq_p:ee + { \exp_not:n {#4} } { \prg_replicate:nn { \tl_count:n {#4} } { 0 } } + } + { \exp_not:n { {#1} {#2} {#3} {#4} {#5} {#6} {#7} } } + { \__siunitx_number_round_figures_aux:nnnnnnn {#1} {#2} {#3} {#4} {#5} {#6} {#7} } + } +\cs_new:Npn \__siunitx_number_round_figures_aux:nnnnnnn #1#2#3#4#5#6#7 { \tl_if_blank:nTF {#5} { @@ -6057,7 +6069,6 @@ \prg_return_true: } { - \show\l__siunitx_symbol_tmpa_tl \show\l__siunitx_symbol_tmpb_tl \group_end: \prg_return_false: } @@ -7140,8 +7151,8 @@ Unit~macro~#1~has~been~deprecated~in~this~release. \\ \\ The~BIPM~have~removed~this~unit~from~the~SI~Brochure.~ You~should~define~it~yourself~using~\token_to_str:N \DeclareSIUnit\ % - in~your~source. The~current~definition~is\\ \\ - \token_to_str:N \DeclareSIUnit \{ #2 \} + in~your~source.~The~current~definition~is\\ \\ + \token_to_str:N \DeclareSIUnit #1 \{ #2 \} } \cs_gset_protected:Npn \__siunitx_emulation_tmp:w #1#2 { -- cgit v1.2.3