summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/siunitx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-05-25 20:49:59 +0000
committerKarl Berry <karl@freefriends.org>2021-05-25 20:49:59 +0000
commit075b67cb856341214b6f335528a93b8b2a766f41 (patch)
tree2b2edb0f1f32599a895ff6805d1ffb64aebfed01 /Master/texmf-dist/source/latex/siunitx
parent3502ad19f49f76a4363fec86d9c17d1639e8e013 (diff)
siunitx (25may21)
git-svn-id: svn://tug.org/texlive/trunk@59348 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/siunitx')
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx96
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx1
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx.dtx2
-rw-r--r--Master/texmf-dist/source/latex/siunitx/siunitx.tex14
4 files changed, 83 insertions, 30 deletions
diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
index 67c9580ca6c..22fff7cdb9c 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
+++ b/Master/texmf-dist/source/latex/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/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx
index 1307e2ee0bf..a517c4e34f2 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx
+++ b/Master/texmf-dist/source/latex/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/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
index 7c75d7a9835..5c86624afb8 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-05-24} {3.0.5}
+\ProvidesExplPackage {siunitx} {2021-05-25} {3.0.6}
{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 8af64c27086..a45c979be16 100644
--- a/Master/texmf-dist/source/latex/siunitx/siunitx.tex
+++ b/Master/texmf-dist/source/latex/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}}