1

How can I split the following table after the "Serra" row to fit on 2 pages? I suppose I have to use longtable, but when I replace tabular by longtable the table gets messed up.

This is what the table looks like right now:

Table

As you can see, it goes outside the bottom margin.

\documentclass[a4paper, oneside]{article}

\usepackage{tabulary}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{array}
\usepackage{booktabs}
\usepackage{makecell} %text wrapping in cells
\usepackage{ragged2e}
\usepackage{geometry}
\usepackage{siunitx} %SI-units
\sisetup{per-mode=symbol}
\DeclareSIUnit \annum{a}
\usepackage{pdflscape} %landscape mode

\begin{document}

%%Tab: Flushing efficiencies
\begin{landscape}
\begin{table}[htbp]
\centering
\setlength\tabcolsep{4pt}
\caption{Flushing efficiencies.}
\begin{tabular}{c 
                c 
                S[table-format=3.1] 
                S[table-format=4] 
                S[table-format=3.2]
                c 
                c 
                c 
                S[table-format=2.2] 
                c}
            
    \toprule
    {\makecell{Reservior\\ (Location)}}  
      & {\makecell{Flushing \\ Year(s)/type}}
        & {\makecell{$V_{s,\mathrm{out}}$ \\ {[\SI{E3}{\cubic\m}]}}} 
          & {\makecell{$V_{w,\mathrm{out}}$  \\ {[\SI{E3}{\cubic\m}]}}} 
            & {\makecell{$\sigma_{s}$ \\ {[\si{\mL\per\L}]}}} 
              & {\makecell{$\sigma_{s,m}$ \\ {[\si{\mL\per\L}]}}}  
                & \makecell{$V_{s,m,\mathrm{out}}$ \\ {[\si{\cubic\m\per a}]}} 
                  & {\makecell{MAS \\  {[\SI{E3}{\cubic\m\per a}]}}} 
                    & \multicolumn{2}{c}{\makecell{Flushing\\ efficiencies  $\eta_{f}$ }} \\
                     \cmidrule{9-10}
        
      &   &   &   &   &   &   &   &    {$\eta_{\sigma}$} {[\si{\percent}]} & {$\eta_{\mathrm{v}}$} {[\si{\percent}]}\\
     
     \midrule
        
         \multirow{5}{*}{Ferden (CH)} & 2018 (E)  &  96  &  2285  & 42.01 
         & \multirow{5}{*}{47.97} & \multirow{5}{*}{112667} & \multirow{5}{*}{50} & 4.20  & \multirow{5}{*}{225.3} \\
             & 2016 (E) &     120.0 &  4030  & 29.78   &       &       &       & 2.98  &  \\
             & 2014 (E) &     60.0   &  2800  & 21.41   &       &       &       & 2.14  &  \\
             & 2013 (E) &     160.0  &  3796  & 42.15   &       &       &       & 4.22  &  \\
             & 2012 (E)  &     240.0  &  2297  & 104.48  &       &       &       & 10.45 &  \\
    \midrule
        \multirow{3}{*}{Gebidem (CH)}  & 2018 (E)  &  295.0  & 9130  & 32.31 & \multirow{3}{*}{37.68} & \multirow{3}{*}{218750}       & \multirow{3}{*}{160}  & 3.23  & \multirow{3}{*}{136.7}  \\
            & 2016 (E)  & 287.0  &  7500  & 38.27 &       &       &       & 3.83  &  \\
            & 2014 (E) & 293.0  &  6900  & 42.46 &       &       &       & 4.25  &  \\
    \midrule
        \multirow{1}{*}{Godey (CH)}  & 2018 (E) & 20.0  & 3456 & 5.79 & 5.79 &  ns & ns &  0.58 & ns \\
    \midrule
        \multirow{2}{*}{Luzzone (CH)}  & 2019 (P)  &   3.6   &  267 & 13.48  
        &    \multirow{2}{*}{12.32}  &  \multirow{2}{*}{ns}     &  \multirow{2}{*}{55}     & 1.35  &  \multirow{2}{*}{ns}\\
                                     & 1985 (E)  &   300.0   &  26877  & 11.16 &       &       &       & 1.12  &  \\
    \midrule
        Malvaglia (CH)  & 2019 (P) & 1.6 & 179 & 8.94 & 8.94 & ns & 25 & 0.89 & ns  \\
    \midrule
        \multirow{2}{*}{Palagnedra (CH)}    & 2013 (E)  & 324.0 &  64000  & 5.06 &  \multirow{2}{*}{4.26}    & \multirow{2}{*}{50400}    &  \multirow{2}{*}{200} & 0.51 & \multirow{2}{*}{25.2}  \\
                                               & 2003 (E)  & 180.0 &  52000  & 3.46  &       &       &       & 0.35  &  \\
     \midrule
        \multirow{4}{*}{Serra (CH)}   & 2018 (E)  &  3.3  &  600  &  5.50  & \multirow{4}{*}{5.95} & \multirow{4}{*}{1616}       & \multirow{4}{*}{ns} & 0.55  & \multirow{4}{*}{ns} \\
                  & 2015 (E)  &  3.9  &  570  &  6.84  &       &       &    & 0.68  &  \\
                  & 2012 (E) &  2.2  &  430  &  5.12  &       &       &    & 0.51  &  \\
                  & 2009 (E) &  5.1  &  810  &  6.35  &       &       &    & 0.64  &  \\
    \midrule
        \multirow{3}{*}{Tourtemagne (CH)}   & 2018 (E)    &   1.8  &  210  & 8.33  & \multirow{3}{*}{13.02} & \multirow{3}{*}{4560}  &  \multirow{3}{*}{ns} & 0.83 & \multirow{3}{*}{ns}  \\
                   & 2017 (E)    &   3.0  &  370  & 8.11  &       &       &       & 0.81  &  \\
                   & 2016 (E)    &   5.5  &  263  & 20.91 &       &       &       & 2.09  &  \\
                   & 2015 (E)    &   3.4  &  233  & 14.72 &       &       &       & 1.47  &  \\
    \midrule
        Dashidaira (JP) & 1995-2006 (E)  & 6000.0  &  ns & ns & ns &  545455  &  1400  & ns & 39.0 \\
    \bottomrule
    
    \multicolumn{10}{l}{\small $\sigma_{s}$ = volumetric mixture concentration,  $\sigma_{s,m}$ = mean volumetric mixture concentration, MAS $(=V_{s,m,\mathrm{in}})$}\\
    
        \end{tabular}
  \label{tab4:flushing_efficiencies}
\end{table}
\end{landscape}

\end{document}
6
  • If I compile your document, I end up with a table fitting into the available space. At least, I don't end up with a warning along the lines of "Float too large for page" which I would expect if a table exceeds into the bottom margin.
    – leandriis
    Jan 8, 2021 at 15:01
  • I am working in overleaf, and I get a warning message. However, I will have to add additional descriptions to the table headers, so it would take up even more space. Therefore, I think I should just split the table.
    – euler132
    Jan 8, 2021 at 15:03
  • Do you think I should rather create 2 separate tables and avoid messing with longtable altogether? However, the caption to the second table will say "Table 4.5" and not "Table 4.4 continued".
    – euler132
    Jan 8, 2021 at 15:05
  • Not necessarily. Using longtable is completely fine here. I just asked because I couldn't see a reason for splitting the table since it did fit into the page. You mentioned getting a warning. Which one specifically? "Overfull \hbox"? If so, that's caused by a too narrow column (The 4th column should be S[table-format=5] instead of S[table-format=4] and the 3rd column should be S[table-format=4.1] instead of S[table-format=3.1].).
    – leandriis
    Jan 8, 2021 at 15:09
  • Since you mentioned "additional descriptions" in the column headers: Probably it is better to provide them in a table note below the table just like the descriptions of \sigma?
    – leandriis
    Jan 8, 2021 at 15:10

1 Answer 1

1

Here is how you could adapt your code to the longtable package. Additionally, I also corrected the two slightly wrong values of table-format in column 3 and 4 in order to overcome the overfull box warnings. Since the table still fits onto a single page, I repeated the last two blocks in the following MWE in order to create a situation in which the table would automatically be split onto two pages.

enter image description here

\documentclass[a4paper, oneside]{article}

\usepackage{tabulary}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{array}
\usepackage{booktabs}
\usepackage{makecell} %text wrapping in cells
\usepackage{ragged2e}
\usepackage{geometry}
\usepackage{siunitx} %SI-units
\sisetup{per-mode=symbol}
\DeclareSIUnit \annum{a}
\usepackage{pdflscape} %landscape mode

\usepackage{longtable}
\begin{document}

%%Tab: Flushing efficiencies
\begin{landscape}
\setlength\tabcolsep{4pt}

