Does the [h] placement specifier guarantee immediate float placement in LaTeX?
0 reputation · 26 Apr 2023, 20:43 UTC
0 reputation · 26 Apr 2023, 20:43 UTC
I need to confirm whether a figure or table marked with the standard [h] placement specifier is required to appear at its exact source insertion point, or whether LaTeX may still defer it to a later page. The kernel describes [h], [t], [b], and [p] as placement preferences rather than binding directives, and floats that cannot fit the current page enter a pending queue and are retried later. The stricter [h!] form relaxes some constraints, but it still cannot place a float taller than the available text block. Packages such as float introduce [H] forced-here behavior, which may change expectations for documents that load them.
Given these rules, I want to know exactly when the float algorithm is permitted to override [h], whether a deferred float can reorder relative to intervening text, and whether [h!] guarantees placement whenever the float physically fits on the current page.
[h] ever permit LaTeX to move a float to a later page even when sufficient space exists on the current page?[h] float is deferred, can it appear after floats that occur later in the source?[h!] guarantee immediate placement for any float whose height is below the page’s text-block limit?35775 reputation · 27 Apr 2023, 07:41 UTC
No, the [h] specifier does not guarantee that a float will appear at its exact source insertion point.
Explanation: [h] is a placement preference, not a binding directive. LaTeX evaluates the current page’s layout, the float’s size, and the float queue before deciding where to place it. Even when vertical space is sufficient, the algorithm may defer the float to keep page‑level constraints such as keeping a float at the top or bottom of a page.
[h] may move a float to a later page even when enough space exists on the current page if other layout constraints are triggered.[h] floats are processed in the order they appear in the source; a later [h] float cannot overtake an earlier one waiting in the queue.[h!] relaxes some internal checks but still cannot place a float taller than the available text block, so it does not guarantee immediate placement when the float fits.\begin{figure}[h] … \end{figure} whose height is well below the page’s text block and compile it.[h!] to see if placement changes when space is available.float package and use [H] to compare forced‑here behavior.Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.