summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-02-16 22:44:12 +0000
committerKarl Berry <karl@freefriends.org>2022-02-16 22:44:12 +0000
commit6d61a2cc468f99649f3e0617eef1f36e6d115e57 (patch)
treecaab7a3d5e59bfcd683cec1d47493c78ca4f6d36 /Master/texmf-dist/tex
parentcba8ece37bbd9d57322f76f4b6d1584464dfb7b1 (diff)
siunitx (15feb22)
git-svn-id: svn://tug.org/texlive/trunk@62048 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/siunitx/siunitx.sty163
1 files changed, 97 insertions, 66 deletions
diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty
index c67097bd938..bf0cc10e738 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-07} {3.0.48}
+\ProvidesExplPackage {siunitx} {2022-02-15} {3.0.49}
{A comprehensive (SI) units package}
\msg_new:nnnn { siunitx } { incompatible-package }
{ Package~'#1'~incompatible. }
@@ -1558,6 +1558,8 @@
} ,
parse-numbers .bool_set:N =
\l_siunitx_number_parse_bool ,
+ retain-explicit-decimal-marker .bool_set:N =
+ \l__siunitx_number_explicit_decimal_bool ,
retain-explicit-plus .bool_set:N =
\l__siunitx_number_explicit_plus_bool ,
retain-zero-uncertainty .bool_set:N =
@@ -1927,9 +1929,15 @@
}
\cs_new_protected:Npn \__siunitx_number_parse_loop_main_end:NN #1#2
{
- \bool_lazy_and:nnT
- {#2} { \tl_if_empty_p:N \l__siunitx_number_partial_tl }
- { \tl_set:Nn \l__siunitx_number_partial_tl { 0 } }
+ \tl_if_empty:NT \l__siunitx_number_partial_tl
+ {
+ \bool_if:NTF #2
+ { \tl_set:Nn \l__siunitx_number_partial_tl { 0 } }
+ {
+ \bool_if:NT \l__siunitx_number_explicit_decimal_bool
+ { \tl_set:Nn \l__siunitx_number_partial_tl { \empty } }
+ }
+ }
\tl_put_right:Nx #1
{
{ \exp_not:V \l__siunitx_number_partial_tl }
@@ -2524,14 +2532,18 @@
{
\tl_set:Nx #2
{
- \cs:w
- __siunitx_number_round_ \l__siunitx_number_round_mode_tl :nnnnnnn
- \exp_after:wN
- \cs_end: #1
- }
+ \str_if_eq:VnTF \l__siunitx_number_round_mode_tl { none }
+ { \exp_not:V #1 }
+ { \exp_after:wN \__siunitx_number_round:nnnnnnn #1 }
+ }
+ }
+\cs_new:Npn \__siunitx_number_round:nnnnnnn #1#2#3#4#5#6#7
+ {
+ \str_if_eq:nnTF {#4} { \empty }
+ { \use:c { __siunitx_number_round_ \l__siunitx_number_round_mode_tl :nnnnnnn } {#1} {#2} {#3} { } }
+ { \use:c { __siunitx_number_round_ \l__siunitx_number_round_mode_tl :nnnnnnn } {#1} {#2} {#3} {#4} }
+ {#5} {#6} {#7}
}
-\cs_new:Npn \__siunitx_number_round_none:nnnnnnn #1#2#3#4#5#6#7
- { \exp_not:n { {#1} {#2} {#3} {#4} {#5} {#6} {#7} } }
\cs_new:Npn \__siunitx_number_round:nnn #1#2#3
{
\__siunitx_number_round_auxi:nnnN {#1} {#2} { }
@@ -3191,6 +3203,8 @@
\l__siunitx_number_unity_mantissa_bool ,
print-zero-exponent .bool_set:N =
\l__siunitx_number_zero_exponent_bool ,
+ print-zero-integer .bool_set:N =
+ \l__siunitx_number_zero_integer_bool ,
tight-spacing .bool_set:N =
\l__siunitx_number_tight_bool ,
uncertainty-mode .choices:nn =
@@ -3310,17 +3324,27 @@
{ \__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 }
- }
+ \bool_lazy_or:nnT
+ { \l__siunitx_number_zero_integer_bool }
+ { ! \str_if_eq_p:nn {#1} { 0 } }
+ {
+ \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 }
+ }
+ {
+ \bool_lazy_and_p:nn
+ { \str_if_eq_p:nn {#1} { 0 } }
+ { \l__siunitx_number_zero_integer_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
@@ -3334,7 +3358,8 @@
{ \exp_not:V \l_siunitx_number_output_decimal_tl }
}
\exp_not:n {#2}
- \__siunitx_number_output_digits:nn { decimal } {#1}
+ \str_if_eq:nnF {#1} { \empty }
+ { \__siunitx_number_output_digits:nn { decimal } {#1} }
}
\cs_generate_variant:Nn \__siunitx_number_output_decimal:nn { f }
\cs_new:Npn \__siunitx_number_output_digits:nn #1#2
@@ -3624,49 +3649,51 @@
}
\keys_set:nn { siunitx }
{
- bracket-ambiguous-numbers = true ,
- bracket-negative-numbers = false ,
- drop-exponent = false ,
- drop-uncertainty = false ,
- drop-zero-decimal = false ,
- evaluate-expression = false ,
- exponent-base = 10 ,
- exponent-mode = input ,
- exponent-product = \times ,
- expression = #1 ,
- fixed-exponent = 0 ,
- group-digits = all ,
- group-minimum-digits = 5 ,
- group-separator = \, , % (
- input-close-uncertainty = ) ,
- input-comparators = { <=>\approx\ge\geq\gg\le\leq\ll\sim } ,
- input-decimal-markers = { ., } ,
- input-digits = 0123456789 ,
- input-exponent-markers = dDeE ,
- input-ignore = \, ,
- input-open-uncertainty = ( , % )
- input-signs = +-\mp\pm ,
- input-uncertainty-signs = \pm ,
- minimum-decimal-digits = 0 ,
- minimum-integer-digits = 0 ,
- negative-color = , % (
- output-close-uncertainty = ) ,
- output-decimal-marker = . ,
- output-open-uncertainty = ( , % )
- parse-numbers = true ,
- print-implicit-plus = false ,
- print-unity-mantissa = true ,
- print-zero-exponent = false ,
- retain-explicit-plus = false ,
- retain-zero-uncertainty = false ,
- round-half = up ,
- round-minimum = 0 ,
- round-mode = none ,
- round-pad = true ,
- round-precision = 2 ,
- tight-spacing = false ,
- uncertainty-mode = compact ,
- uncertainty-separator =
+ bracket-ambiguous-numbers = true ,
+ bracket-negative-numbers = false ,
+ drop-exponent = false ,
+ drop-uncertainty = false ,
+ drop-zero-decimal = false ,
+ evaluate-expression = false ,
+ exponent-base = 10 ,
+ exponent-mode = input ,
+ exponent-product = \times ,
+ expression = #1 ,
+ fixed-exponent = 0 ,
+ group-digits = all ,
+ group-minimum-digits = 5 ,
+ group-separator = \, , % (
+ input-close-uncertainty = ) ,
+ input-comparators = { <=>\approx\ge\geq\gg\le\leq\ll\sim } ,
+ input-decimal-markers = { ., } ,
+ input-digits = 0123456789 ,
+ input-exponent-markers = dDeE ,
+ input-ignore = \, ,
+ input-open-uncertainty = ( , % )
+ input-signs = +-\mp\pm ,
+ input-uncertainty-signs = \pm ,
+ minimum-decimal-digits = 0 ,
+ minimum-integer-digits = 0 ,
+ negative-color = , % (
+ output-close-uncertainty = ) ,
+ output-decimal-marker = . ,
+ output-open-uncertainty = ( , % )
+ parse-numbers = true ,
+ print-implicit-plus = false ,
+ print-unity-mantissa = true ,
+ print-zero-exponent = false ,
+ print-zero-integer = true ,
+ retain-explicit-decimal-marker = false ,
+ retain-explicit-plus = false ,
+ retain-zero-uncertainty = false ,
+ round-half = up ,
+ round-minimum = 0 ,
+ round-mode = none ,
+ round-pad = true ,
+ round-precision = 2 ,
+ tight-spacing = false ,
+ uncertainty-mode = compact ,
+ uncertainty-separator =
}
\RequirePackage { amstext }
\cs_new_eq:NN \__siunitx_print_ams_text:n \text
@@ -7037,7 +7064,11 @@
} ,
add-decimal-zero .default:n = true ,
add-integer-zero .code:n =
- { \__siunitx_option_removed:V \l_keys_key_tl } ,
+ {
+ \__siunitx_option_deprecated:nn
+ { add-integer-zero }
+ { print-zero-integer }
+ } ,
close-bracket .code:n =
{ \__siunitx_option_removed:V \l_keys_key_tl } ,
bracket-numbers .choice: ,