\begin{longtable}{c 
                c 
                S[table-format=4.1] 
                S[table-format=5] 
                S[table-format=3.2]
                c 
                c 
                c 
                S[table-format=2.2] 
                c}
    \caption{Flushing efficiencies.}\label{tab4:flushing_efficiencies}\\        
    \toprule
    {\makecell{Reservior\\ (Location)}}  
      & {\makecell{Flushing \\ Year(s)/type}}
        & {\makecell{$V_{s,\mathrm{out}}$ \\ {[\SI{E3}{\cubic\m}]}}} 
          & {\makecell{$V_{w,\mathrm{out}}$  \\ {[\SI{E3}{\cubic\m}]}}} 
            & {\makecell{$\sigma_{s}$ \\ {[\si{\mL\per\L}]}}} 
              & {\makecell{$\sigma_{s,m}$ \\ {[\si{\mL\per\L}]}}}  
                & \makecell{$V_{s,m,\mathrm{out}}$ \\ {[\si{\cubic\m\per a}]}} 
                  & {\makecell{MAS \\  {[\SI{E3}{\cubic\m\per a}]}}} 
                    & \multicolumn{2}{c}{\makecell{Flushing\\ efficiencies  $\eta_{f}$ }} \\
                     \cmidrule{9-10}        
      &   &   &   &   &   &   &   &    {$\eta_{\sigma}$} {[\si{\percent}]} & {$\eta_{\mathrm{v}}$} {[\si{\percent}]}\\    
     \midrule
     \endfirsthead 
     
    \caption{Flushing efficiencies. - continued from previous page}\\        
    \toprule
    {\makecell{Reservior\\ (Location)}}  
      & {\makecell{Flushing \\ Year(s)/type}}
        & {\makecell{$V_{s,\mathrm{out}}$ \\ {[\SI{E3}{\cubic\m}]}}} 
          & {\makecell{$V_{w,\mathrm{out}}$  \\ {[\SI{E3}{\cubic\m}]}}} 
            & {\makecell{$\sigma_{s}$ \\ {[\si{\mL\per\L}]}}} 
              & {\makecell{$\sigma_{s,m}$ \\ {[\si{\mL\per\L}]}}}  
                & \makecell{$V_{s,m,\mathrm{out}}$ \\ {[\si{\cubic\m\per a}]}} 
                  & {\makecell{MAS \\  {[\SI{E3}{\cubic\m\per a}]}}} 
                    & \multicolumn{2}{c}{\makecell{Flushing\\ efficiencies  $\eta_{f}$ }} \\
                     \cmidrule{9-10}        
      &   &   &   &   &   &   &   &    {$\eta_{\sigma}$} {[\si{\percent}]} & {$\eta_{\mathrm{v}}$} {[\si{\percent}]}\\    
     \midrule
     \endhead    
         
    \multicolumn{10}{l}{\small $\sigma_{s}$ = volumetric mixture concentration,  $\sigma_{s,m}$ = mean volumetric mixture concentration, MAS $(=V_{s,m,\mathrm{in}})$}\\    
    \endfoot
        
         \multirow{5}{*}{Ferden (CH)} & 2018 (E)  &  96  &  2285  & 42.01 
         & \multirow{5}{*}{47.97} & \multirow{5}{*}{112667} & \multirow{5}{*}{50} & 4.20  & \multirow{5}{*}{225.3} \\*
             & 2016 (E) &     120.0 &  4030  & 29.78   &       &       &       & 2.98  &  \\*
             & 2014 (E) &     60.0   &  2800  & 21.41   &       &       &       & 2.14  &  \\*
             & 2013 (E) &     160.0  &  3796  & 42.15   &       &       &       & 4.22  &  \\*
             & 2012 (E)  &     240.0  &  2297  & 104.48  &       &       &       & 10.45 &  \\
    \midrule
        \multirow{3}{*}{Gebidem (CH)}  & 2018 (E)  &  295.0  & 9130  & 32.31 & \multirow{3}{*}{37.68} & \multirow{3}{*}{218750}       & \multirow{3}{*}{160}  & 3.23  & \multirow{3}{*}{136.7}  \\*
            & 2016 (E)  & 287.0  &  7500  & 38.27 &       &       &       & 3.83  &  \\*
            & 2014 (E) & 293.0  &  6900  & 42.46 &       &       &       & 4.25  &  \\
    \midrule
        \multirow{1}{*}{Godey (CH)}  & 2018 (E) & 20.0  & 3456 & 5.79 & 5.79 &  ns & ns &  0.58 & ns \\
    \midrule
        \multirow{2}{*}{Luzzone (CH)}  & 2019 (P)  &   3.6   &  267 & 13.48  
        &    \multirow{2}{*}{12.32}  &  \multirow{2}{*}{ns}     &  \multirow{2}{*}{55}     & 1.35  &  \multirow{2}{*}{ns}\\*
                                     & 1985 (E)  &   300.0   &  26877  & 11.16 &       &       &       & 1.12  &  \\
    \midrule
        Malvaglia (CH)  & 2019 (P) & 1.6 & 179 & 8.94 & 8.94 & ns & 25 & 0.89 & ns  \\
    \midrule
        \multirow{2}{*}{Palagnedra (CH)}    & 2013 (E)  & 324.0 &  64000  & 5.06 &  \multirow{2}{*}{4.26}    & \multirow{2}{*}{50400}    &  \multirow{2}{*}{200} & 0.51 & \multirow{2}{*}{25.2}  \\*
                                               & 2003 (E)  & 180.0 &  52000  & 3.46  &       &       &       & 0.35  &  \\
     \midrule
        \multirow{4}{*}{Serra (CH)}   & 2018 (E)  &  3.3  &  600  &  5.50  & \multirow{4}{*}{5.95} & \multirow{4}{*}{1616}       & \multirow{4}{*}{ns} & 0.55  & \multirow{4}{*}{ns} \\*
                  & 2015 (E)  &  3.9  &  570  &  6.84  &       &       &    & 0.68  &  \\*
                  & 2012 (E) &  2.2  &  430  &  5.12  &       &       &    & 0.51  &  \\*
                  & 2009 (E) &  5.1  &  810  &  6.35  &       &       &    & 0.64  &  \\
    \midrule
        \multirow{4}{*}{Tourtemagne (CH)}   & 2018 (E)    &   1.8  &  210  & 8.33  & \multirow{3}{*}{13.02} & \multirow{3}{*}{4560}  &  \multirow{3}{*}{ns} & 0.83 & \multirow{3}{*}{ns}  \\*
                   & 2017 (E)    &   3.0  &  370  & 8.11  &       &       &       & 0.81  &  \\*
                   & 2016 (E)    &   5.5  &  263  & 20.91 &       &       &       & 2.09  &  \\*
                   & 2015 (E)    &   3.4  &  233  & 14.72 &       &       &       & 1.47  &  \\
    \midrule
        Dashidaira (JP) & 1995-2006 (E)  & 6000.0  &  ns & ns & ns &  545455  &  1400  & ns & 39.0 \\
    \midrule
        \multirow{4}{*}{Tourtemagne (CH)}   & 2018 (E)    &   1.8  &  210  & 8.33  & \multirow{3}{*}{13.02} & \multirow{3}{*}{4560}  &  \multirow{3}{*}{ns} & 0.83 & \multirow{3}{*}{ns}  \\*
                   & 2017 (E)    &   3.0  &  370  & 8.11  &       &       &       & 0.81  &  \\*
                   & 2016 (E)    &   5.5  &  263  & 20.91 &       &       &       & 2.09  &  \\*
                   & 2015 (E)    &   3.4  &  233  & 14.72 &       &       &       & 1.47  &  \\
    \midrule
        Dashidaira (JP) & 1995-2006 (E)  & 6000.0  &  ns & ns & ns &  545455  &  1400  & ns & 39.0 \\
    \bottomrule

    
        \end{longtable}
\end{landscape}

\end{document}
3
  • This looks very nice. Thank you! May I ask just one more thing: why do you go with S[table-format=4.1] instead of S[table-format=3.1]? What does the first number indicate - the total number of digits or just the ones before the decimal places? Or is the decimal point counted as the extra digit?
    – euler132
    Jan 8, 2021 at 15:21
  • 4.1 indicates that the maximum number of digits left of the decimal separator is 4, while there is a maximum of 1 decimal place. Your third column contains the entry "6000.1", which is why you need 4.1 instead of 3.1.
    – leandriis
    Jan 8, 2021 at 15:24
  • Ah, I somehow overlooked the last entry. Now it makes sense. Thank you again!
    – euler132
    Jan 8, 2021 at 15:25

You must log in to answer this question.

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