14

According to the float package documentation, the H float placement specifier

[...]when added to a float, tells LaTeX to “put the float HERE, period”. If there isn’t enough space left on the page, the float is carried over to the next page together with whatever follows, even though there might still be room left for some of that.

I've heard some opinions in favour and some against the use of this placement specifier. I personally tend not to recommend its use and suggest the use of an static object from the beginning instead (but the only reason I have is that I don't like the idea of declaring something as a float and then suppressing the flotation; I'd rather use a static object from the beginning).

Are there any major drawbacks associated with the H float placement specifier besides the one mentioned in the last sentence of the quoted text?

0

2 Answers 2

7

Here is one drawback, that stems from the fact that [H] floats are set as a minipage:

enter image description here

\documentclass{article}
\usepackage{float}
\newcommand{\pangram}{The quick fox jumped over the lazy dog.}
\begin{document}
\pangram

\begin{figure}[h]
  \pangram
  \caption{\pangram}
\end{figure}

\pangram

\clearpage
\pangram

\begin{figure}[H]
  \pangram
  \caption{\pangram}
\end{figure}

\pangram

\end{document}

Another drawback is the way it handles "in-text floats":

enter image description here

\documentclass{article}
\usepackage{float}
\newcommand{\pangram}{The quick fox jumped over the lazy dog.}
\begin{document}
\pangram
\begin{figure}[h]
  \pangram
  \caption{\pangram}
\end{figure}
\pangram

\clearpage
\pangram
\begin{figure}[H]
  \pangram
  \caption{\pangram}
\end{figure}
\pangram

\end{document}
5
  • “The quick fox jumped over the lazy dog” isn't a pangram. the conventional version has a “quick brown fox”, but i think there are other versions. Commented Feb 20, 2014 at 9:18
  • @wasteofspace Even with brown, it's not a pangram. Either jump has to be in the present tense, or you need more than 1 dog. Commented Feb 20, 2014 at 16:44
  • So there's no additional major drawbacks after all? Commented Mar 3, 2014 at 18:19
  • @GonzaloMedina: You've already mentioned another one in your original post: "If there isn’t enough space left on the page, the float is carried over to the next page together with whatever follows, even though there might still be room left for some of that." I think the consensus about [H] is that it goes against what floats should do... float. But, if well-used under these circumstances, there is no major drawback.
    – Werner
    Commented Mar 3, 2014 at 18:22
  • Yes, that's why I said "additional". I guess you're right; well used it can be helpful in some circumstances. Commented Mar 3, 2014 at 18:32
6

Another drawback is that using the H modifier for some floats might result in floats out of order, as the following example demonstrates:

\documentclass{book}
\usepackage{graphicx}
\usepackage{float}

\begin{document}

\chapter{A test chapter}

\begin{figure}
\centering
\includegraphics[width=4cm]{example-image-a}
\caption{A test floating figure}
\end{figure}

\begin{figure}[H]
\centering
\includegraphics[width=4cm]{example-image-b}
\caption{A test non-floating figure}
\end{figure}

\end{document}

enter image description here

2
  • This should be mentioned in the documentation of float. On the other hand, the [H] specifier should never be used. ;-)
    – egreg
    Commented Aug 31, 2015 at 15:33
  • @egreg Yes, this should be mentioned in the documentation. I also agree that [H] shouldn't be used. Commented Aug 31, 2015 at 15:35

You must log in to answer this question.

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