1

This is a follow to this answer to my previous question. I got three such tables that I want make sure they appear on 1 page, so that the keys at the bottom appear right below all.

  1. Is it possible to reduce the space in between the tables, so that some text can appear on the page (before or after tables), since it appears there is large space it between?
\documentclass[runningheads]{llncs}
\usepackage{booktabs,siunitx}
%\usepackage{cleveref}


\begin{document}

\section{Main Section}

\subsection{Sub-section I}
Checking cross-reference for Table \ref{tab:exp1}   

  \title{Paper Title}
  
\begin{table}[!htbp]
    \caption{Experiemnt 1} \label{tab:exp1}
    \setlength{\tabcolsep}{0pt}
    
    \begin{tabular*}{\textwidth}{
        @{\extracolsep{\fill}}
        l
        @{\hskip 1ex}
        *{5}{S[table-format=1.2]}
        @{\hskip 1ex}
        *{5}{S[table-format=1.2]}
        @{\hskip 1ex}
        *{5}{S[table-format=1.2]}
        @{}
      }
      \toprule
      TM &
      \multicolumn{5}{c}{Precision} &
      \multicolumn{5}{c}{Recall} &
      \multicolumn{5}{c}{F1-Score} \\
      \cmidrule(r{1ex}){2-6} \cmidrule(r{1ex}){7-11} \cmidrule{12-16}
      & {R} & {S} & {A} & {B} & {D}   & {R} & {S} & {A} & {B} & {D}   & {R} & {S} & {A} & {B} & {D}\\
      \midrule
      Walk  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
      Bike  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
      Bus   &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
      Taxi   &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
      Train &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
      \bottomrule
    \end{tabular*}

  \end{table}

\begin{table}[!htbp]
    \caption{Experiemtn 2} \label{tab:exp2}
    \setlength{\tabcolsep}{0pt}
    
    \begin{tabular*}{\textwidth}{
        @{\extracolsep{\fill}}
        l
        @{\hskip 1ex}
        *{5}{S[table-format=1.2]}
        @{\hskip 1ex}
        *{5}{S[table-format=1.2]}
        @{\hskip 1ex}
        *{5}{S[table-format=1.2]}
        @{}
      }
      \toprule
      TM &
      \multicolumn{5}{c}{Precision} &
      \multicolumn{5}{c}{Recall} &
      \multicolumn{5}{c}{F1-Score} \\
      \cmidrule(r{1ex}){2-6} \cmidrule(r{1ex}){7-11} \cmidrule{12-16}
      & {R} & {S} & {A} & {B} & {D}   & {R} & {S} & {A} & {B} & {D}   & {R} & {S} & {A} & {B} & {D}\\
      \midrule
      Walk  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
     Bike  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
     Bus   &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
     Taxi   &  &  &  &  &  &  &  & &  &  &  &  &  &  &  \\
     Train &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
      \bottomrule
    \end{tabular*}

  \end{table}

\begin{table}[htbp]
    \caption{Experiemnt 3} \label{tab:exp3}
    \setlength{\tabcolsep}{0pt}
    
    \begin{tabular*}{\textwidth}{
        @{\extracolsep{\fill}}
        l
        @{\hskip 1ex}
        *{5}{S[table-format=1.2]}
        @{\hskip 1ex}
        *{5}{S[table-format=1.2]}
        @{\hskip 1ex}
        *{5}{S[table-format=1.2]}
        @{}
      }
      \toprule
      TM &
      \multicolumn{5}{c}{Precision} &
      \multicolumn{5}{c}{Recall} &
      \multicolumn{5}{c}{F1-Score} \\
      \cmidrule(r{1ex}){2-6} \cmidrule(r{1ex}){7-11} \cmidrule{12-16}
      & {R} & {S} & {A} & {B} & {D}   & {R} & {S} & {A} & {B} & {D}   & {R} & {S} & {A} & {B} & {D}\\
      \midrule
      Walk  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
     Bike  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
     Bus   &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
     Taxi   &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
     Train &   &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
      \bottomrule
    \end{tabular*}

    \medskip

    TM: Transportation mode

    R: RF\textit{(baseline)}; S: RF-SMOTEd; A: AdaBoost; B: SMOTEBoost; D: DECOC
  \end{table}
 
\end{document}

Output:

enter image description here

enter image description here

