2

What is the best practice when it comes to tables that semi-correlate context-wise? I've got the problem, that currently the tables take a large space from my work, but are also required. What would be the best practice method to still make them readable but also reduce space?

\begin{table}[!htb]
\centering
\caption{Accuracy of the different constellations}
\label{tab:nn_acc_const}
\begin{tabular}{rlllll}
\toprule
\multicolumn{1}{l}{}                                                                                         & Size & Const1 & Const2 & Const3 & Const4 \\ \midrule \multirow{4}{*}{\begin{tabular}[c]{@{}r@{}}Accuracy\\ Training\end{tabular}}   & \SI{25}{\%}           & 27.67           & 26.22           & 26.29           & 26.11           \\                                                                                        & \SI{50}{\%}           & 26.5            & 23.78           & 24.31           & 24.34           \\                                                                                       & \SI{75}{\%}           & 25.37           & 25.83           & 24.33           & 23.74           \\                                                                                       & \SI{100}{\%}          & 25.83           & 24.65           & 22.59           & 23.31           \\ \midrule
\multirow{4}{*}{\begin{tabular}[c]{@{}r@{}}Accuracy\\ Validation\end{tabular}} & \SI{25}{\%}           & 18.2            & 18.84           & 18.27           & 21              \\                                                                                        & \SI{50}{\%}           & 17.86           & 22.32           & 18.34           & 19.27           \\                                                                                       & \SI{75}{\%}           & 20.07           & 20.99           & 18.8            & 20.96           \\                                                                                       & \SI{100}{\%}          & 21.06           & 21.22           & 18.2            & 19.56     \\ \bottomrule     
\end{tabular}
\end{table}


\begin{table}[]
\centering
\caption{Loss of the different constellations}
\label{tab:nn_loss_const}
\begin{tabular}{rlllll}
\toprule
\multicolumn{1}{l}{}                                                                                     & Size & Const1 & Const2 & Const3 & Const4 \\ \midrule
\multirow{4}{*}{\begin{tabular}[c]{@{}r@{}}Loss\\ Training\end{tabular}}   & \SI{25}{\%}          & 0.047           & 0.034           & 0.039           & 0.029           \\                                                                                   & \SI{50}{\%}           & 0.036           & 0.26            & 0.029           & 0.023           \\                                                                                   & \SI{75}{\%}           & 0.030           & 0.21            & 0.025           & 0.019           \\                                                                                    & \SI{100}{\%}          & 0.025           & 0.018           & 0.021           & 0.16            \\ \midrule
\multirow{4}{*}{\begin{tabular}[c]{@{}r@{}}Loss\\ Validation\end{tabular}} & \SI{25}{\%}           & 0.2             & 0.14            & 0.17            & 0.12            \\                                                                                    & \SI{50}{\%}           & 0.15            & 0.1             & 0.12            & 0.09            \\                                                                                   & \SI{75}{\%}           & 0.12            & 0.088           & 0.1             & 0.077           \\                                                                                    & \SI{100}{\%}          & 0.1             & 0.075           & 0.086           & 0.066   \\ \bottomrule   
\end{tabular}
\end{table}


\begin{table}[]
\centering
\caption{Overview of \gls{EMG} and \gls{IMU} Accuracy per arm position}
\label{tab:nn_acc_pos}
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{@{}lllllll@{}}
\toprule
\textit{} & IMU$_{train}$ & IMU$_{val}$ & EMG$_{train}$ & EMG$_{val}$ & Combined$_{train}$ & Combined$_{val}$ \\ \midrule
lower     & 23.83         & 18.75       & x             & x           & 23.83              & 18.75            \\
middle    & 26.33         & 20.19       & 28.46         & 16.85       & 22.89              & 18.99            \\
upper     & 23.91         & 20.68       & 25.36         & 16.57       & 20.59              & 18.66            \\ \bottomrule
\end{tabular}
\end{adjustbox}
\end{table}


\begin{table}[]
\centering
\caption{Overview of \gls{EMG} and \gls{IMU} Loss per arm position}
\label{tab:nn_loss_pos}
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{@{}lllllll@{}}
\toprule
\textit{} & IMU$_{train}$ & IMU$_{val}$ & EMG$_{train}$ & EMG$_{val}$ & Combined$_{train}$ & Combined$_{val}$ \\ \midrule
lower     & 0.025         & 0.105       & x             & x           & 0.025              & 0.105            \\
middle    & 0.024         & 0.1         & 0.026         & 0.12        & 0.018              & 0.077            \\
upper     & 0.018         & 0.07        & 0.019         & 0.08        & 0.013              & 0.054            \\ \bottomrule
\end{tabular}
\end{adjustbox}
\end{table}

