diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/siunitx')
5 files changed, 22 insertions, 9 deletions
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,15 +2549,27 @@ % \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} { \int_compare:nNnTF \l_@@_round_precision_int > 0 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% |