From 1bde92bd528b3ba41950517fa33b93fa3005f691 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 4 Feb 2022 22:21:00 +0000 Subject: siunitx (4feb22) git-svn-id: svn://tug.org/texlive/trunk@61879 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md | 8 +++- .../texmf-dist/doc/latex/siunitx/siunitx-code.pdf | Bin 607585 -> 607726 bytes Master/texmf-dist/doc/latex/siunitx/siunitx.pdf | Bin 639462 -> 639466 bytes .../source/latex/siunitx/siunitx-number.dtx | 24 +++++------ .../source/latex/siunitx/siunitx-print.dtx | 27 +++++++----- Master/texmf-dist/source/latex/siunitx/siunitx.dtx | 2 +- Master/texmf-dist/tex/latex/siunitx/siunitx.sty | 47 +++++++++++---------- 7 files changed, 58 insertions(+), 50 deletions(-) diff --git a/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md b/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md index 8a218bd89ce..ba5c3de075a 100644 --- a/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md +++ b/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md @@ -7,6 +7,11 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ## [Unreleased] +## [v3.0.47] - 2022-02-03 + +### Changed +- Better handling of `\mathord` in text mode + ## [v3.0.46] - 2022-02-02 ### Fixed @@ -1698,7 +1703,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.46...HEAD +[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.47...HEAD +[v3.0.47]: https://github.com/josephwright/siunitx/compare/v3.0.46...v3.0.47 [v3.0.46]: https://github.com/josephwright/siunitx/compare/v3.0.45...v3.0.46 [v3.0.45]: https://github.com/josephwright/siunitx/compare/v3.0.44...v3.0.45 [v3.0.44]: https://github.com/josephwright/siunitx/compare/v3.0.43...v3.0.44 diff --git a/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf b/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf index ecd6faf3e6b..d6d131b16c5 100644 Binary files a/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf and b/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf differ diff --git a/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf index c4f79568c01..5563799b59a 100644 Binary files a/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf and b/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf differ diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx index a7bd0b7e160..98f52307c24 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx @@ -3169,7 +3169,6 @@ % \begin{macro}[rEXP]{\@@_output_comparator:nn} % \begin{macro}[rEXP]{\@@_output_sign:nnn} % \begin{macro}[rEXP]{\@@_output_sign:nN} -% \begin{macro}[rEXP]{\@@_output_sign:N} % \begin{macro}[rEXP] % {\@@_output_sign_color:w, \@@_output_sign_brackets:w} % \begin{macro}[rEXP]{\@@_output_integer:nnn} @@ -3310,7 +3309,7 @@ { \bool_if:NTF \l_@@_bracket_negative_bool { \@@_output_sign_brackets:w } - { \@@_output_sign:nN {#1} #2 } + { \@@_output_sign:nN {#1} - } } { \@@_output_sign:nN {#1} #2 } } @@ -3319,14 +3318,9 @@ \cs_new:Npn \@@_output_sign:nN #1#2 { \tl_if_blank:nTF {#1} - { \@@_output_sign:N #2 } - { \exp_not:n { \mathord {#2} } } - } -\cs_new:Npn \@@_output_sign:N #1 - { - \bool_if:NTF \l_@@_tight_bool - { \exp_not:n { \mathord {#1} } } - { \exp_not:n {#1} } + { \use:n } + { \mathord } + { \exp_not:n {#2} } } \cs_new:Npn \@@_output_sign_brackets:w #1 \@@_output_end: @@ -3481,7 +3475,10 @@ \str_if_eq:VnTF \l_@@_uncert_mode_tl { separate } { \exp_not:n {#2} - \@@_output_sign:N \pm + \bool_if:NTF \l_@@_tight_bool + { \mathord } + { \use:n } + { \exp_not:n { \pm } } \exp_not:n {#2} \@@_output_uncert_S_aux:nnn { \int_eval:n { \tl_count:n {#4} - \tl_count:n {#1} } } @@ -3617,9 +3614,9 @@ \bool_lazy_and:nnT { \l_@@_implicit_plus_bool } { ! \str_if_eq_p:nn {#2} { 0 } } - { \@@_output_sign:N + } + { + } } - { \@@_output_sign:N #1 } + { \exp_not:n {#1} } \@@_output_digits:nn { integer } {#2} } % \end{macrocode} @@ -3660,7 +3657,6 @@ % \end{macro} % \end{macro} % \end{macro} -% \end{macro} % % \subsection{Miscellaneous tools} % diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx index 8f1e4bb4677..10a316da897 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% File: siunitx-print.dtx Copyright (C) 2016-2019,2021 Joseph Wright +% File: siunitx-print.dtx Copyright (C) 2016-2019,2021,2022 Joseph Wright % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -791,6 +791,7 @@ % % \begin{macro}{\siunitx_print_text:n} % \begin{macro}{\@@_text_replace:n, \@@_text_replace_aux:n} +% \begin{macro}[EXP]{\@@_text_replace_first:N} % \begin{macro}{\@@_text_replace:N} % \begin{macro}{\@@_text_replace:NNn} % \begin{macro}{\@@_text_replace:Nnnn} @@ -844,28 +845,31 @@ \tl_if_empty:NF \l_siunitx_unit_font_tl { \exp_after:wN \cs_set_eq:NN \l_siunitx_unit_font_tl \use:n } \cs_set:Npn \mathord ##1 - { - \str_case:nnF {##1} - { - { \cdot } { \exp_not:N \textperiodcentered } - { \pm } { \exp_not:N \textpm } - { \times } { \exp_not:N \texttimes } - } - {##1} - } + { \@@_text_replace_first:N ##1 } \cs_set:Npn \pm { \: \exp_not:N \textpm \: } \tl_map_inline:nn { \mp \ge \le \gg \ll } { \cs_set:Npn ##1 { \exp_not:N \ensuremath { \exp_not:N ##1 } } } \cs_set:Npn \cdot { \: \exp_not:N \textperiodcentered \: } \cs_set:Npn \times { \: \exp_not:N \texttimes \: } - \protected@edef \l_@@_tmp_tl { \l_@@_tmp_tl } + \protected@edef \l_@@_tmp_tl + { \exp_after:wN \@@_text_replace_first:N \l_@@_tmp_tl } \@@_text_replace:N \l_@@_tmp_tl \@@_text_replace_aux:n { \tl_use:N \l_@@_tmp_tl } } \group_end: } \cs_new_protected:Npn \@@_text_replace_aux:n #1 {#1} +\cs_new:Npn \@@_text_replace_first:N #1 + { + \str_case:nnF {#1} + { + { \cdot } { \exp_not:N \textperiodcentered } + { \pm } { \exp_not:N \textpm } + { \times } { \exp_not:N \texttimes } + } + {#1} + } \cs_new_protected:Npx \@@_text_replace:N #1 { \exp_not:N \@@_text_replace:NNn #1 @@ -1022,6 +1026,7 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % \subsection{Standard settings for module options} % diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx index e860a803b32..d1d4e125ab9 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} {2022-02-02} {3.0.46} +\ProvidesExplPackage {siunitx} {2022-02-03} {3.0.47} {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 80815547eb8..a821be14f47 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} {2022-02-02} {3.0.46} +\ProvidesExplPackage {siunitx} {2022-02-03} {3.0.47} {A comprehensive (SI) units package} \msg_new:nnnn { siunitx } { incompatible-package } { Package~'#1'~incompatible. } @@ -3272,7 +3272,7 @@ { \bool_if:NTF \l__siunitx_number_bracket_negative_bool { \__siunitx_number_output_sign_brackets:w } - { \__siunitx_number_output_sign:nN {#1} #2 } + { \__siunitx_number_output_sign:nN {#1} - } } { \__siunitx_number_output_sign:nN {#1} #2 } } @@ -3281,14 +3281,9 @@ \cs_new:Npn \__siunitx_number_output_sign:nN #1#2 { \tl_if_blank:nTF {#1} - { \__siunitx_number_output_sign:N #2 } - { \exp_not:n { \mathord {#2} } } - } -\cs_new:Npn \__siunitx_number_output_sign:N #1 - { - \bool_if:NTF \l__siunitx_number_tight_bool - { \exp_not:n { \mathord {#1} } } - { \exp_not:n {#1} } + { \use:n } + { \mathord } + { \exp_not:n {#2} } } \cs_new:Npn \__siunitx_number_output_sign_brackets:w #1 \__siunitx_number_output_end: @@ -3418,7 +3413,10 @@ \str_if_eq:VnTF \l__siunitx_number_uncert_mode_tl { separate } { \exp_not:n {#2} - \__siunitx_number_output_sign:N \pm + \bool_if:NTF \l__siunitx_number_tight_bool + { \mathord } + { \use:n } + { \exp_not:n { \pm } } \exp_not:n {#2} \__siunitx_number_output_uncert_S_aux:nnn { \int_eval:n { \tl_count:n {#4} - \tl_count:n {#1} } } @@ -3541,9 +3539,9 @@ \bool_lazy_and:nnT { \l__siunitx_number_implicit_plus_bool } { ! \str_if_eq_p:nn {#2} { 0 } } - { \__siunitx_number_output_sign:N + } + { + } } - { \__siunitx_number_output_sign:N #1 } + { \exp_not:n {#1} } \__siunitx_number_output_digits:nn { integer } {#2} } \cs_new:Npn \__siunitx_number_output_end: { } @@ -3971,28 +3969,31 @@ \tl_if_empty:NF \l_siunitx_unit_font_tl { \exp_after:wN \cs_set_eq:NN \l_siunitx_unit_font_tl \use:n } \cs_set:Npn \mathord ##1 - { - \str_case:nnF {##1} - { - { \cdot } { \exp_not:N \textperiodcentered } - { \pm } { \exp_not:N \textpm } - { \times } { \exp_not:N \texttimes } - } - {##1} - } + { \__siunitx_print_text_replace_first:N ##1 } \cs_set:Npn \pm { \: \exp_not:N \textpm \: } \tl_map_inline:nn { \mp \ge \le \gg \ll } { \cs_set:Npn ##1 { \exp_not:N \ensuremath { \exp_not:N ##1 } } } \cs_set:Npn \cdot { \: \exp_not:N \textperiodcentered \: } \cs_set:Npn \times { \: \exp_not:N \texttimes \: } - \protected@edef \l__siunitx_print_tmp_tl { \l__siunitx_print_tmp_tl } + \protected@edef \l__siunitx_print_tmp_tl + { \exp_after:wN \__siunitx_print_text_replace_first:N \l__siunitx_print_tmp_tl } \__siunitx_print_text_replace:N \l__siunitx_print_tmp_tl \__siunitx_print_text_replace_aux:n { \tl_use:N \l__siunitx_print_tmp_tl } } \group_end: } \cs_new_protected:Npn \__siunitx_print_text_replace_aux:n #1 {#1} +\cs_new:Npn \__siunitx_print_text_replace_first:N #1 + { + \str_case:nnF {#1} + { + { \cdot } { \exp_not:N \textperiodcentered } + { \pm } { \exp_not:N \textpm } + { \times } { \exp_not:N \texttimes } + } + {#1} + } \cs_new_protected:Npx \__siunitx_print_text_replace:N #1 { \exp_not:N \__siunitx_print_text_replace:NNn #1 -- cgit v1.2.3