From b78bac2f0be0b410e1de350e0d90a5db5e713115 Mon Sep 17 00:00:00 2001 From: Joseph Wright Date: Thu, 27 Jul 2023 18:08:54 +0100 Subject: [PATCH] Add option "table-model-setup" (fixes #659) --- CHANGELOG.md | 2 + siunitx-table.dtx | 60 +++++-- siunitx.tex | 55 ++++--- testfiles/siunitx-table.luatex.tlg | 248 +++++++++++++++++++++++++++-- testfiles/siunitx-table.lvt | 14 ++ testfiles/siunitx-table.tlg | 248 +++++++++++++++++++++++++++-- testfiles/siunitx-table.xetex.tlg | 248 +++++++++++++++++++++++++++-- 7 files changed, 815 insertions(+), 60 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f72b0bd..0f48003a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,8 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to - `range-open-bracket` (see issue [\#262](https://github.com/josephwright/siunitx/issues/262)) +- Option `table-model-setup` (see issue + [\#659](https://github.com/josephwright/siunitx/issues/659)) ### Changed diff --git a/siunitx-table.dtx b/siunitx-table.dtx index 16ef628c..3fe8d34a 100644 --- a/siunitx-table.dtx +++ b/siunitx-table.dtx @@ -190,6 +190,15 @@ % the same size. % \end{function} % +% \begin{function}{table-model-setup} +% \begin{syntax} +% |table-model-setup| = \meta{commands} +% \end{syntax} +% Additional commands to be inserted when using the |table-format| to +% create a model for alignment of cells. Typically this will be used to +% handle variable-width fonts in columns. The standard setting is empty. +% \end{function} +% % \begin{function}{table-number-alignment} % \begin{syntax} % |table-number-alignment| = |center|\verb"|"|left|\verb"|"|right| @@ -818,7 +827,12 @@ % \end{macro} % % \begin{variable} -% {\l_@@_auto_round_bool, \l_@@_align_mode_tl, \l_@@_align_number_tl} +% { +% \l_@@_auto_round_bool, +% \l_@@_model_setup_tl , +% \l_@@_align_mode_tl , +% \l_@@_align_number_tl +% } % Options for tables with defined space. % \begin{macrocode} \keys_define:nn { siunitx } @@ -842,6 +856,8 @@ \exp_args:NV \@@_generate_model:n \l_@@_model_tl \tl_set:Nn \l_@@_align_mode_tl { format } } , + table-model-setup .tl_set:N = + \l_@@_model_setup_tl , table-number-alignment .choices:nn = { center , left , right } { \tl_set_eq:NN \l_@@_align_number_tl \l_keys_choice_tl } @@ -1174,7 +1190,12 @@ % \@@_print_format_auxxii:w , % \@@_print_format_auxxiii:w % } -% \begin{macro}{\@@_print_format_box:Nn, \@@_print_format_box:No} +% \begin{macro} +% { +% \@@_print_format_box:Nn, \@@_print_format_box:No , +% \@@_print_model_box:Nn, \@@_print_model_box:No +% } +% \begin{macro}{\@@_print_format_box:nNn, \@@_print_format_box:VNn} % \begin{macro}{\@@_print_format_after:N} % \begin{macro}{\@@_print_none:nnn} % \begin{macrocode} @@ -1325,7 +1346,7 @@ #1 \q_nil #2 \q_mark #3 \q_nil #4 \q_stop { \@@_color_check:w #3 \q_nil \q_stop - \@@_print_format_box:Nn \l_@@_tmp_box {#1} + \@@_print_model_box:Nn \l_@@_tmp_box {#1} \bool_if:NTF \l_@@_align_before_bool { \hbox_set_to_wd:Nnn \l_@@_integer_box @@ -1365,7 +1386,7 @@ \cs_new_protected:Npn \@@_print_format_auxii:w #1 \q_nil #2 \q_nil #3 \q_mark #4 \q_nil #5 \q_nil #6 \q_stop { - \@@_print_format_box:Nn \l_@@_tmp_box {#1#2} + \@@_print_model_box:Nn \l_@@_tmp_box {#1#2} \dim_set:Nn \l_@@_tmp_dim { \box_wd:N \l_@@_tmp_box } \@@_print_format_box:Nn \l_@@_tmp_box {#4#5} \dim_compare:nNnT { \box_wd:N \l_@@_tmp_box } > \l_@@_tmp_dim @@ -1437,7 +1458,7 @@ \cs_new_protected:Npn \@@_print_format_auxiii:w #1 \q_nil #2 \q_nil #3 \q_mark #4 \q_nil #5 \q_nil #6 \q_stop { - \@@_print_format_box:No \l_@@_tmp_box { \use_none:n #1#2 } + \@@_print_model_box:No \l_@@_tmp_box { \use_none:n #1#2 } \@@_print_format_box:No \l_@@_decimal_box { \use_none:n #4#5 } \dim_set:Nn \l_@@_carry_dim { @@ -1506,7 +1527,7 @@ #1 \q_nil #2 \q_nil #3 \q_mark #4 \q_nil #5 \q_nil #6 \q_stop { - \@@_print_format_box:Nn \l_@@_tmp_box {#1#2} + \@@_print_model_box:Nn \l_@@_tmp_box {#1#2} \hbox_set_to_wd:Nnn \l_@@_tmp_box { \box_wd:N \l_@@_uncert_box @@ -1536,7 +1557,7 @@ #1 \q_nil #2 \q_mark #3 \q_nil #4 \q_stop { - \@@_print_format_box:Nn \l_@@_tmp_box { { } #1 } + \@@_print_model_box:Nn \l_@@_tmp_box { { } #1 } \dim_set:Nn \l_@@_tmp_dim { \box_wd:N \l_@@_tmp_box } \@@_print_format_box:Nn \l_@@_tmp_box { { } #3 } \@@_print_format_auxxii:w #2 \q_mark #4 \q_stop @@ -1563,7 +1584,7 @@ { \tl_if_blank:nF {#2} { - \@@_print_format_box:Nn \l_@@_tmp_box { { } #1#2 } + \@@_print_model_box:Nn \l_@@_tmp_box { { } #1#2 } \dim_set:Nn \l_@@_tmp_dim { \box_wd:N \l_@@_tmp_box } \@@_print_format_box:Nn \l_@@_tmp_box { @@ -1571,7 +1592,7 @@ { \l_@@_align_exponent_bool } { \tl_if_blank_p:n {#3} } { - \@@_print_format_box:Nn \l_@@_tmp_box { { } #1 { } } + \@@_print_model_box:Nn \l_@@_tmp_box { { } #1 { } } \@@_skip:n { \box_wd:N \l_@@_tmp_box } } { } #3#4 @@ -1581,17 +1602,27 @@ } % \end{macrocode} % A simple auxiliary to avoid relatively expensive use of the print routine -% for empty parts. +% for empty parts. There is a separate function for the model as this allows +% for the case where different font widths are in use. % \begin{macrocode} \cs_new_protected:Npn \@@_print_format_box:Nn #1#2 + { \@@_print_format_box:nNn { } #1 {#2} } +\cs_generate_variant:Nn \@@_print_format_box:Nn { No } +\cs_new_protected:Npn \@@_print_model_box:Nn #1#2 + { \@@_print_format_box:VNn \l_@@_model_setup_tl #1 {#2} } +\cs_generate_variant:Nn \@@_print_model_box:Nn { No } +\cs_new_protected:Npn \@@_print_format_box:nNn #1#2#3 { - \hbox_set:Nn #1 + \hbox_set:Nn #2 { - \tl_if_blank:nF {#2} - { \siunitx_print_number:n {#2} } + \tl_if_blank:nF {#3} + { + #1 + \siunitx_print_number:n {#3} + } } } -\cs_generate_variant:Nn \@@_print_format_box:Nn { No } +\cs_generate_variant:Nn \@@_print_format_box:nNn { V } % \end{macrocode} % A common routine for placing material after the decimal marker and % \enquote{shuffling}. @@ -1655,6 +1686,7 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % \subsection{Standard settings for module options} % diff --git a/siunitx.tex b/siunitx.tex index 6be782e1..b869b2b6 100644 --- a/siunitx.tex +++ b/siunitx.tex @@ -2766,19 +2766,20 @@ \subsection{Tabular material} Type & \multicolumn{1}{l@{}}{Default} \\ \midrule - table-align-comparator & Switch & true \\ - table-align-exponent & Switch & true \\ - table-align-text-after & Switch & true \\ - table-align-text-before & Switch & true \\ - table-align-uncertainty & Switch & true \\ - table-alignment & Meta & center \\ - table-alignment-mode & Choice & marker \\ - table-auto-round & Switch & false \\ - table-column-width & Length & 0pt \\ - table-fixed-width & Switch & false \\ - table-format & Special & 2.2 \\ - table-number-alignment & Choice & center \\ - table-text-alignment & Choice & center \\ + table-align-comparator & Switch & true \\ + table-align-exponent & Switch & true \\ + table-align-text-after & Switch & true \\ + table-align-text-before & Switch & true \\ + table-align-uncertainty & Switch & true \\ + table-alignment & Meta & center \\ + table-alignment-mode & Choice & marker \\ + table-auto-round & Switch & false \\ + table-column-width & Length & 0pt \\ + table-fixed-width & Switch & false \\ + table-format & Special & 2.2 \\ + table-model-setup & Literal & \meta{empty} \\ + table-number-alignment & Choice & center \\ + table-text-alignment & Choice & center \\ \bottomrule \end{tabular} \end{table} @@ -2896,6 +2897,12 @@ \subsection{Tabular material} zero). Setting the \opt{table-format} option also resets \opt{table-alignment-mode} to \opt{format}. +\DescribeOption{table-model-setup} +In some tables (particularly those using bold extended fonts), it may be +necessary to insert additional information when creating the \enquote{model}. +This is handled using the \opt{table-model-setup} key. An example of the use of +this key is given in Section~\ref{sec:hint:heading}. + Space for material before and after the \texttt{S} column can be reserved by giving model text as part of the \opt{table-format} key. This is then used to provide the necessary gap while maintaining alignment (Table~\ref{tab:S:ends}). @@ -3855,20 +3862,30 @@ \subsection{Tables with heading rows% demonstrated in Section~\ref{sec:hint:expanding}), then to use this macro to make the heading cells bold. This approach is illustrated in Table~\ref{tab:xmpl:headers}, along with the use of \cs{rowcolor} to provide a -background color. +background color. Some typical \LaTeX{} font arrangements use a wider +(extended) width for the bold font compared with the normal font. This will +disturb the alignment if the \opt{table-format} is not symmetrical. For these +cases, the \opt{table-model-setup} key may be used to apply the wider font to +the \enquote{model} used in ensuring alignment. \begin{LaTeXdemo}[code and float] \begin{table} \caption{Header row in a table.% \label{tab:xmpl:headers}} \robustify\bfseries \centering + \sisetup{text-series-to-math} \begin{tabular} - {@{}S[text-series-to-math, table-format = 3.3]@{}} + { + @{} + S[table-format = 3.3] + S[table-format = 3.6, table-model-setup = \bfseries] + @{} + } \rowcolor[gray]{0.9} - \bfseries 123.456 \\ - 23.45 \\ - 123.4 \\ - 3.456 \\ + \bfseries 123.456 & \bfseries 123.456789 \\ + 23.45 & 23.45 \\ + 123.4 & 123.4 \\ + 3.456 & 3.456 \\ \end{tabular} \end{table} \end{LaTeXdemo} diff --git a/testfiles/siunitx-table.luatex.tlg b/testfiles/siunitx-table.luatex.tlg index 97bd70d6..c23f743d 100644 --- a/testfiles/siunitx-table.luatex.tlg +++ b/testfiles/siunitx-table.luatex.tlg @@ -2266,7 +2266,237 @@ $\OMS/cmsy/m/n/10 ^^@\OT1/cmr/m/n/10 12$ l. ... } ============================================================ ============================================================ -TEST 13: Option setting "table-number-alignment" +TEST 13: Option setting "table-model-setup" +============================================================ +> \box...= +\hbox(6.44444+0.0)x49.44455, direction TLT +.\glue 0.0 plus 0.5fill +.\kern0.0 +.\hbox(0.0+0.0)x0.0, direction TLT +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.0)x15.00005, glue set 2.50002fil, direction TLT +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\mathon +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(6.44444+0.0)x12.77782, direction TLT +..\mathon +..\OML/cmm/m/it/10 : +..\OT1/cmr/m/n/10 3 +..\OT1/cmr/m/n/10 4 +..\mathoff +.\hbox(0.0+0.0)x21.66669, direction TLT +..\glue 21.66669 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern0.0 +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x49.44455, direction TLT +.\glue 0.0 plus 0.5fill +.\kern0.0 +.\hbox(0.0+0.0)x0.0, direction TLT +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.0)x15.00005, glue set 2.50002fil, direction TLT +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\mathon +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(0.0+0.0)x0.0, direction TLT +.\hbox(0.0+0.0)x34.4445, direction TLT +..\glue 34.4445 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern0.0 +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x49.44455, direction TLT +.\glue 0.0 plus 0.5fill +.\kern0.0 +.\hbox(0.0+0.0)x0.0, direction TLT +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.0)x15.00005, glue set 2.50002fil, direction TLT +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\mathon +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(6.44444+0.0)x12.77782, direction TLT +..\mathon +..\OML/cmm/m/it/10 : +..\OT1/cmr/m/n/10 3 +..\OT1/cmr/m/n/10 4 +..\mathoff +.\hbox(0.0+0.0)x21.66669, direction TLT +..\glue 21.66669 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern0.0 +! OK. + \l_tmpa_box +l. ... } +Overfull \hbox (2.77779pt too wide) detected at line 192 +$\OMS/cmsy/m/n/10 ^^@\OT1/cmr/m/n/10 12$ +\hbox(6.44444+0.83333)x15.00005, direction TLT +.\mathon +.\OMS/cmsy/m/n/10 ^^@ +.\OT1/cmr/m/n/10 1 +.\OT1/cmr/m/n/10 2 +.\mathoff +> \box...= +\hbox(6.44444+0.83333)x49.44455, direction TLT +.\glue 0.0 plus 0.5fill +.\kern0.0 +.\hbox(0.0+0.0)x0.0, direction TLT +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.83333)x15.00005, glue set - 2.77779fil, direction TLT +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil minus 1.0fil +..\mathon +..\OMS/cmsy/m/n/10 ^^@ +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(6.44444+0.0)x12.77782, direction TLT +..\mathon +..\OML/cmm/m/it/10 : +..\OT1/cmr/m/n/10 3 +..\OT1/cmr/m/n/10 4 +..\mathoff +.\hbox(0.0+0.0)x21.66669, direction TLT +..\glue 21.66669 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern0.0 +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x49.44455, direction TLT +.\glue 0.0 plus 0.5fill +.\kern0.0 +.\hbox(0.0+0.0)x0.0, direction TLT +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.0)x15.00005, glue set 2.50002fil, direction TLT +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\mathon +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(6.44444+0.0)x12.77782, direction TLT +..\mathon +..\OML/cmm/m/it/10 : +..\OT1/cmr/m/n/10 3 +..\OT1/cmr/m/n/10 4 +..\mathoff +.\hbox(0.0+0.0)x21.66669, direction TLT +..\glue 21.66669 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern0.0 +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x49.44455, direction TLT +.\glue 0.0 plus 0.5fill +.\kern0.0 +.\hbox(0.0+0.0)x0.0, direction TLT +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.0)x15.00005, glue set 2.50002fil, direction TLT +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\mathon +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(0.0+0.0)x0.0, direction TLT +.\hbox(0.0+0.0)x34.4445, direction TLT +..\glue 34.4445 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern0.0 +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x49.44455, direction TLT +.\glue 0.0 plus 0.5fill +.\kern0.0 +.\hbox(0.0+0.0)x0.0, direction TLT +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.0)x15.00005, glue set 2.50002fil, direction TLT +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\mathon +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(6.44444+0.0)x12.77782, direction TLT +..\mathon +..\OML/cmm/m/it/10 : +..\OT1/cmr/m/n/10 3 +..\OT1/cmr/m/n/10 4 +..\mathoff +.\hbox(0.0+0.0)x21.66669, direction TLT +..\glue 21.66669 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern0.0 +! OK. + \l_tmpa_box +l. ... } +Overfull \hbox (2.77779pt too wide) detected at line 192 +$\OMS/cmsy/m/n/10 ^^@\OT1/cmr/m/n/10 12$ +\hbox(6.44444+0.83333)x15.00005, direction TLT +.\mathon +.\OMS/cmsy/m/n/10 ^^@ +.\OT1/cmr/m/n/10 1 +.\OT1/cmr/m/n/10 2 +.\mathoff +> \box...= +\hbox(6.44444+0.83333)x49.44455, direction TLT +.\glue 0.0 plus 0.5fill +.\kern0.0 +.\hbox(0.0+0.0)x0.0, direction TLT +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.83333)x15.00005, glue set - 2.77779fil, direction TLT +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil minus 1.0fil +..\mathon +..\OMS/cmsy/m/n/10 ^^@ +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(6.44444+0.0)x12.77782, direction TLT +..\mathon +..\OML/cmm/m/it/10 : +..\OT1/cmr/m/n/10 3 +..\OT1/cmr/m/n/10 4 +..\mathoff +.\hbox(0.0+0.0)x21.66669, direction TLT +..\glue 21.66669 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern0.0 +! OK. + \l_tmpa_box +l. ... } +============================================================ +============================================================ +TEST 14: Option setting "table-number-alignment" ============================================================ > \box...= \hbox(6.44444+0.0)x142.26378, glue set 119.48593fill, direction TLT @@ -2507,7 +2737,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 14: Option setting "table-text-alignment" +TEST 15: Option setting "table-text-alignment" ============================================================ > \box...= \hbox(6.94+0.11)x142.26378, glue set 119.76378fill, direction TLT @@ -2551,7 +2781,7 @@ l. ... } ! OK. \l_tmpa_box l. ... } -Underfull \hbox (badness 10000) detected at line 221 +Underfull \hbox (badness 10000) detected at line 235 \TU/lmr/m/n/10 Hello \hbox(6.94+0.11)x142.26378, direction TLT .\TU/lmr/m/n/10 H @@ -2571,7 +2801,7 @@ Underfull \hbox (badness 10000) detected at line 221 l. ... } ============================================================ ============================================================ -TEST 15: Option setting "output-decimal-marker" in tables +TEST 16: Option setting "output-decimal-marker" in tables ============================================================ > \box...= \hbox(8.14003+0.83333)x142.26378, glue set 60.51392fill, direction TLT @@ -2606,7 +2836,7 @@ TEST 15: Option setting "output-decimal-marker" in tables l. ... } ============================================================ ============================================================ -TEST 16: Option setting "output-exponent-marker" in tables +TEST 17: Option setting "output-exponent-marker" in tables ============================================================ > \box...= \hbox(6.44444+0.0)x142.26378, glue set 100.59702fill, direction TLT @@ -2635,7 +2865,7 @@ TEST 16: Option setting "output-exponent-marker" in tables l. ... } ============================================================ ============================================================ -TEST 17: Option setting "parse-numbers" in tables +TEST 18: Option setting "parse-numbers" in tables ============================================================ > \box...= \hbox(6.44444+0.0)x142.26378, glue set 119.48593fill, direction TLT @@ -2892,7 +3122,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 18: Option setting "negative-color" in tables +TEST 19: Option setting "negative-color" in tables ============================================================ > \box...= \hbox(6.44444+0.0)x142.26378, glue set 119.48593fill, direction TLT @@ -3116,7 +3346,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 19: Option setting "print-zero-integer = false" in tables +TEST 20: Option setting "print-zero-integer = false" in tables ============================================================ > \box...= \hbox(6.44444+0.0)x142.26378, glue set 119.48593fill, direction TLT @@ -3205,7 +3435,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 20: Non-numerical parts +TEST 21: Non-numerical parts ============================================================ > \box...= \hbox(6.94+0.11)x43.89787, direction TLT diff --git a/testfiles/siunitx-table.lvt b/testfiles/siunitx-table.lvt index 2a131bbe..6ccdf57e 100644 --- a/testfiles/siunitx-table.lvt +++ b/testfiles/siunitx-table.lvt @@ -177,6 +177,20 @@ \test:n { -12.34 } } +\TEST { Option~setting~"table-model-setup" } + { + \keys_set:nn { siunitx } { table-format = 3.6 } + \test:n { 12.34 } + \test:n { 12 } + \test:n { 12.34e4 } + \test:n { -12.34 } + \keys_set:nn { siunitx } { table-model-setup = \bfseries } + \test:n { 12.34 } + \test:n { 12 } + \test:n { 12.34e4 } + \test:n { -12.34 } + } + \TEST { Option~setting~"table-number-alignment" } { \OMIT diff --git a/testfiles/siunitx-table.tlg b/testfiles/siunitx-table.tlg index d80c2ada..74379435 100644 --- a/testfiles/siunitx-table.tlg +++ b/testfiles/siunitx-table.tlg @@ -2266,7 +2266,237 @@ $\OMS/cmsy/m/n/10 ^^@\OT1/cmr/m/n/10 12$ l. ... } ============================================================ ============================================================ -TEST 13: Option setting "table-number-alignment" +TEST 13: Option setting "table-model-setup" +============================================================ +> \box...= +\hbox(6.44444+0.0)x49.44455 +.\glue 0.0 plus 0.5fill +.\kern 0.0 +.\hbox(0.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.0)x15.00005, glue set 2.50002fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\mathon +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(6.44444+0.0)x12.77782 +..\mathon +..\OML/cmm/m/it/10 : +..\OT1/cmr/m/n/10 3 +..\OT1/cmr/m/n/10 4 +..\mathoff +.\hbox(0.0+0.0)x21.66669 +..\glue 21.66669 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern 0.0 +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x49.44455 +.\glue 0.0 plus 0.5fill +.\kern 0.0 +.\hbox(0.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.0)x15.00005, glue set 2.50002fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\mathon +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(0.0+0.0)x0.0 +.\hbox(0.0+0.0)x34.4445 +..\glue 34.4445 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern 0.0 +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x49.44455 +.\glue 0.0 plus 0.5fill +.\kern 0.0 +.\hbox(0.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.0)x15.00005, glue set 2.50002fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\mathon +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(6.44444+0.0)x12.77782 +..\mathon +..\OML/cmm/m/it/10 : +..\OT1/cmr/m/n/10 3 +..\OT1/cmr/m/n/10 4 +..\mathoff +.\hbox(0.0+0.0)x21.66669 +..\glue 21.66669 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern 0.0 +! OK. + \l_tmpa_box +l. ... } +Overfull \hbox (2.77779pt too wide) detected at line 192 +$\OMS/cmsy/m/n/10 ^^@\OT1/cmr/m/n/10 12$ +\hbox(6.44444+0.83333)x15.00005 +.\mathon +.\OMS/cmsy/m/n/10 ^^@ +.\OT1/cmr/m/n/10 1 +.\OT1/cmr/m/n/10 2 +.\mathoff +> \box...= +\hbox(6.44444+0.83333)x49.44455 +.\glue 0.0 plus 0.5fill +.\kern 0.0 +.\hbox(0.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.83333)x15.00005, glue set - 2.77779fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil minus 1.0fil +..\mathon +..\OMS/cmsy/m/n/10 ^^@ +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(6.44444+0.0)x12.77782 +..\mathon +..\OML/cmm/m/it/10 : +..\OT1/cmr/m/n/10 3 +..\OT1/cmr/m/n/10 4 +..\mathoff +.\hbox(0.0+0.0)x21.66669 +..\glue 21.66669 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern 0.0 +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x49.44455 +.\glue 0.0 plus 0.5fill +.\kern 0.0 +.\hbox(0.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.0)x15.00005, glue set 2.50002fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\mathon +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(6.44444+0.0)x12.77782 +..\mathon +..\OML/cmm/m/it/10 : +..\OT1/cmr/m/n/10 3 +..\OT1/cmr/m/n/10 4 +..\mathoff +.\hbox(0.0+0.0)x21.66669 +..\glue 21.66669 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern 0.0 +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x49.44455 +.\glue 0.0 plus 0.5fill +.\kern 0.0 +.\hbox(0.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.0)x15.00005, glue set 2.50002fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\mathon +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(0.0+0.0)x0.0 +.\hbox(0.0+0.0)x34.4445 +..\glue 34.4445 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern 0.0 +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x49.44455 +.\glue 0.0 plus 0.5fill +.\kern 0.0 +.\hbox(0.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.0)x15.00005, glue set 2.50002fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\mathon +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(6.44444+0.0)x12.77782 +..\mathon +..\OML/cmm/m/it/10 : +..\OT1/cmr/m/n/10 3 +..\OT1/cmr/m/n/10 4 +..\mathoff +.\hbox(0.0+0.0)x21.66669 +..\glue 21.66669 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern 0.0 +! OK. + \l_tmpa_box +l. ... } +Overfull \hbox (2.77779pt too wide) detected at line 192 +$\OMS/cmsy/m/n/10 ^^@\OT1/cmr/m/n/10 12$ +\hbox(6.44444+0.83333)x15.00005 +.\mathon +.\OMS/cmsy/m/n/10 ^^@ +.\OT1/cmr/m/n/10 1 +.\OT1/cmr/m/n/10 2 +.\mathoff +> \box...= +\hbox(6.44444+0.83333)x49.44455 +.\glue 0.0 plus 0.5fill +.\kern 0.0 +.\hbox(0.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.83333)x15.00005, glue set - 2.77779fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil minus 1.0fil +..\mathon +..\OMS/cmsy/m/n/10 ^^@ +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(6.44444+0.0)x12.77782 +..\mathon +..\OML/cmm/m/it/10 : +..\OT1/cmr/m/n/10 3 +..\OT1/cmr/m/n/10 4 +..\mathoff +.\hbox(0.0+0.0)x21.66669 +..\glue 21.66669 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern 0.0 +! OK. + \l_tmpa_box +l. ... } +============================================================ +============================================================ +TEST 14: Option setting "table-number-alignment" ============================================================ > \box...= \hbox(6.44444+0.0)x142.26378, glue set 119.48593fill @@ -2507,7 +2737,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 14: Option setting "table-text-alignment" +TEST 15: Option setting "table-text-alignment" ============================================================ > \box...= \hbox(6.94444+0.0)x142.26378, glue set 119.76373fill @@ -2551,7 +2781,7 @@ l. ... } ! OK. \l_tmpa_box l. ... } -Underfull \hbox (badness 10000) detected at line 221 +Underfull \hbox (badness 10000) detected at line 235 \OT1/cmr/m/n/10 Hello \hbox(6.94444+0.0)x142.26378 .\OT1/cmr/m/n/10 H @@ -2571,7 +2801,7 @@ Underfull \hbox (badness 10000) detected at line 221 l. ... } ============================================================ ============================================================ -TEST 15: Option setting "output-decimal-marker" in tables +TEST 16: Option setting "output-decimal-marker" in tables ============================================================ > \box...= \hbox(8.14003+0.83333)x142.26378, glue set 60.51392fill @@ -2606,7 +2836,7 @@ TEST 15: Option setting "output-decimal-marker" in tables l. ... } ============================================================ ============================================================ -TEST 16: Option setting "output-exponent-marker" in tables +TEST 17: Option setting "output-exponent-marker" in tables ============================================================ > \box...= \hbox(6.44444+0.0)x142.26378, glue set 100.59702fill @@ -2635,7 +2865,7 @@ TEST 16: Option setting "output-exponent-marker" in tables l. ... } ============================================================ ============================================================ -TEST 17: Option setting "parse-numbers" in tables +TEST 18: Option setting "parse-numbers" in tables ============================================================ > \box...= \hbox(6.44444+0.0)x142.26378, glue set 119.48593fill @@ -2892,7 +3122,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 18: Option setting "negative-color" in tables +TEST 19: Option setting "negative-color" in tables ============================================================ > \box...= \hbox(6.44444+0.0)x142.26378, glue set 119.48593fill @@ -3116,7 +3346,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 19: Option setting "print-zero-integer = false" in tables +TEST 20: Option setting "print-zero-integer = false" in tables ============================================================ > \box...= \hbox(6.44444+0.0)x142.26378, glue set 119.48593fill @@ -3205,7 +3435,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 20: Non-numerical parts +TEST 21: Non-numerical parts ============================================================ > \box...= \hbox(6.94444+0.0)x43.88902 diff --git a/testfiles/siunitx-table.xetex.tlg b/testfiles/siunitx-table.xetex.tlg index 4a8ab09a..5cd9c75a 100644 --- a/testfiles/siunitx-table.xetex.tlg +++ b/testfiles/siunitx-table.xetex.tlg @@ -2266,7 +2266,237 @@ $\OMS/cmsy/m/n/10 ^^@\OT1/cmr/m/n/10 12$ l. ... } ============================================================ ============================================================ -TEST 13: Option setting "table-number-alignment" +TEST 13: Option setting "table-model-setup" +============================================================ +> \box...= +\hbox(6.44444+0.0)x49.44455 +.\glue 0.0 plus 0.5fill +.\kern 0.0 +.\hbox(0.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.0)x15.00005, glue set 2.50002fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\mathon +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(6.44444+0.0)x12.77782 +..\mathon +..\OML/cmm/m/it/10 : +..\OT1/cmr/m/n/10 3 +..\OT1/cmr/m/n/10 4 +..\mathoff +.\hbox(0.0+0.0)x21.66669 +..\glue 21.66669 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern 0.0 +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x49.44455 +.\glue 0.0 plus 0.5fill +.\kern 0.0 +.\hbox(0.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.0)x15.00005, glue set 2.50002fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\mathon +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(0.0+0.0)x0.0 +.\hbox(0.0+0.0)x34.4445 +..\glue 34.4445 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern 0.0 +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x49.44455 +.\glue 0.0 plus 0.5fill +.\kern 0.0 +.\hbox(0.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.0)x15.00005, glue set 2.50002fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\mathon +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(6.44444+0.0)x12.77782 +..\mathon +..\OML/cmm/m/it/10 : +..\OT1/cmr/m/n/10 3 +..\OT1/cmr/m/n/10 4 +..\mathoff +.\hbox(0.0+0.0)x21.66669 +..\glue 21.66669 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern 0.0 +! OK. + \l_tmpa_box +l. ... } +Overfull \hbox (2.77779pt too wide) detected at line 192 +$\OMS/cmsy/m/n/10 ^^@\OT1/cmr/m/n/10 12$ +\hbox(6.44444+0.83333)x15.00005 +.\mathon +.\OMS/cmsy/m/n/10 ^^@ +.\OT1/cmr/m/n/10 1 +.\OT1/cmr/m/n/10 2 +.\mathoff +> \box...= +\hbox(6.44444+0.83333)x49.44455 +.\glue 0.0 plus 0.5fill +.\kern 0.0 +.\hbox(0.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.83333)x15.00005, glue set - 2.77779fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil minus 1.0fil +..\mathon +..\OMS/cmsy/m/n/10 ^^@ +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(6.44444+0.0)x12.77782 +..\mathon +..\OML/cmm/m/it/10 : +..\OT1/cmr/m/n/10 3 +..\OT1/cmr/m/n/10 4 +..\mathoff +.\hbox(0.0+0.0)x21.66669 +..\glue 21.66669 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern 0.0 +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x49.44455 +.\glue 0.0 plus 0.5fill +.\kern 0.0 +.\hbox(0.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.0)x15.00005, glue set 2.50002fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\mathon +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(6.44444+0.0)x12.77782 +..\mathon +..\OML/cmm/m/it/10 : +..\OT1/cmr/m/n/10 3 +..\OT1/cmr/m/n/10 4 +..\mathoff +.\hbox(0.0+0.0)x21.66669 +..\glue 21.66669 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern 0.0 +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x49.44455 +.\glue 0.0 plus 0.5fill +.\kern 0.0 +.\hbox(0.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.0)x15.00005, glue set 2.50002fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\mathon +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(0.0+0.0)x0.0 +.\hbox(0.0+0.0)x34.4445 +..\glue 34.4445 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern 0.0 +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x49.44455 +.\glue 0.0 plus 0.5fill +.\kern 0.0 +.\hbox(0.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.0)x15.00005, glue set 2.50002fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\mathon +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(6.44444+0.0)x12.77782 +..\mathon +..\OML/cmm/m/it/10 : +..\OT1/cmr/m/n/10 3 +..\OT1/cmr/m/n/10 4 +..\mathoff +.\hbox(0.0+0.0)x21.66669 +..\glue 21.66669 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern 0.0 +! OK. + \l_tmpa_box +l. ... } +Overfull \hbox (2.77779pt too wide) detected at line 192 +$\OMS/cmsy/m/n/10 ^^@\OT1/cmr/m/n/10 12$ +\hbox(6.44444+0.83333)x15.00005 +.\mathon +.\OMS/cmsy/m/n/10 ^^@ +.\OT1/cmr/m/n/10 1 +.\OT1/cmr/m/n/10 2 +.\mathoff +> \box...= +\hbox(6.44444+0.83333)x49.44455 +.\glue 0.0 plus 0.5fill +.\kern 0.0 +.\hbox(0.0+0.0)x0.0 +..\glue 0.0 plus 1.0fil +.\hbox(6.44444+0.83333)x15.00005, glue set - 2.77779fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil +..\glue 0.0 plus 1.0fil minus 1.0fil +..\mathon +..\OMS/cmsy/m/n/10 ^^@ +..\OT1/cmr/m/n/10 1 +..\OT1/cmr/m/n/10 2 +..\mathoff +.\hbox(6.44444+0.0)x12.77782 +..\mathon +..\OML/cmm/m/it/10 : +..\OT1/cmr/m/n/10 3 +..\OT1/cmr/m/n/10 4 +..\mathoff +.\hbox(0.0+0.0)x21.66669 +..\glue 21.66669 +..\glue 0.0 plus 1.0fil +.\glue 0.0 plus 0.5fill +.\kern 0.0 +! OK. + \l_tmpa_box +l. ... } +============================================================ +============================================================ +TEST 14: Option setting "table-number-alignment" ============================================================ > \box...= \hbox(6.44444+0.0)x142.26378, glue set 119.48593fill @@ -2507,7 +2737,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 14: Option setting "table-text-alignment" +TEST 15: Option setting "table-text-alignment" ============================================================ > \box...= \hbox(6.94+0.10999)x142.26378, glue set 119.76378fill @@ -2539,7 +2769,7 @@ l. ... } ! OK. \l_tmpa_box l. ... } -Underfull \hbox (badness 10000) detected at line 221 +Underfull \hbox (badness 10000) detected at line 235 \TU/lmr/m/n/10 Hello \hbox(6.94+0.10999)x142.26378 .\TU/lmr/m/n/10 Hello @@ -2551,7 +2781,7 @@ Underfull \hbox (badness 10000) detected at line 221 l. ... } ============================================================ ============================================================ -TEST 15: Option setting "output-decimal-marker" in tables +TEST 16: Option setting "output-decimal-marker" in tables ============================================================ > \box...= \hbox(8.14003+0.83333)x142.26378, glue set 60.51392fill @@ -2586,7 +2816,7 @@ TEST 15: Option setting "output-decimal-marker" in tables l. ... } ============================================================ ============================================================ -TEST 16: Option setting "output-exponent-marker" in tables +TEST 17: Option setting "output-exponent-marker" in tables ============================================================ > \box...= \hbox(6.44444+0.0)x142.26378, glue set 100.59702fill @@ -2615,7 +2845,7 @@ TEST 16: Option setting "output-exponent-marker" in tables l. ... } ============================================================ ============================================================ -TEST 17: Option setting "parse-numbers" in tables +TEST 18: Option setting "parse-numbers" in tables ============================================================ > \box...= \hbox(6.44444+0.0)x142.26378, glue set 119.48593fill @@ -2872,7 +3102,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 18: Option setting "negative-color" in tables +TEST 19: Option setting "negative-color" in tables ============================================================ > \box...= \hbox(6.44444+0.0)x142.26378, glue set 119.48593fill @@ -3096,7 +3326,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 19: Option setting "print-zero-integer = false" in tables +TEST 20: Option setting "print-zero-integer = false" in tables ============================================================ > \box...= \hbox(6.44444+0.0)x142.26378, glue set 119.48593fill @@ -3185,7 +3415,7 @@ l. ... } l. ... } ============================================================ ============================================================ -TEST 20: Non-numerical parts +TEST 21: Non-numerical parts ============================================================ > \box...= \hbox(6.94+0.10999)x43.89787