Rendered PDF view of the first table page

and

\begin{table}[]
\centering
\caption{Accuracy of size and speed limitations}
\label{tab:nn_acc_limits}
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{@{}lllllll@{}}
\toprule
\textit{} & slow$_{train}$ & slow$_{val}$ & fast$_{train}$ & fast$_{val}$ & combined$_{train}$ & combined$_{val}$ \\ \midrule
5cm       & 23.05          & 18.1         & 23.98          & 18.69        & 22.18              & 18.27            \\
10cm      & 24.34          & 21.49        & 24.37          & 20.39        & 22.24              & 20.94            \\
combined  & 21.59          & 18.56        & 21.72          & 18.29        & 20.63              & 18.94            \\ \bottomrule
\end{tabular}
\end{adjustbox}
\end{table}

\begin{table}[]
\centering
\caption{Loss of size and speed limitations}
\label{tab:nn_loss_limits}
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{@{}lllllll@{}}
\toprule
\textit{} & slow$_{train}$ & slow$_{val}$ & fast$_{train}$ & fast$_{val}$ & combined$_{train}$ & combined$_{val}$ \\ \midrule
5cm       & 0.02           & 0.083        & 0.02           & 0.084        & 0.014              & 0.058            \\
10cm      & 0.019          & 0.08         & 0.02           & 0.083        & 0.014              & 0.057            \\
combined  & 0.014          & 0.057        & 0.014          & 0.058        & 0.01               & 0.041            \\ \bottomrule
\end{tabular}
\end{adjustbox}
\end{table}
\begin{table}[]
\centering
\caption{Accuracy of the standard settings and the tuned settings for the \gls{RFC}}
\label{tab:compar_acc}
\begin{tabular}{@{}lll@{}}
\toprule
\textit{} & Standard settings & Tuned settings \\ \midrule
combined  & 0.161             & 0.167          \\
IMU       & 0.18              & 0.185          \\
EMG       & 0.139             & 0.139          \\ \bottomrule
\end{tabular}
\end{table}
\begin{table}[]
\centering
\caption{NeuroKit pipeline Accuracy comparison using \gls{RFC}}
\label{tab:compar_nk_acc_rfc}
\begin{tabular}{@{}llll@{}}
\toprule
\textit{} & \begin{tabular}[c]{@{}l@{}}Standard settings \\ normal pipeline\end{tabular} & \begin{tabular}[c]{@{}l@{}}Standard settings \\ NK pipeline\end{tabular} & \begin{tabular}[c]{@{}l@{}}Tuned settings \\ NK pipeline\end{tabular} \\ \midrule
combined  & 0.161                                                                          & 0.204                                                                      & 0.197                                                                   \\
IMU       & 0.18                                                                           & 0.252                                                                      & 0.255                                                                   \\
EMG       & 0.139                                                                          & 0.115                                                                      & 0.111                                                                   \\ \bottomrule
\end{tabular}
\end{table}

\begin{table}[]
\centering
\caption{NeuroKit pipeline Accuracy comparison using \gls{NN}}
\label{tab:compar_nk_acc_nn}
\begin{tabular}{@{}lllll@{}}
\toprule
\textbf{} & Standard$_{train}$ & Standard$_{test}$ & NK pipeline$_{train}$ & NK pipeline$_{test}$ \\ \midrule
combined  & 20.63              & 18.94             & 23.68                 & 21.82                \\
IMU       & 22.92              & 20.28             & 29.75                 & 26.86                \\
EMG       & 22                 & 17                & 17.32                 & 15.89                \\ \bottomrule
\end{tabular}
\end{table}

Rendered PDF view of the second table page

