4

I have the following table:

\documentclass[border=3mm]{standalone}
    \usepackage{graphicx}
    \usepackage{booktabs,multirow}
    \usepackage{siunitx}
    \usepackage{stackengine}

\begin{document}
\begin{table}[h!]
\begin{center}
\resizebox{\textwidth}{!} {
\begin{tabular}{cc*{2}{S[table-format=-1.3]}
                       S[table-format= 1.3]
                       S
                       S[table-format=-1.3]
                       S[table-format= 3.3]
                       S[table-format= 1.3]}
\toprule
& {\stackon{}{$\mathbf{T^{x\vphantom{y}}_{EO}}$}} 
& {\stackon{[m]}{$\mathbf{T^{x\vphantom{y}}_{EO}}$}}
& {\stackon{[m]}{$\mathbf{T^y_{EO}}$}}
& {\stackon{[m]}{$\mathbf{T^{z\vphantom{y}}_{EO}}$}}
& {\stackon{[deg]}{$\mathbf{R^{x\vphantom{y}}_{EO}}$}}
& {\stackon{[deg]}{$\mathbf{R^y_{EO}}$}}
& {\stackon{[deg]}{$\mathbf{R^{z\vphantom{y}}_{EO}}$}}
& {\stackon{[px]}{\textbf{RMS}\vphantom{y}}} \\
    \midrule
\multirow{4}{*}{\rotatebox[origin=c]{90}{P\textit{n}P-LM}}
    & A & 2.748  & -0.135 & 2.175 & 119.232 & 1.368  & -76.261 & 0.240\\ 
    & B & 2.690  & 0.768  & 2.128 & 124.905 & -1.972 & -91.559 & 0.247\\
    & C & -1.576 & 1.139  & 2.146 & 120.264 & 1.428  & 98.205  & 0.255\\
    & D & -1.575 & -0.122 & 2.165 & 119.634 & -0.818 & 85.313  & 0.231\\
    \midrule
\multirow{4}{*}{\rotatebox[origin=c]{90}{EP\textit{n}P}}
    & A & 2.722  & -0.161 & 2.345 & 121.639 & 1.828  & -75.974 & 0.463\\
    & B & 2.649  & 0.729  & 2.259 & 127.082 & -0.881 & -91.444 & 0.432\\
    & C & -1.565 & 1.148  & 2.246 & 121.639 & 1.250  & 98.377  & 0.389\\
    & D & -1.547 & -0.077 & 2.238 & 120.951 & 0.199  & 85.428  & 0.372\\
    \bottomrule
\end{tabular}
}
\end{center}
\caption{Exterior orientation parameters and corresponding RMS error for all Kinect sensors defined within the chessboard coordinate system.}
\label{tab:rigidParams}
\end{table}
\end{document}

Although it is placed within the width of the text it gives me an overfull warning. I would like to understand why.

  • This does not compile. Changing from standalone to article fixes the compilation issue, but as you say, there are overfull boxes. – Mark Mar 8 '16 at 6:32
  • I have no idea what the root cause is, since I have no clue what magic is conjured by the packages you're using. But the following fixes the issue, with a barely noticeable change in appearance (to me): change the tabular spec to all {lll lll lll} – Mark Mar 8 '16 at 6:38
  • @Mark How do you mean change the tabular spec? Can you propose another way of writing this table so it looks the same? – Kostas Mar 8 '16 at 8:00
  • Almost the same. after \begin{tabular}, and before \toprule, you have a bunch of stuff. Try replacing it by a bunch of ls. Like 9 ls. Or maybe cs if you think that looks better. – Mark Mar 8 '16 at 19:13
2

The overfull boxes come from the minus signs in the penultimate column. I detected this by adding \showoutput to the original file (with article class rather than standalone, as the latter gave a compilation error). You have just missed the minus in your format specification for the column; it should be

 S[table-format=-3.3]

rather than S[table-format= 3.3].

\documentclass{article}

\usepackage{graphicx}
\usepackage{booktabs,multirow}
\usepackage{siunitx}
\usepackage{stackengine}

\begin{document}

\begin{table}[h!]
\begin{center}
\resizebox{\textwidth}{!} {
\begin{tabular}{cc*{2}{S[table-format=-1.3]}
                       S[table-format= 1.3]
                       S
                       S[table-format=-1.3]
                       S[table-format=-3.3]
                       S[table-format=1.3]}
\toprule
& {\stackon{}{$\mathbf{T^{x\vphantom{y}}_{EO}}$}} 
& {\stackon{[m]}{$\mathbf{T^{x\vphantom{y}}_{EO}}$}}
& {\stackon{[m]}{$\mathbf{T^y_{EO}}$}}
& {\stackon{[m]}{$\mathbf{T^{z\vphantom{y}}_{EO}}$}}
& {\stackon{[deg]}{$\mathbf{R^{x\vphantom{y}}_{EO}}$}}
& {\stackon{[deg]}{$\mathbf{R^y_{EO}}$}}
& {\stackon{[deg]}{$\mathbf{R^{z\vphantom{y}}_{EO}}$}}
& {\stackon{[px]}{\textbf{RMS}\vphantom{y}}} \\
    \midrule
\multirow{4}{*}{\rotatebox[origin=c]{90}{P\textit{n}P-LM}}
    & A & 2.748  & -0.135 & 2.175 & 119.232 & 1.368  & -76.261 & 0.240\\ 
    & B & 2.690  & 0.768  & 2.128 & 124.905 & -1.972 & -91.559 & 0.247\\
    & C & -1.576 & 1.139  & 2.146 & 120.264 & 1.428  & 98.205  & 0.255\\
    & D & -1.575 & -0.122 & 2.165 & 119.634 & -0.818 & 85.313  & 0.231\\
    \midrule
\multirow{4}{*}{\rotatebox[origin=c]{90}{EP\textit{n}P}}
    & A & 2.722  & -0.161 & 2.345 & 121.639 & 1.828  & -75.974 & 0.463\\
    & B & 2.649  & 0.729  & 2.259 & 127.082 & -0.881 & -91.444 & 0.432\\
    & C & -1.565 & 1.148  & 2.246 & 121.639 & 1.250  & 98.377  & 0.389\\
    & D & -1.547 & -0.077 & 2.238 & 120.951 & 0.199  & 85.428  & 0.372\\
    \bottomrule
\end{tabular}
}
\end{center}
\caption{Exterior orientation parameters and corresponding RMS error for all Kinect sensors defined within the chessboard coordinate system.}
\label{tab:rigidParams}
\end{table}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.