summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/siunitx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-08-31 21:41:49 +0000
committerKarl Berry <karl@freefriends.org>2023-08-31 21:41:49 +0000
commit92e212c571b21030c6e8a7cae6211e1c0702255d (patch)
tree6ec912ac913af88e49ebfeda3a0809d365f6a97c /Master/texmf-dist/tex/latex/siunitx
parent9972c9fb25a9090dc047fd54aa53cc980b645109 (diff)
siunitx (31aug23)
git-svn-id: svn://tug.org/texlive/trunk@68127 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/siunitx')
-rw-r--r--Master/texmf-dist/tex/latex/siunitx/siunitx.sty360
1 files changed, 217 insertions, 143 deletions
diff --git a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty
index 3a687856f41..d166b07ce44 100644
--- a/Master/texmf-dist/tex/latex/siunitx/siunitx.sty
+++ b/Master/texmf-dist/tex/latex/siunitx/siunitx.sty
@@ -41,7 +41,7 @@
}%
\endinput
}%
-\ProvidesExplPackage {siunitx} {2023-08-24} {3.3.4}
+\ProvidesExplPackage {siunitx} {2023-08-30} {3.3.5}
{A comprehensive (SI) units package}
\msg_new:nnnn { siunitx } { incompatible-package }
{ Package~'#1'~incompatible. }
@@ -63,7 +63,7 @@
\providecommand \IfFormatAtLeastTF { \@ifl@t@r \fmtversion }
\tl_new:N \l__siunitx_tmp_tl
\cs_generate_variant:Nn \keys_set:nn { nx }
-\cs_generate_variant:Nn \tl_if_blank:nTF { f }
+\cs_generate_variant:Nn \tl_if_blank:nTF { e }
\cs_generate_variant:Nn \tl_if_in:NnTF { NV }
\cs_generate_variant:Nn \tl_if_in:nnTF { nV }
\cs_generate_variant:Nn \tl_remove_all:Nn { NV }
@@ -218,7 +218,7 @@
\tl_put_right:NV \l__siunitx_number_uncert_tl \l__siunitx_number_flex_tl
\tl_if_empty:NF \l__siunitx_number_uncert_tl
{
- \tl_if_blank:fTF { \exp_after:wN \use_iv:nnnn \l__siunitx_number_parsed_tl }
+ \tl_if_blank:eTF { \exp_after:wN \use_iv:nnnn \l__siunitx_number_parsed_tl }
{ \__siunitx_number_parse_combine_uncert: }
{ \tl_clear:N \l__siunitx_number_parsed_tl }
}
@@ -255,16 +255,18 @@
{
\quark_if_recursion_tail_stop_do:nn {#4}
{ \__siunitx_number_parse_combine_uncert_end:nnn {#1} {#2} {#3} }
- \exp_args:Nf \__siunitx_number_parse_combine_uncert:nnnnnn
+ \__siunitx_number_parse_combine_uncert:ennnnn
{ \int_eval:n { \tl_count:n {#1} - \tl_count:n {#6} } }
{#1} {#2} {#3} {#5} {#6}
}
+\cs_generate_variant:Nn \__siunitx_number_parse_combine_uncert_loop:nnnnnnn { nee }
\cs_new:Npn \__siunitx_number_parse_combine_uncert:nnnnnn #1
{
- \exp_args:Nf \__siunitx_number_parse_combine_uncert:nnnnnnn
+ \__siunitx_number_parse_combine_uncert:ennnnnn
{ \prg_replicate:nn { \int_abs:n {#1} } { 0 } }
{#1}
}
+\cs_generate_variant:Nn \__siunitx_number_parse_combine_uncert:nnnnnn { e }
\cs_new:Npn \__siunitx_number_parse_combine_uncert:nnnnnnn #1#2#3#4#5#6#7
{
\int_compare:nNnTF {#2} > 0
@@ -277,9 +279,10 @@
{ #3 #1 } {#4} {#5} {#6} {#7}
}
}
+\cs_generate_variant:Nn \__siunitx_number_parse_combine_uncert:nnnnnnn { e }
\cs_new:Npn \__siunitx_number_parse_combine_uncert:nnnnn #1#2#3#4#5
{
- \exp_args:Nee \__siunitx_number_parse_combine_uncert_aux:nnnn
+ \__siunitx_number_parse_combine_uncert_aux:eenn
{
\bool_lazy_and:nnTF
{ \tl_if_blank_p:n {#1} }
@@ -296,8 +299,8 @@
}
\cs_new:Npn \__siunitx_number_parse_combine_uncert_aux:nnnn #1#2#3#4
{
- \exp_args:Neee \__siunitx_number_parse_combine_uncert_loop:nnnnnnn
- { \exp_not:n {#1} }
+ \__siunitx_number_parse_combine_uncert_loop:neennnn
+ {#1}
{
\exp_not:n {#3}
\tl_if_blank:nF {#2} { S }
@@ -307,6 +310,7 @@
\tl_if_blank:nF {#2} { { \exp_not:n {#2} } }
}
}
+\cs_generate_variant:Nn \__siunitx_number_parse_combine_uncert_aux:nnnn { ee }
\cs_new:Npn \__siunitx_number_parse_combine_uncert:N #1
{
\quark_if_recursion_tail_stop_do:Nn #1
@@ -350,7 +354,7 @@
{
\tl_if_empty:NTF \l_siunitx_number_input_exponent_tl
{
- \tl_set:Nn \l__siunitx_number_exponent_tl { { } 0 }
+ \tl_set:Nn \l__siunitx_number_exponent_tl { { } { } }
\tl_if_empty:NF \l__siunitx_number_parsed_tl
{ \__siunitx_number_parse_loop: }
}
@@ -384,7 +388,7 @@
\cs_new_protected:Npn \__siunitx_number_parse_exponent_auxii:nn #1#2
{
\quark_if_nil:nTF {#2}
- { \tl_set:Nn \l__siunitx_number_exponent_tl { { } 0 } }
+ { \tl_set:Nn \l__siunitx_number_exponent_tl { { } { } } }
{
\tl_set:Nn \l__siunitx_number_arg_tl {#1}
\tl_if_blank:nTF {#2}
@@ -590,7 +594,7 @@
}
\cs_new_protected:Npn \__siunitx_number_parse_loop_after_decimal:NN #1#2
{
- \tl_if_blank:fTF { \exp_after:wN \use_none:n #1 }
+ \tl_if_blank:eTF { \exp_after:wN \use_none:n #1 }
{
\quark_if_recursion_tail_stop_do:Nn #2
{ \__siunitx_number_parse_loop_break:w \q_recursion_stop }
@@ -768,7 +772,7 @@
}
\cs_new_protected:Npn \__siunitx_number_parse_uncert_marker:nnnnnN #1#2#3#4#5#6
{
- \exp_args:Ne \__siunitx_number_parse_uncert_marker:nnnnnnN
+ \__siunitx_number_parse_uncert_marker:xnnnnnN
{ \int_eval:n { \tl_count:n {#4} } }
{#1} {#2} {#3} {#4} {#5} #6
}
@@ -804,6 +808,7 @@
}
#5#6#7
}
+\cs_generate_variant:Nn \__siunitx_number_parse_uncert_marker:nnnnnnN { x }
\cs_new_protected:Npn \__siunitx_number_parse_uncert_after:N #1
{
\tl_set:Nx \l__siunitx_number_uncert_tl
@@ -948,6 +953,7 @@
\__siunitx_number_digits:NN #2 #2
}
}
+\cs_generate_variant:Nn \siunitx_number_process:NN { cc }
\cs_new_protected:Npn \__siunitx_number_process:nnnnnnnNN #1#2#3#4#5#6#7#8#9
{
\bool_lazy_and:nnTF
@@ -965,21 +971,31 @@
\cs_new_protected:Npn \__siunitx_number_exponent:NN #1#2
{
\tl_set:Nx #2
- {
- \cs:w
- __siunitx_number_exponent_ \l__siunitx_number_exponent_mode_tl :nnnnnnn
- \exp_after:wN
- \cs_end: #1
- }
+ { \exp_after:wN \__siunitx_number_exponent:nnnnnnn #1 }
\str_if_eq:VnT \l__siunitx_number_exponent_mode_tl { engineering }
{
\tl_set:Nx #2
{ \exp_after:wN \__siunitx_number_exponent_engineering_aux:nnnnnnn #2 }
}
}
+\cs_new:Npn \__siunitx_number_exponent:nnnnnnn #1#2#3#4#5#6#7
+ {
+ \str_if_eq:VnTF \l__siunitx_number_exponent_mode_tl { input }
+ { \exp_not:n { {#1} {#2} {#3} {#4} {#5} {#6} {#7} } }
+ {
+ \tl_if_blank:nTF {#7}
+ { \__siunitx_number_exponent_aux:nnnnnnn {#1} {#2} {#3} {#4} {#5} {#6} { 0 } }
+ { \__siunitx_number_exponent_aux:nnnnnnn {#1} {#2} {#3} {#4} {#5} {#6} {#7} }
+ }
+ }
+\cs_new:Npn \__siunitx_number_exponent_aux:nnnnnnn #1#2#3#4#5#6#7
+ {
+ \use:c { __siunitx_number_exponent_ \l__siunitx_number_exponent_mode_tl :nnnnnnn }
+ {#1} {#2} {#3} {#4} {#5} {#6} {#7}
+ }
\cs_new:Npn \__siunitx_number_exponent_fixed:nnnnnnn #1#2#3#4#5#6#7
{
- \exp_args:Nf \__siunitx_number_exponent_fixed:nnnnnnnn
+ \__siunitx_number_exponent_fixed:ennnnnnn
{ \int_eval:n { \l__siunitx_number_exponent_fixed_int - (#6#7) } }
{#1} {#2} {#3} {#4} {#5} {#6} {#7}
}
@@ -991,11 +1007,10 @@
{ \int_compare:nNnT \l__siunitx_number_exponent_fixed_int < 0 { - } }
{ \int_abs:n \l__siunitx_number_exponent_fixed_int }
}
-\cs_new:Npn \__siunitx_number_exponent_input:nnnnnnn #1#2#3#4#5#6#7
- { \exp_not:n { {#1} {#2} {#3} {#4} {#5} {#6} {#7} } }
+\cs_generate_variant:Nn \__siunitx_number_exponent_fixed:nnnnnnnn { e }
\cs_new:Npn \__siunitx_number_exponent_scientific:nnnnnnn #1#2#3#4#5#6#7
{
- \exp_args:Nf \__siunitx_number_exponent_scientific:nnnnnnnn
+ \__siunitx_number_exponent_scientific:ennnnnnn
{ \int_eval:n { \tl_count:n {#3} } }
{#1} {#2} {#3} {#4} {#5} {#6} {#7}
}
@@ -1017,6 +1032,7 @@
\__siunitx_number_exponent_finalise:n { #1 + #7#8 - 1 }
}
}
+\cs_generate_variant:Nn \__siunitx_number_exponent_scientific:nnnnnnnn { e }
\cs_new_eq:NN \__siunitx_number_exponent_engineering:nnnnnnn
\__siunitx_number_exponent_scientific:nnnnnnn
\cs_new:Npn \__siunitx_number_exponent_scientific:nnnw #1#2#3#4#5 \q_stop
@@ -1041,7 +1057,7 @@
{ {#2} {#3} }
}
}
-\cs_generate_variant:Nn \__siunitx_number_exponent_shift:nnn { nnf }
+\cs_generate_variant:Nn \__siunitx_number_exponent_shift:nnn { nne }
\cs_new:Npn \__siunitx_number_exponent_shift_down:nnnw #1#2#3#4#5 \q_stop
{
\tl_if_blank:nTF {#5}
@@ -1064,7 +1080,7 @@
{
\tl_if_blank:nTF {#3}
{
- \__siunitx_number_exponent_shift_up_aux:ffn
+ \__siunitx_number_exponent_shift_up_aux:een
{ \int_eval:n { #1 + 1 } }
{ \str_if_eq:nnF {#2} { 0 } {#2} 0 }
{ }
@@ -1074,7 +1090,7 @@
}
\cs_new:Npn \__siunitx_number_exponent_shift_up:nnw #1#2#3#4 \q_stop
{
- \__siunitx_number_exponent_shift_up_aux:ffn
+ \__siunitx_number_exponent_shift_up_aux:een
{ \int_eval:n { #1 + 1 } }
{ \str_if_eq:nnF {#2} { 0 } {#2} #3 }
{#4}
@@ -1096,7 +1112,7 @@
{ \__siunitx_number_exponent_shift_up:nnn {#1} {#2} {#3} }
}
}
-\cs_generate_variant:Nn \__siunitx_number_exponent_shift_up_aux:nnn { f , ff }
+\cs_generate_variant:Nn \__siunitx_number_exponent_shift_up_aux:nnn { ee }
\cs_new:Npn \__siunitx_number_exponent_shift_uncert:nw
#1#2 \__siunitx_number_exponent_uncert:n #3
{
@@ -1112,7 +1128,7 @@
\__siunitx_number_exponent_uncert:n { { S } { 0 } }
}
{
- \use:c { __siunitx_number_exponent_shift_uncert_ \use_i:nn #3 :fnnn }
+ \__siunitx_number_exponent_shift_uncert_S:ennn
{ \prg_replicate:nn {#1} { 0 } }
{#2}
#3
@@ -1124,7 +1140,7 @@
#2
\__siunitx_number_exponent_uncert:n { { S } { #4#1 } }
}
-\cs_generate_variant:Nn \__siunitx_number_exponent_shift_uncert_S:nnnn { f }
+\cs_generate_variant:Nn \__siunitx_number_exponent_shift_uncert_S:nnnn { e }
\cs_new:Npn \__siunitx_number_exponent_uncert:n #1 { { \exp_not:n {#1} } }
\cs_new:Npn \__siunitx_number_exponent_finalise:n #1
{
@@ -1167,7 +1183,7 @@
}
{
{ \exp_not:n {#1} \exp_not:o { \tl_head:w #2 \q_stop } }
- { \exp_not:f { \tl_tail:n {#2} } }
+ { \tl_tail:n {#2} }
{ \exp_not:n {#3} }
}
\__siunitx_number_exponent_finalise:n { #4 - 1 }
@@ -1191,7 +1207,7 @@
}
{
{ \exp_not:n {#1#3} \exp_not:o { \tl_head:w #4 \q_stop } }
- { \exp_not:f { \tl_tail:n {#4} } }
+ { \tl_tail:n {#4} }
{ \exp_not:n {#2} }
}
}
@@ -1213,16 +1229,17 @@
}
\cs_new:Npn \__siunitx_number_exponent_threshold:nnnnnnn #1#2#3#4#5#6#7
{
- \exp_args:Ne \__siunitx_number_exponent_threshold:nn
+ \__siunitx_number_exponent_threshold:en
{
\__siunitx_number_exponent_scientific:nnnnnnn
{#1} {#2} {#3} {#4} {#5} {#6} {#7}
}
{ {#1} {#2} {#3} {#4} {#5} {#6} {#7} }
}
-\cs_new:Npn \__siunitx_number_exponent_threshold:nn #1#2
+\cs_new:Npn \__siunitx_number_exponent_threshold:nn #1#2
{ \__siunitx_number_exponent_threshold:nnnnnnnn #1 {#2} }
-\cs_new:Npn \__siunitx_number_exponent_threshold:nnnnnnnn #1#2#3#4#5#6#7#8
+\cs_generate_variant:Nn \__siunitx_number_exponent_threshold:nn { e }
+\cs_new:Npn \__siunitx_number_exponent_threshold:nnnnnnnn #1#2#3#4#5#6#7#8
{
\bool_lazy_and:nnTF
{ \int_compare_p:nNn {#6#7} > \l__siunitx_number_lower_threshold_int }
@@ -1230,7 +1247,6 @@
{ \exp_not:n {#8} }
{ \exp_not:n { {#1} {#2} {#3} {#4} {#5} {#6} {#7} } }
}
-
\cs_new_protected:Npn \__siunitx_number_digits:NN #1#2
{
\tl_set:Nx #2
@@ -1344,7 +1360,7 @@
\__siunitx_number_round:Vnnn \l__siunitx_number_round_dir_tl
{#1} {#2} {#3}
}
-\cs_generate_variant:Nn \__siunitx_number_round:nnn { f }
+\cs_generate_variant:Nn \__siunitx_number_round:nnn { e }
\cs_new:Npn \__siunitx_number_round:nnnn #1#2#3#4
{
\__siunitx_number_round_auxi:nnnnN {#1} {#2} {#3} { }
@@ -1385,11 +1401,12 @@
}
\int_compare:nNnTF {#1} > 0
{
- \exp_args:Nf \__siunitx_number_round_auxiii:nnnnN
+ \__siunitx_number_round_auxiii:ennnN
{ \int_eval:n { #1 - 1 } } {#2} {#3} { #5#4 }
}
{ \__siunitx_number_round_auxv:nnnN {#2} {#4} {#3} #5 }
}
+\cs_generate_variant:Nn \__siunitx_number_round_auxiii:nnnnN { e }
\cs_new:Npn \__siunitx_number_round_auxiv:nnnnN #1#2#3#4#5
{
\quark_if_recursion_tail_stop_do:Nn #5
@@ -1403,11 +1420,12 @@
}
\int_compare:nNnTF {#1} > 0
{
- \exp_args:Nf \__siunitx_number_round_auxiv:nnnnN
+ \__siunitx_number_round_auxiv:ennnN
{ \int_eval:n { #1 - 1 } } {#2} { #3 0 } { #5#4 }
}
{ \__siunitx_number_round_auxvi:nnnN {#2} {#4} {#3} #5 }
}
+\cs_generate_variant:Nn \__siunitx_number_round_auxiv:nnnnN { e }
\cs_new:Npn \__siunitx_number_round_auxv:nnnN #1#2#3#4
{
\quark_if_recursion_tail_stop_do:Nn #4
@@ -1455,7 +1473,7 @@
{
\str_if_eq:nnTF {#1} { 0 }
{
- \__siunitx_number_round_final_output:ff
+ \__siunitx_number_round_final_output:ne
{ 1 }
{ \__siunitx_number_round_truncate:n {#2} }
}
@@ -1482,7 +1500,7 @@
}
}
{
- \__siunitx_number_round_final:fn
+ \__siunitx_number_round_final:en
{ \int_eval:n { #3 + 1 } }
{ \__siunitx_number_round_final_decimal:nnw {#1} {#2} }
}
@@ -1494,15 +1512,12 @@
{
\tl_if_blank:nTF {#1}
{
- \__siunitx_number_round_final_shift:ff
- {
- \exp_last_unbraced:Nf 1
- { \__siunitx_number_round_truncate_direct:n {#2} } 0
- }
+ \__siunitx_number_round_final_shift:en
+ { 1 \__siunitx_number_round_truncate_direct:n {#2} 0 }
{ }
}
{
- \__siunitx_number_round_final_shift:ff
+ \__siunitx_number_round_final_shift:ee
{ 1 #2 }
{ \__siunitx_number_round_truncate:n {#1} }
}
@@ -1510,7 +1525,7 @@
\int_compare:nNnTF {#3} = 9
{ \__siunitx_number_round_auxix:nnN {#1} { 0 #2 } }
{
- \__siunitx_number_round_final:fn
+ \__siunitx_number_round_final:en
{ \int_eval:n { #3 + 1 } }
{ \__siunitx_number_round_final_integer:nnw {#1} {#2} }
}
@@ -1518,15 +1533,15 @@
\cs_new:Npn \__siunitx_number_round_final_decimal:nnw
#1#2#3 \q_recursion_tail \q_recursion_stop
{
- \__siunitx_number_round_final_output:ff
+ \__siunitx_number_round_final_output:ee
{ \tl_reverse:n {#1} }
{ \tl_reverse:n {#3} #2 }
}
\cs_new:Npn \__siunitx_number_round_final_integer:nnw
#1#2#3 \q_recursion_tail \q_recursion_stop
{
- \__siunitx_number_round_final_output:ff
- { \exp_args:Ne \__siunitx_number_round_final_significant:n { \tl_reverse:n {#3} #2 } }
+ \__siunitx_number_round_final_output:en
+ { \__siunitx_number_round_final_significant:e { \tl_reverse:n {#3} #2 } }
{#1}
}
\cs_new:Npn \__siunitx_number_round_final_significant:n #1
@@ -1534,6 +1549,7 @@
\__siunitx_number_round_final_significant:N #1
\q_recursion_tail \q_recursion_stop
}
+\cs_generate_variant:Nn \__siunitx_number_round_final_significant:n { e }
\cs_new:Npn \__siunitx_number_round_final_significant:N #1
{
\quark_if_recursion_tail_stop_do:Nn #1 { 0 }
@@ -1548,10 +1564,10 @@
#1 \q_recursion_tail \q_recursion_stop
{#1}
\cs_new:Npn \__siunitx_number_round_final_output:nn #1#2 { {#1} {#2} }
-\cs_generate_variant:Nn \__siunitx_number_round_final_output:nn { ff }
+\cs_generate_variant:Nn \__siunitx_number_round_final_output:nn { ne , e , ee }
\cs_new:Npn \__siunitx_number_round_final:nn #1#2
{ #2 #1 }
-\cs_generate_variant:Nn \__siunitx_number_round_final:nn { f }
+\cs_generate_variant:Nn \__siunitx_number_round_final:nn { e }
\cs_new:Npn \__siunitx_number_round_final_shift:nn #1#2
{
\bool_lazy_or:nnTF
@@ -1564,7 +1580,7 @@
}
{ {#1} {#2} }
}
-\cs_generate_variant:Nn \__siunitx_number_round_final_shift:nn { ff }
+\cs_generate_variant:Nn \__siunitx_number_round_final_shift:nn { en , ee }
\cs_new:Npn \__siunitx_number_round_engineering:nn #1#2
{
\int_compare:nNnTF { \tl_count:n {#1} } = 4
@@ -1581,7 +1597,7 @@
\cs_new:Npn \__siunitx_number_round_engineering:NNNNn #1#2#3#4#5
{
{#1}
- \exp_args:NV \__siunitx_number_round_engineering:nnN
+ \__siunitx_number_round_engineering:VnN
\l__siunitx_number_round_precision_int { }
#2#3#4#5 \q_recursion_tail \q_recursion_stop
}
@@ -1592,6 +1608,7 @@
{ \use_i_delimit_by_q_recursion_stop:nw { {#2} } }
{ \__siunitx_number_round_engineering:nnN { #1 - 1 } { #2#3 } }
}
+\cs_generate_variant:Nn \__siunitx_number_round_engineering:nnN { V }
\cs_new:Npn \__siunitx_number_round_fixed:nn #1#2 { {#1} {#2} }
\cs_new:Npn \__siunitx_number_round_input:nn #1#2 { {#1} {#2} }
\cs_new:Npn \__siunitx_number_round_scientific:nn #1#2
@@ -1601,7 +1618,7 @@
{ \str_if_eq_p:Vn \l__siunitx_number_round_mode_tl { figures } }
{ { 1 } { } }
{
- \__siunitx_number_exponent_shift:nnf
+ \__siunitx_number_exponent_shift:nne
{ 1 } {#1} { \__siunitx_number_round_truncate_direct:n {#2} }
}
\__siunitx_number_round_final_shift:Nw 1
@@ -1694,7 +1711,7 @@
{
\int_compare:nNnTF {#1} > \l__siunitx_number_round_precision_int
{
- \__siunitx_number_round:fnn
+ \__siunitx_number_round:enn
{ \int_eval:n { #1 - \l__siunitx_number_round_precision_int } }
{#2} {#3}
}
@@ -1703,14 +1720,15 @@
{ \l__siunitx_number_round_precision_int - (#1) } {#2} {#3}
}
}
- \exp_args:Nf \__siunitx_number_round_figures_count:nnnN
+ \__siunitx_number_round_figures_count:ennN
{ \int_eval:n { #1 + 1 } } {#2} {#3}
}
+\cs_generate_variant:Nn \__siunitx_number_round_figures_count:nnnN { e }
\cs_new:Npn \__siunitx_number_round_places:nnnnnnn #1#2#3#4#5#6#7
{
\tl_if_blank:nTF {#5}
{
- \exp_args:Ne \__siunitx_number_round_places_finalise:n
+ \__siunitx_number_round_places_finalise:e
{
\exp_not:n { {#1} {#2} }
\int_compare:nNnTF \l__siunitx_number_round_precision_int > 0
@@ -1732,7 +1750,7 @@
{#1} {#2}
}
{
- \__siunitx_number_round:fnn
+ \__siunitx_number_round:enn
{
\int_eval:n
{ 0 \tl_count:n {#2} - \l__siunitx_number_round_precision_int }
@@ -1742,7 +1760,7 @@
}
\cs_new:Npn \__siunitx_number_round_places_integer:nn #1#2
{
- \__siunitx_number_round:fnn
+ \__siunitx_number_round:enn
{
\int_eval:n
{ 0 \tl_count:n {#2} - \l__siunitx_number_round_precision_int }
@@ -1775,6 +1793,7 @@
}
{ \exp_not:n { {#1} {#2} {#3} {#4} {#5} {#6} {#7} } }
}
+\cs_generate_variant:Nn \__siunitx_number_round_places_finalise:n { e }
\cs_new:Npn \__siunitx_number_round_places_finalise:nnnnn #1#2#3#4#5
{
{
@@ -1794,7 +1813,7 @@
\str_if_eq:eeTF { \tl_head:n {#5} } { S }
{
\exp_not:n { {#1} {#2} }
- \exp_args:Nnno \__siunitx_number_round_uncertainty:nnn
+ \__siunitx_number_round_uncertainty:nno
{#3} {#4} { \use_ii:nn #5 }
{#6} {#7}
}
@@ -1803,13 +1822,14 @@
}
\cs_new:Npn \__siunitx_number_round_uncertainty:nnn #1#2#3
{
- \exp_args:Nf \__siunitx_number_round_uncertainty:nnnn
+ \__siunitx_number_round_uncertainty:ennn
{
\int_eval:n
{ \tl_count:n {#3} - \l__siunitx_number_round_precision_int }
}
{#1} {#2} {#3}
}
+\cs_generate_variant:Nn \__siunitx_number_round_uncertainty:nnn { nno }
\cs_new:Npn \__siunitx_number_round_uncertainty:nnnn #1#2#3#4
{
\use:e
@@ -1820,6 +1840,7 @@
{#2} {#3} {#1} {#4}
}
}
+\cs_generate_variant:Nn \__siunitx_number_round_uncertainty:nnnn { e }
\cs_new:Npn \__siunitx_number_round_uncertainty:nnnnnn #1#2#3#4#5#6
{
\tl_if_blank:nTF {#1}
@@ -1829,7 +1850,7 @@
}
\cs_new:Npn \__siunitx_number_round_uncertainty_auxi:nnnnn #1#2#3#4#5
{
- \exp_args:Nf \__siunitx_number_round_uncertainty_auxiv:nnnnnnN
+ \__siunitx_number_round_uncertainty_auxiv:ennnnnN
{ \__siunitx_number_round_uncertainty_zeros:nnnn {#1} {#3} {#4} {#5} }
{#4}
{#2} {#3} {#1} { }
@@ -1837,7 +1858,7 @@
}
\cs_new:Npn \__siunitx_number_round_uncertainty_auxii:nnnnn #1#2#3#4#5
{
- \exp_args:Nff \__siunitx_number_round_uncertainty_auxiii:nnnnnnn
+ \__siunitx_number_round_uncertainty_auxiii:eennnnn
{ \tl_count:n {#5} }
{ \tl_count:n {#3} }
{#1} {#2} {#3} {#4} {#5}
@@ -1849,26 +1870,21 @@
\bool_lazy_and:nnTF
{ \int_compare_p:nNn \l__siunitx_number_round_precision_int = 2 }
{ \int_compare_p:nNn {#1} = {#2} }
- {
- \exp_args:Nnf \__siunitx_number_round_uncertainty_auxiv:nnnnnnN
- { 0 }
- }
- {
- \exp_args:Nnf \__siunitx_number_round_uncertainty_auxiv:nnnnnnN
- { }
- }
+ { \__siunitx_number_round_uncertainty_auxiv:nennnnN { 0 } }
+ { \__siunitx_number_round_uncertainty_auxiv:nennnnN { } }
{ \int_eval:n { #6 + 1 } }
{#4} {#5} { 1 } { }
\__siunitx_number_round_uncertainty_auxvii:nnNnnn
}
{
- \exp_args:Nff \__siunitx_number_round_uncertainty_auxiv:nnnnnnN
+ \__siunitx_number_round_uncertainty_auxiv:eennnnN
{ \__siunitx_number_round_uncertainty_zeros:nnnn {#3} {#5} {#6} {#7} }
{ \int_eval:n { #6 + 1 } }
{#4} {#5} { 1 } {#3}
\__siunitx_number_round_uncertainty_auxvii:nnNnnn
}
}
+\cs_generate_variant:Nn \__siunitx_number_round_uncertainty_auxiii:nnnnnnn { ee }
\cs_new:Npn \__siunitx_number_round_uncertainty_zeros:nnnn #1#2#3#4
{
\prg_replicate:nn
@@ -1896,6 +1912,7 @@
{#3} #7
\__siunitx_number_round_end:nnn { { S } { #5#6 #1 } }
}
+\cs_generate_variant:Nn \__siunitx_number_round_uncertainty_auxiv:nnnnnnN { ne , e , ee }
\cs_new:Npn \__siunitx_number_round_uncertainty_auxv:nnnN #1#2#3#4
{
\int_compare:nNnT { \tl_count:n {#1} } > { \tl_count:n {#3} }
@@ -2005,18 +2022,20 @@
}
\cs_new:Npn \siunitx_number_adjust_exponent:nn #1#2
{ \__siunitx_number_adjust_exp:nnnnnnnn #1 {#2} }
+\cs_generate_variant:Nn \siunitx_number_adjust_exponent:nn { V }
\cs_new:Npn \siunitx_number_adjust_exponent:Nn #1#2
{
\tl_if_empty:NF #1
- { \exp_args:NV \siunitx_number_adjust_exponent:nn #1 {#2} }
+ { \siunitx_number_adjust_exponent:Vn #1 {#2} }
}
\cs_new:Npn \__siunitx_number_adjust_exp:nnnnnnnn #1#2#3#4#5#6#7#8
{
\exp_not:n { {#1} {#2} {#3} {#4} {#5} }
- \exp_args:Ne \__siunitx_number_adjust_exp:nn { \fp_eval:n { #6#7 + #8 } } {#6}
+ \__siunitx_number_adjust_exp:en { \fp_eval:n { #6#7 + #8 } } {#6}
}
\cs_new:Npn \__siunitx_number_adjust_exp:nn #1#2
{ \__siunitx_number_adjust_exp:nNw {#2} #1 \q_stop }
+\cs_generate_variant:Nn \__siunitx_number_adjust_exp:nn { e }
\cs_new:Npn \__siunitx_number_adjust_exp:nNw #1#2#3 \q_stop
{
\token_if_eq_meaning:NNTF #2 -
@@ -2124,10 +2143,12 @@
\tl_new:N \l__siunitx_number_uncert_mode_tl
\cs_new:Npn \siunitx_number_output:N #1
{ \__siunitx_number_output:Nn #1 { } }
+\cs_generate_variant:Nn \siunitx_number_output:N { c }
\cs_new:Npn \siunitx_number_output:n #1
{ \__siunitx_number_output:nn #1 { } }
\cs_new:Npn \siunitx_number_output:NN #1#2
{ \__siunitx_number_output:Nn #1 {#2} }
+\cs_generate_variant:Nn \siunitx_number_output:NN { c }
\cs_new:Npn \siunitx_number_output:nN #1#2
{ \__siunitx_number_output:nn #1 {#2} }
\cs_new:Npn \__siunitx_number_output:Nn #1#2
@@ -2162,7 +2183,11 @@
{
\bool_lazy_or_p:nn
{ \l__siunitx_number_zero_exponent_bool }
- { ! \str_if_eq_p:nn {#2} { 0 } }
+ {
+ ! \bool_lazy_or_p:nn
+ { \tl_if_blank_p:n {#2} }
+ { \str_if_eq_p:nn {#2} { 0 } }
+ }
}
}
\__siunitx_number_output_bracket:w
@@ -2277,7 +2302,7 @@
{ \__siunitx_number_output_digits:nn { decimal } {#1} }
}
}
-\cs_generate_variant:Nn \__siunitx_number_output_decimal:nn { f }
+\cs_generate_variant:Nn \__siunitx_number_output_decimal:nn { e }
\cs_new:Npn \__siunitx_number_output_digits:nn #1#2
{
\bool_if:cTF { l__siunitx_number_group_ #1 _ bool }
@@ -2337,13 +2362,14 @@
}
\cs_new:Npn \__siunitx_number_output_integer_first:n #1
{
- \exp_args:Ne \__siunitx_number_output_integer_aux:n { \tl_reverse:n {#1} }
+ \__siunitx_number_output_integer_aux:e { \tl_reverse:n {#1} }
}
\cs_new:Npn \__siunitx_number_output_integer_aux:n #1
{
\__siunitx_number_output_integer_loop:NnnN \l__siunitx_number_group_first_int { 0 } { }
#1 \q_recursion_tail \q_recursion_stop
}
+\cs_generate_variant:Nn \__siunitx_number_output_integer_aux:n { e }
\cs_new:Npn \__siunitx_number_output_integer_loop:NnnN #1#2#3#4
{
\quark_if_recursion_tail_stop_do:Nn #4 {#3}
@@ -2448,7 +2474,7 @@
{ \exp_not:n { #1 #1 #1 #1 } }
\cs_new:Npn \__siunitx_number_output_uncert:nnnn #1#2#3#4
{
- \exp_args:NV \__siunitx_number_output_uncert:nnnnn \l__siunitx_number_uncert_desc_clist
+ \__siunitx_number_output_uncert:Vnnnn \l__siunitx_number_uncert_desc_clist
{#1} {#2} {#3} {#4}
}
\cs_new:Npn \__siunitx_number_output_uncert:nnnnn #1#2#3#4#5
@@ -2456,6 +2482,7 @@
\__siunitx_number_output_uncert_loop:nnN {#2} {#3}
#4 \q_recursion_tail #1 , \q_recursion_stop {#5}
}
+\cs_generate_variant:Nn \__siunitx_number_output_uncert:nnnnn { V }
\cs_new:Npn \__siunitx_number_output_uncert_loop:nnN #1#2#3
{
\quark_if_recursion_tail_stop:N #3
@@ -2573,7 +2600,7 @@
}
\cs_new:Npn \__siunitx_number_output_uncert_augment:nnnn #1#2#3#4
{
- \exp_args:Nf \__siunitx_number_output_uncert_augment:nnn
+ \__siunitx_number_output_uncert_augment:enn
{ \int_eval:n { \tl_count:n {#1} - \tl_count:n {#2} } }
{#3} {#4}
}
@@ -2581,7 +2608,7 @@
{
\int_compare:nNnTF {#1} > 0
{
- \__siunitx_number_output_uncert_augment:fnnw
+ \__siunitx_number_output_uncert_augment:ennw
{ \int_eval:n { #1 - 1 } }
{#3}
{ }
@@ -2589,7 +2616,7 @@
}
{
0
- \__siunitx_number_output_decimal:fn
+ \__siunitx_number_output_decimal:en
{
\prg_replicate:nn { \int_abs:n {#1} } { 0 }
#2
@@ -2597,6 +2624,7 @@
{#3}
}
}
+\cs_generate_variant:Nn \__siunitx_number_output_uncert_augment:nnn { e }
\cs_new:Npn \__siunitx_number_output_uncert_augment:nnnw #1#2#3#4
{
\quark_if_nil:NF #4
@@ -2604,14 +2632,14 @@
\int_compare:nNnTF {#1} = 0
{ \__siunitx_number_output_uncert_augment:nnw {#3#4} {#2} }
{
- \__siunitx_number_output_uncert_augment:fnnw
+ \__siunitx_number_output_uncert_augment:ennw
{ \int_eval:n { #1 - 1 } }
{#2}
{#3#4}
}
}
}
-\cs_generate_variant:Nn \__siunitx_number_output_uncert_augment:nnnw { f }
+\cs_generate_variant:Nn \__siunitx_number_output_uncert_augment:nnnw { e }
\cs_new:Npn \__siunitx_number_output_uncert_augment:nnw #1#2#3 \q_nil
{
\__siunitx_number_output_digits:nn { integer } {#1}
@@ -2620,18 +2648,28 @@
\cs_new:Npn \__siunitx_number_output_exponent:nnnnn #1#2#3#4#5
{
\exp_not:n {#5}
+ \str_if_empty:nTF {#2}
+ {
+ \bool_if:NTF \l__siunitx_number_zero_exponent_bool
+ { \__siunitx_number_output_exponent_auxi:nnnnn {#1} { 0 } {#3} {#4} {#5} }
+ { \exp_not:n {#5} }
+ }
+ { \__siunitx_number_output_exponent_auxi:nnnnn {#1} {#2} {#3} {#4} {#5} }
+ }
+\cs_new:Npn \__siunitx_number_output_exponent_auxi:nnnnn #1#2#3#4#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:nnnnn }
{ \__siunitx_number_output_exponent_auxii:nnnnn }
+ { \__siunitx_number_output_exponent_auxiii:nnnnn }
{#1} {#2} {#3} {#4} {#5}
}
{ \exp_not:n {#5} }
}
-\cs_new:Npn \__siunitx_number_output_exponent_auxi:nnnnn #1#2#3#4#5
+\cs_new:Npn \__siunitx_number_output_exponent_auxii:nnnnn #1#2#3#4#5
{
\bool_lazy_or:nnT
{
@@ -2653,15 +2691,15 @@
\exp_not:n {#5}
\exp_not:V \l__siunitx_number_exponent_base_tl
^
- { \__siunitx_number_output_exponent_auxiii:nnn { } {#1} {#2} }
+ { \__siunitx_number_output_exponent_auxiv:nnn { } {#1} {#2} }
}
-\cs_new:Npn \__siunitx_number_output_exponent_auxii:nnnnn #1#2#3#4#5
+\cs_new:Npn \__siunitx_number_output_exponent_auxiii:nnnnn #1#2#3#4#5
{
\exp_not:n {#5}
\exp_not:V \l__siunitx_number_output_exp_marker_tl
- \__siunitx_number_output_exponent_auxiii:nnn { \mathord } {#1} {#2}
+ \__siunitx_number_output_exponent_auxiv:nnn { \mathord } {#1} {#2}
}
-\cs_new:Npn \__siunitx_number_output_exponent_auxiii:nnn #1#2#3
+\cs_new:Npn \__siunitx_number_output_exponent_auxiv:nnn #1#2#3
{
\tl_if_blank:nTF {#2}
{
@@ -2869,10 +2907,11 @@
}
}
}
+\cs_generate_variant:Nn \siunitx_angle:n { x }
\cs_new_protected:Npn \__siunitx_angle_angle:n #1
{
\bool_if:NTF \l__siunitx_angle_force_arc_bool
- { \exp_args:Ne \__siunitx_angle_arc_convert:n { \fp_eval:n {#1} } }
+ { \__siunitx_angle_arc_convert:x { \fp_eval:n {#1} } }
{
\siunitx_number_parse:nN {#1} \l__siunitx_angle_degrees_tl
\siunitx_number_process:NN \l__siunitx_angle_degrees_tl \l__siunitx_angle_degrees_tl
@@ -2890,7 +2929,7 @@
{
\bool_if:NTF \l__siunitx_angle_force_decimal_bool
{
- \exp_args:Ne \siunitx_angle:n
+ \siunitx_angle:x
{ \fp_eval:n { #1 + (#2) / 60 + (#3) / 3600 } }
}
{ \__siunitx_angle_arc_sign:nnn {#1} {#2} {#3} }
@@ -2908,25 +2947,24 @@
\l__siunitx_angle_seconds_tl
}
}
+\cs_generate_variant:Nn \siunitx_angle:nnn { xxx }
\cs_new_protected:Npn \__siunitx_angle_arc_convert:n #1
{
- \use:x
+ \siunitx_angle:xxx
+ { \fp_eval:n { trunc(#1,0) } }
+ { \fp_eval:n { trunc((#1 - trunc(#1,0)) * 60,0) } }
{
- \siunitx_angle:nnn
- { \fp_eval:n { trunc(#1,0) } }
- { \fp_eval:n { trunc((#1 - trunc(#1,0)) * 60,0) } }
+ \fp_eval:n
{
- \fp_eval:n
- {
- (
- (#1 - trunc(#1,0)) * 60
- - trunc((#1 - trunc(#1,0)) * 60,0)
- )
- * 60
- }
+ (
+ (#1 - trunc(#1,0)) * 60
+ - trunc((#1 - trunc(#1,0)) * 60,0)
+ )
+ * 60
}
}
}
+\cs_generate_variant:Nn \__siunitx_angle_arc_convert:n { x }
\tl_new:N \l__siunitx_angle_degrees_tl
\tl_new:N \l__siunitx_angle_minutes_tl
\tl_new:N \l__siunitx_angle_seconds_tl
@@ -2978,11 +3016,11 @@
{
\tl_if_empty:cF { l__siunitx_angle_ ##1 _tl }
{
- \exp_args:Ncc \siunitx_number_process:NN
+ \siunitx_number_process:cc
{ l__siunitx_angle_ ##1 _tl } { l__siunitx_angle_ ##1 _tl }
\tl_set:cx { l__siunitx_angle_ ##1 _tl }
{
- \exp_args:Nc \siunitx_number_output:NN
+ \siunitx_number_output:cN
{ l__siunitx_angle_ ##1 _tl } \q_nil
}
}
@@ -3478,6 +3516,7 @@
}
}
}
+\cs_generate_variant:Nn \siunitx_complex_number:n { x }
\cs_new_protected:Npn \siunitx_complex_number:nn #1#2
{
\bool_lazy_or:nnTF
@@ -3495,7 +3534,7 @@
{ \l__siunitx_complex_force_cartesian_bool }
{ \l_siunitx_number_parse_bool }
{
- \exp_args:Ne \siunitx_complex_number:n
+ \siunitx_complex_number:x
{ \__siunitx_complex_convert_cartesian:nn {#1} {#2} }
}
{
@@ -3525,6 +3564,7 @@
{ \siunitx_quantity:nn {#1} {#2} }
}
}
+\cs_generate_variant:Nn \siunitx_complex_quantity:nn { x }
\cs_new_protected:Npn \siunitx_complex_quantity:nnn #1#2#3
{
\bool_lazy_or:nnTF
@@ -3542,7 +3582,7 @@
{ \l__siunitx_complex_force_cartesian_bool }
{ \l_siunitx_number_parse_bool }
{
- \exp_args:Ne \siunitx_complex_quantity:nn
+ \siunitx_complex_quantity:xn
{ \__siunitx_complex_convert_cartesian:nn {#1} {#2} }
{#3}
}
@@ -3733,7 +3773,7 @@
\siunitx_print_number:V \l__siunitx_complex_tmp_tl
\bool_if:NT \l__siunitx_complex_polar_degree_bool
{
- \exp_args:NV \siunitx_unit_format:nN \l__siunitx_complex_symbol_degree_tl \l__siunitx_complex_tmp_tl
+ \siunitx_unit_format:VN \l__siunitx_complex_symbol_degree_tl \l__siunitx_complex_tmp_tl
\nobreak
\siunitx_print_unit:V \l__siunitx_complex_tmp_tl
}
@@ -3763,7 +3803,7 @@
}
\cs_new:Npn \__siunitx_complex_convert_cartesian:nn #1#2
{
- \exp_args:Nee \__siunitx_complex_convert_cartesian_aux:nn
+ \__siunitx_complex_convert_cartesian_aux:ee
{
\fp_to_tl:n
{ (#1) * cos \bool_if:NT \l__siunitx_complex_polar_degree_bool { d } (#2) }
@@ -3777,6 +3817,7 @@
{
\__siunitx_complex_convert_cartesian_aux:w #1 e e \q_mark #2 e e \q_stop
}
+\cs_generate_variant:Nn \__siunitx_complex_convert_cartesian_aux:nn { ee }
\cs_new:Npn \__siunitx_complex_convert_cartesian_aux:w
#1 e #2 e #3 \q_mark #4 e #5 e #6 \q_stop
{
@@ -3834,21 +3875,23 @@
}
\cs_new:Npn \__siunitx_complex_convert_polar_auxvi:nnn #1#2#3
{
- \exp_args:Neee \__siunitx_complex_convert_polar_auxvii:nnn
+ \__siunitx_complex_convert_polar_auxvii:eee
{ \tl_if_blank:nTF {#1} { 0 } {#1} }
{ \tl_if_blank:nTF {#2} { 0 } {#2} }
{ \tl_if_blank:nF {#3} { e#3 } }
}
\cs_new:Npn \__siunitx_complex_convert_polar_auxvii:nnn #1#2#3
{
- \exp_args:Nee \__siunitx_complex_format_polar_auxviii:nn
+ \__siunitx_complex_format_polar_auxviii:ee
{ \fp_eval:n { sqrt ( (#1#3)^2 + (#2#3)^2 ) } }
{
\fp_eval:n
{ atan \bool_if:NT \l__siunitx_complex_polar_degree_bool { d } (#2 , #1) }
}
}
+\cs_generate_variant:Nn \__siunitx_complex_convert_polar_auxvii:nnn { eee }
\cs_new:Npn \__siunitx_complex_format_polar_auxviii:nn #1#2 { {#1} {#2} }
+\cs_generate_variant:Nn \__siunitx_complex_format_polar_auxviii:nn { ee }
\msg_new:nnnn { siunitx } { invalid-polar-form }
{ Invalid~polar~form~"#1:#2". }
{
@@ -3973,7 +4016,7 @@
\seq_clear:N \l__siunitx_compound_tmp_seq
\bool_if:NTF \l_siunitx_number_parse_bool
{
- \exp_args:Nxx \__siunitx_compound_format:nnn
+ \__siunitx_compound_format:xxn
{ \tl_head:n {#1} }
{ \tl_tail:n {#1} }
{#2}
@@ -3989,6 +4032,7 @@
}
{ \__siunitx_compound_format_aux:nnn {#1} {#2} {#3} }
}
+\cs_generate_variant:Nn \__siunitx_compound_format:nnn { xx }
\cs_new_protected:Npn \__siunitx_compound_format_aux:nnn #1#2#3
{
\siunitx_number_parse:nN {#1} \l__siunitx_compound_tmp_tl
@@ -4101,7 +4145,7 @@
{
\bool_set_true:N \l__siunitx_compound_exp_combine_bool
\siunitx_number_process:NN \l__siunitx_compound_tmp_tl \l__siunitx_compound_first_tl
- \exp_args:NV \__siunitx_compound_extract_exp:nN
+ \__siunitx_compound_extract_exp:VN
\l__siunitx_compound_first_tl \l__siunitx_compound_tmp_fp
#1 \l__siunitx_compound_tmp_fp \l__siunitx_compound_unit_tl
}
@@ -4138,6 +4182,7 @@
}
\cs_new_protected:Npn \__siunitx_compound_extract_exp:nN #1#2
{ \__siunitx_compound_extract_exp:nnnnnnnN #1 #2 }
+\cs_generate_variant:Nn \__siunitx_compound_extract_exp:nN { V }
\cs_new_protected:Npn \__siunitx_compound_extract_exp:nnnnnnnN #1#2#3#4#5#6#7#8
{ \fp_set:Nn #8 {#6#7} }
\cs_new_protected:Npn \siunitx_compound_quantity:nn #1#2
@@ -4160,7 +4205,7 @@
}
\cs_new_protected:Npn \__siunitx_compound_quantity_auxi:nn #1#2
{
- \__siunitx_compound_print_boundary:V \l__siunitx_compound_boundary_close_tl
+ \__siunitx_compound_print_boundary:V \l__siunitx_compound_boundary_open_tl
\seq_clear:N \l__siunitx_compound_tmp_seq
\tl_map_inline:nn {#1}
{
@@ -4218,14 +4263,14 @@
}
#1
}
- { \__siunitx_compound_print:xxN { } { \exp_not:V \l__siunitx_compound_exp_tl } #1 }
+ { \__siunitx_compound_print:nVN { } \l__siunitx_compound_exp_tl #1 }
}
\cs_new_protected:Npn \__siunitx_compound_print:nnN #1#2#3
{
- \exp_args:Nx \__siunitx_compound_print:nnnN
+ \__siunitx_compound_print:xnnN
{ \seq_count:N \l__siunitx_compound_tmp_seq } {#1} {#2} #3
}
-\cs_generate_variant:Nn \__siunitx_compound_print:nnN { xx }
+\cs_generate_variant:Nn \__siunitx_compound_print:nnN { nV , x , xx }
\cs_new_protected:Npn \__siunitx_compound_print:nnnN #1#2#3#4
{
\int_case:nnF {#1}
@@ -4250,7 +4295,7 @@
\seq_item:Nn \l__siunitx_compound_tmp_seq { 2 }
\exp_not:n {#3}
}
- \__siunitx_compound_print_boundary:V \l__siunitx_compound_boundary_open_tl
+ \__siunitx_compound_print_boundary:V \l__siunitx_compound_boundary_close_tl
}
}
{
@@ -4265,6 +4310,7 @@
\__siunitx_compound_print_boundary:V \l__siunitx_compound_boundary_close_tl
}
}
+\cs_generate_variant:Nn \__siunitx_compound_print:nnnN { x }
\cs_new_protected:Npn \__siunitx_compound_print_aux:n #1 { }
\cs_new_protected:Npn \__siunitx_compound_print_aux:nn #1#2
{
@@ -4742,14 +4788,14 @@
\cs_generate_variant:Nn \siunitx_print_number:n { V , x }
\cs_new_protected:Npn \siunitx_print_unit:n #1
{ \__siunitx_print_aux:nn { unit } {#1} }
-\cs_generate_variant:Nn \siunitx_print_unit:n { V , x }
+\cs_generate_variant:Nn \siunitx_print_unit:n { V , o , x }
\cs_new_protected:Npn \__siunitx_print_aux:nn #1#2
{
\tl_if_empty:oF {#2}
{
\tl_if_empty:cTF { l__siunitx_print_ #1 _color_tl }
{ \use:n }
- { \exp_args:Nv \textcolor { l__siunitx_print_ #1 _color_tl } }
+ { \ExpandArgs { v } \textcolor { l__siunitx_print_ #1 _color_tl } }
{
\use:c
{
@@ -4845,7 +4891,7 @@
\exp_after:wN \__siunitx_print_math_replace:Nn
\l__siunitx_print_math_html_tl
\q_recursion_tail { } \q_recursion_stop
- \exp_args:NV \__siunitx_print_math_auxiii:n \l__siunitx_print_tmp_tl
+ \__siunitx_print_math_auxiii:V \l__siunitx_print_tmp_tl
\group_end:
}
\cs_new_protected:Npn \__siunitx_print_math_text_setup:
@@ -4877,6 +4923,7 @@
{ \__siunitx_print_math_auxiv:n }
{#1}
}
+\cs_generate_variant:Nn \__siunitx_print_math_auxiii:n { V }
\cs_new_protected:Npn \__siunitx_print_math_auxiv:n #1
{
\bool_if:NTF \l__siunitx_print_math_font_bool
@@ -4899,6 +4946,7 @@
}
\cs_new_protected:Npn \__siunitx_print_math_auxvi:Nn #1#2
{ \__siunitx_print_math_ensure:n { #1 {#2} } }
+\cs_generate_variant:Nn \__siunitx_print_math_auxvi:Nn { NV }
\cs_new_protected:Npn \__siunitx_print_math_auxvii:N #1
{
\quark_if_recursion_tail_stop_do:Nn #1 { \__siunitx_print_math_auxv:n }
@@ -4923,8 +4971,7 @@
\tl_replace_all:Nnn \exp_not:N \l__siunitx_print_tmp_tl
{ ^ }
{ \exp_not:N \__siunitx_print_math_super:n }
- \exp_not:N \exp_args:NNV \__siunitx_print_math_auxvi:Nn
- #1 \exp_not:N \l__siunitx_print_tmp_tl
+ \__siunitx_print_math_auxvi:NV #1 \exp_not:N \l__siunitx_print_tmp_tl
\group_end:
}
\cs_new_protected:Npx \__siunitx_print_math_sub:n #1
@@ -4975,7 +5022,8 @@
}
{ \selectfont }
\tl_use:N \l__siunitx_print_text_font_tl
- \exp_args:NnV \tl_if_head_eq_meaning:nNTF {#1} \l_siunitx_unit_fraction_tl
+ \exp_last_unbraced:Nno \tl_if_head_eq_meaning:nNTF
+ {#1} \l_siunitx_unit_fraction_tl
{ \__siunitx_print_text_fraction:Nnn #1 }
{ \__siunitx_print_text_replace:n {#1} }
}
@@ -4989,8 +5037,12 @@
\tl_set:Nn \l__siunitx_print_tmp_tl {#1}
\tl_if_empty:NF \l__siunitx_print_tmp_tl
{
+ \__siunitx_print_text_replace_font:N \l__siunitx_print_tmp_tl
\tl_if_empty:NF \l_siunitx_unit_font_tl
- { \exp_after:wN \cs_set_eq:NN \l_siunitx_unit_font_tl \use:n }
+ {
+ \exp_after:wN
+ \cs_set_eq:NN \l_siunitx_unit_font_tl \scan_stop:
+ }
\cs_set:Npn \mathord ##1
{ \__siunitx_print_text_replace_first:N ##1 }
\group_begin:
@@ -5016,6 +5068,14 @@
\group_end:
}
\cs_new_protected:Npn \__siunitx_print_text_replace_aux:n #1 {#1}
+\cs_new_protected:Npn \__siunitx_print_text_replace_font:N #1
+ {
+ \tl_if_empty:NF \l_siunitx_unit_font_tl
+ {
+ \tl_replace_all:NVn #1
+ \l_siunitx_unit_font_tl { \use:n }
+ }
+ }
\cs_new:Npn \__siunitx_print_text_replace_first:N #1
{
\str_case:nnF {#1}
@@ -5044,6 +5104,7 @@
\exp_not:N \q_recursion_tail
{ ? }
\exp_not:N \q_recursion_stop
+ \__siunitx_print_text_replace_font:N #1
}
\cs_new_protected:Npn \__siunitx_print_text_replace:NNn #1#2#3
{
@@ -5064,7 +5125,8 @@
}
\cs_new_protected:Npn \__siunitx_print_print_replace_frac:n #1
{
- \exp_args:NnV \tl_if_head_eq_meaning:nNTF {#1} \l_siunitx_unit_fraction_tl
+ \exp_last_unbraced:Nno \tl_if_head_eq_meaning:nNTF
+ {#1} \l_siunitx_unit_fraction_tl
{ \__siunitx_print_text_fraction:Nnn #1 }
{ \mbox { \__siunitx_print_text_replace:n {#1} } }
}
@@ -5178,6 +5240,7 @@
eb = bold ,
ub = bold
}
+\cs_generate_variant:Nn \keys_set:nn { nx }
\box_new:N \l__siunitx_table_tmp_box
\dim_new:N \l__siunitx_table_tmp_dim
\tl_new:N \l__siunitx_table_tmp_tl
@@ -5292,7 +5355,7 @@
{
\exp_args:NNV \group_end:
\__siunitx_table_collect_end:n \l__siunitx_table_collect_tl
- \exp_args:NV \__siunitx_table_split:nNNN
+ \__siunitx_table_split:VNNN
\l__siunitx_table_collect_tl
\l__siunitx_table_before_tl
\l__siunitx_table_number_tl
@@ -5331,6 +5394,7 @@
\__siunitx_table_split_tidy:N #2
\__siunitx_table_split_tidy:N #4
}
+\cs_generate_variant:Nn \__siunitx_table_split:nNNN { V }
\cs_new_protected:Npn \__siunitx_table_split_loop:NNN #1#2#3
{
\peek_remove_spaces:n
@@ -5540,7 +5604,7 @@
\l__siunitx_table_before_model_tl
\l__siunitx_table_model_tl
\l__siunitx_table_after_model_tl
- \exp_args:NV \__siunitx_table_generate_model:n \l__siunitx_table_model_tl
+ \__siunitx_table_generate_model:V \l__siunitx_table_model_tl
\tl_set:Nn \l__siunitx_table_align_mode_tl { format }
} ,
table-model-setup .tl_set:N =
@@ -5569,6 +5633,7 @@
\l__siunitx_table_format_tl
}
}
+\cs_generate_variant:Nn \__siunitx_table_generate_model:n { V }
\cs_new_protected:Npn \__siunitx_table_generate_model:nnnnnnn #1#2#3#4#5#6#7
{
\tl_set:Nx \l__siunitx_table_model_tl
@@ -5589,9 +5654,9 @@
}
\exp_not:n { {#6} }
{
- \int_compare:nNnTF {#7} = 0
+ \int_compare:nNnTF { 0#7 } = 0
{ 0 }
- { \prg_replicate:nn {#7} { 8 } }
+ { \prg_replicate:nn { 0#7 } { 8 } }
}
}
}
@@ -5599,7 +5664,7 @@
{
{ S }
{
- \exp_args:Nff \__siunitx_table_generate_model_S:nnn
+ \__siunitx_table_generate_model_S:een
{ \tl_count:n {#1} } { \tl_count:n {#3} }
{#3}
}
@@ -5618,6 +5683,7 @@
}
{ 8 }
}
+\cs_generate_variant:Nn \__siunitx_table_generate_model_S:nnn { ee }
\cs_new_protected:Npn \__siunitx_table_direct_begin:
{ \__siunitx_table_direct_begin:w }
\cs_new_protected:Npn \__siunitx_table_direct_begin:w #1 \ignorespaces
@@ -5798,7 +5864,12 @@
#1 \q_nil #2 \q_nil #3 \q_nil #4 \q_nil #5
\q_nil #6 \q_nil #7 \q_nil #8 \q_stop
{
- \exp_not:n {#1#2#3#4#5#6}
+ \bool_lazy_and:nnTF
+ { \tl_if_blank_p:n {#1#2} }
+ { ! \tl_if_blank_p:n {#3} }
+ { { } }
+ { \exp_not:n {#1#2} }
+ \exp_not:n {#3#4#5#6}
\tl_if_blank:nT {#1#2#3#4#5#6} { { } }
\exp_not:n {#7#8}
}
@@ -5816,7 +5887,7 @@
\group_begin:
\bool_if:NT \l__siunitx_table_auto_round_bool
{
- \exp_args:Nx \keys_set:nn { siunitx }
+ \keys_set:nx { siunitx }
{
round-mode = places ,
round-pad = true ,
@@ -6276,6 +6347,7 @@
\fp_set:Nn \l__siunitx_unit_multiple_fp { \c_one_fp }
\__siunitx_unit_format:nNN {#1} #2 \l__siunitx_unit_tmp_fp
}
+\cs_generate_variant:Nn \siunitx_unit_format:nN { V }
\cs_new_protected:Npn \siunitx_unit_format_extract_prefixes:nNN #1#2#3
{
\bool_set_true:N \l__siunitx_unit_prefix_exp_bool
@@ -6359,6 +6431,7 @@
{ \token_to_str:N ^ } { ^ }
\tl_replace_all:Nnn \exp_not:N \l__siunitx_unit_tmp_tl
{ \token_to_str:N _ } { \c__siunitx_unit_math_subscript_tl }
+ \cs_set_eq:NN \exp_not:N \text \scan_stop:
\char_set_active_eq:NN ^
\exp_not:N \__siunitx_unit_format_literal_superscript:
\char_set_active_eq:NN _
@@ -7454,7 +7527,7 @@
\cs_new_protected:cpn { __siunitx_quantity_parsed_combine-exponent:n } #1
{
\siunitx_number_process:NN \l__siunitx_quantity_number_tl \l__siunitx_quantity_number_tl
- \exp_args:NV \__siunitx_quantity_extract_exp:nNN
+ \__siunitx_quantity_extract_exp:VNN
\l__siunitx_quantity_number_tl \l__siunitx_quantity_tmp_fp \l__siunitx_quantity_number_tl
\siunitx_unit_format_combine_exponent:nnN {#1}
\l__siunitx_quantity_tmp_fp \l__siunitx_quantity_unit_tl
@@ -7483,7 +7556,7 @@
{ \__siunitx_quantity_parsed_aux:nnnnw {#1} {#2} {#3} {#4} ? }
\cs_new_protected:Npn \__siunitx_quantity_parsed_aux:nnnnw
#1#2#3#4 #5 \q_nil #6 \q_stop
- { \exp_args:No \__siunitx_quantity_parsed_aux:nnnn { \use_none:n #5#6 } {#1} {#2} {#3#4} }
+ { \__siunitx_quantity_parsed_aux:onnn { \use_none:n #5#6 } {#1} {#2} {#3#4} }
\cs_new_protected:Npn \__siunitx_quantity_parsed_aux:nnnn #1#2#3#4
{
\tl_if_blank:nTF {#4}
@@ -7512,6 +7585,7 @@
}
}
}
+\cs_generate_variant:Nn \__siunitx_quantity_parsed_aux:nnnn { o }
\cs_new_protected:Npn \__siunitx_quantity_parsed_aux:nnn #1#2#3
{
\siunitx_quantity_print:nV {#1#3} \l__siunitx_quantity_unit_tl
@@ -7520,6 +7594,7 @@
}
\cs_new_protected:Npn \__siunitx_quantity_extract_exp:nNN #1#2#3
{ \__siunitx_quantity_extract_exp:nnnnnnnNN #1 #2 #3 }
+\cs_generate_variant:Nn \__siunitx_quantity_extract_exp:nNN { V }
\cs_new_protected:Npn \__siunitx_quantity_extract_exp:nnnnnnnNN #1#2#3#4#5#6#7#8#9
{
\fp_set:Nn #8 {#6#7}
@@ -7541,9 +7616,7 @@
{ \nobreak }
\siunitx_print_unit:n {#2}
}
- {
- \exp_args:No \siunitx_print_unit:n { \use_none:n #2 }
- }
+ { \siunitx_print_unit:o { \use_none:n #2 } }
}
}
\cs_generate_variant:Nn \siunitx_quantity_print:nn { nV , VV , xV }
@@ -7714,7 +7787,7 @@
{
\@ifpackageloaded { hyperref }
{
- \exp_args:Nx \pdfstringdefDisableCommands
+ \ExpandArgs { x } \pdfstringdefDisableCommands
{
\cs_set_eq:NN \siunitx_print_text:n \exp_not:N \use:n
\siunitx_declare_unit:Nn \exp_not:N \ohm
@@ -8843,7 +8916,7 @@
\cs_set_protected:Npn \__siunitx_tmp:w \NC@do ##1##2 \NC@do #1
{ \NC@list { \NC@do ##1 \NC@do #1 ##2 } }
\exp_after:wN \__siunitx_tmp:w \the \NC@list
- \exp_args:NNc \renewcommand * { NC@rewrite@ #1 } [ 1 ] [ ]
+ \ExpandArgs { Nc } \renewcommand * { NC@rewrite@ #1 } [ 1 ] [ ]
{
\@temptokena \expandafter
{
@@ -8883,7 +8956,7 @@
}
\cs_new_protected:Npn \__siunitx_bookmark_cmd:Nnn #1#2#3
{
- \exp_args:Nc \DeclareExpandableDocumentCommand
+ \ExpandArgs { c } \DeclareExpandableDocumentCommand
{ \cs_to_str:N #1 \c_space_tl ( pdfstring ~ context ) }
{#2} {#3}
}
@@ -9008,12 +9081,13 @@
{
0
\exp_not:N \__siunitx_list_count:w \c_space_tl
- #1 \exp_not:n { ; \q_recursion_tail ; \q_recursion_stop }
+ #1
+ \exp_not:n { ; \s_stop \use_none_delimit_by_q_stop:w ; \q_stop }
}
}
\cs_new:Npx \__siunitx_list_count:w #1 ;
{
- \exp_not:n { \exp_args:Nf \quark_if_recursion_tail_stop:n } {#1}
+ \exp_not:N \use_none_delimit_by_s_stop:w #1 \exp_not:N \s_stop
\exp_not:N \tl_if_blank:nF {#1} { + 1 }
\exp_not:N \__siunitx_list_count:w \c_space_tl
}