1

I have half a page of text, followed by a short table under it, followed a large table on the next page. The short table is placed at the bottom of the page under the half page of text which is leaving a large space in the page. Is it possible to align the float in the middle of the space instead so that it looks better?

Werner
  • 603,163
mtanti
  • 123
  • 4

2 Answers2

3

Since you're interested in particular float placement, the float package's [H]ere placement option can be of help.

Place the table-in-question within a \vfill spacing on both sides:

enter image description here

\documentclass{article}
\usepackage{lipsum,float}

\begin{document}

\lipsum[1-7]

\vfill

\begin{table}[H]% This table will not float
  \centering
  \rule{.8\textwidth}{7\baselineskip}
  \caption{A very small table.}
\end{table}

\vfill

\clearpage

\begin{table}[t]
  \centering
  \rule{.8\textwidth}{.4\textheight}
  \caption{A very large table.}
\end{table}

\lipsum[8-15]

\end{document}
Werner
  • 603,163
2

You can adjust LaTeX's bottom float area so that the floats are centred in the space, thanks to Werner for the MWE:-)

enter image description here

\documentclass{article}
\usepackage{lipsum,float}

\makeatletter

\def \@cflb {%
    \let\@elt\@comflelt
    \setbox\@tempboxa \vbox{}%
    \@botlist
    \setbox\@outputbox \vbox{%
                             \unvbox\@outputbox
                             \vfill
                             \botfigrule
                             \unvbox\@tempboxa
                             \vskip -\floatsep
                             \vskip0ptplus2fill\relax
                             }%
    \let\@elt\relax
    \xdef\@freelist{\@freelist\@botlist}%
    \global \let \@botlist\@empty
}

\makeatother

\begin{document}

\lipsum[1-7]

\vfill

\begin{table}[b]% This table will  float
  \centering
  \rule{.8\textwidth}{7\baselineskip}
  \caption{A very small table.}
\end{table}

\vfill

\clearpage

\begin{table}[t]
  \centering
  \rule{.8\textwidth}{.4\textheight}
  \caption{A very large table.}
\end{table}

\lipsum[8-15]

\end{document}
David Carlisle
  • 757,742