diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md | 10 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf | bin | 642405 -> 643576 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/siunitx/siunitx.pdf | bin | 691136 -> 691136 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx-compound.dtx | 7 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx | 39 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx | 32 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/siunitx/siunitx.dtx | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/siunitx/siunitx.sty | 60 |
8 files changed, 81 insertions, 69 deletions
diff --git a/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md b/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md index a471996dcf6..cbd19e3d0d9 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.2.8] - 2023-07-25 + +### Fixed +- Suppression of leading `1` when `per-mode = symbol` is used with + non-repeated units ranges (see issue + [\#677](https://github.com/josephwright/siunitx/issues/677)) + ## [v3.2.7] - 2023-07-20 ### Fixed @@ -1914,7 +1921,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.7...HEAD +[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.2.8...HEAD +[v3.2.8]: https://github.com/josephwright/siunitx/compare/v3.2.7...v3.2.8 [v3.2.7]: https://github.com/josephwright/siunitx/compare/v3.2.6...v3.2.7 [v3.2.6]: https://github.com/josephwright/siunitx/compare/v3.2.5...v3.2.6 [v3.2.5]: https://github.com/josephwright/siunitx/compare/v3.2.4...v3.2.5 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 ad5229ba63e..bdd6dfe01a4 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 c89c21174a8..3d9dd8b90c4 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-compound.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-compound.dtx index c4d22488450..51701c6915e 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-compound.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-compound.dtx @@ -337,7 +337,6 @@ % \l_@@_exp_bracket_bool , % \l_@@_exp_combine_bool , % \l_@@_unit_bracket_bool , -% \l_@@_unit_repeat_bool , % \l_@@_unit_repeat_bool % } % List options. @@ -667,7 +666,9 @@ % % \begin{macro}{\siunitx_compound_quantity:nn} % For quantities, life is more complex as there are interactions between the -% options for exponents and units. +% options for exponents and units. The \cs{c_empty_tl} suppresses any +% leading \texttt{1} if the unit starts \cs{per}; the \pkg{siunitx-print} +% module will skip any printing in this case. % \begin{macrocode} \cs_new_protected:Npn \siunitx_compound_quantity:nn #1#2 { @@ -698,7 +699,7 @@ \siunitx_print_number:V \l_@@_bracket_close_tl } { \@@_print:N \siunitx_print_number:x } - \@@_print_quantity:n { } + \@@_print_quantity:n { \c_empty_tl } } \group_end: } diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx index 0b51a9cd1c0..8bc0a2dd718 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx @@ -2619,7 +2619,8 @@ % } % \begin{macro}[EXP]{\@@_round_auxiv:nnN, \@@_round_auxv:nnN} % \begin{macro}[EXP]{\@@_round_auxvi:nN} -% \begin{macro}[EXP]{\@@_round_auxvii:nnN, \@@_round_auxviii:nnN} +% \begin{macro}[EXP]{\@@_round_auxvii:nnTF} +% \begin{macro}[EXP]{\@@_round_auxviii:nnN, \@@_round_auxix:nnN} % \begin{macro}[EXP]{\@@_round_final_integer:nnw, \@@_round_final_decimal:nnw} % \begin{macro}[EXP]{\@@_round_final_signicant:n} % \begin{macro}[EXP]{\@@_round_final_signicant:N} @@ -2731,37 +2732,32 @@ \@@_round_auxvi:nnN {#1} { } #2 \q_recursion_tail \q_recursion_stop } - \bool_lazy_or:nnTF - { \int_compare_p:nNn { 0 \tl_head:n {#1} } < 5 } - { - \bool_lazy_all_p:n - { - { \l_@@_round_half_even_bool } - { ! \int_if_odd_p:n {#3} } - { \@@_round_if_half_p:n {#1} } - } - } + \@@_round_auxvii:nnTF {#1} {#3} { \@@_round_final_decimal:nnw } - { \@@_round_auxvii:nnN } + { \@@_round_auxviii:nnN } {#2} { } #3 } \cs_new:Npn \@@_round_auxvi:nnN #1#2#3 { \quark_if_recursion_tail_stop_do:Nn #3 { { 0 } { } } + \@@_round_auxvii:nnTF {#1} {#3} + { \@@_round_final_integer:nnw } + { \@@_round_auxix:nnN } + { } {#2} #3 + } +\cs_new:Npn \@@_round_auxvii:nnTF #1#2 + { \bool_lazy_or:nnTF { \int_compare_p:nNn { 0 \tl_head:n {#1} } < 5 } { \bool_lazy_all_p:n { { \l_@@_round_half_even_bool } - { ! \int_if_odd_p:n {#3} } + { ! \int_if_odd_p:n {#2} } { \@@_round_if_half_p:n {#1} } } } - { \@@_round_final_integer:nnw } - { \@@_round_auxviii:nnN } - { } {#2} #3 } % \end{macrocode} % The main rounding routines. These are only every called when there is @@ -2771,7 +2767,7 @@ % where a zero is rounded up: that automatically means a need to trim % the other end. % \begin{macrocode} -\cs_new:Npn \@@_round_auxvii:nnN #1#2#3 +\cs_new:Npn \@@_round_auxviii:nnN #1#2#3 { \quark_if_recursion_tail_stop_do:Nn #3 { @@ -2782,12 +2778,12 @@ { \@@_round_truncate:n {#2} } } { - \@@_round_auxviii:nnN {#2} { } #1 + \@@_round_auxix:nnN {#2} { } #1 \q_recursion_tail \q_recursion_stop } } \int_compare:nNnTF {#3} = 9 - { \@@_round_auxvii:nnN {#1} { 0 #2 } } + { \@@_round_auxviii:nnN {#1} { 0 #2 } } { \int_compare:nNnTF {#3} = 0 { @@ -2810,7 +2806,7 @@ } } } -\cs_new:Npn \@@_round_auxviii:nnN #1#2#3 +\cs_new:Npn \@@_round_auxix:nnN #1#2#3 { \quark_if_recursion_tail_stop_do:Nn #3 { @@ -2830,7 +2826,7 @@ } } \int_compare:nNnTF {#3} = 9 - { \@@_round_auxviii:nnN {#1} { 0 #2 } } + { \@@_round_auxix:nnN {#1} { 0 #2 } } { \@@_round_final:fn { \int_eval:n { #3 + 1 } } @@ -2985,6 +2981,7 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % \begin{macro}[EXP]{\@@_round_if_half_p:n} % \begin{macro}[EXP]{\@@_round_if_half:N} diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx index 0e8277cd93f..86540606512 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx @@ -106,7 +106,8 @@ % roman font, and |^| and |_| will typically be used to indicate super- and % subscripts, respectively. These elements will be correctly handled when % printing for example using |\mathsf| in math mode, or using only text -% fonts. +% fonts. No printing takes place if the \cs{material} is entirely empty +% after a single expansion. % \end{function} % % \begin{function} @@ -120,7 +121,8 @@ % with a fixed text or math mode output. The printing does \emph{not} set % color (which is managed on a |unit|/|number| basis), but otherwise sets % the font as described above. The |match| function uses either the prevailing -% math or text mode. +% math or text mode. No printing takes place if the \cs{material} is entirely +% empty after a single expansion. % \end{function} % % \subsection{Key--value options} @@ -449,7 +451,10 @@ % } % \begin{macro}{\@@_aux:nn} % The main printing function doesn't actually need to do very much: just set -% the color and select the correct sub-function. +% the color and select the correct sub-function. The \cs{tl_if_empty:oF} is +% needed to allow a leading \texttt{1} to be omitted in the case of a unit +% starting \cs{per} in cases where we can't simply use an entirely empty +% value: see the \pkg{siunitx-compound} submodule. % \begin{macrocode} \cs_new_protected:Npn \siunitx_print_number:n #1 { \@@_aux:nn { number } {#1} } @@ -459,17 +464,20 @@ \cs_generate_variant:Nn \siunitx_print_unit:n { V , x } \cs_new_protected:Npn \@@_aux:nn #1#2 { - \tl_if_empty:cTF { l_@@_ #1 _color_tl } - { \use:n } - { \exp_args:Nv \textcolor { l_@@_ #1 _color_tl } } - { - \use:c + \tl_if_empty:oF {#2} + { + \tl_if_empty:cTF { l_@@_ #1 _color_tl } + { \use:n } + { \exp_args:Nv \textcolor { l_@@_ #1 _color_tl } } { - siunitx_print_ - \tl_use:c { l_@@_ #1 _mode_tl } :n + \use:c + { + siunitx_print_ + \tl_use:c { l_@@_ #1 _mode_tl } :n + } + {#2} } - {#2} - } + } } % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx index 31b3e791814..75b83bf1828 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-07-20} {3.2.7} +\ProvidesExplPackage {siunitx} {2023-07-25} {3.2.8} {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 0b201695cc6..5bf7e83d355 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-07-20} {3.2.7} +\ProvidesExplPackage {siunitx} {2023-07-25} {3.2.8} {A comprehensive (SI) units package} \msg_new:nnnn { siunitx } { incompatible-package } { Package~'#1'~incompatible. } @@ -1398,7 +1398,7 @@ \siunitx_print_number:V \l__siunitx_compound_bracket_close_tl } { \__siunitx_compound_print:N \siunitx_print_number:x } - \__siunitx_compound_print_quantity:n { } + \__siunitx_compound_print_quantity:n { \c_empty_tl } } \group_end: } @@ -3056,39 +3056,34 @@ \__siunitx_number_round_auxvi:nnN {#1} { } #2 \q_recursion_tail \q_recursion_stop } - \bool_lazy_or:nnTF - { \int_compare_p:nNn { 0 \tl_head:n {#1} } < 5 } - { - \bool_lazy_all_p:n - { - { \l__siunitx_number_round_half_even_bool } - { ! \int_if_odd_p:n {#3} } - { \__siunitx_number_round_if_half_p:n {#1} } - } - } + \__siunitx_number_round_auxvii:nnTF {#1} {#3} { \__siunitx_number_round_final_decimal:nnw } - { \__siunitx_number_round_auxvii:nnN } + { \__siunitx_number_round_auxviii:nnN } {#2} { } #3 } \cs_new:Npn \__siunitx_number_round_auxvi:nnN #1#2#3 { \quark_if_recursion_tail_stop_do:Nn #3 { { 0 } { } } + \__siunitx_number_round_auxvii:nnTF {#1} {#3} + { \__siunitx_number_round_final_integer:nnw } + { \__siunitx_number_round_auxix:nnN } + { } {#2} #3 + } +\cs_new:Npn \__siunitx_number_round_auxvii:nnTF #1#2 + { \bool_lazy_or:nnTF { \int_compare_p:nNn { 0 \tl_head:n {#1} } < 5 } { \bool_lazy_all_p:n { { \l__siunitx_number_round_half_even_bool } - { ! \int_if_odd_p:n {#3} } + { ! \int_if_odd_p:n {#2} } { \__siunitx_number_round_if_half_p:n {#1} } } } - { \__siunitx_number_round_final_integer:nnw } - { \__siunitx_number_round_auxviii:nnN } - { } {#2} #3 } -\cs_new:Npn \__siunitx_number_round_auxvii:nnN #1#2#3 +\cs_new:Npn \__siunitx_number_round_auxviii:nnN #1#2#3 { \quark_if_recursion_tail_stop_do:Nn #3 { @@ -3099,12 +3094,12 @@ { \__siunitx_number_round_truncate:n {#2} } } { - \__siunitx_number_round_auxviii:nnN {#2} { } #1 + \__siunitx_number_round_auxix:nnN {#2} { } #1 \q_recursion_tail \q_recursion_stop } } \int_compare:nNnTF {#3} = 9 - { \__siunitx_number_round_auxvii:nnN {#1} { 0 #2 } } + { \__siunitx_number_round_auxviii:nnN {#1} { 0 #2 } } { \int_compare:nNnTF {#3} = 0 { @@ -3127,7 +3122,7 @@ } } } -\cs_new:Npn \__siunitx_number_round_auxviii:nnN #1#2#3 +\cs_new:Npn \__siunitx_number_round_auxix:nnN #1#2#3 { \quark_if_recursion_tail_stop_do:Nn #3 { @@ -3147,7 +3142,7 @@ } } \int_compare:nNnTF {#3} = 9 - { \__siunitx_number_round_auxviii:nnN {#1} { 0 #2 } } + { \__siunitx_number_round_auxix:nnN {#1} { 0 #2 } } { \__siunitx_number_round_final:fn { \int_eval:n { #3 + 1 } } @@ -4513,17 +4508,20 @@ \cs_generate_variant:Nn \siunitx_print_unit:n { V , x } \cs_new_protected:Npn \__siunitx_print_aux:nn #1#2 { - \tl_if_empty:cTF { l__siunitx_print_ #1 _color_tl } - { \use:n } - { \exp_args:Nv \textcolor { l__siunitx_print_ #1 _color_tl } } - { - \use:c + \tl_if_empty:oF {#2} + { + \tl_if_empty:cTF { l__siunitx_print_ #1 _color_tl } + { \use:n } + { \exp_args:Nv \textcolor { l__siunitx_print_ #1 _color_tl } } { - siunitx_print_ - \tl_use:c { l__siunitx_print_ #1 _mode_tl } :n + \use:c + { + siunitx_print_ + \tl_use:c { l__siunitx_print_ #1 _mode_tl } :n + } + {#2} } - {#2} - } + } } \cs_new_protected:Npn \siunitx_print_match:n #1 { |