8
  • 2
    note document design isn't really on topic, once you have decided the design asking how to implement that is on topic but doesn't seem to be your question,. Note \begin{table}[] means "don't allow thetable anywhere" latex actually checks for that and issues the warning LaTeX Warning: No positions in optional float specifier. Jan 15, 2022 at 22:42
  • scaling tables as in \begin{adjustbox}{max width=\textwidth} should usually be avoided, it leads to inconsistent font sizes Jan 15, 2022 at 22:45
  • @DavidCarlisle The data collection is done. I just don't know how to present it best practice-wise as it's a lot of different tables. The work is mainly focused on getting these results, therefore it's crucial to display them. I just used the adjustbox, because the tables are a few pt too wide for the textwidth.
    – Lukas S
    Jan 15, 2022 at 22:49
  • sure it's a reasonable question just not really best place to ask it as the design of the table display isn't really a tex question, you could ask it of Word or indesign or a typewriter. one tex point though use slow$_{\mathrm{val}}$ and similarly for all your others, never use math italic for words, it separates the letters to look like a product of 1-letter variables Jan 15, 2022 at 22:52
  • 2
    you could make a complete article class document fixing the page size to match your real document, as that's all that matters here. I would try to make the column headings fit the columns rather than the other way round, to avoid the ugly uneven spacing. abbreviate or rotate or write on two lines or... Jan 16, 2022 at 0:00

2 Answers 2

2

What is the "best praxis" is opinion based. For example, in your MWE I would use packages which enable to write clear and short code:

\documentclass{article}
\usepackage[showframe,  % in real document delete this option
            vmargin=25mm]{geometry}
\renewcommand{\textfraction}{0.07}
\setcounter{totalnumber}{4}
%
\usepackage[skip=1ex,
            font=small, labelfont=bf]{caption}