1
  • You used the position specifier !htbp for tables 1 and 2, but htbp for table 3. If you had stayed with !htbp for the third table, I suppose you wouldn't have needed to post this query...
    – Mico
    Mar 18 at 6:03

1 Answer 1

2

LaTeX, at default settings, expect that 1/3 page is reserve for the text, Consequently in your page is not sufficient space for three floats. This yout overcome on the two ways:

  • merge all floats in one:
\documentclass[runningheads]{llncs}
\usepackage[skip=1ex]{caption}      % added, for better placement of captions
\usepackage{booktabs,siunitx}
%\usepackage{cleveref}

\begin{document}

\section{Main Section}
\subsection{Sub-section I}
Checking cross-reference for Table \ref{tab:exp1}

  \title{Paper Title}

\begin{table}[!htbp]
    \caption{Experiement 1} \label{tab:exp1}
    \setlength{\tabcolsep}{0pt}

    \begin{tabular*}{\textwidth}{
        @{\extracolsep{\fill}}
        l
        @{\hskip 1ex}
        *{5}{S[table-format=1.2]}
        @{\hskip 1ex}
        *{5}{S[table-format=1.2]}
        @{\hskip 1ex}
        *{5}{S[table-format=1.2]}
        @{}
      }
      \toprule
      TM &
      \multicolumn{5}{c}{Precision} &
      \multicolumn{5}{c}{Recall} &
      \multicolumn{5}{c}{F1-Score} \\
      \cmidrule(r{1ex}){2-6} \cmidrule(r{1ex}){7-11} \cmidrule{12-16}
      & {R} & {S} & {A} & {B} & {D}   & {R} & {S} & {A} & {B} & {D}   & {R} & {S} & {A} & {B} & {D}\\
      \midrule
      Walk  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
      Bike  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
      Bus   &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
      Taxi  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
      Train &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
      \bottomrule
    \end{tabular*}

    \caption{Experiemtn 2} \label{tab:exp2}
    \setlength{\tabcolsep}{0pt}

    \begin{tabular*}{\textwidth}{
        @{\extracolsep{\fill}}
        l
        @{\hskip 1ex}
        *{5}{S[table-format=1.2]}
        @{\hskip 1ex}
        *{5}{S[table-format=1.2]}
        @{\hskip 1ex}
        *{5}{S[table-format=1.2]}
        @{}
      }
      \toprule
      TM &
      \multicolumn{5}{c}{Precision} &
      \multicolumn{5}{c}{Recall} &
      \multicolumn{5}{c}{F1-Score} \\
      \cmidrule(r{1ex}){2-6} \cmidrule(r{1ex}){7-11} \cmidrule{12-16}
      & {R} & {S} & {A} & {B} & {D}   & {R} & {S} & {A} & {B} & {D}   & {R} & {S} & {A} & {B} & {D}\\
      \midrule
      Walk  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
     Bike   &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
     Bus    &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
     Taxi   &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
     Train  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
      \bottomrule
    \end{tabular*}

    \caption{Experiment 3} \label{tab:exp3}
    \setlength{\tabcolsep}{0pt}

    \begin{tabular*}{\textwidth}{
        @{\extracolsep{\fill}}
        l
        @{\hskip 1ex}
        *{5}{S[table-format=1.2]}
        @{\hskip 1ex}
        *{5}{S[table-format=1.2]}
        @{\hskip 1ex}
        *{5}{S[table-format=1.2]}
        @{}
      }
      \toprule
      TM &
      \multicolumn{5}{c}{Precision} &
      \multicolumn{5}{c}{Recall} &
      \multicolumn{5}{c}{F1-Score} \\
      \cmidrule(r{1ex}){2-6} \cmidrule(r{1ex}){7-11} \cmidrule{12-16}
      & {R} & {S} & {A} & {B} & {D}   & {R} & {S} & {A} & {B} & {D}   & {R} & {S} & {A} & {B} & {D}\\
      \midrule
     Walk   &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
     Bike   &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
     Bus    &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
     Taxi   &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
     Train  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\
      \bottomrule
    \end{tabular*}

    \medskip

    TM: Transportation mode

    R: RF\textit{(baseline)}; S: RF-SMOTEd; A: AdaBoost; B: SMOTEBoost; D: DECOC
  \end{table}

\end{document}

enter image description here

