diff options
author | Karl Berry <karl@freefriends.org> | 2021-05-25 20:49:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-05-25 20:49:59 +0000 |
commit | 075b67cb856341214b6f335528a93b8b2a766f41 (patch) | |
tree | 2b2edb0f1f32599a895ff6805d1ffb64aebfed01 /Master | |
parent | 3502ad19f49f76a4363fec86d9c17d1639e8e013 (diff) |
siunitx (25may21)
git-svn-id: svn://tug.org/texlive/trunk@59348 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md | 14 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf | bin | 1443594 -> 1444886 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/siunitx/siunitx.pdf | bin | 598400 -> 598829 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx | 96 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx | 1 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx.dtx | 2 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx.tex | 14 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/siunitx/siunitx.sty | 75 |
8 files changed, 148 insertions, 54 deletions
diff --git a/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md b/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md index a473e9cd491..0ff02b04432 100644 --- a/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md +++ b/Master/texmf-dist/doc/latex/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/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf b/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf Binary files differindex d8f5d6536e1..ec731faa3f1 100644 --- a/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf +++ b/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf diff --git a/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf Binary files differindex 36327498118..a13fa3ea8bb 100644 --- a/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf +++ b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf 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}} diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty index 1c5da1ff452..977f56d9efd 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-05-24} {3.0.5} +\ProvidesExplPackage {siunitx} {2021-05-25} {3.0.6} {A comprehensive (SI) units package} \msg_new:nnnn { siunitx } { incompatible-package } { Package~'#1'~incompatible. } @@ -3031,7 +3031,7 @@ \__siunitx_number_output_sign:nnn {#1} {#2} {#8} \__siunitx_number_output_integer:nnn {#3} {#4} {#7} \__siunitx_number_output_decimal:nn {#4} {#8} - \__siunitx_number_output_uncertainty:nnn {#5} {#4} {#8} + \__siunitx_number_output_uncertainty:nnnn {#5} {#3} {#4} {#8} \__siunitx_number_output_exponent:nnnn {#6} {#7} { #3 . #4 } {#8} \__siunitx_number_output_end: } @@ -3200,41 +3200,69 @@ } } } -\cs_new:Npn \__siunitx_number_output_uncertainty:nnn #1#2#3 +\cs_new:Npn \__siunitx_number_output_uncertainty:nnnn #1#2#3#4 { \tl_if_blank:nTF {#1} - { \__siunitx_number_output_uncertainty_unaligned:n {#3} } + { \__siunitx_number_output_uncertainty_unaligned:n {#4} } { - \use:c { __siunitx_number_output_uncert_ \tl_head:n {#1} :nnnw } - {#2} {#3} #1 + \use:c { __siunitx_number_output_uncert_ \tl_head:n {#1} :nnnnw } + {#2} {#3} {#4} #1 } } \cs_new:Npn \__siunitx_number_output_uncertainty_unaligned:n #1 { \exp_not:n { #1 #1 #1 #1 } } -\cs_new:Npn \__siunitx_number_output_uncert_S:nnnw #1#2#3#4 +\cs_new:Npn \__siunitx_number_output_uncert_S:nnnnw #1#2#3#4#5 { \str_if_eq:VnTF \l__siunitx_number_uncert_mode_tl { separate } { - \exp_not:n {#2} + \exp_not:n {#3} \__siunitx_number_output_sign:N \pm - \exp_not:n {#2} - \__siunitx_number_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} + { \__siunitx_number_output_uncert_S_auxi:nnn {#1} {#5} {#3} } + { + \__siunitx_number_output_uncert_S_auxiv:fnn + { \int_eval:n { \tl_count:n {#5} - \tl_count:n {#2} } } + {#5} {#3} + } } { \exp_not:V \l__siunitx_number_uncert_separator_tl \exp_not:V \l__siunitx_number_output_uncert_open_tl - \use:c { __siunitx_number_output_uncert_S_ \l__siunitx_number_uncert_mode_tl :nn } {#1} {#4} + \use:c { __siunitx_number_output_uncert_S_ \l__siunitx_number_uncert_mode_tl :nn } {#2} {#5} \exp_not:V \l__siunitx_number_output_uncert_close_tl - \__siunitx_number_output_uncertainty_unaligned:n {#2} + \__siunitx_number_output_uncertainty_unaligned:n {#3} + } + } +\cs_new:Npn \__siunitx_number_output_uncert_S_auxi:nnn #1#2#3 + { + \__siunitx_number_output_uncert_S_auxii:nnN { 0 } {#2} #1 + \q_recursion_tail \q_recursion_stop {#3} + } +\cs_new:Npn \__siunitx_number_output_uncert_S_auxii:nnN #1#2#3 + { + \quark_if_recursion_tail_stop_do:Nn #3 + { + \exp_args:Nf \__siunitx_number_output_uncert_S_auxiii:nnn + { \prg_replicate:nn {#1} { 0 } } {#2} } + \str_if_eq:nnTF {#3} { 0 } + { + \exp_args:Nf \__siunitx_number_output_uncert_S_auxii:nnN + { \int_eval:n { #1 + 1 } } {#2} + } + { \__siunitx_number_output_uncert_S_auxii:nnN { 0 } {#2} } + } +\cs_new:Npn \__siunitx_number_output_uncert_S_auxiii:nnn #1#2#3 + { + \__siunitx_number_output_uncert_S_auxiv:fnn + { \int_eval:n { \tl_count:n {#2#1} } } {#2#1} {#3} } -\cs_new:Npn \__siunitx_number_output_uncert_S_aux:nnn #1#2#3 +\cs_new:Npn \__siunitx_number_output_uncert_S_auxiv:nnn #1#2#3 { \int_compare:nNnTF {#1} > 0 { - \__siunitx_number_output_uncert_S_aux:fnnw + \__siunitx_number_output_uncert_S_auxv:fnnw { \int_eval:n { #1 - 1 } } {#3} { } @@ -3250,23 +3278,23 @@ {#3} } } -\cs_generate_variant:Nn \__siunitx_number_output_uncert_S_aux:nnn { f } -\cs_new:Npn \__siunitx_number_output_uncert_S_aux:nnnw #1#2#3#4 +\cs_generate_variant:Nn \__siunitx_number_output_uncert_S_auxiv:nnn { f } +\cs_new:Npn \__siunitx_number_output_uncert_S_auxv:nnnw #1#2#3#4 { \quark_if_nil:NF #4 { \int_compare:nNnTF {#1} = 0 - { \__siunitx_number_output_uncert_S_aux:nnw {#3#4} {#2} } + { \__siunitx_number_output_uncert_S_auxvi:nnw {#3#4} {#2} } { - \__siunitx_number_output_uncert_S_aux:fnnw + \__siunitx_number_output_uncert_S_auxv:fnnw { \int_eval:n { #1 - 1 } } {#2} {#3#4} } } } -\cs_generate_variant:Nn \__siunitx_number_output_uncert_S_aux:nnnw { f } -\cs_new:Npn \__siunitx_number_output_uncert_S_aux:nnw #1#2#3 \q_nil +\cs_generate_variant:Nn \__siunitx_number_output_uncert_S_auxv:nnnw { f } +\cs_new:Npn \__siunitx_number_output_uncert_S_auxvi:nnw #1#2#3 \q_nil { \__siunitx_number_output_digits:nn { integer } {#1} \__siunitx_number_output_decimal:nn {#3} {#2} @@ -3284,7 +3312,7 @@ } \cs_new:Npn \__siunitx_number_output_uncert_S_full:nn #1#2 { - \__siunitx_number_output_uncert_S_aux:fnn + \__siunitx_number_output_uncert_S_auxiv:fnn { \int_eval:n { \tl_count:n {#2} - \tl_count:n {#1} } } {#2} { } } @@ -6121,6 +6149,7 @@ { \group_end: } } \group_begin: + \keys_set:nn { siunitx } { forbid-literal-units = false } \tl_set:Nn \l__siunitx_symbol_tmpa_tl { \mathrm { m } \cdot \mathrm { s } } \tl_set:Nn \l_siunitx_unit_font_tl { \mathrm } \siunitx_unit_format:nN { m . s } \l__siunitx_symbol_tmpb_tl |