1

I've seen many questions regarding 2 tables, but for some reason none of the solutions worked for me when I have multiple tables, which may extend to a new page.

The example below is for 2 tables, but in my actual document I have many tables, and there is a large space between them. I tried the following:

  1. Rolling them all into a single table using \begin{table}...\end{table}. This does indeed remove the whitespace. But the problem is that when there are many tables over multiple pages, then it doesn't break into a new page in the correct place. It just truncates the table and the rest of the table disappears.
  1. However, when I split them up, as shown below, then there is a large whitespace in between.

  2. Of course I can manually insert \begin{table}....\end{table} for a subset of the tables (perhaps the first 2 or 3), and then let the page break happen, and then group the remaining tables \begin{table}....\end{table}, but that doesn't seem like a sustainable solution to me because as the document changes I would have to update this.

\documentclass[runningheads]{llncs} \usepackage{subcaption} \usepackage{booktabs} \usepackage{tabularx} \begin{document} \begin{table}[] \caption{S } \label{tab:mytable} \begin{tabular}{@{}llll@{}} \toprule & a & b & q \\ \midrule 0 & 5 & 2 & 9.0 \\ 0 & 5 & 5 & .39 \\ 0 & 5 & 3 & .73 \\ \bottomrule \end{tabular} \end{table} \setlength{\floatsep}{0.1pt} \begin{table}[] \caption{S } \label{tab:mytable} \begin{tabular}{@{}llll@{}} \toprule & a & b & q \\ \midrule 0 & 5 & 2 & 9.0 \\ 0 & 5 & 5 & .39 \\ 0 & 5 & 3 & .73 \\ \bottomrule \end{tabular} \end{table} \end{document} 

How do I reduce the space between multiple tables, yet still allow the page breaks to happen naturally?

6
  • you can put both tabular and both captions in the same table if you want them to stay together, but don't do \begin{table}[] that means the table is allowed nowhere: latex will warn about that and remove the option Commented Dec 11, 2023 at 19:01
  • if you want to set floatsep set it in the preamble (or at least on the page before the tables appear) not between the tables. Commented Dec 11, 2023 at 19:03
  • I tried \setlength{\floatsep}{0.1pt} in the preamble, but that did not change anything for me. Commented Dec 11, 2023 at 19:37
  • You have not provided a test document that allows debugging table is not defined by default, it is defined by the documentclass which you have not shown Commented Dec 11, 2023 at 19:40
  • Just added it: \documentclass[runningheads]{llncs} Commented Dec 11, 2023 at 19:49

1 Answer 1

2

You used \begin{table}[] which means do not allow the float anywhere.

LaTeX assumes you did not mean that and warns:

LaTeX Warning: No positions in optional float specifier. Default added (so using `htbp') on input line 8. 

as it happens it ended up using h so the effective parameter is not \floatsep but \intextsep

enter image description here

\documentclass[runningheads]{llncs} \usepackage{subcaption} \usepackage{booktabs} \usepackage{tabularx} \setlength{\intextsep}{-10.1pt} \raggedbottom \begin{document} \begin{table}[] \caption{S } \label{tab:mytable} \begin{tabular}{@{}llll@{}} \toprule & a & b & q \\ \midrule 0 & 5 & 2 & 9.0 \\ 0 & 5 & 5 & .39 \\ 0 & 5 & 3 & .73 \\ \bottomrule \end{tabular} \end{table} \begin{table}[] \caption{S } \label{tab:mytable} \begin{tabular}{@{}llll@{}} \toprule & a & b & q \\ \midrule 0 & 5 & 2 & 9.0 \\ 0 & 5 & 5 & .39 \\ 0 & 5 & 3 & .73 \\ \bottomrule \end{tabular} \end{table} \end{document} 

Note h would not have been defaulted by the standard classes, this is specific to llncs (which you had not mentioned in the original version of the question)

7
  • Thanks, that was very helpful. Unfortunately someone closed my question, claiming it was a duplicate, so I modified it to be more clear. Hope it's okay. Commented Dec 11, 2023 at 20:08
  • sure I reopened the question so I could post an answer @somewhere Commented Dec 11, 2023 at 20:10
  • I added \setlength{\intextsep}{-10.1pt} \raggedbottom. But this still suffers from the problem I alluded to: When the table extends beyond the page, it just gets truncated and doesn't start a new page. I'm trying to avoid setting \begin{table}...\end{table} manually. Do you have any suggestions for that? Commented Dec 11, 2023 at 21:41
  • Also, do you mind helping me understand what do you mean by "which means do not allow the float anywhere. ? Commented Dec 11, 2023 at 21:43
  • @somewhere [tbp] means allow floats top bottom or on a float page, [th] means allow floats top or here [h] means allow just here (this usually gets changed to [ht]) so [] means don't allow floats anywhere. An argument of [] is not the same as not having the optional argument at all: use \begin{table} not \begin{table}[] just as \\ is not the same as \\[] (which gives an error) Commented Dec 11, 2023 at 21:47

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.