diff --git a/CHANGELOG.md b/CHANGELOG.md index b6e289d1..45e7569d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ### Added - Abbreviations `\T`, `\mT`, `\uT` (see issue [\#670](https://github.com/josephwright/siunitx/issues/670)) +- Option `range-open-phrase` - Option `round-direction` to allow 'truncation' of rounded values (see issue [\#664](https://github.com/josephwright/siunitx/issues/664)) diff --git a/siunitx-compound.dtx b/siunitx-compound.dtx index 844389fd..7e97ea99 100644 --- a/siunitx-compound.dtx +++ b/siunitx-compound.dtx @@ -137,6 +137,25 @@ % 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-exponents} % \begin{syntax} % |compound-exponents| = |combine|\verb"|"|combine-bracket|\verb"|"|individual| @@ -236,10 +255,22 @@ % \end{syntax} % \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} @@ -333,8 +364,10 @@ % % \begin{variable} % { +% \l_@@_boundary_close_tl , % \l_@@_separator_final_tl , % \l_@@_separator_pair_tl , +% \l_@@_boundary_open_tl , % \l_@@_separator_tl , % \l_@@_separator_text_bool , % \l_@@_exp_bracket_bool , @@ -344,6 +377,7 @@ % } % 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 @@ -352,6 +386,13 @@ \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-exponents .choice: , compound-exponents / combine .code:n = { @@ -372,6 +413,8 @@ \l_@@_separator_final_tl , compound-pair-separator .tl_set:N = \l_@@_separator_pair_tl , + compound-open-boundary .tl_set:N = + \l_@@_boundary_open_tl , compound-separator .tl_set:N = \l_@@_separator_tl , compound-separator-mode .choice: , @@ -715,7 +758,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. @@ -760,6 +807,7 @@ } { 2 } { + \@@_print_boundary:V \l_@@_boundary_open_tl #4 { \exp_not:n {#2} @@ -771,6 +819,7 @@ \seq_item:Nn \l_@@_tmp_seq { 2 } \exp_not:n {#3} } + \@@_print_boundary:V \l_@@_boundary_open_tl } } { @@ -778,9 +827,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 { } @@ -819,6 +870,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 @@ -923,9 +984,11 @@ { \keys_set:nx { siunitx } { + compound-close-boundary = , compound-exponents = \l_@@_exp_tl , compound-final-separator = { \exp_not:V \l_siunitx_list_separator_final_tl } , + compound-open-boundary = , compound-pair-separator = { \exp_not:V \l_siunitx_list_separator_pair_tl } , compound-separator = @@ -1009,8 +1072,10 @@ { \keys_set:nx { siunitx } { + compound-close-boundary = , compound-exponents = \l_@@_exp_tl , compound-final-separator = { \exp_not:n {#1} } , + compound-open-boundary = , compound-pair-separator = { \exp_not:n {#1} } , compound-separator = { \exp_not:n {#1} } , compound-separator-mode = @@ -1036,6 +1101,7 @@ % \begin{variable} % { % \l_@@_exp_tl , +% \l_@@_open_tl , % \l_siunitx_range_phrase_tl , % \l_@@_units_tl % } @@ -1048,6 +1114,7 @@ range-exponents .choices:nn = { combine , combine-bracket , individual } { \tl_set_eq:NN \l_@@_exp_tl \l_keys_choice_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 } @@ -1079,10 +1146,13 @@ { \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-exponents = \l_@@_exp_tl , + compound-open-boundary = { \exp_not:V \l_@@_open_tl } , + compound-pair-separator = { \exp_not:V \l_siunitx_range_phrase_tl } , + compound-separator-mode = text , + compound-units = \l_@@_units_tl } } % \end{macrocode} @@ -1098,13 +1168,16 @@ % \begin{macrocode} \keys_set:nn { siunitx } { - compound-exponents = individual , + compound-boundary-mode = text , + compound-close-boundary = , + compound-exponents = individual , compound-final-separator = { \ifmmode \ \else \space \fi \text { and } \ifmmode \ \else \space \fi } , + compound-open-boundary = , compound-pair-separator = { \ifmmode \ \else \space \fi @@ -1113,9 +1186,9 @@ } , compound-separator = { , \ifmmode \ \else \space \fi } , - compound-separator-mode = text , - compound-units = repeat , - list-exponents = individual , + compound-separator-mode = text , + compound-units = repeat , + list-exponents = individual , list-final-separator = { \ifmmode \ \else \space \fi @@ -1130,9 +1203,9 @@ } , list-separator = { , \ifmmode \ \else \space \fi } , - list-units = repeat , - product-exponents = individual , - product-mode = symbol , + list-units = repeat , + product-exponents = individual , + product-mode = symbol , product-phrase = { \ifmmode \ \else \space \fi @@ -1142,6 +1215,7 @@ product-symbol = \times , product-units = repeat , range-exponents = individual , + range-open-phrase = , range-phrase = { \ifmmode \ \else \space \fi diff --git a/siunitx.tex b/siunitx.tex index ae0471b5..eeddf61e 100644 --- a/siunitx.tex +++ b/siunitx.tex @@ -1995,6 +1995,7 @@ \subsection{Lists, products and ranges} product-symbol & Literal & \cs{times} \\ product-units & Choice & repeat \\ range-exponents & Choice & individual \\ + range-open-phrase & Literal & \meta{empty} \\ range-phrase & Literal & \verb*= \text{to} = \\ range-units & Choice & repeat \\ \bottomrule @@ -2047,6 +2048,7 @@ \subsection{Lists, products and ranges} \numproduct[product-phrase = { BY }]{5 x 100 x 2} \\ \end{LaTeXdemo} +\DescribeOption{range-open-phrase} \DescribeOption{range-phrase} Ranges of numbers can be given as input. These will have an appropriate word or symbol inserted between the two entries: this is stored using the @@ -2056,6 +2058,12 @@ \subsection{Lists, products and ranges} \numrange{5}{100} \\ \numrange[range-phrase = --]{5}{100} \end{LaTeXdemo} +In some languages, an opening phrase is \emph{required}; this is supported +using the \opt{range-open-phrase} key. +\begin{LaTeXdemo} + \numrange{10}{12} \\ + \numrange[range-open-phrase = {\text{from} }]{5}{100} +\end{LaTeXdemo} \DescribeOption{list-exponents} \DescribeOption{product-exponents} diff --git a/testfiles/siunitx-compound.luatex.tlg b/testfiles/siunitx-compound.luatex.tlg index c1745199..2bf7a4d0 100644 --- a/testfiles/siunitx-compound.luatex.tlg +++ b/testfiles/siunitx-compound.luatex.tlg @@ -1525,7 +1525,125 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 9: Option setting "list-exponents" +TEST 9: Option settings "compound-open-boundary" and"compound-close-boundary" +============================================================ +> \box...= +\hbox(6.44444+0.0)x5.00002, direction TLT +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.94+0.11)x32.78003, direction TLT +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\glue(\spaceskip) 3.33 plus 1.665 minus 1.11 +.\hbox(6.94+0.11)x16.12, direction TLT +..\TU/lmr/m/n/10 a +..\TU/lmr/m/n/10 n +..\TU/lmr/m/n/10 d +.\glue(\spaceskip) 3.33 plus 1.665 minus 1.11 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.94+1.93)x43.89005, direction TLT +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\TU/lmr/m/n/10 , +.\glue(\spaceskip) 3.33 plus 2.08124 minus 0.888 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +.\glue(\spaceskip) 3.33 plus 1.665 minus 1.11 +.\hbox(6.94+0.11)x16.12, direction TLT +..\TU/lmr/m/n/10 a +..\TU/lmr/m/n/10 n +..\TU/lmr/m/n/10 d +.\glue(\spaceskip) 3.33 plus 1.665 minus 1.11 +.\mathon +.\OT1/cmr/m/n/10 3 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x5.00002, direction TLT +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(7.16+0.11)x47.78003, direction TLT +.\mathon +.\hbox(7.16+0.0)x7.5, direction TLT +..\hbox(7.16+0.0)x7.5, direction TLT +...\TU/lmr/m/n/10 A +.\mathoff +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\glue(\spaceskip) 3.33 plus 1.665 minus 1.11 +.\hbox(6.94+0.11)x16.12, direction TLT +..\TU/lmr/m/n/10 a +..\TU/lmr/m/n/10 n +..\TU/lmr/m/n/10 d +.\glue(\spaceskip) 3.33 plus 1.665 minus 1.11 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +.\mathon +.\hbox(7.16+0.0)x7.5, direction TLT +..\hbox(7.16+0.0)x7.5, direction TLT +...\TU/lmr/m/n/10 A +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(7.16+1.93)x61.67004, direction TLT +.\mathon +.\hbox(7.16+0.0)x7.5, direction TLT +..\hbox(7.16+0.0)x7.5, direction TLT +...\TU/lmr/m/n/10 A +.\mathoff +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\TU/lmr/m/n/10 , +.\glue(\spaceskip) 3.33 plus 2.08124 minus 0.888 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +.\glue(\spaceskip) 3.33 plus 1.665 minus 1.11 +.\hbox(6.94+0.11)x16.12, direction TLT +..\TU/lmr/m/n/10 a +..\TU/lmr/m/n/10 n +..\TU/lmr/m/n/10 d +.\glue(\spaceskip) 3.33 plus 1.665 minus 1.11 +.\mathon +.\OT1/cmr/m/n/10 3 +.\mathoff +.\mathon +.\hbox(6.83+0.22)x10.28, direction TLT +..\hbox(6.83+0.22)x10.28, direction TLT +...\TU/lmr/m/n/10 W +.\mathoff +! OK. + \l_tmpa_box +l. ... } +============================================================ +============================================================ +TEST 10: Option setting "list-exponents" ============================================================ > \box...= \hbox(8.14003+0.83333)x31.70831, direction TLT @@ -1786,7 +1904,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 10: Option setting "product-exponents" +TEST 11: Option setting "product-exponents" ============================================================ > \box...= \hbox(8.14003+0.83333)x31.70831, direction TLT @@ -2083,7 +2201,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 11: Option setting "product-mode" +TEST 12: Option setting "product-mode" ============================================================ > \box...= \hbox(6.44444+0.0)x5.00002, direction TLT @@ -2192,7 +2310,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 12: Option setting "product-symbol" +TEST 13: Option setting "product-symbol" ============================================================ > \box...= \hbox(6.44444+0.0)x5.00002, direction TLT @@ -2301,7 +2419,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 13: Option setting "product-phrase" +TEST 14: Option setting "product-phrase" ============================================================ > \box...= \hbox(6.44444+0.0)x5.00002, direction TLT @@ -2404,7 +2522,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 14: Option setting "range-exponents" +TEST 15: Option setting "range-exponents" ============================================================ > \box...= \hbox(8.14003+0.83333)x78.96663, direction TLT @@ -2648,7 +2766,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 15: Option setting "range-phrase" +TEST 16: Option settings "range-open phrase" and "range-phrase" ============================================================ > \box...= \hbox(6.44444+0.11)x25.55003, direction TLT @@ -2678,9 +2796,43 @@ l. ... } ! OK. \l_tmpa_box l. ... } +> \box...= +\hbox(7.05+0.11)x72.83003, direction TLT +.\mathon +.\hbox(7.05+0.11)x20.31, direction TLT +..\hbox(7.05+0.11)x20.31, direction TLT +...\TU/lmr/m/n/10 f +...\TU/lmr/m/n/10 r +...\TU/lmr/m/n/10 o +...\TU/lmr/m/n/10 m +.\glue(\spaceskip) 3.33 plus 1.665 minus 1.11 +.\mathoff +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\glue(\spaceskip) 3.33 plus 1.665 minus 1.11 +.\hbox(6.15+0.11)x8.89, direction TLT +..\TU/lmr/m/n/10 t +..\TU/lmr/m/n/10 o +.\glue(\spaceskip) 3.33 plus 1.665 minus 1.11 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +.\mathon +.\hbox(7.05+0.11)x20.31, direction TLT +..\hbox(7.05+0.11)x20.31, direction TLT +...\TU/lmr/m/n/10 f +...\TU/lmr/m/n/10 r +...\TU/lmr/m/n/10 o +...\TU/lmr/m/n/10 m +.\glue(\spaceskip) 3.33 plus 1.665 minus 1.11 +.\mathoff +! OK. + \l_tmpa_box +l. ... } ============================================================ ============================================================ -TEST 16: Option setting "compound-units" +TEST 17: Option setting "compound-units" ============================================================ > \box...= \hbox(6.94+1.93)x73.89027, direction TLT @@ -3206,7 +3358,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 17: Option setting "list-units" +TEST 18: Option setting "list-units" ============================================================ > \box...= \hbox(6.94+1.93)x73.89027, direction TLT @@ -3562,7 +3714,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 18: Option setting "product-units" +TEST 19: Option setting "product-units" ============================================================ > \box...= \hbox(6.44444+0.83333)x69.44455, direction TLT @@ -4160,7 +4312,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 19: Option setting "range-units" +TEST 20: Option setting "range-units" ============================================================ > \box...= \hbox(6.44444+0.11)x45.55019, direction TLT @@ -4420,7 +4572,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 20: Option settings "parse-numbers = false" +TEST 21: Option settings "parse-numbers = false" ============================================================ > \box...= \hbox(6.44444+0.0)x15.00009, direction TLT @@ -4501,7 +4653,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 21: Option settings "prefix-mode" and "compound-units" +TEST 22: Option settings "prefix-mode" and "compound-units" ============================================================ > \box...= \hbox(6.94444+1.93)x90.55699, direction TLT @@ -5027,7 +5179,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 22: Option setting "uncertainty-mode = separate" +TEST 23: Option setting "uncertainty-mode = separate" ============================================================ > \box...= \hbox(7.5+2.5)x93.89142, direction TLT @@ -5227,7 +5379,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 23: Option settings "mode" and "output-decimal-marker" +TEST 24: Option settings "mode" and "output-decimal-marker" ============================================================ > \box...= \hbox(6.66+1.93)x27.77672, direction TLT @@ -5314,7 +5466,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 24: Option settings "range-units = single" and "per-mode=symbol" +TEST 25: Option settings "range-units = single" and "per-mode=symbol" ============================================================ > \box...= \hbox(7.5+2.5)x37.77788, direction TLT diff --git a/testfiles/siunitx-compound.lvt b/testfiles/siunitx-compound.lvt index cd7c83a1..ef4f6731 100644 --- a/testfiles/siunitx-compound.lvt +++ b/testfiles/siunitx-compound.lvt @@ -185,6 +185,25 @@ \test:nn { compound } { { 1e2 } { 2e3 } { 3e1 } } } +\TEST + { + Option~settings~"compound-open-boundary"~and + "compound-close-boundary" + } + { + \test:nn { compound } { { 1 } } + \test:nn { compound } { { 1 } { 2 } } + \test:nn { compound } { { 1 } { 2 } { 3 } } + \keys_set:nn { siunitx } + { + compound-open-boundary = \text { A } , + compound-close-boundary = \text { W } + } + \test:nn { compound } { { 1 } } + \test:nn { compound } { { 1 } { 2 } } + \test:nn { compound } { { 1 } { 2 } { 3 } } + } + \TEST { Option~setting~"list-exponents" } { \test:nn { list } { { 1e2 } } @@ -266,10 +285,21 @@ \test:nn { 1e2 } { 2e1 } } -\TEST { Option~setting~"range-phrase" } +\TEST { Option~settings~"range-open~phrase"~and~"range-phrase" } { \test:nn { 1 } { 2 } - \keys_set:nn { siunitx } { range-phrase = -- } + \group_begin: + \keys_set:nn { siunitx } { range-phrase = -- } + \test:nn { 1 } { 2 } + \group_end: + \keys_set:nn { siunitx } + { + range-open-phrase = + { + \text { from } + \ifmmode \ \else \space \fi + } + } \test:nn { 1 } { 2 } } diff --git a/testfiles/siunitx-compound.tlg b/testfiles/siunitx-compound.tlg index 1d6b9396..b24dfe85 100644 --- a/testfiles/siunitx-compound.tlg +++ b/testfiles/siunitx-compound.tlg @@ -1525,7 +1525,125 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 9: Option setting "list-exponents" +TEST 9: Option settings "compound-open-boundary" and"compound-close-boundary" +============================================================ +> \box...= +\hbox(6.44444+0.0)x5.00002 +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.94444+0.0)x32.77785 +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\glue 3.33333 plus 1.66666 minus 1.11111 +.\hbox(6.94444+0.0)x16.11116 +..\OT1/cmr/m/n/10 a +..\OT1/cmr/m/n/10 n +..\OT1/cmr/m/n/10 d +.\glue 3.33333 plus 1.66666 minus 1.11111 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.94444+1.94444)x43.88898 +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\OT1/cmr/m/n/10 , +.\glue 3.33333 plus 2.08331 minus 0.88889 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +.\glue 3.33333 plus 1.66666 minus 1.11111 +.\hbox(6.94444+0.0)x16.11116 +..\OT1/cmr/m/n/10 a +..\OT1/cmr/m/n/10 n +..\OT1/cmr/m/n/10 d +.\glue 3.33333 plus 1.66666 minus 1.11111 +.\mathon +.\OT1/cmr/m/n/10 3 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x5.00002 +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.94444+0.0)x47.77788 +.\mathon +.\hbox(6.83331+0.0)x7.50002 +..\hbox(6.83331+0.0)x7.50002 +...\OT1/cmr/m/n/10 A +.\mathoff +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\glue 3.33333 plus 1.66666 minus 1.11111 +.\hbox(6.94444+0.0)x16.11116 +..\OT1/cmr/m/n/10 a +..\OT1/cmr/m/n/10 n +..\OT1/cmr/m/n/10 d +.\glue 3.33333 plus 1.66666 minus 1.11111 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +.\mathon +.\hbox(6.83331+0.0)x7.50002 +..\hbox(6.83331+0.0)x7.50002 +...\OT1/cmr/m/n/10 A +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.94444+1.94444)x61.6668 +.\mathon +.\hbox(6.83331+0.0)x7.50002 +..\hbox(6.83331+0.0)x7.50002 +...\OT1/cmr/m/n/10 A +.\mathoff +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\OT1/cmr/m/n/10 , +.\glue 3.33333 plus 2.08331 minus 0.88889 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +.\glue 3.33333 plus 1.66666 minus 1.11111 +.\hbox(6.94444+0.0)x16.11116 +..\OT1/cmr/m/n/10 a +..\OT1/cmr/m/n/10 n +..\OT1/cmr/m/n/10 d +.\glue 3.33333 plus 1.66666 minus 1.11111 +.\mathon +.\OT1/cmr/m/n/10 3 +.\mathoff +.\mathon +.\hbox(6.83331+0.0)x10.2778 +..\hbox(6.83331+0.0)x10.2778 +...\OT1/cmr/m/n/10 W +.\mathoff +! OK. + \l_tmpa_box +l. ... } +============================================================ +============================================================ +TEST 10: Option setting "list-exponents" ============================================================ > \box...= \hbox(8.14003+0.83333)x31.70831 @@ -1786,7 +1904,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 10: Option setting "product-exponents" +TEST 11: Option setting "product-exponents" ============================================================ > \box...= \hbox(8.14003+0.83333)x31.70831 @@ -2083,7 +2201,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 11: Option setting "product-mode" +TEST 12: Option setting "product-mode" ============================================================ > \box...= \hbox(6.44444+0.0)x5.00002 @@ -2192,7 +2310,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 12: Option setting "product-symbol" +TEST 13: Option setting "product-symbol" ============================================================ > \box...= \hbox(6.44444+0.0)x5.00002 @@ -2301,7 +2419,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 13: Option setting "product-phrase" +TEST 14: Option setting "product-phrase" ============================================================ > \box...= \hbox(6.44444+0.0)x5.00002 @@ -2404,7 +2522,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 14: Option setting "range-exponents" +TEST 15: Option setting "range-exponents" ============================================================ > \box...= \hbox(8.14003+0.83333)x78.9722 @@ -2648,7 +2766,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 15: Option setting "range-phrase" +TEST 16: Option settings "range-open phrase" and "range-phrase" ============================================================ > \box...= \hbox(6.44444+0.0)x25.5556 @@ -2678,9 +2796,43 @@ l. ... } ! OK. \l_tmpa_box l. ... } +> \box...= +\hbox(6.94444+0.0)x72.8335 +.\mathon +.\hbox(6.94444+0.0)x20.30562 +..\hbox(6.94444+0.0)x20.30562 +...\OT1/cmr/m/n/10 f +...\OT1/cmr/m/n/10 r +...\OT1/cmr/m/n/10 o +...\OT1/cmr/m/n/10 m +.\glue 3.33333 plus 1.66666 minus 1.11111 +.\mathoff +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\glue 3.33333 plus 1.66666 minus 1.11111 +.\hbox(6.15079+0.0)x8.88892 +..\OT1/cmr/m/n/10 t +..\OT1/cmr/m/n/10 o +.\glue 3.33333 plus 1.66666 minus 1.11111 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +.\mathon +.\hbox(6.94444+0.0)x20.30562 +..\hbox(6.94444+0.0)x20.30562 +...\OT1/cmr/m/n/10 f +...\OT1/cmr/m/n/10 r +...\OT1/cmr/m/n/10 o +...\OT1/cmr/m/n/10 m +.\glue 3.33333 plus 1.66666 minus 1.11111 +.\mathoff +! OK. + \l_tmpa_box +l. ... } ============================================================ ============================================================ -TEST 16: Option setting "compound-units" +TEST 17: Option setting "compound-units" ============================================================ > \box...= \hbox(6.94444+1.94444)x73.8892 @@ -3206,7 +3358,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 17: Option setting "list-units" +TEST 18: Option setting "list-units" ============================================================ > \box...= \hbox(6.94444+1.94444)x73.8892 @@ -3562,7 +3714,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 18: Option setting "product-units" +TEST 19: Option setting "product-units" ============================================================ > \box...= \hbox(6.44444+0.83333)x69.44455 @@ -4160,7 +4312,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 19: Option setting "range-units" +TEST 20: Option setting "range-units" ============================================================ > \box...= \hbox(6.44444+0.0)x45.55576 @@ -4420,7 +4572,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 20: Option settings "parse-numbers = false" +TEST 21: Option settings "parse-numbers = false" ============================================================ > \box...= \hbox(6.44444+0.0)x15.00009 @@ -4501,7 +4653,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 21: Option settings "prefix-mode" and "compound-units" +TEST 22: Option settings "prefix-mode" and "compound-units" ============================================================ > \box...= \hbox(6.94444+1.94444)x90.55592 @@ -5027,7 +5179,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 22: Option setting "uncertainty-mode = separate" +TEST 23: Option setting "uncertainty-mode = separate" ============================================================ > \box...= \hbox(7.5+2.5)x93.88924 @@ -5227,7 +5379,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 23: Option settings "mode" and "output-decimal-marker" +TEST 24: Option settings "mode" and "output-decimal-marker" ============================================================ > \box...= \hbox(6.44444+1.94444)x27.77791 @@ -5314,7 +5466,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 24: Option settings "range-units = single" and "per-mode=symbol" +TEST 25: Option settings "range-units = single" and "per-mode=symbol" ============================================================ > \box...= \hbox(7.5+2.5)x37.77788 diff --git a/testfiles/siunitx-compound.xetex.tlg b/testfiles/siunitx-compound.xetex.tlg index 731e429c..cca14407 100644 --- a/testfiles/siunitx-compound.xetex.tlg +++ b/testfiles/siunitx-compound.xetex.tlg @@ -1445,7 +1445,117 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 9: Option setting "list-exponents" +TEST 9: Option settings "compound-open-boundary" and"compound-close-boundary" +============================================================ +> \box...= +\hbox(6.44444+0.0)x5.00002 +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.94+0.10999)x32.78003 +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\glue 3.33 plus 1.665 minus 1.11 +.\hbox(6.94+0.10999)x16.12 +..\TU/lmr/m/n/10 and +.\glue 3.33 plus 1.665 minus 1.11 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.94+1.92998)x43.89005 +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\TU/lmr/m/n/10 , +.\glue 3.33 plus 2.08124 minus 0.888 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +.\glue 3.33 plus 1.665 minus 1.11 +.\hbox(6.94+0.10999)x16.12 +..\TU/lmr/m/n/10 and +.\glue 3.33 plus 1.665 minus 1.11 +.\mathon +.\OT1/cmr/m/n/10 3 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x5.00002 +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(7.16+0.10999)x47.78003 +.\mathon +.\hbox(7.16+0.0)x7.5 +..\hbox(7.16+0.0)x7.5 +...\TU/lmr/m/n/10 A +.\mathoff +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\glue 3.33 plus 1.665 minus 1.11 +.\hbox(6.94+0.10999)x16.12 +..\TU/lmr/m/n/10 and +.\glue 3.33 plus 1.665 minus 1.11 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +.\mathon +.\hbox(7.16+0.0)x7.5 +..\hbox(7.16+0.0)x7.5 +...\TU/lmr/m/n/10 A +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(7.16+1.92998)x61.67004 +.\mathon +.\hbox(7.16+0.0)x7.5 +..\hbox(7.16+0.0)x7.5 +...\TU/lmr/m/n/10 A +.\mathoff +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\TU/lmr/m/n/10 , +.\glue 3.33 plus 2.08124 minus 0.888 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +.\glue 3.33 plus 1.665 minus 1.11 +.\hbox(6.94+0.10999)x16.12 +..\TU/lmr/m/n/10 and +.\glue 3.33 plus 1.665 minus 1.11 +.\mathon +.\OT1/cmr/m/n/10 3 +.\mathoff +.\mathon +.\hbox(6.83+0.21999)x10.28 +..\hbox(6.83+0.21999)x10.28 +...\TU/lmr/m/n/10 W +.\mathoff +! OK. + \l_tmpa_box +l. ... } +============================================================ +============================================================ +TEST 10: Option setting "list-exponents" ============================================================ > \box...= \hbox(8.14003+0.83333)x31.70831 @@ -1694,7 +1804,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 10: Option setting "product-exponents" +TEST 11: Option setting "product-exponents" ============================================================ > \box...= \hbox(8.14003+0.83333)x31.70831 @@ -1991,7 +2101,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 11: Option setting "product-mode" +TEST 12: Option setting "product-mode" ============================================================ > \box...= \hbox(6.44444+0.0)x5.00002 @@ -2094,7 +2204,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 12: Option setting "product-symbol" +TEST 13: Option setting "product-symbol" ============================================================ > \box...= \hbox(6.44444+0.0)x5.00002 @@ -2203,7 +2313,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 13: Option setting "product-phrase" +TEST 14: Option setting "product-phrase" ============================================================ > \box...= \hbox(6.44444+0.0)x5.00002 @@ -2288,7 +2398,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 14: Option setting "range-exponents" +TEST 15: Option setting "range-exponents" ============================================================ > \box...= \hbox(8.14003+0.83333)x78.96663 @@ -2523,7 +2633,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 15: Option setting "range-phrase" +TEST 16: Option settings "range-open phrase" and "range-phrase" ============================================================ > \box...= \hbox(6.44444+0.10999)x25.55003 @@ -2552,9 +2662,36 @@ l. ... } ! OK. \l_tmpa_box l. ... } +> \box...= +\hbox(7.05+0.10999)x72.83003 +.\mathon +.\hbox(7.05+0.10999)x20.31 +..\hbox(7.05+0.10999)x20.31 +...\TU/lmr/m/n/10 from +.\glue 3.33 plus 1.665 minus 1.11 +.\mathoff +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\glue 3.33 plus 1.665 minus 1.11 +.\hbox(6.15+0.10999)x8.89 +..\TU/lmr/m/n/10 to +.\glue 3.33 plus 1.665 minus 1.11 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +.\mathon +.\hbox(7.05+0.10999)x20.31 +..\hbox(7.05+0.10999)x20.31 +...\TU/lmr/m/n/10 from +.\glue 3.33 plus 1.665 minus 1.11 +.\mathoff +! OK. + \l_tmpa_box +l. ... } ============================================================ ============================================================ -TEST 16: Option setting "compound-units" +TEST 17: Option setting "compound-units" ============================================================ > \box...= \hbox(6.94+1.92998)x73.89027 @@ -3056,7 +3193,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 17: Option setting "list-units" +TEST 18: Option setting "list-units" ============================================================ > \box...= \hbox(6.94+1.92998)x73.89027 @@ -3396,7 +3533,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 18: Option setting "product-units" +TEST 19: Option setting "product-units" ============================================================ > \box...= \hbox(6.44444+0.83333)x69.44455 @@ -3994,7 +4131,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 19: Option setting "range-units" +TEST 20: Option setting "range-units" ============================================================ > \box...= \hbox(6.44444+0.10999)x45.55019 @@ -4246,7 +4383,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 20: Option settings "parse-numbers = false" +TEST 21: Option settings "parse-numbers = false" ============================================================ > \box...= \hbox(6.44444+0.0)x15.00009 @@ -4323,7 +4460,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 21: Option settings "prefix-mode" and "compound-units" +TEST 22: Option settings "prefix-mode" and "compound-units" ============================================================ > \box...= \hbox(6.94444+1.92998)x90.55699 @@ -4825,7 +4962,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 22: Option setting "uncertainty-mode = separate" +TEST 23: Option setting "uncertainty-mode = separate" ============================================================ > \box...= \hbox(7.5+2.5)x93.89142 @@ -5017,7 +5154,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 23: Option settings "mode" and "output-decimal-marker" +TEST 24: Option settings "mode" and "output-decimal-marker" ============================================================ > \box...= \hbox(6.66+1.92998)x27.77672 @@ -5082,7 +5219,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 24: Option settings "range-units = single" and "per-mode=symbol" +TEST 25: Option settings "range-units = single" and "per-mode=symbol" ============================================================ > \box...= \hbox(7.5+2.5)x37.77788