# How to make LaTeX optimize floats/tables placement if order doesn't matter

I have a bunch of tables that their order in the document doesn't matter. How can I reduce empty space to a minimum and make it more visually appealing? All the tables are in a separate chapter with not text at all.

• May i ask what the tables include? It is quite strange, that the order of tables is completely not relevant. – Johannes_B Dec 18 '15 at 19:21
• @Johannes_B We are presenting some dummy database data and there are a bunch of tables (imported from csv) and we don't really care about the order. – orestisf Dec 18 '15 at 19:23
• Haw many (approximately) tables have you got? – Przemysław Scherwentke Dec 18 '15 at 20:33
• @PrzemysławScherwentke 11 – orestisf Dec 19 '15 at 14:24

## 2 Answers

LaTeX assumes the order of the tables is important to you, and strictly respects that.

Probably the easiest (but not sexiest) way to get what you want is to reorder them by hand. Unless this is a frequent, repetitive task, you risk xkcd's automation.

Allow all possible positions in table environments:

\begin{table}[htbp!]


Fix tolerant defaults about the amount of float per page. Some like:

\setcounter{topnumber}{4}
\setcounter{bottomnumber}{4}
\setcounter{totalnumber}{8}
\setcounter{dbltopnumber}{6}
\renewcommand{\topfraction}{0.9}
\renewcommand{\bottomfraction}{0.9}
\renewcommand{\dbltopfraction}{0.9}
\renewcommand{\floatpagefraction}{0.7}
\renewcommand{\dblfloatpagefraction}{0.7}
\renewcommand{\textfraction}{0.1}   % allow minimal text with figures


And finally, reorder the floats manually (cut & paste).

• Thanks for your reply. Unfortunately this doesn't seem to change anything in my document – orestisf Dec 19 '15 at 14:38
• @orestisf Then you should edit your question to add a minimal working example (MWE) and explain what improvements you expect with respect the actual results of that MWE. – Fran Dec 19 '15 at 17:53