1

I am trying to mark certain entries in a siunitx table column with either +, *, or ?, but when I do so, I get overfull hbox warnings. I've tried to use table-space-text-post to give more space, but it doesn't seem to have an effect on the overfull hbox situation. (It's also deprecated, but I'm unsure how to set table-format to achieve the same effect.)

The table is a bit squished to fit in a single column, but the default tabcolsep still causes overfull hboxes in table entries.

\documentclass{IEEEtran}

\usepackage{siunitx}
\usepackage{booktabs}

\begin{document}
\begin{table}
    \setlength{\tabcolsep}{0.2em}
    \newcolumntype{d}{S[input-signs=,input-symbols=+,table-format=3.1,table-space-text-post={$+$}]}

    \centering
    \begin{tabular}{@{}rdddddddd@{}}
        \toprule
        Foo & {\% $+$ve} & {\% $-$ve} & {\% $+$ve} & {\% $-$ve} & {\% $+$ve} & {\% $-$ve} & {\% $+$ve} & {\% $-$ve} \\ \midrule
         3 & 100.0+ &   0.0  &  13.3* &   4.4  & 100.0+ &   0.0  &   6.7? &   2.2  \\
    \end{tabular}
\end{table}
\end{document}

Overfull hboxes correspond to + characters in the table:

Overfull \hbox (6.6112pt too wide) detected at line 15
 

Overfull \hbox (6.6112pt too wide) detected at line 15

Visually, things look okay, but I'd like to know how to do set the column width correctly.

1
  • Welcome to TeX.SE!
    – Mensch
    Sep 28, 2021 at 22:52

1 Answer 1

0

Your table is too wide that can be fit in one column. See if prescribing table width and reformulating column headers into two lines as done in the following MWWE (minimal Working Example) is acceptable to you. In it distances between columns is left to LaTeX to determine:

\documentclass{IEEEtran}
\usepackage{siunitx}    % considered is version 3
\usepackage{booktabs}

%---------------- Show page layout. Don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{lipsum}

\begin{document}
    \begin{table}[htb]
\sisetup{input-signs=,
         input-symbols=+,
         table-format=3.1{$+$}
         }
\setlength\tabcolsep{0pt}
    \centering
%    \small
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} r @{\quad} *{8}{S} }
    \toprule
    &   \multicolumn{8}{c}{share in \%}    \\
    \cmidrule{2-9}
Foo & {$+$ve} & {$-$ve} & {$+$ve} & {$-$ve} & {$+$ve} & {$-$ve} & {$+$ve} & {$-$ve} \\ 
    \midrule
3   & 100.0+     &  0.0       & 13.3*      &   4.4      & 100.0+     & 0.0        & 6.7?       & 2.2        \\
\end{tabular*}
    \end{table}
\lipsum
\end{document}

enter image description here

3
  • Thanks! This helped a good bit, as did upgrading to a newer siunitx -- turns out the version in debian stable/testing texlive is from 2020.
    – Natasha
    Sep 29, 2021 at 3:45
  • @Natasha, new siunitx version was published in this year summer :-)
    – Zarko
    Sep 29, 2021 at 3:52
  • I have the latest and greatest now, and it is quite great!
    – Natasha
    Sep 29, 2021 at 23:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .