summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/siunitx/siunitx-complex.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-01-07 03:01:08 +0000
committerNorbert Preining <norbert@preining.info>2022-01-07 03:01:08 +0000
commitf69513397ac0e1f02c6b4a5f50588d411413271a (patch)
treebfc0fc24255cb74e53aab1a6e7ac644f2952b9af /macros/latex/contrib/siunitx/siunitx-complex.dtx
parent55032f1ad7128dcf6493e798424f4ade02c923a7 (diff)
CTAN sync 202201070301
Diffstat (limited to 'macros/latex/contrib/siunitx/siunitx-complex.dtx')
-rw-r--r--macros/latex/contrib/siunitx/siunitx-complex.dtx30
1 files changed, 8 insertions, 22 deletions
diff --git a/macros/latex/contrib/siunitx/siunitx-complex.dtx b/macros/latex/contrib/siunitx/siunitx-complex.dtx
index 247d9acc0d..8aa6e8ebc1 100644
--- a/macros/latex/contrib/siunitx/siunitx-complex.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-complex.dtx
@@ -603,7 +603,6 @@
% \begin{macro}{\@@_format_sign:nnnnnnn}
% \begin{macro}{\@@_extract_exponent:nw}
% \begin{macro}{\@@_extract_exponent_aux:w}
-% \begin{macro}{\@@_format_unary:nnnnnnn}
% \begin{macro}[EXP]{\@@_format_bracket:n}
% We start here checking that there is something to do.
% \begin{macrocode}
@@ -643,7 +642,6 @@
\tl_if_empty:NF \l_@@_real_tl
{ \exp_after:wN \@@_drop_exponent:nnnnnnn \l_@@_real_tl }
\exp_after:wN \@@_format_sign:nnnnnnn \l_@@_img_tl
- \exp_after:wN \@@_format_unary:nnnnnnn \l_@@_img_tl
\tl_set:Nx \l_@@_tmp_tl
{ \siunitx_number_output:NN \l_@@_img_tl \q_nil }
\exp_after:wN \@@_extract_exponent:w \l_@@_tmp_tl \q_stop
@@ -708,13 +706,20 @@
}
% \end{macrocode}
% Pull out the formatted exponent: we also need the sign.
+% An imaginary part that is exactly $1$ is omitted, with only the complex
+% root printed. That means checking and removing a lone $1$ here.
% \begin{macrocode}
\cs_new_protected:Npn \@@_extract_exponent:w
#1 \q_nil #2 \q_nil #3 \q_nil #4 \q_nil #5 \q_nil #6 \q_nil #7 \q_nil #8
\q_nil #9 \q_stop
{
\tl_set:Nn \l_@@_sign_tl {#1#2}
- \@@_extract_exponent_aux:nw {#3#4#5#6#7#8} #9 \q_stop
+ \bool_lazy_and:nnTF
+ { \str_if_eq_p:nn {#3} { 1 } }
+ { \tl_if_blank_p:n {#5} }
+ { \@@_extract_exponent_aux:nw {#6#7#8} }
+ { \@@_extract_exponent_aux:nw {#3#4#5#6#7#8} }
+ #9 \q_stop
}
\cs_new:Npn \@@_extract_exponent_aux:nw
#1#2 \q_nil #3 \q_nil #4 \q_stop
@@ -722,25 +727,6 @@
\tl_set:Nn \l_@@_tmp_tl {#1#2}
\tl_set:Nn \l_@@_exp_tl {#3#4}
}
-% \end{macrocode}
-% An imaginary part that is exactly $1$ is omitted, with only the complex
-% root printed. That means checking and removing a lone $1$ here.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_format_unary:nnnnnnn #1#2#3#4#5#6#7
- {
- \tl_set:Nx \l_@@_img_tl
- {
- \exp_not:n { {#1} {#2} }
- \tl_if_blank:nTF {#4}
- {
- \str_if_eq:nnTF {#3} { 1 }
- { { } { } }
- { \exp_not:n { {#3} {#4} } }
- }
- { \exp_not:n { {#3} {#4} } }
- \exp_not:n { {#5} {#6} {#7} }
- }
- }
\cs_new_protected:Npn \@@_format_bracket:n #1
{
\exp_not:V \l_@@_bracket_open_tl