\usepackage{tabularray} % new
\UseTblrLibrary{booktabs, siunitx, varwidth} % new
\newcommand\gls[1]{\textcolor{cyan}{#1}}

\begin{document}
    \begin{table}[ht]
\centering
\caption{Accuracy of the different constellations}
\label{tab:nn_acc_const}
    \begin{tblr}{colspec = {@{} Q[r, wd=5em]
                                Q[c, si={table-format=3{\,\%}}]
                           *{4}{Q[c, si={table-format=2.2}]} @{}},
                  rowsep = 1pt,
                 measure = vbox}
    \toprule
    & {{{Size}}}        & {{{Const$_1$}}}   & {{{Const$_2$}}}  
    & {{{Const$_3$}}}   & {{{Const$_4$}}}   \\ 
    \midrule 
\SetCell[r=4]{r}   Accuracy Training
    &  25\,\%   & 27.67 & 26.22 & 26.29 & 26.11     \\                                                                                        &  50\,\%   & 26.5  & 23.78 & 24.31 & 24.34     \\                                                                                       &  75\,\%   & 25.37 & 25.83 & 24.33 & 23.74     \\                                                                                       & 100\,\%   & 25.83 & 24.65 & 22.59 & 23.31     \\ 
    \midrule
\SetCell[r=4]{r}   Accuracy Validation
    &  25\,\%   & 18.2  & 18.84 & 18.27 & 21        \\                                                                                        &  50\,\%   & 17.86 & 22.32 & 18.34 & 19.27     \\                                                                                       &  75\,\%   & 20.07 & 20.99 & 18.8  & 20.96     \\                                                                                       & 100\,\%   & 21.06 & 21.22 & 18.2  & 19.56     \\ 
    \bottomrule
\end{tblr}
    \end{table}

    \begin{table}[ht]
\centering
\caption{Loss of the different constellations}
\label{tab:nn_loss_const}
     \begin{tblr}{colspec = {@{} Q[r, wd=5em]
                                Q[c, si={table-format=3{\,\%}}]
                           *{4}{Q[c, si={table-format=2.3}]} @{}},
                  rowsep = 1pt,
                 measure = vbox}
    \toprule
    & {{{Size}}}        & {{{Const$_1$}}}   & {{{Const$_2$}}}
    & {{{Const$_3$}}}   & {{{Const$_4$}}}   \\
    \midrule
\SetCell[r=4]{r}   Loss Training
    &  25\,\%   & 0.047 & 0.034 & 0.039 & 0.029     \\                                                                                   &  50\,\%   & 0.036 & 0.26  & 0.029 & 0.023     \\                                                                                   &  75\,\%   & 0.030 & 0.21  & 0.025 & 0.019     \\                                                                                    & 100\,\%   & 0.025 & 0.018 & 0.021 & 0.16      \\ 
    \midrule
\SetCell[r=4]{r}   Loss Validation
    &  25\,\%   & 0.2   & 0.14  & 0.17  & 0.12      \\                                                                                    &  50\,\%   & 0.15  & 0.1   & 0.12  & 0.09      \\                                                                                   &  75\,\%   & 0.12  & 0.088 & 0.1   & 0.077     \\                                                                                    & 100\,\%   & 0.1   & 0.075 & 0.086 & 0.066     \\
    \bottomrule
\end{tblr}
    \end{table}

    \begin{table}[ht]
\centering
\caption{Overview of \gls{EMG} and \gls{IMU} Accuracy per arm position}
\label{tab:nn_acc_pos}
     \begin{tblr}{colspec = {@{} Q[r, wd=3em]
                            *{6}{Q[c, si={table-format=2.2}]} @{}},
                  colsep=3pt,
                  rowsep = 1pt,
                 measure = vbox}
    \toprule
    & {{{IMU\textsubscript{train}}}}        & {{{IMU\textsubscript{val}}}}
    & {{{EMG\textsubscript{train}}}}        & {{{EMG\textsubscript{val}}}}
    & {{{Combined\textsubscript{train}}}}   & {{{Combined\textsubscript{val}}}} \\
    \midrule
lower   & 23.83 & 18.75 & {{{--}}}  & {{{--}}}  & 23.83 & 18.75 \\
middle  & 26.33 & 20.19 & 28.46     & 16.85     & 22.89 & 18.99 \\
upper   & 23.91 & 20.68 & 25.36     & 16.57     & 20.59 & 18.66 \\
    \bottomrule
\end{tblr}
    \end{table}

    \begin{table}[ht]
\centering
\caption{Overview of \gls{EMG} and \gls{IMU} Loss per arm position}
\label{tab:nn_acc_pos}
     \begin{tblr}{colspec = {@{} Q[r, wd=3em]
                            *{6}{Q[c, si={table-format=2.3}]} @{}},
                  rowsep = 1pt,
                 measure = vbox}
    \toprule
    & {{{IMU\textsubscript{train}}}}        & {{{IMU\textsubscript{val}}}}
    & {{{EMG\textsubscript{train}}}}        & {{{EMG\textsubscript{val}}}}
    & {{{Combined\textsubscript{train}}}}   & {{{Combined\textsubscript{val}}}} \\
    \midrule
lower   & 0.025 & 0.105 & {{{--}}}  & {{{--}}}  & 0.025 & 0.105 \\
middle  & 0.024 & 0.1   & 0.026     & 0.12      & 0.018 & 0.077 \\
upper   & 0.018 & 0.07  & 0.019     & 0.08      & 0.013 & 0.054 \\ 
    \bottomrule
\end{tblr}
    \end{table}
\end{document}

enter image description here

1

A remark up front: I am in no position to declare which table-related formatting practices may be best. My suggestions are, moreover, inevitably opinion-based. Nevertheless, I trust they can still be useful.

For sure, if there are two tables with very similar structure -- say, one is about the "accuracy" of some entity, and the other is about "loss" -- I'd set up subtable environments for both, within one and the same table environment, and provide captions both for the overall table as well as both subtable.

One thing that's immediately noticeable about your sample tables is that you don't exactly go out of your way to provide an abundance of visual structure, especially in the header row(s). That's unfortunate, as the odds that your readers will actually bother to study the contents of the tables will improve drastically if you do provide some helpful visual structure of this form. The code below provides some suggestions which will hopefully kickstart your own formatting efforts in this regard.

A final remark: If there's a conflict between providing adequate visual structure and keeping the tabular material short, I'd certainly err on the side of pursuing the former goal.

enter image description here

\documentclass{article} % or some other suitable document class

\usepackage[letterpaper,margin=2.5cm]{geometry} % set appropriate page parameters
\usepackage{booktabs,siunitx}

\providecommand\gls[1]{#1} % provide a dummy definition for "\gls"

\usepackage[skip=0.25\baselineskip]{subcaption} % <-- new instruction

\begin{document}

\begin{table}[!htbp]
\caption{Accuracy and loss of the four constellations}
\label{tab:nn_const}

\begin{subtable}{\textwidth}
\centering
\caption{Accuracy} \label{tab:nn_const_acc}

\begin{tabular}{@{} l *{4}{S[table-format=2.2]} @{}}
\toprule
Size & \multicolumn{4}{c@{}}{{Constellations}} \\
\cmidrule(l){2-5}
& {1} & {2} & {3} & {4} \\ 
\midrule 
Training \\
\SI{25}{\%}   & 27.67  & 26.22  & 26.29  & 26.11  \\ 
\SI{50}{\%}   & 26.5   & 23.78  & 24.31  & 24.34  \\
\SI{75}{\%}   & 25.37  & 25.83  & 24.33  & 23.74  \\
\SI{100}{\%}  & 25.83  & 24.65  & 22.59  & 23.31  \\ 
\midrule
Validation \\
\SI{25}{\%}   & 18.2   & 18.84  & 18.27  & 21     \\ 
\SI{50}{\%}   & 17.86  & 22.32  & 18.34  & 19.27  \\
\SI{75}{\%}   & 20.07  & 20.99  & 18.8   & 20.96  \\
\SI{100}{\%}  & 21.06  & 21.22  & 18.2   & 19.56  \\ 
\bottomrule     
\end{tabular}

\end{subtable}

\bigskip

\begin{subtable}{\textwidth}
\centering
\caption{Loss} \label{tab:nn_const_loss}

\begin{tabular}{@{} l *{4}{S[table-format=1.3]} @{}}
\toprule
Size & \multicolumn{4}{c@{}}{{Constellations}} \\
\cmidrule(l){2-5}
& {1} & {2} & {3} & {4} \\ 
\midrule 
Training \\
\SI{25}{\%}   & 0.047  & 0.034  & 0.039  & 0.029  \\                                                           \SI{50}{\%}   & 0.036  & 0.26   & 0.029  & 0.023  \\                                                           \SI{75}{\%}   & 0.030  & 0.21   & 0.025  & 0.019  \\                                                            \SI{100}{\%}  & 0.025  & 0.018  & 0.021  & 0.16   \\ 
\midrule
Validation  \\
\SI{25}{\%}   & 0.2    & 0.14   & 0.17   & 0.12   \\                                                            \SI{50}{\%}   & 0.15   & 0.1    & 0.12   & 0.09   \\                                                           \SI{75}{\%}   & 0.12   & 0.088  & 0.1    & 0.077  \\                                                            \SI{100}{\%}  & 0.1    & 0.075  & 0.086  & 0.066  \\ 
\bottomrule   
\end{tabular}

\end{subtable}

\end{table}



\begin{table}[htbp!]
\caption{Accuracy and loss of \gls{EMG} and \gls{IMU}, per arm position}
\label{tab:nn_pos}

\begin{subtable}{\textwidth}
\centering
\caption{Accuracy} \label{tab:nn_pos_acc}

\begin{tabular}{@{} l *{6}{S[table-format=2.2]} @{}}
\toprule
& \multicolumn{2}{c}{IMU} & \multicolumn{2}{c}{EMG} & \multicolumn{2}{c@{}}{Combined} \\
\cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(l){6-7}
& {train} & {val} & {train} & {val} & {train} & {val} \\
\midrule
lower     & 23.83  & 18.75  & {--}    & {--}  & 23.83  & 18.75   \\
middle    & 26.33  & 20.19  & 28.46  & 16.85  & 22.89  & 18.99   \\
upper     & 23.91  & 20.68  & 25.36  & 16.57  & 20.59  & 18.66   \\ 
\bottomrule
\end{tabular}

\end{subtable}

\bigskip

\begin{subtable}{\textwidth}
\centering
\caption{Loss} \label{tab:nn_pos_loss}

\begin{tabular}{@{} l *{6}{S[table-format=1.3]} @{}}
\toprule
& \multicolumn{2}{c}{IMU} & \multicolumn{2}{c}{EMG} & \multicolumn{2}{c@{}}{Combined} \\
\cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(l){6-7}
& {train} & {val} & {train} & {val} & {train} & {val} \\
\midrule
lower  & 0.025  & 0.105  & {--}   & {--}   & 0.025  & 0.105   \\
middle & 0.024  & 0.1    & 0.026  & 0.12   & 0.018  & 0.077   \\
upper  & 0.018  & 0.07   & 0.019  & 0.08   & 0.013  & 0.054   \\ 
\bottomrule
\end{tabular}

\end{subtable}

\end{table}

\end{document}
1
  • 1
    Thank you. The table examples you provided look way cleaner than mine. I have a strong programming background and don't often write texts or Latex and I guess it shows ... Much appreciation!
    – Lukas S
    Jan 16, 2022 at 11:36

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.