diff options
author | Karl Berry <karl@freefriends.org> | 2023-04-04 20:12:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-04-04 20:12:17 +0000 |
commit | 9fd8dbbf46c600b2dd7cbf52301aa86acfeffc86 (patch) | |
tree | f38283bd5733ee300e9a0152b0667442dd58106e | |
parent | 223b4f3317b36773937aa82b8ad3f4344cb38696 (diff) |
siunitx (4apr23)
git-svn-id: svn://tug.org/texlive/trunk@66761 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md | 9 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf | bin | 642235 -> 642304 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/siunitx/siunitx.pdf | bin | 691121 -> 691514 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx-locale.dtx | 18 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx | 93 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx.dtx | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/siunitx/siunitx.sty | 81 |
7 files changed, 141 insertions, 62 deletions
diff --git a/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md b/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md index 9d37819ad8c..49a16c2766e 100644 --- a/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md +++ b/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md @@ -7,6 +7,12 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ## [Unreleased] +## [v3.2.4] - 2023-04-04 + + +### Fixed +- Parsing of 'full' uncertainty parts with leading zeros (see issues + [\#652](https://github.com/josephwright/siunitx/issues/652)) ## [v3.2.3] - 2023-03-14 ### Fixed @@ -1882,7 +1888,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.2.3...HEAD +[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.2.4...HEAD +[v3.2.4]: https://github.com/josephwright/siunitx/compare/v3.2.3...v3.2.4 [v3.2.3]: https://github.com/josephwright/siunitx/compare/v3.2.2...v3.2.3 [v3.2.2]: https://github.com/josephwright/siunitx/compare/v3.2.1...v3.2.2 [v3.2.1]: https://github.com/josephwright/siunitx/compare/v3.2.0...v3.2.1 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 447e0054991..3fa73c20871 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 b8961446226..bdff52cf3b7 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-locale.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-locale.dtx index 6a0aa3ffea6..43f432733a3 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-locale.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-locale.dtx @@ -102,18 +102,18 @@ inter-unit-product = \, , output-decimal-marker = { , } } , - locale / PL .meta:n = - { - exponent-product = \cdot , - inter-unit-product = \cdot , - output-decimal-marker = { , } - } , locale / FR .meta:n = { exponent-product = \times , inter-unit-product = \, , output-decimal-marker = { , } } , + locale / PL .meta:n = + { + exponent-product = \cdot , + inter-unit-product = \cdot , + output-decimal-marker = { , } + } , locale / SI .meta:n = { exponent-product = \times , @@ -150,17 +150,17 @@ { \RequirePackage { translations } \DeclareTranslation { Catalan } { and } { i } - \DeclareTranslation { Slovene } { and } { in } \DeclareTranslation { Portuguese } { and } { e } + \DeclareTranslation { Slovene } { and } { in } + \DeclareTranslation { Brazilian } { to~(numerical~range) } { a } \DeclareTranslation { Catalan } { to~(numerical~range) } { a } \DeclareTranslation { English } { to~(numerical~range) } { to } \DeclareTranslation { French } { to~(numerical~range) } { à } \DeclareTranslation { German } { to~(numerical~range) } { bis } \DeclareTranslation { Polish } { to~(numerical~range) } { do } + \DeclareTranslation { Portuguese } { to~(numerical~range) } { a } \DeclareTranslation { Slovene } { to~(numerical~range) } { do } \DeclareTranslation { Spanish } { to~(numerical~range) } { a } - \DeclareTranslation { Brazilian } { to~(numerical~range) } { a } - \DeclareTranslation { Portuguese } { to~(numerical~range) } { a } \keys_set:nn { siunitx } { list-final-separator = diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx index 8df5670c25f..0b51a9cd1c0 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx @@ -683,6 +683,7 @@ \cs_generate_variant:Nn \tl_if_blank:nTF { f } \cs_generate_variant:Nn \tl_if_blank_p:n { f } \cs_generate_variant:Nn \tl_if_in:NnTF { NV } +\cs_generate_variant:Nn \tl_if_in:nnTF { nV } \cs_generate_variant:Nn \tl_remove_all:Nn { NV } \cs_generate_variant:Nn \tl_replace_all:Nnn { NnV } % \end{macrocode} @@ -1695,9 +1696,14 @@ % \begin{macro}{\@@_parse_uncert:N} % \begin{macro}{\@@_parse_uncert:NNN} % \begin{macro}{\@@_parse_uncert_auxi:N, \@@_parse_uncert_auxii:N} -% \begin{macro} {\@@_parse_uncert_auxii:, \@@_parse_uncert_marker:} -% \begin{macro}{\@@_parse_uncert_extend:nnn} -% \begin{macro}{\@@_parse_uncert_after:N} +% \begin{macro}{\@@_parse_uncert_auxii:} +% \begin{macro}{\@@_parse_uncert_marker:} +% \begin{macro}{\@@_parse_uncert_marker:nnn} +% \begin{macro}{\@@_parse_uncert_marker:nnnw} +% \begin{macro}{\@@_parse_uncert_marker:Nnnn} +% \begin{macro}{\@@_parse_uncert_marker:w} +% \begin{macro}{\@@_parse_uncert_marker:nnnnN} +% \begin{macro}{\@@_parse_uncert_after:N} % Parsing a combined uncertainty has a very restricted range of allowed % tokens. A closing uncertainty token in the first place is an error, % so we filter that out explicitly. After that, we check for digits, @@ -1778,9 +1784,11 @@ % not too long, and extend the decimal if it is. % Both of these require data from the collected partial number, % so we extract that first. Checking the decimal part needs the length of the -% not-yet-collected uncertainty. Handily, we know that it should be a set of -% digits then a closing marker. So we can use that as a length: if it's -% too long we can stop. +% not-yet-collected uncertainty. There may be one or more parts to that, so +% we have to grab p to the \emph{first} closing token to count the length: +% just grabbing everything only works if there is only a single uncertainty. +% We take protective steps against an entirely-missing closing token so that +% there is not an uncontrolled error. % \begin{macrocode} \cs_new_protected:Npn \@@_parse_uncert_marker: { @@ -1792,29 +1800,61 @@ \int_compare:nNnTF { \tl_count:N \l_@@_partial_tl } > { \tl_count:n {#2} } { \@@_parse_loop_break:w } - { \@@_parse_uncert_marker:nw {#3} } + { \@@_parse_uncert_marker:nnnw {#1} {#2} {#3} } } -\cs_new_protected:Npn \@@_parse_uncert_marker:nw - #1#2 \q_recursion_tail \q_recursion_stop +\cs_new_protected:Npn \@@_parse_uncert_marker:nnnw + #1#2#3#4 \q_recursion_tail \q_recursion_stop { - \int_compare:nNnTF - { \tl_count:n {#2} - 1 } = { \tl_count:n {#1} } - { - \str_if_eq:eeTF - { \exp_not:V \l_@@_uncert_tl } - { \prg_replicate:nn { \tl_count:N \l_@@_partial_tl } { 0 } } - { \@@_parse_uncert:NNN \c_false_bool } - { \@@_parse_uncert:NNN \c_true_bool } - \@@_parse_uncert_auxii:N + \tl_if_in:nVTF {#4} \l_@@_input_uncert_close_tl + { + \exp_after:wN \@@_parse_uncert_marker:Nnnn + \l_@@_input_uncert_close_tl + {#1} {#2} {#3} } - { \exp_after:wN \@@_parse_uncert_extend:nnn \l_@@_parsed_tl } - #2 \q_recursion_tail \q_recursion_stop + { \@@_parse_loop_break:w } + #4 \q_recursion_tail \q_recursion_stop + } +\cs_new_protected:Npn \@@_parse_uncert_marker:Nnnn + #1#2#3#4 + { + \cs_set_protected:Npn \@@_parse_uncert_marker:w ##1 #1 + { \@@_parse_uncert_marker:nnnnN {#2} {#3} {#4} {##1} #1 } + \@@_parse_uncert_marker:w } -\cs_new_protected:Npn \@@_parse_uncert_extend:nnn #1#2#3 +\cs_new_protected:Npn \@@_parse_uncert_marker:w { } +% \end{macrocode} +% With the separated out main part and the current uncertainty part +% available, we can pad the main part if required then restart the +% collection of the uncertainty having thrown away the decimal marker +% and with the lengths lined up. +% \begin{macrocode} +\cs_new_protected:Npn \@@_parse_uncert_marker:nnnnN #1#2#3#4#5 { - \tl_set:Nn \l_@@_parsed_tl { {#1} {#2} { #3 0 } } - \@@_parse_uncert:NNN \c_true_bool - \@@_parse_uncert_auxii:N + \tl_set:Nx \l_@@_parsed_tl + { + {#1} + {#2} + { + #3 + \prg_replicate:nn + { + \int_max:nn + { 0 } + { \tl_count:n {#4} - \tl_count:n {#3} } + } + { 0 } + } + } + \tl_if_empty:NTF \l_@@_partial_tl + { + \@@_parse_uncert:NNN \c_false_bool + \@@_parse_uncert_auxii:N + } + { + \@@_parse_uncert:NNN \c_true_bool + \@@_parse_uncert_auxii:N + } + #4#5 } % \end{macrocode} % At the end of collection, we can either start another one or be done: @@ -1860,6 +1900,11 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} % % \subsection{Processing numbers} % diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx index 3242c280077..78b5ffa7762 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx @@ -122,7 +122,7 @@ % % Identify the package and give the over all version information. % \begin{macrocode} -\ProvidesExplPackage {siunitx} {2023-03-14} {3.2.3} +\ProvidesExplPackage {siunitx} {2023-04-04} {3.2.4} {A comprehensive (SI) units package} % \end{macrocode} % diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty index 2a998acf188..6ecc46054e1 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} {2023-03-14} {3.2.3} +\ProvidesExplPackage {siunitx} {2023-04-04} {3.2.4} {A comprehensive (SI) units package} \msg_new:nnnn { siunitx } { incompatible-package } { Package~'#1'~incompatible. } @@ -1696,18 +1696,18 @@ inter-unit-product = \, , output-decimal-marker = { , } } , - locale / PL .meta:n = - { - exponent-product = \cdot , - inter-unit-product = \cdot , - output-decimal-marker = { , } - } , locale / FR .meta:n = { exponent-product = \times , inter-unit-product = \, , output-decimal-marker = { , } } , + locale / PL .meta:n = + { + exponent-product = \cdot , + inter-unit-product = \cdot , + output-decimal-marker = { , } + } , locale / SI .meta:n = { exponent-product = \times , @@ -1737,17 +1737,17 @@ { \RequirePackage { translations } \DeclareTranslation { Catalan } { and } { i } - \DeclareTranslation { Slovene } { and } { in } \DeclareTranslation { Portuguese } { and } { e } + \DeclareTranslation { Slovene } { and } { in } + \DeclareTranslation { Brazilian } { to~(numerical~range) } { a } \DeclareTranslation { Catalan } { to~(numerical~range) } { a } \DeclareTranslation { English } { to~(numerical~range) } { to } \DeclareTranslation { French } { to~(numerical~range) } { à } \DeclareTranslation { German } { to~(numerical~range) } { bis } \DeclareTranslation { Polish } { to~(numerical~range) } { do } + \DeclareTranslation { Portuguese } { to~(numerical~range) } { a } \DeclareTranslation { Slovene } { to~(numerical~range) } { do } \DeclareTranslation { Spanish } { to~(numerical~range) } { a } - \DeclareTranslation { Brazilian } { to~(numerical~range) } { a } - \DeclareTranslation { Portuguese } { to~(numerical~range) } { a } \keys_set:nn { siunitx } { list-final-separator = @@ -1773,6 +1773,7 @@ \cs_generate_variant:Nn \tl_if_blank:nTF { f } \cs_generate_variant:Nn \tl_if_blank_p:n { f } \cs_generate_variant:Nn \tl_if_in:NnTF { NV } +\cs_generate_variant:Nn \tl_if_in:nnTF { nV } \cs_generate_variant:Nn \tl_remove_all:Nn { NV } \cs_generate_variant:Nn \tl_replace_all:Nnn { NnV } \tl_new:N \l__siunitx_number_tmp_tl @@ -2402,29 +2403,55 @@ \int_compare:nNnTF { \tl_count:N \l__siunitx_number_partial_tl } > { \tl_count:n {#2} } { \__siunitx_number_parse_loop_break:w } - { \__siunitx_number_parse_uncert_marker:nw {#3} } + { \__siunitx_number_parse_uncert_marker:nnnw {#1} {#2} {#3} } } -\cs_new_protected:Npn \__siunitx_number_parse_uncert_marker:nw - #1#2 \q_recursion_tail \q_recursion_stop +\cs_new_protected:Npn \__siunitx_number_parse_uncert_marker:nnnw + #1#2#3#4 \q_recursion_tail \q_recursion_stop { - \int_compare:nNnTF - { \tl_count:n {#2} - 1 } = { \tl_count:n {#1} } + \tl_if_in:nVTF {#4} \l__siunitx_number_input_uncert_close_tl { - \str_if_eq:eeTF - { \exp_not:V \l__siunitx_number_uncert_tl } - { \prg_replicate:nn { \tl_count:N \l__siunitx_number_partial_tl } { 0 } } - { \__siunitx_number_parse_uncert:NNN \c_false_bool } - { \__siunitx_number_parse_uncert:NNN \c_true_bool } - \__siunitx_number_parse_uncert_auxii:N + \exp_after:wN \__siunitx_number_parse_uncert_marker:Nnnn + \l__siunitx_number_input_uncert_close_tl + {#1} {#2} {#3} } - { \exp_after:wN \__siunitx_number_parse_uncert_extend:nnn \l__siunitx_number_parsed_tl } - #2 \q_recursion_tail \q_recursion_stop + { \__siunitx_number_parse_loop_break:w } + #4 \q_recursion_tail \q_recursion_stop } -\cs_new_protected:Npn \__siunitx_number_parse_uncert_extend:nnn #1#2#3 +\cs_new_protected:Npn \__siunitx_number_parse_uncert_marker:Nnnn + #1#2#3#4 + { + \cs_set_protected:Npn \__siunitx_number_parse_uncert_marker:w ##1 #1 + { \__siunitx_number_parse_uncert_marker:nnnnN {#2} {#3} {#4} {##1} #1 } + \__siunitx_number_parse_uncert_marker:w + } +\cs_new_protected:Npn \__siunitx_number_parse_uncert_marker:w { } +\cs_new_protected:Npn \__siunitx_number_parse_uncert_marker:nnnnN #1#2#3#4#5 { - \tl_set:Nn \l__siunitx_number_parsed_tl { {#1} {#2} { #3 0 } } - \__siunitx_number_parse_uncert:NNN \c_true_bool - \__siunitx_number_parse_uncert_auxii:N + \tl_set:Nx \l__siunitx_number_parsed_tl + { + {#1} + {#2} + { + #3 + \prg_replicate:nn + { + \int_max:nn + { 0 } + { \tl_count:n {#4} - \tl_count:n {#3} } + } + { 0 } + } + } + \tl_if_empty:NTF \l__siunitx_number_partial_tl + { + \__siunitx_number_parse_uncert:NNN \c_false_bool + \__siunitx_number_parse_uncert_auxii:N + } + { + \__siunitx_number_parse_uncert:NNN \c_true_bool + \__siunitx_number_parse_uncert_auxii:N + } + #4#5 } \cs_new_protected:Npn \__siunitx_number_parse_uncert_after:N #1 { |