Edit:

  • or if you persist (for unknown reasons) to have separated floats for your tables, you have (again) two possibilities:
    • change all table placement options to [!htbp] as suggest @Mico in his comment (you already use them at first two tables, why you left out it at the third table, is unclear, but this is cause of your problem), or
    • in preamble add: \renewcommand{\textfraction}{0.07} and for all tables position options use just [htbp].

In this case the tables will place in one page as follows:

enter image description here

(red lines show page layout)

Off-topic: For your tables you may consider to merge all table in one table where each has title in separate rows. IN this case the use of the talltblr tabularray package:

\documentclass[runningheads]{llncs}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage[skip=1ex]{caption}      % added, for better placement of captions
\usepackage{tabularray}
\UseTblrLibrary{booktabs,siunitx}
\NewTableCommand\experiment[1][2ex]{%
    \SetRow{abovesep+=#1, preto=\hspace{-1em}}
    \SetCell[c=16]{font=\bfseries\itshape}
                              }

\begin{document}

\section{Main Section}
\subsection{Sub-section I}
Checking cross-reference for Table \ref{tab:exp1}

  \title{Paper Title}

    \begin{table}[htbp]
\caption{Experiment 1}
\label{tab:exp1}
\begin{talltblr}[
caption = {Result of experiments 1 -- 3},
  label = {tab:exp1},
note{}  = {TM: Transportation mode\newline
           R: RF(\textit{baseline});
           S: RF-SMOTEd;
           A: AdaBoost;
           B: SMOTEBoost;
           D: DECOC}
                ]{colspec  = {Q[l,leftsep=1em]
                              *{3}{*{5}{X[c, si={table-format=1.2}]}}},
             row{1,2} = {guard},
             rowsep=1pt
             }
    \toprule
TM      &   \SetCell[c=5]{c}    Precision
            &   &   &   &   \SetCell[c=5]{c}    Recall
                            &   &   &   &   &   \SetCell[c=5]{c}    F1-Score
                                                &   &   &   &   &       \\
    \cmidrule[lr=-1]{2-6} 
    \cmidrule[lr=-1]{7-11} 
    \cmidrule[l=-1]{12-16}
        & R & S & A & B & D & R & S & A & B & D & R & S & A & B & D     \\
    \midrule
\experiment  Experiment 1
        &   &   &   &   &   &   &   &   &   &   &   &   &   &   &       \\
Walk    &   &   &   &   &   &   &   &   &   &   &   &   &   &   &       \\
Bike    &   &   &   &   &   &   &   &   &   &   &   &   &   &   &       \\
Bus     &   &   &   &   &   &   &   &   &   &   &   &   &   &   &       \\
Taxi    &   &   &   &   &   &   &   &   &   &   &   &   &   &   &       \\
Train   &   &   &   &   &   &   &   &   &   &   &   &   &   &   &       \\
\experiment  Experiment 2
        &   &   &   &   &   &   &   &   &   &   &   &   &   &   &       \\
Walk    &   &   &   &   &   &   &   &   &   &   &   &   &   &   &       \\
Bike    &   &   &   &   &   &   &   &   &   &   &   &   &   &   &       \\
Bus     &   &   &   &   &   &   &   &   &   &   &   &   &   &   &       \\
Taxi    &   &   &   &   &   &   &   &   &   &   &   &   &   &   &       \\
Train   &   &   &   &   &   &   &   &   &   &   &   &   &   &   &       \\
\experiment  Experiment 3
        &   &   &   &   &   &   &   &   &   &   &   &   &   &   &       \\
Walk    &   &   &   &   &   &   &   &   &   &   &   &   &   &   &       \\
Bike    &   &   &   &   &   &   &   &   &   &   &   &   &   &   &       \\
Bus     &   &   &   &   &   &   &   &   &   &   &   &   &   &   &       \\
Taxi    &   &   &   &   &   &   &   &   &   &   &   &   &   &   &       \\
Train   &   &   &   &   &   &   &   &   &   &   &   &   &   &   &       \\
    \bottomrule
\end{talltblr}
  \end{table}
\end{document}

enter image description here

2
  • Just curious why you didn't also suggest changing htbp to !htbp for the third table.
    – Mico
    Mar 18 at 6:06
  • 1
    @Mico, to be honest, Now I don't know ... with ! the default settings is overwritten. Your comment is now now considered in edited answer.
    – Zarko
    Mar 18 at 8:23

You must log in to answer this question.

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