I am doing the final layouting pass on a book, and while LaTeX does "the right thing" most of the time, and the occassional ugliness can be tweaked with minor touches to the text, there are cases where I feel there is no alternative to forcing LaTeX's hand.
The case I am looking at right now are three tables, which need to be close together due to context, and basically would fill a complete page on their own.
However, LaTeX basically insists that three tables on one page look bad, and spreads them over multiple pages.
How could I force those tables to be on the same page?
Stating \begin{table}[h]
doesn't work. (LaTeX apparently simply ignores the setting.)
Putting the tables into individual cells of a page-sized table ("the HTML way") doesn't work, because I cannot put captions and labels to them properly that way.
Attached is a much dumbed-down version of the problem as a kind of MWE. I used scrbook
as documentclass because that's what the original document is in, and changing that (or the twocolumn
layout) is not an option.
\documentclass[paper=a4,fontsize=10pt,twocolumn]{scrbook}
\usepackage{lipsum}
\usepackage{tabularx}
\begin{document}
\lipsum[1]
\begin{table}
\caption{Tab 1}
\begin{tabularx}{\columnwidth}{|X|}
\hline
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\hline
\end{tabularx}
\end{table}
\lipsum[2]
\begin{table}
\caption{Tab 2}
\begin{tabularx}{\columnwidth}{|X|}
\hline
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\hline
\end{tabularx}
\end{table}
\lipsum[3]
\begin{table}
\caption{Tab 3}
\begin{tabularx}{\columnwidth}{|X|}
\hline
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\hline
\end{tabularx}
\end{table}
\end{document}
Best Answer
If you really want to have the tables together on one page, cheat a bit. Put all the material in a single table-environemt. That means you need to put the stuff between the tables either in front or after them. Here as a quick example.
Here is what pdflatex will give you: