1

I'm in the middle of creating a lot of tables, but I've run into a problem. When I add more than 3 tables in a row, a space between the tables are suddently created.

I created a few copies of the following table, they are generated tough some excel add-in:

\begin{table}[htbp]
  \centering
    \begin{tabular}{lrrrr}
    \hline
    \textit{(1,000,000)} & \multicolumn{1}{l}{MV} & \multicolumn{1}{l}{TP} & \multicolumn{1}{l}{ST} & \multicolumn{1}{l}{RP} \bigstrut\\
    \hline
    Mean  & 227,799 & 284,627 & 234,909 & 290,288 \bigstrut[]\\
    Std Dev & 28,711 & 33,111 & 29,954 & 35,171 \\
    Default & 0.00  & 0.00  & 0.00  & 0.00 \bigstrut[]\\
    \hline
    \end{tabular}
  \label{tab:test}
   \caption{Add caption}
\end{table}

Preamble

\documentclass[11pt]{article}
\usepackage{Pgfplots}
\usepackage{booktabs}
\usepackage{bigstrut}

\raggedbottom



\begin{document}

Does anyone know what is wrong and how to fix it?

Page1 Page1

2
  • @DavidCarlisle adding ragged bottom does not changed anything neither does removing h, I added the preamble, but I dont really have anything there Commented Apr 24, 2018 at 16:01
  • no that's because I guessed wrong (it is hard to guess the markup just from an image of the output:-) article is raggedbottom by default, so the issue is not my guess (I will delete the comment) the issue is as @Mico says Commented Apr 24, 2018 at 16:37

1 Answer 1

2

I'd like to suggest that you add the following instructions to the preamble:

\makeatletter
\setlength\@fptop{0pt}             % default: '0\p@ \@plus 1fil'
\setlength\@fpsep{2\baselineskip}  % default: '8\p@ \@plus 2fil'
\makeatother

This code governs the spacing above and between floats on floats-only pages.

2\baselineskip means: insert vertical whitespace in the amount of 2\baselineskip between floats on a floats-only page; you're obviously free to either increase or decrease this amount.

4
  • This did fix the 2nd page, but there is still a big space between page 1 and 2, where one more table could easily be fitted? Commented Apr 24, 2018 at 16:27
  • changing the baseline setting only seems to affect the tables on page 2 Commented Apr 24, 2018 at 16:35
  • @DennisChristiansen - The permissible number of floats on a single page is controlled by the counter totalnumber; its default value is 3. (In case you're curious: By default, 2 floats are allowed at the top and 1 is allowed at the bottom.) I can suggest adding the following code to the preamble: \setcounter{topnumber}{3} \setcounter{bottomnumber}{2} \setcounter{topnumber}{5}.
    – Mico
    Commented Apr 24, 2018 at 16:51
  • Hmm this still only shows 3 tables on the first page and then 5 on the rest. But I found a solution myself, by using \usepackage{float} and then "H" I was able to show 5 tables on the first page as well. Commented Apr 24, 2018 at 18:31

You must log in to answer this question.

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