texlive[59381] Master/texmf-dist: siunitx (28may21)

commits+karl at tug.org commits+karl at tug.org
Fri May 28 22:51:02 CEST 2021


Revision: 59381
          http://tug.org/svn/texlive?view=revision&revision=59381
Author:   karl
Date:     2021-05-28 22:51:02 +0200 (Fri, 28 May 2021)
Log Message:
-----------
siunitx (28may21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md
    trunk/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf
    trunk/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
    trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex
    trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty

Modified: trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md	2021-05-28 20:50:48 UTC (rev 59380)
+++ trunk/Master/texmf-dist/doc/latex/siunitx/CHANGELOG.md	2021-05-28 20:51:02 UTC (rev 59381)
@@ -7,6 +7,16 @@
 
 ## [Unreleased]
 
+## [v3.0.7]
+
+### Fixed
+- Formatting of some literal units (issue #449)
+- Issue a warning for removed option `load-configurations`
+  (issue #455)
+- Printing of `\times` and `\cdot` in text mode when using a
+  locale (issue #457)
+- Implement missing `output-exponent-marker` (issue #458)
+
 ## [v3.0.6]
 
 ### Changed
@@ -1312,7 +1322,8 @@
 ### Added
 - First public testing release (as `si`)
 
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.6...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.7...HEAD
+[v3.0.7]: https://github.com/josephwright/siunitx/compare/v3.0.6...v3.0.7
 [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

Modified: trunk/Master/texmf-dist/doc/latex/siunitx/siunitx-code.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/siunitx/siunitx.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx	2021-05-28 20:50:48 UTC (rev 59380)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-emulation.dtx	2021-05-28 20:51:02 UTC (rev 59381)
@@ -125,8 +125,14 @@
 % \subsection{Load-time option}
 %
 %    \begin{macrocode}
-\clist_map_inline:nn { abbreviations , binary-units , version-1-compatibility }
+\clist_map_inline:nn
   {
+    abbreviations           ,
+    binary-units            ,
+    load-configurations     ,
+    version-1-compatibility
+  }
+  {
     \keys_define:nn { siunitx } { #1 .code:n = \@@_option_removed:n {#1} }
   }
 %    \end{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx	2021-05-28 20:50:48 UTC (rev 59380)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-number.dtx	2021-05-28 20:51:02 UTC (rev 59381)
@@ -2860,6 +2860,7 @@
 %      \l_@@_group_minimum_int      ,
 %      \l_@@_group_separator_tl     ,
 %      \l_@@_negative_color_tl      ,
+%      \l_@@_output_exp_marker_tl   ,
 %      \l_@@_output_uncert_close_tl ,
 %      \l_@@_output_uncert_open_tl  ,
 %      \l_@@_uncert_mode_tl         ,
@@ -2912,6 +2913,8 @@
       \l_@@_output_uncert_close_tl ,
     output-decimal-marker .tl_set:N =
       \l_siunitx_number_output_decimal_tl ,
+    output-exponent-marker .tl_set:N =
+      \l_@@_output_exp_marker_tl ,
     output-open-uncertainty .tl_set:N =
       \l_@@_output_uncert_open_tl ,
     print-implicit-plus .bool_set:N =
@@ -2980,7 +2983,13 @@
 %     \@@_output_uncert_S_compact-marker:nn ,
 %     \@@_output_uncert_S_full:nn
 %   }
-% \begin{macro}[rEXP]{\@@_output_exponent:nnnn}
+% \begin{macro}[rEXP]
+%   {
+%     \@@_output_exponent:nnnn       ,
+%     \@@_output_exponent_auxi:nnnn  ,
+%     \@@_output_exponent_auxii:nnnn
+%   }
+% \begin{macro}[rEXP]{\@@_output_exponent_auxiii:nn}
 % \begin{macro}[rEXP]{\@@_output_end:}
 %   The approach to formatting a single number is to split into
 %   the constituent parts. All of the parts are assembled including
@@ -3371,31 +3380,46 @@
       { \l_@@_zero_exponent_bool }
       { ! \str_if_eq_p:nn {#2} { 0 } }
       {
-        \bool_lazy_and:nnTF
-          { \str_if_eq_p:nn {#3} { 1. } }
-          { ! \l_@@_unity_mantissa_bool }
-          { \exp_not:n {#4} }
-          {
-            \bool_if:NTF \l_@@_tight_bool
-              { \exp_not:N \mathord }
-              { \use:n }
-                { \exp_not:V \l_@@_exponent_product_tl }
-            \exp_not:n {#4}
-          }
-        \exp_not:V \l_@@_exponent_base_tl
-        ^
-          {
-            \tl_if_blank:nTF {#1}
-              {
-                \bool_if:NT \l_@@_implicit_plus_bool
-                  { \@@_output_sign:N + }
-              }
-              { \@@_output_sign:N #1 }
-            \@@_output_digits:nn { integer } {#2}
-          }
+        \tl_if_empty:NTF \l_@@_output_exp_marker_tl
+          { \@@_output_exponent_auxi:nnnn }
+          { \@@_output_exponent_auxii:nnnn }
+            {#1} {#2} {#3} {#4}
       }
       { \exp_not:n {#4} }
   }
+\cs_new:Npn \@@_output_exponent_auxi:nnnn #1#2#3#4
+  {
+    \bool_lazy_and:nnTF
+      { \str_if_eq_p:nn {#3} { 1. } }
+      { ! \l_@@_unity_mantissa_bool }
+      { \exp_not:n {#4} }
+      {
+        \bool_if:NTF \l_@@_tight_bool
+          { \exp_not:N \mathord }
+          { \use:n }
+            { \exp_not:V \l_@@_exponent_product_tl }
+        \exp_not:n {#4}
+      }
+    \exp_not:V \l_@@_exponent_base_tl
+    ^
+      { \@@_output_exponent_auxiii:nn {#1} {#2} }
+  }
+\cs_new:Npn \@@_output_exponent_auxii:nnnn #1#2#3#4
+  {
+    \exp_not:n {#4}
+    \exp_not:V \l_@@_output_exp_marker_tl
+    \@@_output_exponent_auxiii:nn {#1} {#2}
+  }
+\cs_new:Npn \@@_output_exponent_auxiii:nn #1#2
+  {
+    \tl_if_blank:nTF {#1}
+      {
+        \bool_if:NT \l_@@_implicit_plus_bool
+          { \@@_output_sign:N + }
+      }
+      { \@@_output_sign:N #1 }
+    \@@_output_digits:nn { integer } {#2}
+  }
 %    \end{macrocode}
 %   A do-nothing marker used to allow shuffling of the output and so expandable
 %   operations for formatting.
@@ -3437,6 +3461,7 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
+% \end{macro}
 %
 % \subsection{Miscellaneous tools}
 %

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx	2021-05-28 20:50:48 UTC (rev 59380)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-print.dtx	2021-05-28 20:51:02 UTC (rev 59381)
@@ -78,8 +78,8 @@
 % also required to provide the functionality detailed.
 % \begin{itemize}
 %   \item \pkg{color}: support for color using \cs{textcolor}
-%   \item \pkg{textcomp}: \cs{textminus} and \cs{textpm} for printing
-%     in text mode
+%   \item \pkg{textcomp}: \cs{textminus}, \cs{textpm} \cs{texttimes} and
+%     \cs{textcenteredperiod} for printing in text mode
 %   \item \pkg{amstext}: the \cs{text} command for printing in text mode
 % \end{itemize}
 % For detection of math mode fonts, as well as \cs{mathrm}, the existence of
@@ -779,6 +779,10 @@
         { \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 }
       ^

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx	2021-05-28 20:50:48 UTC (rev 59380)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-symbol.dtx	2021-05-28 20:51:02 UTC (rev 59381)
@@ -253,62 +253,6 @@
   }
 %    \end{macrocode}
 %
-%   For the times symbol, only \LuaTeX{} allows us to use the math mode symbol
-%   directly. However, that likely won't follow the surrounding font appearance,
-%   so in all cases we use the |TS1| version for text. Otherwise much the
-%   same as |\textmu| support. It's hard to check for the product symbol, so
-%   we just go with it an hope for the best!
-%    \begin{macrocode}
-\keys_set:nn { siunitx }
-  { product-symbol  = \ifmmode \times \else \texttimes \fi }
-\AtBeginDocument
-  {
-    \group_begin:
-        \tl_set:Nn \l_@@_tmpa_tl
-          { { } { } { 2 } { } { } { } { 1 } }
-        \tl_set:Nx \l_@@_tmpa_tl
-          { \siunitx_number_output:N \l_@@_tmpa_tl }
-        \tl_set:Nn \l_@@_tmpb_tl { 2 \times 10 ^ { 1 } }
-        \tl_if_eq:NNTF \l_@@_tmpa_tl \l_@@_tmpb_tl
-          {
-            \group_end:
-            \keys_set:nn { siunitx }
-              {
-                exponent-product =
-                  \ifmmode \times \else \texttimes \fi
-              }
-          }
-          {
-            \tl_set:Nn \l_@@_tmpb_tl { 2 \cdot 10 ^ { 1 } }
-            \tl_if_eq:NNTF \l_@@_tmpa_tl \l_@@_tmpb_tl
-              {
-                \group_end:
-                \keys_set:nn { siunitx }
-                  {
-                    exponent-product =
-                      \ifmmode \cdot \else \textperiodcentered \fi
-                  }
-              }
-              { \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
-      \tl_if_eq:NNTF \l_@@_tmpa_tl \l_@@_tmpb_tl
-        {
-          \group_end:
-          \keys_set:nn { siunitx }
-            {
-              inter-unit-product =
-                \ifmmode \cdot \else \textperiodcentered \fi
-            }
-        }
-        { \group_end: }
-  }
-%    \end{macrocode}
-%
 % \subsection{Bookmark definitions}
 %
 % Inside PDF strings we disable the text printing function. The definition of

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx	2021-05-28 20:50:48 UTC (rev 59380)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx-unit.dtx	2021-05-28 20:51:02 UTC (rev 59381)
@@ -1179,8 +1179,12 @@
 % \begin{macro}{\@@_format_literal_auxi:w}
 % \begin{macro}{\@@_format_literal_auxii:w}
 % \begin{macro}{\@@_format_literal_auxiii:w}
-% \begin{macro}{\@@_format_literal_auxiv:w}
-% \begin{macro}{\@@_format_literal_auxv:w}
+% \begin{macro}{\@@_format_literal_auxiv:n}
+% \begin{macro}{\@@_format_literal_auxv:nw}
+% \begin{macro}{\@@_format_literal_auxvi:nN}
+% \begin{macro}{\@@_format_literal_super:nn, \@@_format_literal_sub:nn}
+% \begin{macro}{\@@_format_literal_add:n}
+% \begin{macro}{\@@_format_literal_auxvii:nn}
 % \begin{variable}{\l_@@_separator_tl}
 %   To format literal units, there are two tasks to do. The input is
 %   \texttt{x}-type expanded to force any symbolic units to be converted into
@@ -1254,71 +1258,79 @@
 \cs_new_protected:Npn \@@_format_literal_auxiii:w #1 /
   {
     \quark_if_recursion_tail_stop:n {#1}
-    \@@_format_literal_auxiv:w #1 ^ ^ \q_stop
+    \@@_format_literal_auxiv:n {#1}
     \tl_set:Nn \l_@@_separator_tl { / }
     \@@_format_literal_auxiii:w
   }
+\cs_new_protected:Npn \@@_format_literal_auxiv:n #1
+  {
+    \@@_format_literal_auxv:nw { }
+      #1 \q_recursion_tail \q_recursion_stop
+  }
 %    \end{macrocode}
-%   Within each unit any sub- and superscript parts need to be separated out:
-%   wrapping everything in the font command is incorrect. The superscript part
-%   is relatively easy as there is no catcode issue or font command to add,
-%   while the subscript part needs a bit more work. As the user might have the
-%   two parts in either order, picking up the subscript needs to look in two
-%   places. We assume that only one is given: odd input here is simply accepted.
+%   To deal properly with literal formatting, we have to worry about super-
+%   and subscript markers. That can be complicated as they could come anywhere
+%   in the input: we handle that by iterating through the input and picking
+%   them out. This avoids any issue with loosing braces for mid-input scripts.
+%   We also have to deal with fractions, hence needing a series of nested
+%   loops and a change of separator.
 %    \begin{macrocode}
-\use:x
+\cs_new_protected:Npn \@@_format_literal_auxv:nw
+  #1#2 \q_recursion_stop
   {
-    \cs_new_protected:Npn \exp_not:N \@@_format_literal_auxiv:w
-      ##1 ^ ##2 ^ ##3 \exp_not:N \q_stop
+    \tl_if_head_is_N_type:nTF {#2}
+      { \@@_format_literal_auxvi:nN }
+      { \@@_format_literal_auxvii:nn }
+        {#1} #2 \q_recursion_stop
+  }
+\cs_new_protected:Npx \@@_format_literal_auxvi:nN #1#2
+  {
+    \exp_not:N \quark_if_recursion_tail_stop_do:Nn #2
+      { \exp_not:N \@@_format_literal_add:n {#1} }
+    \exp_not:N \token_if_eq_meaning:NNTF #2 ^
+      { \exp_not:N \@@_format_literal_super:nn {#1} }
       {
-        \exp_not:N \@@_format_literal_auxv:w
-          ##1
-          \c_@@_math_subscript_tl
-          \c_@@_math_subscript_tl
-          \exp_not:N \q_mark
-          ##2
-          \c_@@_math_subscript_tl
-          \c_@@_math_subscript_tl
-          \exp_not:N \q_stop
+        \exp_not:N \token_if_eq_meaning:NNTF
+          #2 \c_@@_math_subscript_tl
+          { \exp_not:N \@@_format_literal_sub:nn {#1} }
+          { \exp_not:N \@@_format_literal_auxvi:nN {#1#2} }
       }
-    \cs_new_protected:Npn \exp_not:N \@@_format_literal_auxv:w
-      ##1 \c_@@_math_subscript_tl
-      ##2 \c_@@_math_subscript_tl ##3
-      \exp_not:N \q_mark
-      ##4 \c_@@_math_subscript_tl
-      ##5 \c_@@_math_subscript_tl ##6
-      \exp_not:N \q_stop
+  }
+\cs_new_protected:Npn \@@_format_literal_super:nn #1#2
+  {
+    \quark_if_recursion_tail_stop:n {#2}
+    \@@_format_literal_add:n {#1}
+    \tl_put_right:Nn \l_@@_formatted_tl { ^ {#2} }
+    \@@_format_literal_auxvi:nN { }
+  }
+\cs_new_protected:Npx \@@_format_literal_sub:nn #1#2
+  {
+    \exp_not:N \quark_if_recursion_tail_stop:n {#2}
+    \exp_not:N \@@_format_literal_add:n {#1}
+    \tl_put_right:Nx \exp_not:N \l_@@_formatted_tl
       {
-        \tl_set:Nx \exp_not:N \l_@@_formatted_tl
+        \c_@@_math_subscript_tl
           {
             \exp_not:N \exp_not:V
-              \exp_not:N \l_@@_formatted_tl
-            \exp_not:N \tl_if_empty:NF
-              \exp_not:N \l_@@_formatted_tl
-              {
-                \exp_not:N \exp_not:V
-                  \exp_not:N \l_@@_separator_tl
-              }
-            \exp_not:N \tl_if_blank:nF {##1}
-              {
-                \exp_not:N \exp_not:V
-                  \exp_not:N \l_siunitx_unit_font_tl
-                  { \exp_not:N \exp_not:n {##1} }
-              }
-            \exp_not:N \tl_if_blank:nF {##4}
-              { ^ { \exp_not:N \exp_not:n {##4} } }
-            \exp_not:N \tl_if_blank:nF {##2##5}
-              {
-                \c_@@_math_subscript_tl
-                  {
-                    \exp_not:N \exp_not:V
-                      \exp_not:N \l_siunitx_unit_font_tl
-                      { \exp_not:N \exp_not:n {##2##5} }
-                  }
-              }
+              \exp_not:N \l_siunitx_unit_font_tl
+                { \exp_not:N \exp_not:n {#2} }
           }
       }
+    \exp_not:N \@@_format_literal_auxvi:nN { }
   }
+\cs_new_protected:Npn \@@_format_literal_add:n #1
+  {
+    \tl_put_right:Nx \l_@@_formatted_tl
+      {
+        \tl_if_empty:NF \l_@@_formatted_tl
+          { \exp_not:V \l_@@_separator_tl }
+        \tl_if_empty:nF {#1}
+          { \exp_not:V \l_siunitx_unit_font_tl { \exp_not:n {#1} } }
+      }
+    \tl_clear:N \l_@@_separator_tl
+  }
+\cs_new_protected:Npn \@@_format_literal_auxvii:nn #1#2
+  { \@@_format_literal_auxvi:nN { #1 {#2} } }
 \tl_new:N \l_@@_separator_tl
 %    \end{macrocode}
 % \end{variable}
@@ -1329,6 +1341,10 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
 %
 % \subsection{(PDF) String creation}
 %

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2021-05-28 20:50:48 UTC (rev 59380)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.dtx	2021-05-28 20:51:02 UTC (rev 59381)
@@ -121,7 +121,7 @@
 %
 % Identify the package and give the over all version information.
 %    \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2021-05-25} {3.0.6}
+\ProvidesExplPackage {siunitx} {2021-05-28} {3.0.7}
   {A comprehensive (SI) units package}
 %    \end{macrocode}
 %

Modified: trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex	2021-05-28 20:50:48 UTC (rev 59380)
+++ trunk/Master/texmf-dist/source/latex/siunitx/siunitx.tex	2021-05-28 20:51:02 UTC (rev 59381)
@@ -484,7 +484,7 @@
     \cs{qtyrange}\oarg{options}\marg{number1}\marg{number2}\marg{unit}
   \end{syntax}
 \end{function}
-Products of numbers with units can be handled using the \cs{qtyrange}
+Ranges of numbers with units can be handled using the \cs{qtyrange}
 function. The behaviour of this function is similar to \cs{numrange}, but
 with the addition of a unit to each number.
 \begin{LaTeXdemo}
@@ -493,7 +493,7 @@
 
 The input of lists, products and ranges of quantities using a single command
 allows them to be adjusted together. These commands are intended to allow
-consistent formatting of related values: as such, they apply a a single
+consistent formatting of related values: as such, they apply a single
 unit to all of the values. This is particularly notable when using
 adjustment of the numerical values.
 
@@ -1580,6 +1580,7 @@
       negative-color           & Literal & \meta{none}       \\ ^^A (
       output-close-uncertainty & Literal & )                 \\
       output-decimal-marker    & Literal & .                 \\
+      output-exponent-marker   & Literal & \meta{none}       \\
       output-open-uncertainty  & Literal & (                 \\ ^^A )
       print-implicit-plus      & Switch  & false             \\
       print-unity-mantissa     & Switch  & true              \\
@@ -1648,6 +1649,13 @@
   \num[exponent-product = \cdot]{1e2} \\
   \num[exponent-base = 2]{1e2}
 \end{LaTeXdemo}
+\DescribeOption{output-exponent-marker}
+Alternatively, if the \opt{output-exponent-marker} option is set then the value
+stored will be used in place of the normal product and base combination.
+\begin{LaTeXdemo}
+  \num[output-exponent-marker = e]{1e2} \\
+  \num[output-exponent-marker = \mathrm{E}]{1e2}
+\end{LaTeXdemo}
 
 \DescribeOption{uncertainty-separator}
 \DescribeOption{output-open-uncertainty}

Modified: trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty	2021-05-28 20:50:48 UTC (rev 59380)
+++ trunk/Master/texmf-dist/tex/latex/siunitx/siunitx.sty	2021-05-28 20:51:02 UTC (rev 59381)
@@ -42,7 +42,7 @@
       }%
     \endinput
   }%
-\ProvidesExplPackage {siunitx} {2021-05-25} {3.0.6}
+\ProvidesExplPackage {siunitx} {2021-05-28} {3.0.7}
   {A comprehensive (SI) units package}
 \msg_new:nnnn { siunitx } { incompatible-package }
   { Package~'#1'~incompatible. }
@@ -2986,6 +2986,8 @@
       \l__siunitx_number_output_uncert_close_tl ,
     output-decimal-marker .tl_set:N =
       \l_siunitx_number_output_decimal_tl ,
+    output-exponent-marker .tl_set:N =
+      \l__siunitx_number_output_exp_marker_tl ,
     output-open-uncertainty .tl_set:N =
       \l__siunitx_number_output_uncert_open_tl ,
     print-implicit-plus .bool_set:N =
@@ -3323,31 +3325,46 @@
       { \l__siunitx_number_zero_exponent_bool }
       { ! \str_if_eq_p:nn {#2} { 0 } }
       {
-        \bool_lazy_and:nnTF
-          { \str_if_eq_p:nn {#3} { 1. } }
-          { ! \l__siunitx_number_unity_mantissa_bool }
-          { \exp_not:n {#4} }
-          {
-            \bool_if:NTF \l__siunitx_number_tight_bool
-              { \exp_not:N \mathord }
-              { \use:n }
-                { \exp_not:V \l__siunitx_number_exponent_product_tl }
-            \exp_not:n {#4}
-          }
-        \exp_not:V \l__siunitx_number_exponent_base_tl
-        ^
-          {
-            \tl_if_blank:nTF {#1}
-              {
-                \bool_if:NT \l__siunitx_number_implicit_plus_bool
-                  { \__siunitx_number_output_sign:N + }
-              }
-              { \__siunitx_number_output_sign:N #1 }
-            \__siunitx_number_output_digits:nn { integer } {#2}
-          }
+        \tl_if_empty:NTF \l__siunitx_number_output_exp_marker_tl
+          { \__siunitx_number_output_exponent_auxi:nnnn }
+          { \__siunitx_number_output_exponent_auxii:nnnn }
+            {#1} {#2} {#3} {#4}
       }
       { \exp_not:n {#4} }
   }
+\cs_new:Npn \__siunitx_number_output_exponent_auxi:nnnn #1#2#3#4
+  {
+    \bool_lazy_and:nnTF
+      { \str_if_eq_p:nn {#3} { 1. } }
+      { ! \l__siunitx_number_unity_mantissa_bool }
+      { \exp_not:n {#4} }
+      {
+        \bool_if:NTF \l__siunitx_number_tight_bool
+          { \exp_not:N \mathord }
+          { \use:n }
+            { \exp_not:V \l__siunitx_number_exponent_product_tl }
+        \exp_not:n {#4}
+      }
+    \exp_not:V \l__siunitx_number_exponent_base_tl
+    ^
+      { \__siunitx_number_output_exponent_auxiii:nn {#1} {#2} }
+  }
+\cs_new:Npn \__siunitx_number_output_exponent_auxii:nnnn #1#2#3#4
+  {
+    \exp_not:n {#4}
+    \exp_not:V \l__siunitx_number_output_exp_marker_tl
+    \__siunitx_number_output_exponent_auxiii:nn {#1} {#2}
+  }
+\cs_new:Npn \__siunitx_number_output_exponent_auxiii:nn #1#2
+  {
+    \tl_if_blank:nTF {#1}
+      {
+        \bool_if:NT \l__siunitx_number_implicit_plus_bool
+          { \__siunitx_number_output_sign:N + }
+      }
+      { \__siunitx_number_output_sign:N #1 }
+    \__siunitx_number_output_digits:nn { integer } {#2}
+  }
 \cs_new:Npn \__siunitx_number_output_end: { }
 \tl_new:N \l__siunitx_number_valid_tl
 \prg_new_protected_conditional:Npnn \siunitx_if_number:n #1
@@ -3733,6 +3750,10 @@
         { \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 \__siunitx_print_text_sub:n }
       ^
@@ -4936,63 +4957,71 @@
 \cs_new_protected:Npn \__siunitx_unit_format_literal_auxiii:w #1 /
   {
     \quark_if_recursion_tail_stop:n {#1}
-    \__siunitx_unit_format_literal_auxiv:w #1 ^ ^ \q_stop
+    \__siunitx_unit_format_literal_auxiv:n {#1}
     \tl_set:Nn \l__siunitx_unit_separator_tl { / }
     \__siunitx_unit_format_literal_auxiii:w
   }
-\use:x
+\cs_new_protected:Npn \__siunitx_unit_format_literal_auxiv:n #1
   {
-    \cs_new_protected:Npn \exp_not:N \__siunitx_unit_format_literal_auxiv:w
-      ##1 ^ ##2 ^ ##3 \exp_not:N \q_stop
+    \__siunitx_unit_format_literal_auxv:nw { }
+      #1 \q_recursion_tail \q_recursion_stop
+  }
+\cs_new_protected:Npn \__siunitx_unit_format_literal_auxv:nw
+  #1#2 \q_recursion_stop
+  {
+    \tl_if_head_is_N_type:nTF {#2}
+      { \__siunitx_unit_format_literal_auxvi:nN }
+      { \__siunitx_unit_format_literal_auxvii:nn }
+        {#1} #2 \q_recursion_stop
+  }
+\cs_new_protected:Npx \__siunitx_unit_format_literal_auxvi:nN #1#2
+  {
+    \exp_not:N \quark_if_recursion_tail_stop_do:Nn #2
+      { \exp_not:N \__siunitx_unit_format_literal_add:n {#1} }
+    \exp_not:N \token_if_eq_meaning:NNTF #2 ^
+      { \exp_not:N \__siunitx_unit_format_literal_super:nn {#1} }
       {
-        \exp_not:N \__siunitx_unit_format_literal_auxv:w
-          ##1
-          \c__siunitx_unit_math_subscript_tl
-          \c__siunitx_unit_math_subscript_tl
-          \exp_not:N \q_mark
-          ##2
-          \c__siunitx_unit_math_subscript_tl
-          \c__siunitx_unit_math_subscript_tl
-          \exp_not:N \q_stop
+        \exp_not:N \token_if_eq_meaning:NNTF
+          #2 \c__siunitx_unit_math_subscript_tl
+          { \exp_not:N \__siunitx_unit_format_literal_sub:nn {#1} }
+          { \exp_not:N \__siunitx_unit_format_literal_auxvi:nN {#1#2} }
       }
-    \cs_new_protected:Npn \exp_not:N \__siunitx_unit_format_literal_auxv:w
-      ##1 \c__siunitx_unit_math_subscript_tl
-      ##2 \c__siunitx_unit_math_subscript_tl ##3
-      \exp_not:N \q_mark
-      ##4 \c__siunitx_unit_math_subscript_tl
-      ##5 \c__siunitx_unit_math_subscript_tl ##6
-      \exp_not:N \q_stop
+  }
+\cs_new_protected:Npn \__siunitx_unit_format_literal_super:nn #1#2
+  {
+    \quark_if_recursion_tail_stop:n {#2}
+    \__siunitx_unit_format_literal_add:n {#1}
+    \tl_put_right:Nn \l__siunitx_unit_formatted_tl { ^ {#2} }
+    \__siunitx_unit_format_literal_auxvi:nN { }
+  }
+\cs_new_protected:Npx \__siunitx_unit_format_literal_sub:nn #1#2
+  {
+    \exp_not:N \quark_if_recursion_tail_stop:n {#2}
+    \exp_not:N \__siunitx_unit_format_literal_add:n {#1}
+    \tl_put_right:Nx \exp_not:N \l__siunitx_unit_formatted_tl
       {
-        \tl_set:Nx \exp_not:N \l__siunitx_unit_formatted_tl
+        \c__siunitx_unit_math_subscript_tl
           {
             \exp_not:N \exp_not:V
-              \exp_not:N \l__siunitx_unit_formatted_tl
-            \exp_not:N \tl_if_empty:NF
-              \exp_not:N \l__siunitx_unit_formatted_tl
-              {
-                \exp_not:N \exp_not:V
-                  \exp_not:N \l__siunitx_unit_separator_tl
-              }
-            \exp_not:N \tl_if_blank:nF {##1}
-              {
-                \exp_not:N \exp_not:V
-                  \exp_not:N \l_siunitx_unit_font_tl
-                  { \exp_not:N \exp_not:n {##1} }
-              }
-            \exp_not:N \tl_if_blank:nF {##4}
-              { ^ { \exp_not:N \exp_not:n {##4} } }
-            \exp_not:N \tl_if_blank:nF {##2##5}
-              {
-                \c__siunitx_unit_math_subscript_tl
-                  {
-                    \exp_not:N \exp_not:V
-                      \exp_not:N \l_siunitx_unit_font_tl
-                      { \exp_not:N \exp_not:n {##2##5} }
-                  }
-              }
+              \exp_not:N \l_siunitx_unit_font_tl
+                { \exp_not:N \exp_not:n {#2} }
           }
       }
+    \exp_not:N \__siunitx_unit_format_literal_auxvi:nN { }
   }
+\cs_new_protected:Npn \__siunitx_unit_format_literal_add:n #1
+  {
+    \tl_put_right:Nx \l__siunitx_unit_formatted_tl
+      {
+        \tl_if_empty:NF \l__siunitx_unit_formatted_tl
+          { \exp_not:V \l__siunitx_unit_separator_tl }
+        \tl_if_empty:nF {#1}
+          { \exp_not:V \l_siunitx_unit_font_tl { \exp_not:n {#1} } }
+      }
+    \tl_clear:N \l__siunitx_unit_separator_tl
+  }
+\cs_new_protected:Npn \__siunitx_unit_format_literal_auxvii:nn #1#2
+  { \__siunitx_unit_format_literal_auxvi:nN { #1 {#2} } }
 \tl_new:N \l__siunitx_unit_separator_tl
 \cs_new_protected:Npn \siunitx_unit_pdfstring_context:
   {
@@ -6116,56 +6145,8 @@
           }
       }
   }
-\keys_set:nn { siunitx }
-  { product-symbol  = \ifmmode \times \else \texttimes \fi }
 \AtBeginDocument
   {
-    \group_begin:
-        \tl_set:Nn \l__siunitx_symbol_tmpa_tl
-          { { } { } { 2 } { } { } { } { 1 } }
-        \tl_set:Nx \l__siunitx_symbol_tmpa_tl
-          { \siunitx_number_output:N \l__siunitx_symbol_tmpa_tl }
-        \tl_set:Nn \l__siunitx_symbol_tmpb_tl { 2 \times 10 ^ { 1 } }
-        \tl_if_eq:NNTF \l__siunitx_symbol_tmpa_tl \l__siunitx_symbol_tmpb_tl
-          {
-            \group_end:
-            \keys_set:nn { siunitx }
-              {
-                exponent-product =
-                  \ifmmode \times \else \texttimes \fi
-              }
-          }
-          {
-            \tl_set:Nn \l__siunitx_symbol_tmpb_tl { 2 \cdot 10 ^ { 1 } }
-            \tl_if_eq:NNTF \l__siunitx_symbol_tmpa_tl \l__siunitx_symbol_tmpb_tl
-              {
-                \group_end:
-                \keys_set:nn { siunitx }
-                  {
-                    exponent-product =
-                      \ifmmode \cdot \else \textperiodcentered \fi
-                  }
-              }
-              { \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
-      \tl_if_eq:NNTF \l__siunitx_symbol_tmpa_tl \l__siunitx_symbol_tmpb_tl
-        {
-          \group_end:
-          \keys_set:nn { siunitx }
-            {
-              inter-unit-product =
-                \ifmmode \cdot \else \textperiodcentered \fi
-            }
-        }
-        { \group_end: }
-  }
-\AtBeginDocument
-  {
     \@ifpackageloaded { hyperref }
       {
         \exp_args:Nx \pdfstringdefDisableCommands
@@ -6404,8 +6385,14 @@
       {#1}
   }
 \cs_generate_variant:Nn \__siunitx_option_removed:n { V }
-\clist_map_inline:nn { abbreviations , binary-units , version-1-compatibility }
+\clist_map_inline:nn
   {
+    abbreviations           ,
+    binary-units            ,
+    load-configurations     ,
+    version-1-compatibility
+  }
+  {
     \keys_define:nn { siunitx } { #1 .code:n = \__siunitx_option_removed:n {#1} }
   }
 \keys_define:nn { siunitx }



More information about the tex-live-commits mailing list.