I'm trying to choose the positions of my tables but I can't figure out the difference between [H] and [h]. I've seen both advised over my search. If I use [h] the row spacing is different than [H] use.
- 599
-
8For the long answer, see http://tex.stackexchange.com/a/39020/4012, in particular the section "Here" really just means "here if it fits". – doncherry Sep 07 '13 at 20:34
1 Answers
Never use [h] on its own, it is basically an error waiting to happen and LaTeX will most likely give a warning and change it to [ht].
LaTeX has four float areas into which a float may be placed: top of page (t), bottom of page (b), here where the float appears in the source (h) and on a float page with only floats and no text (p).
H makes the environment essentially not a float at all it is more or less the same as using minipage except that \caption works, but you can caption minipages using the capt-of package.
H should be used sparingly, like any large box, it is likely to produce bad page breaks with large amounts of white space.
If you use the optional argument of a float you are mostly restricting the float areas to which the float may be allocated. If you over-restrict it is likely that the float can not be positioned at all, and will then go to the end of the document. So if you want to allow h it is best to allow t and p as well so use [tph]. You should almost always use p if you use the optional argument.
- 757,742
-
2
-
3@Diaa no, latex has a fixed algorithm for placing floats and the option is just a filter that makes it skip stages, so if the option doesn't contain
tlatex doesn't try a top float If it has atthen it will try that, the order doesn't matter. – David Carlisle Nov 04 '19 at 18:12