summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-01-06 21:08:20 +0000
committerKarl Berry <karl@freefriends.org>2022-01-06 21:08:20 +0000
commitc8e3dae3f1927ad24133fbf27333831fdc3db48f (patch)
tree1dfe2e589c8b572ff0d3ad71241089720b252cbf /Master/texmf-dist/tex
parentb8af323ca941e92b4511211d6f5513337004f456 (diff)
siunitx (6jan22)
git-svn-id: svn://tug.org/texlive/trunk@61515 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/siunitx/siunitx.sty95
1 files changed, 50 insertions, 45 deletions
diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty
index 8321891f2f0..55634bb097a 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-01-04} {3.0.38}
+\ProvidesExplPackage {siunitx} {2022-01-05} {3.0.39}
{A comprehensive (SI) units package}
\msg_new:nnnn { siunitx } { incompatible-package }
{ Package~'#1'~incompatible. }
@@ -675,7 +675,6 @@
\tl_if_empty:NF \l__siunitx_complex_real_tl
{ \exp_after:wN \__siunitx_complex_drop_exponent:nnnnnnn \l__siunitx_complex_real_tl }
\exp_after:wN \__siunitx_complex_format_sign:nnnnnnn \l__siunitx_complex_img_tl
- \exp_after:wN \__siunitx_complex_format_unary:nnnnnnn \l__siunitx_complex_img_tl
\tl_set:Nx \l__siunitx_complex_tmp_tl
{ \siunitx_number_output:NN \l__siunitx_complex_img_tl \q_nil }
\exp_after:wN \__siunitx_complex_extract_exponent:w \l__siunitx_complex_tmp_tl \q_stop
@@ -736,7 +735,12 @@
\q_nil #9 \q_stop
{
\tl_set:Nn \l__siunitx_complex_sign_tl {#1#2}
- \__siunitx_complex_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} }
+ { \__siunitx_complex_extract_exponent_aux:nw {#6#7#8} }
+ { \__siunitx_complex_extract_exponent_aux:nw {#3#4#5#6#7#8} }
+ #9 \q_stop
}
\cs_new:Npn \__siunitx_complex_extract_exponent_aux:nw
#1#2 \q_nil #3 \q_nil #4 \q_stop
@@ -744,21 +748,6 @@
\tl_set:Nn \l__siunitx_complex_tmp_tl {#1#2}
\tl_set:Nn \l__siunitx_complex_exp_tl {#3#4}
}
-\cs_new_protected:Npn \__siunitx_complex_format_unary:nnnnnnn #1#2#3#4#5#6#7
- {
- \tl_set:Nx \l__siunitx_complex_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 \__siunitx_complex_format_bracket:n #1
{
\exp_not:V \l__siunitx_complex_bracket_open_tl
@@ -1873,7 +1862,7 @@
\quark_if_recursion_tail_stop_do:Nn #3
{
\bool_if:NTF #2
- { \tl_put_right:Nn #1 { { 1 } { } { } } }
+ { \tl_put_right:Nn #1 { { } { } { } } }
{ \__siunitx_number_parse_loop_break:wN \q_recursion_stop }
}
\tl_if_in:NnTF \l__siunitx_number_input_digit_tl {#3}
@@ -3221,7 +3210,7 @@
\__siunitx_number_output_integer:nnn {#3} {#4} {#7}
\__siunitx_number_output_decimal:nn {#4} {#8}
\__siunitx_number_output_uncertainty:nnn {#5} {#4} {#8}
- \__siunitx_number_output_exponent:nnnn {#6} {#7} { #3 . #4 } {#8}
+ \__siunitx_number_output_exponent:nnnnn {#6} {#7} {#3} {#4} {#8}
\__siunitx_number_output_end:
}
\cs_new:Npn \__siunitx_number_output_bracket:nn #1#2
@@ -3239,12 +3228,12 @@
}
\__siunitx_number_output_bracket:w
}
-\cs_new:Npn \__siunitx_number_output_bracket:w #1 \__siunitx_number_output_exponent:nnnn
+\cs_new:Npn \__siunitx_number_output_bracket:w #1 \__siunitx_number_output_exponent:nnnnn
{
\exp_not:V \l__siunitx_number_bracket_open_tl
#1
\exp_not:V \l__siunitx_number_bracket_close_tl
- \__siunitx_number_output_exponent:nnnn
+ \__siunitx_number_output_exponent:nnnnn
}
\cs_new:Npn \__siunitx_number_output_color:n #1
{
@@ -3299,17 +3288,26 @@
}
\cs_new:Npn \__siunitx_number_output_integer:nnn #1#2#3
{
- \bool_lazy_any:nT
+ \tl_if_blank:nTF {#1}
{
- { \l__siunitx_number_unity_mantissa_bool }
- { ! \str_if_eq_p:nn { #1 . #2 } { 1. } }
- {
- \bool_lazy_and_p:nn
- { \str_if_eq_p:nn {#3} { 0 } }
- { ! \l__siunitx_number_zero_exponent_bool }
- }
+ \bool_lazy_and:nnT
+ { \str_if_eq_p:nn {#3} { 0 } }
+ { ! \l__siunitx_number_zero_exponent_bool }
+ { \__siunitx_number_output_digits:nn { integer } { 1 } }
+ }
+ {
+ \bool_lazy_any:nT
+ {
+ { \l__siunitx_number_unity_mantissa_bool }
+ { ! \str_if_eq_p:nn { #1 . #2 } { 1. } }
+ {
+ \bool_lazy_and_p:nn
+ { \str_if_eq_p:nn {#3} { 0 } }
+ { ! \l__siunitx_number_zero_exponent_bool }
+ }
+ }
+ { \__siunitx_number_output_digits:nn { integer } {#1} }
}
- { \__siunitx_number_output_digits:nn { integer } {#1} }
}
\cs_new:Npn \__siunitx_number_output_decimal:nn #1#2
{
@@ -3480,40 +3478,47 @@
{ \int_eval:n { \tl_count:n {#2} - \tl_count:n {#1} } }
{#2} { }
}
-\cs_new:Npn \__siunitx_number_output_exponent:nnnn #1#2#3#4
+\cs_new:Npn \__siunitx_number_output_exponent:nnnnn #1#2#3#4#5
{
- \exp_not:n {#4}
+ \exp_not:n {#5}
\bool_lazy_or:nnTF
{ \l__siunitx_number_zero_exponent_bool }
{ ! \str_if_eq_p:nn {#2} { 0 } }
{
\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}
+ { \__siunitx_number_output_exponent_auxi:nnnnn }
+ { \__siunitx_number_output_exponent_auxii:nnnnn }
+ {#1} {#2} {#3} {#4} {#5}
}
- { \exp_not:n {#4} }
+ { \exp_not:n {#5} }
}
-\cs_new:Npn \__siunitx_number_output_exponent_auxi:nnnn #1#2#3#4
+\cs_new:Npn \__siunitx_number_output_exponent_auxi:nnnnn #1#2#3#4#5
{
- \bool_lazy_or:nnTF
- { \l__siunitx_number_unity_mantissa_bool }
- { ! \str_if_eq_p:nn {#3} { 1. } }
+ \bool_lazy_or:nnT
+ {
+ \bool_lazy_and_p:nn
+ { \l__siunitx_number_unity_mantissa_bool }
+ { \str_if_eq_p:nn { #3 . #4 } { 1. } }
+ }
+ {
+ ! \bool_lazy_or_p:nn
+ { \str_if_eq_p:nn { #3 . #4 } { 1. } }
+ { \tl_if_blank_p:n {#3} }
+ }
{
\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:n {#4} }
+ \exp_not:n {#5}
\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
+\cs_new:Npn \__siunitx_number_output_exponent_auxii:nnnnn #1#2#3#4#5
{
- \exp_not:n {#4}
+ \exp_not:n {#5}
\exp_not:V \l__siunitx_number_output_exp_marker_tl
\__siunitx_number_output_exponent_auxiii:nn {#1} {#2}
}