summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/siunitx/siunitx-compound.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-08-01 03:01:19 +0000
committerNorbert Preining <norbert@preining.info>2023-08-01 03:01:19 +0000
commit84777905249300f2ab97a23141e31f952bceb865 (patch)
tree5621415ee6ecbcbe62e4c500977af3c41aeebd9c /macros/latex/contrib/siunitx/siunitx-compound.dtx
parent17d547a1effe2cafcdfbf704bdf8cb0484790ef2 (diff)
CTAN sync 202308010301
Diffstat (limited to 'macros/latex/contrib/siunitx/siunitx-compound.dtx')
-rw-r--r--macros/latex/contrib/siunitx/siunitx-compound.dtx418
1 files changed, 336 insertions, 82 deletions
diff --git a/macros/latex/contrib/siunitx/siunitx-compound.dtx b/macros/latex/contrib/siunitx/siunitx-compound.dtx
index 51701c6915..b16aa63f30 100644
--- a/macros/latex/contrib/siunitx/siunitx-compound.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-compound.dtx
@@ -137,6 +137,35 @@
% Phrase (or similar) used between limits of a range.
% \end{variable}
%
+% \begin{function}{compound-boundary-mode}
+% \begin{syntax}
+% |compound-boundary-mode| = |number|\verb"|"|text|
+% \end{syntax}
+% Choice which determines whether the material at the start and
+% end of a compound quantity are typeset a |number| or as |text|;
+% the latter is the standard setting.
+% \end{function}
+%
+% \begin{function}{compound-close-boundary, compound-open-boundary}
+% \begin{syntax}
+% |compound-close-boundary| = \meta{tokens}\\
+% |compound-open-boundary| = \meta{tokens}
+% \end{syntax}
+% Literals which are inserted at the opening and closing boundary of a compound
+% quantity; they are not used when the number of items is one.
+% The standard settings set these empty.
+% \end{function}
+%
+% \begin{function}{compound-close-bracket, compound-open-bracket}
+% \begin{syntax}
+% |compound-close-bracket| = \meta{token} \\
+% |compound-open-bracket| = \meta{token}
+% \end{syntax}
+% Literals containing the tokens inserted at the start and end of a compound
+% value when |compounds-units| is set to |bracket|. The standard settings are
+% |(| and |)|.
+% \end{function}
+%
% \begin{function}{compound-exponents}
% \begin{syntax}
% |compound-exponents| = |combine|\verb"|"|combine-bracket|\verb"|"|individual|
@@ -149,6 +178,15 @@
% \end{syntax}
% \end{function}
%
+% \begin{function}{compound-independent-prefix}
+% \begin{syntax}
+% |compound-independent-prefix| = |true|\verb"|"|false|
+% \end{syntax}
+% Switch which determines whether unit prefixes are calculated
+% independently when units are repeated. The standard setting is
+% |false|.
+% \end{function}
+%
% \begin{function}{compound-pair-separator}
% \begin{syntax}
% |compound-pair-separator| = \meta{text}
@@ -165,6 +203,9 @@
% \begin{syntax}
% |compound-separator-mode| = |number|\verb"|"|text|
% \end{syntax}
+% Choice which determines whether the separators between components
+% of compound quantity are typeset a |number| or as |text|;
+% the latter is the standard setting.
% \end{function}
%
% \begin{function}{compound-units}
@@ -173,6 +214,15 @@
% \end{syntax}
% \end{function}
%
+% \begin{function}{list-close-bracket, list-open-bracket}
+% \begin{syntax}
+% |list-close-bracket| = \meta{token} \\
+% |list-open-bracket| = \meta{token}
+% \end{syntax}
+% Literals containing the tokens inserted at the start and end of a list when
+% |list-units| is set to |bracket|. The standard settings are |(| and |)|.
+% \end{function}
+%
% \begin{function}{list-exponents}
% \begin{syntax}
% |list-exponents| = |combine|\verb"|"|combine-bracket|\verb"|"|individual|
@@ -185,6 +235,15 @@
% \end{syntax}
% \end{function}
%
+% \begin{function}{list-independent-prefix}
+% \begin{syntax}
+% |list-independent-prefix| = |true|\verb"|"|false|
+% \end{syntax}
+% Switch which determines whether unit prefixes are calculated
+% independently when units are repeated. The standard setting is
+% |false|.
+% \end{function}
+%
% \begin{function}{list-pair-separator}
% \begin{syntax}
% |list-pair-separator| = \meta{text}
@@ -203,12 +262,31 @@
% \end{syntax}
% \end{function}
%
+% \begin{function}{product-close-bracket, product-open-bracket}
+% \begin{syntax}
+% |product-close-bracket| = \meta{token} \\
+% |product-open-bracket| = \meta{token}
+% \end{syntax}
+% Literals containing the tokens inserted at the start and end of a product
+% when |product-units| is set to |bracket|. The standard settings are |(|
+% and |)|.
+% \end{function}
+%
% \begin{function}{product-exponents}
% \begin{syntax}
% |product-exponents| = |combine|\verb"|"|combine-bracket|\verb"|"|individual|
% \end{syntax}
% \end{function}
%
+% \begin{function}{product-independent-prefix}
+% \begin{syntax}
+% |product-independent-prefix| = |true|\verb"|"|false|
+% \end{syntax}
+% Switch which determines whether unit prefixes are calculated
+% independently when units are repeated. The standard setting is
+% |false|.
+% \end{function}
+%
% \begin{function}{product-mode}
% \begin{syntax}
% |product-mode| = |phrase|\verb"|"|choice|
@@ -233,10 +311,40 @@
% \end{syntax}
% \end{function}
%
+% \begin{function}{range-close-bracket, range-open-bracket}
+% \begin{syntax}
+% |range-close-bracket| = \meta{token} \\
+% |range-open-bracket| = \meta{token}
+% \end{syntax}
+% Literals containing the tokens inserted at the start and end of a range when
+% |range-units| is set to |bracket|. The standard settings are |(| and |)|.
+% \end{function}
+%
+% \begin{function}{range-independent-prefix}
+% \begin{syntax}
+% |range-independent-prefix| = |true|\verb"|"|false|
+% \end{syntax}
+% Switch which determines whether unit prefixes are calculated
+% independently when units are repeated. The standard setting is
+% |false|.
+% \end{function}
+%
+% \begin{function}{range-open-phrase}
+% \begin{syntax}
+% |range-open-phrase| = \meta{text}
+% \end{syntax}
+% Literal containing the material to be inserted at the start of a range.
+% The standard setting is empty.
+% \end{function}
+%
% \begin{function}{range-phrase}
% \begin{syntax}
% |range-phrase| = \meta{text}
% \end{syntax}
+% Literal containing the material to be inserted between the start and end
+% of a range. The standard setting contains the word \texttt{to} inside the
+% \cs{text} command, along with appropriate spacing commands to allow this
+% material to work in both math and text typesetting modes.
% \end{function}
%
% \begin{function}{range-units}
@@ -258,6 +366,7 @@
%
% \begin{macrocode}
\cs_generate_variant:Nn \keys_set:nn { nx }
+\cs_generate_variant:Nn \seq_use:Nnnn { NVVV }
% \end{macrocode}
%
% \subsection{General mechanism}
@@ -318,29 +427,26 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_@@_bracket_close_tl, \l_@@_bracket_open_tl}
-% Purely internal for the present.
-% \begin{macrocode}
-\tl_new:N \l_@@_bracket_close_tl
-\tl_new:N \l_@@_bracket_open_tl
-\tl_set:Nn \l_@@_bracket_open_tl { ( }
-\tl_set:Nn \l_@@_bracket_close_tl { ) }
-% \end{macrocode}
-% \end{variable}
-%
% \begin{variable}
% {
+% \l_@@_boundary_close_tl ,
+% \l_@@_bracket_close_tl ,
+% \l_@@_independent_bool ,
% \l_@@_separator_final_tl ,
% \l_@@_separator_pair_tl ,
+% \l_@@_boundary_open_tl ,
+% \l_@@_bracket_open_tl ,
% \l_@@_separator_tl ,
% \l_@@_separator_text_bool ,
% \l_@@_exp_bracket_bool ,
% \l_@@_exp_combine_bool ,
% \l_@@_unit_bracket_bool ,
-% \l_@@_unit_repeat_bool
+% \l_@@_unit_power_bool ,
+% \l_@@_unit_repeat_bool ,
% }
% List options.
% \begin{macrocode}
+\bool_new:N \l_@@_boundary_text_bool
\bool_new:N \l_@@_exp_bracket_bool
\bool_new:N \l_@@_exp_combine_bool
\bool_new:N \l_@@_separator_text_bool
@@ -349,6 +455,15 @@
\bool_new:N \l_@@_unit_repeat_bool
\keys_define:nn { siunitx }
{
+ compound-boundary-mode .choice: ,
+ compound-boundary-mode / number .code:n =
+ { \bool_set_false:N \l_@@_delim_text_bool } ,
+ compound-boundary-mode / text .code:n =
+ { \bool_set_true:N \l_@@_delim_text_bool } ,
+ compound-close-boundary .tl_set:N =
+ \l_@@_boundary_close_tl ,
+ compound-close-bracket .tl_set:N =
+ \l_@@_bracket_close_tl ,
compound-exponents .choice: ,
compound-exponents / combine .code:n =
{
@@ -367,8 +482,14 @@
} ,
compound-final-separator .tl_set:N =
\l_@@_separator_final_tl ,
+ compound-independent-prefix .bool_set:N =
+ \l_@@_independent_bool ,
compound-pair-separator .tl_set:N =
\l_@@_separator_pair_tl ,
+ compound-open-boundary .tl_set:N =
+ \l_@@_boundary_open_tl ,
+ compound-open-bracket .tl_set:N =
+ \l_@@_bracket_open_tl ,
compound-separator .tl_set:N =
\l_@@_separator_tl ,
compound-separator-mode .choice: ,
@@ -406,7 +527,7 @@
\bool_set_false:N \l_@@_unit_bracket_bool
\bool_set_false:N \l_@@_unit_power_bool
\bool_set_false:N \l_@@_unit_repeat_bool
- }
+ }
}
% \end{macrocode}
% \end{variable}
@@ -664,7 +785,12 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\siunitx_compound_quantity:nn}
+% \begin{macro}
+% {
+% \siunitx_compound_quantity:nn ,
+% \@@_quantity_auxi:nn ,
+% \@@_quantity_auxii:nn
+% }
% For quantities, life is more complex as there are interactions between the
% options for exponents and units. The \cs{c_empty_tl} suppresses any
% leading \texttt{1} if the unit starts \cs{per}; the \pkg{siunitx-print}
@@ -673,37 +799,76 @@
\cs_new_protected:Npn \siunitx_compound_quantity:nn #1#2
{
\group_begin:
- \bool_if:NT \l_@@_unit_bracket_bool
- { \bool_set_true:N \l_@@_exp_bracket_bool }
- \bool_if:NT \l_@@_unit_repeat_bool
- { \bool_set_false:N \l_@@_exp_combine_bool }
- \bool_lazy_or:nnT
- { \l_@@_unit_bracket_bool }
- { ! \l_@@_unit_repeat_bool }
- { \bool_set_false:N \l_siunitx_number_bracket_ambiguous_bool }
- \bool_set_true:N \l_@@_unit_bool
- \@@_format:nn {#1} {#2}
- \bool_if:NF \l_siunitx_number_parse_bool
- { \siunitx_unit_format:nN {#2} \l_@@_unit_tl }
- \str_if_eq:VnT \l_siunitx_quantity_prefix_mode_tl { combine-exponent }
- { \tl_clear:N \l_@@_exp_tl }
- \bool_if:NTF \l_@@_unit_repeat_bool
- { \@@_print:N \@@_print_quantity:x }
+ \bool_lazy_all:nTF
{
- \bool_lazy_and:nnTF
- { \l_@@_unit_bracket_bool }
- { \tl_if_empty_p:N \l_@@_exp_tl }
- {
- \siunitx_print_number:V \l_@@_bracket_open_tl
- \@@_print:N \siunitx_print_number:x
- \siunitx_print_number:V \l_@@_bracket_close_tl
- }
- { \@@_print:N \siunitx_print_number:x }
- \@@_print_quantity:n { \c_empty_tl }
+ { \l_@@_independent_bool }
+ {
+ \str_if_eq_p:Vn
+ \l_siunitx_quantity_prefix_mode_tl
+ { combine-exponent }
+ }
+ { \int_compare_p:nNn { \tl_count:n {#1} } > 1 }
}
+ { \@@_quantity_auxi:nn }
+ { \@@_quantity_auxii:nn }
+ {#1} {#2}
\group_end:
}
% \end{macrocode}
+% The rather special case where all units are printed independently:
+% we just convert to a simple sequence then print.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_quantity_auxi:nn #1#2
+ {
+ \@@_print_boundary:V \l_@@_boundary_close_tl
+ \seq_clear:N \l_@@_tmp_seq
+ \tl_map_inline:nn {#1}
+ {
+ \seq_put_right:Nn \l_@@_tmp_seq
+ { \siunitx_quantity:nn {##1} {#2} }
+ }
+ \seq_use:NVVV \l_@@_tmp_seq
+ \l_@@_separator_pair_tl
+ \l_@@_separator_tl
+ \l_@@_separator_final_tl
+ \@@_print_boundary:V \l_@@_boundary_close_tl
+ }
+% \end{macrocode}
+% The business end for all other cases.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_quantity_auxii:nn #1#2
+ {
+ \bool_if:NT \l_@@_unit_bracket_bool
+ { \bool_set_true:N \l_@@_exp_bracket_bool }
+ \bool_if:NT \l_@@_unit_repeat_bool
+ { \bool_set_false:N \l_@@_exp_combine_bool }
+ \bool_lazy_or:nnT
+ { \l_@@_unit_bracket_bool }
+ { ! \l_@@_unit_repeat_bool }
+ { \bool_set_false:N \l_siunitx_number_bracket_ambiguous_bool }
+ \bool_set_true:N \l_@@_unit_bool
+ \@@_format:nn {#1} {#2}
+ \bool_if:NF \l_siunitx_number_parse_bool
+ { \siunitx_unit_format:nN {#2} \l_@@_unit_tl }
+ \str_if_eq:VnT \l_siunitx_quantity_prefix_mode_tl { combine-exponent }
+ { \tl_clear:N \l_@@_exp_tl }
+ \bool_if:NTF \l_@@_unit_repeat_bool
+ { \@@_print:N \@@_print_quantity:x }
+ {
+ \bool_lazy_and:nnTF
+ { \l_@@_unit_bracket_bool }
+ { \tl_if_empty_p:N \l_@@_exp_tl }
+ {
+ \siunitx_print_number:V \l_@@_bracket_open_tl
+ \@@_print:N \siunitx_print_number:x
+ \siunitx_print_number:V \l_@@_bracket_close_tl
+ }
+ { \@@_print:N \siunitx_print_number:x }
+ \@@_print_quantity:n { \c_empty_tl }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
% \end{macro}
%
% \begin{macro}{\@@_print:N}
@@ -712,7 +877,11 @@
% \begin{macro}{\@@_print_aux:n}
% \begin{macro}{\@@_print_aux:nn}
% \begin{macro}{\@@_print_quantity:n, \@@_print_quantity:x}
-% \begin{macro}{\@@_print_separator:n, \@@_print_separator:V}
+% \begin{macro}
+% {
+% \@@_print_boundary:n, \@@_print_boundary:V,
+% \@@_print_separator:n, \@@_print_separator:V
+% }
% We now need to know how many entries there are: the reason we don't use
% \cs{seq_use:Nnnn} is that we want to be able to insert
% \cs{siunitx_print_\dots:n} in a controlled way.
@@ -757,6 +926,7 @@
}
{ 2 }
{
+ \@@_print_boundary:V \l_@@_boundary_open_tl
#4
{
\exp_not:n {#2}
@@ -768,6 +938,7 @@
\seq_item:Nn \l_@@_tmp_seq { 2 }
\exp_not:n {#3}
}
+ \@@_print_boundary:V \l_@@_boundary_open_tl
}
}
{
@@ -775,9 +946,11 @@
\tl_set:Nn \l_@@_start_tl {#2}
\tl_set:Nn \l_@@_end_tl {#3}
\cs_set_eq:NN \@@_print_aux:n #4
+ \@@_print_boundary:V \l_@@_boundary_open_tl
\seq_map_indexed_function:NN
\l_@@_tmp_seq
\@@_print_aux:nn
+ \@@_print_boundary:V \l_@@_boundary_close_tl
}
}
\cs_new_protected:Npn \@@_print_aux:n #1 { }
@@ -816,6 +989,16 @@
\cs_new_protected:Npn \@@_print_quantity:n #1
{ \siunitx_quantity_print:nV {#1} \l_@@_unit_tl }
\cs_generate_variant:Nn \@@_print_quantity:n { x }
+\cs_new_protected:Npn \@@_print_boundary:n #1
+ {
+ \tl_if_blank:nF {#1}
+ {
+ \bool_if:NTF \l_@@_boundary_text_bool
+ { #1 }
+ { \siunitx_print_number:n {#1} }
+ }
+ }
+\cs_generate_variant:Nn \@@_print_boundary:n { V }
\cs_new_protected:Npn \@@_print_separator:n #1
{
\bool_if:NTF \l_@@_separator_text_bool
@@ -872,8 +1055,11 @@
%
% \begin{variable}
% {
+% \l_@@_bracket_close_tl ,
+% \l_@@_independent_bool ,
% \l_siunitx_list_separator_tl ,
% \l_siunitx_list_separator_final_tl ,
+% \l_@@_bracket_open_tl ,
% \l_siunitx_list_separator_pair_tl ,
% \l_@@_exp_tl ,
% \l_@@_units_tl
@@ -884,14 +1070,20 @@
\tl_new:N \l_@@_units_tl
\keys_define:nn { siunitx }
{
+ list-close-bracket .tl_set:N =
+ \l_@@_bracket_close_tl ,
list-exponents .choices:nn =
{ combine , combine-bracket , individual }
{ \tl_set_eq:NN \l_@@_exp_tl \l_keys_choice_tl } ,
list-final-separator .tl_set:N = \l_siunitx_list_separator_final_tl ,
+ list-independent-prefix .bool_set:N =
+ \l_@@_independent_bool ,
+ list-open-bracket .tl_set:N =
+ \l_@@_bracket_open_tl ,
list-pair-separator .tl_set:N = \l_siunitx_list_separator_pair_tl ,
list-separator .tl_set:N = \l_siunitx_list_separator_tl ,
list-units .choices:nn =
- { bracket , repeat , single }
+ { bracket , independent , repeat , single }
{ \tl_set_eq:NN \l_@@_units_tl \l_keys_choice_tl }
}
% \end{macrocode}
@@ -920,15 +1112,23 @@
{
\keys_set:nx { siunitx }
{
- compound-exponents = \l_@@_exp_tl ,
- compound-final-separator =
+ compound-close-bracket =
+ { \exp_not:V \l_@@_bracket_close_tl } ,
+ compound-close-boundary = ,
+ compound-exponents = \l_@@_exp_tl ,
+ compound-final-separator =
{ \exp_not:V \l_siunitx_list_separator_final_tl } ,
- compound-pair-separator =
+ compound-independent-prefix =
+ \bool_if:NTF \l_@@_independent_bool { true } { false } ,
+ compound-open-boundary = ,
+ compound-open-bracket =
+ { \exp_not:V \l_@@_bracket_open_tl } ,
+ compound-pair-separator =
{ \exp_not:V \l_siunitx_list_separator_pair_tl } ,
- compound-separator =
+ compound-separator =
{ \exp_not:V \l_siunitx_list_separator_tl } ,
- compound-separator-mode = text ,
- compound-units = \l_@@_units_tl
+ compound-separator-mode = text ,
+ compound-units = \l_@@_units_tl
}
}
% \end{macrocode}
@@ -946,10 +1146,13 @@
%
% \begin{variable}
% {
-% \l_@@_exp_tl ,
-% \l_@@_phrase_bool ,
-% \l_@@_phrase_tl ,
-% \l_@@_symbol_tl ,
+% \l_@@_bracket_close_tl ,
+% \l_@@_exp_tl ,
+% \l_@@_independent_bool ,
+% \l_@@_bracket_open_tl ,
+% \l_@@_phrase_bool ,
+% \l_@@_phrase_tl ,
+% \l_@@_symbol_tl ,
% \l_@@_units_tl
% }
% Options for products.
@@ -959,18 +1162,24 @@
\tl_new:N \l_@@_units_tl
\keys_define:nn { siunitx }
{
+ product-close-bracket .tl_set:N =
+ \l_@@_bracket_close_tl ,
product-exponents .choices:nn =
{ combine , combine-bracket , individual }
{ \tl_set_eq:NN \l_@@_exp_tl \l_keys_choice_tl } ,
+ product-independent-prefix .bool_set:N =
+ \l_@@_independent_bool ,
product-mode .choice: ,
product-mode / phrase .code:n =
{ \bool_set_true:N \l_@@_phrase_bool } ,
product-mode / symbol .code:n =
{ \bool_set_false:N \l_@@_phrase_bool } ,
+ product-open-bracket .tl_set:N =
+ \l_@@_bracket_open_tl ,
product-phrase .tl_set:N = \l_@@_phrase_tl ,
product-symbol .tl_set:N = \l_@@_symbol_tl ,
product-units .choices:nn =
- { bracket , bracket-power , power , repeat , single }
+ { bracket , bracket-power , independent , power , repeat , single }
{ \tl_set_eq:NN \l_@@_units_tl \l_keys_choice_tl }
}
% \end{macrocode}
@@ -1006,13 +1215,21 @@
{
\keys_set:nx { siunitx }
{
- compound-exponents = \l_@@_exp_tl ,
- compound-final-separator = { \exp_not:n {#1} } ,
- compound-pair-separator = { \exp_not:n {#1} } ,
- compound-separator = { \exp_not:n {#1} } ,
- compound-separator-mode =
+ compound-close-boundary = ,
+ compound-close-bracket =
+ { \exp_not:V \l_@@_bracket_close_tl } ,
+ compound-exponents = \l_@@_exp_tl ,
+ compound-final-separator = { \exp_not:n {#1} } ,
+ compound-independent-prefix =
+ \bool_if:NTF \l_@@_independent_bool { true } { false } ,
+ compound-open-boundary = ,
+ compound-open-bracket =
+ { \exp_not:V \l_@@_bracket_open_tl } ,
+ compound-pair-separator = { \exp_not:n {#1} } ,
+ compound-separator = { \exp_not:n {#1} } ,
+ compound-separator-mode =
\bool_if:NTF \l_@@_phrase_bool { text } { number } ,
- compound-units = \l_@@_units_tl
+ compound-units = \l_@@_units_tl
}
}
\cs_generate_variant:Nn \@@_aux:n { x }
@@ -1032,7 +1249,11 @@
%
% \begin{variable}
% {
+% \l_@@_bracket_close_tl ,
% \l_@@_exp_tl ,
+% \l_@@_independent_bool ,
+% \l_@@_bracket_open_tl ,
+% \l_@@_open_tl ,
% \l_siunitx_range_phrase_tl ,
% \l_@@_units_tl
% }
@@ -1042,12 +1263,19 @@
\tl_new:N \l_@@_units_tl
\keys_define:nn { siunitx }
{
+ range-close-bracket .tl_set:N =
+ \l_@@_bracket_close_tl ,
range-exponents .choices:nn =
{ combine , combine-bracket , individual }
{ \tl_set_eq:NN \l_@@_exp_tl \l_keys_choice_tl } ,
+ range-independent-prefix .bool_set:N =
+ \l_@@_independent_bool ,
+ range-open-bracket .tl_set:N =
+ \l_@@_bracket_open_tl ,
+ range-open-phrase .tl_set:N = \l_@@_open_tl ,
range-phrase .tl_set:N = \l_siunitx_range_phrase_tl ,
range-units .choices:nn =
- { bracket , repeat , single }
+ { bracket , independent , repeat , single }
{ \tl_set_eq:NN \l_@@_units_tl \l_keys_choice_tl }
}
% \end{macrocode}
@@ -1076,10 +1304,20 @@
{
\keys_set:nx { siunitx }
{
- compound-exponents = \l_@@_exp_tl ,
- compound-pair-separator = { \exp_not:V \l_siunitx_range_phrase_tl } ,
- compound-separator-mode = text ,
- compound-units = \l_@@_units_tl
+ compound-boundary-mode = text ,
+ compound-close-boundary = ,
+ compound-close-bracket =
+ { \exp_not:V \l_@@_bracket_close_tl } ,
+ compound-exponents = \l_@@_exp_tl ,
+ compound-independent-prefix =
+ \bool_if:NTF \l_@@_independent_bool { true } { false } ,
+ compound-open-boundary = { \exp_not:V \l_@@_open_tl } ,
+ compound-open-bracket =
+ { \exp_not:V \l_@@_bracket_open_tl } ,
+ compound-pair-separator =
+ { \exp_not:V \l_siunitx_range_phrase_tl } ,
+ compound-separator-mode = text ,
+ compound-units = \l_@@_units_tl
}
}
% \end{macrocode}
@@ -1095,57 +1333,73 @@
% \begin{macrocode}
\keys_set:nn { siunitx }
{
- compound-exponents = individual ,
- compound-final-separator =
+ compound-boundary-mode = text ,
+ compound-close-boundary = , % (
+ compound-close-bracket = ) ,
+ compound-exponents = individual ,
+ compound-final-separator =
{
\ifmmode \ \else \space \fi
\text { and }
\ifmmode \ \else \space \fi
} ,
- compound-pair-separator =
+ compound-independent-prefix = false ,
+ compound-open-boundary = ,
+ compound-open-bracket = ( , % )
+ compound-pair-separator =
{
\ifmmode \ \else \space \fi
\text { and }
\ifmmode \ \else \space \fi
} ,
- compound-separator =
+ compound-separator =
{ , \ifmmode \ \else \space \fi } ,
- compound-separator-mode = text ,
- compound-units = repeat ,
- list-exponents = individual ,
- list-final-separator =
+ compound-separator-mode = text ,
+ compound-units = repeat , % (
+ list-close-bracket = ) ,
+ list-exponents = individual ,
+ list-final-separator =
{
\ifmmode \ \else \space \fi
\text { and }
\ifmmode \ \else \space \fi
} ,
- list-pair-separator =
+ list-independent-prefix = false ,
+ list-open-bracket = ( , % )
+ list-pair-separator =
{
\ifmmode \ \else \space \fi
\text { and }
\ifmmode \ \else \space \fi
} ,
- list-separator =
+ list-separator =
{ , \ifmmode \ \else \space \fi } ,
- list-units = repeat ,
- product-exponents = individual ,
- product-mode = symbol ,
- product-phrase =
+ list-units = repeat , % (
+ product-close-bracket = ) ,
+ product-exponents = individual ,
+ product-independent-prefix = false ,
+ product-mode = symbol ,
+ product-open-bracket = ( , % )
+ product-phrase =
{
\ifmmode \ \else \space \fi
\text { by }
\ifmmode \ \else \space \fi
} ,
- product-symbol = \times ,
- product-units = repeat ,
- range-exponents = individual ,
- range-phrase =
+ product-symbol = \times ,
+ product-units = repeat , % (
+ range-close-bracket = ) ,
+ range-exponents = individual ,
+ range-independent-prefix = false ,
+ range-open-bracket = ( , % )
+ range-open-phrase = ,
+ range-phrase =
{
\ifmmode \ \else \space \fi
\text { to }
\ifmmode \ \else \space \fi
} ,
- range-units = repeat
+ range-units = repeat
}
% \end{macrocode}
%