From 60b6a6a5d2af2023ea83817a15388e17e1475a44 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 15 Oct 2021 22:16:18 +0000 Subject: siunitx (16oct21) git-svn-id: svn://tug.org/texlive/trunk@60771 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/siunitx/siunitx-print.dtx | 48 ++++++++++------------ .../source/latex/siunitx/siunitx-symbol.dtx | 8 +++- Master/texmf-dist/source/latex/siunitx/siunitx.dtx | 2 +- 3 files changed, 28 insertions(+), 30 deletions(-) (limited to 'Master/texmf-dist/source/latex/siunitx') diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx index fc3ba7c0fca..4f107b5cbb5 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx @@ -765,7 +765,7 @@ % \end{macro} % % \begin{macro}{\siunitx_print_text:n} -% \begin{macro}{\@@_text_replace:n} +% \begin{macro}{\@@_text_replace:n, \@@_text_replace_aux:n} % \begin{macro}{\@@_text_replace:N} % \begin{macro}{\@@_text_replace:NNn} % \begin{macro}{\@@_text_replace:Nnnn} @@ -806,35 +806,36 @@ } % \end{macrocode} % To get math mode material to print in text mode, various search-and-replace -% steps are needed. +% steps are needed. We use \tn{protected@edef} to deal with commands, partly +% for speed and partly as it deals with anything nested inside \cs{mathord}. % \begin{macrocode} \cs_new_protected:Npn \@@_text_replace:n #1 { \group_begin: - \tl_if_head_eq_meaning:nNTF {#1} \mathchoice - { \@@_text_replace:Nnnnn #1 } - { - \tl_set:Nn \l_@@_tmp_tl {#1} - \@@_text_replace:N \l_@@_tmp_tl - \tl_use:N \l_@@_tmp_tl - } + \tl_if_head_eq_meaning:nNTF {#1} \mathchoice + { \@@_text_replace:Nnnnn #1 } + { + \tl_set:Nn \l_@@_tmp_tl {#1} + \@@_replace_font:N \l_@@_tmp_tl + \cs_set:Npn \mathord ##1 {##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 } + \@@_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_protected:Npx \@@_text_replace:N #1 { - \@@_replace_font:N #1 \exp_not:N \@@_text_replace:NNn #1 - \exp_not:N \mathord { } - \exp_not:N \pm - { \exp_not:N \textpm } - \exp_not:N \mp - { \exp_not:n { \ensuremath { \mp } } } - { \exp_not:N \textminus } - \exp_not:N \times - { \exp_not:N \texttimes } - \exp_not:N \cdot - { \exp_not:N \textperiodcentered } \char_generate:nn { `\_ } { 8 } { \exp_not:N \@@_text_sub:n } ^ @@ -880,14 +881,7 @@ { \@ifpackageloaded { bidi } { - \cs_set_protected:Npn \@@_text_replace:n #1 - { - \group_begin: - \tl_set:Nn \l_@@_tmp_tl {#1} - \@@_text_replace:N \l_@@_tmp_tl - \LRE { \tl_use:N \l_@@_tmp_tl } - \group_end: - } + \cs_set_protected:Npn \@@_text_replace_aux:n #1 { \LRE {#1} } } { } } diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx index e8519187221..4fa17bde89b 100644 --- a/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx +++ b/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx @@ -180,7 +180,9 @@ \siunitx_declare_unit:Nxn \degree { \exp_not:N \ifmmode - { } ^ { \exp_not:N \circ } + \@ifpackageloaded { unicode-math } + { \@@_non_latin:n { "00B0 } } + { { } ^ { \exp_not:N \circ } } \exp_not:N \else \exp_not:N \text { @@ -208,7 +210,9 @@ \siunitx_declare_unit:Nx \degreeCelsius { \exp_not:N \ifmmode - { } ^ { \exp_not:N \circ } + \@ifpackageloaded { unicode-math } + { \@@_non_latin:n { "00B0 } } + { { } ^ { \exp_not:N \circ } } \exp_not:N \else \exp_not:N \text { diff --git a/Master/texmf-dist/source/latex/siunitx/siunitx.dtx b/Master/texmf-dist/source/latex/siunitx/siunitx.dtx index f786828c46f..adb8063b9d1 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-09-29} {3.0.32} +\ProvidesExplPackage {siunitx} {2021-10-15} {3.0.33} {A comprehensive (SI) units package} % \end{macrocode} % -- cgit v1.2.3