I would appreciate if someone could tell me difference between [t] and [ht] in the following example? I don't see a difference in the output pdf file.
\begin{figure}[ht]
...
\end{figure}
and
\begin{figure}[t]
...
\end{figure}
I would appreciate if someone could tell me difference between [t] and [ht] in the following example? I don't see a difference in the output pdf file.
\begin{figure}[ht]
...
\end{figure}
and
\begin{figure}[t]
...
\end{figure}
These are optional parameters to fine tune the placement of tables and figures, with the following meaning:
h, heret, topb, bottomp, page of floatand LaTeX will try to honour the placement with respect to the actual place, the top or bottom of the page, or a separate page of floats coming immediately after the present insertion point. For example, when using ht LaTeX will try to put the figure at the insertion point, then on the top of the next page if it happens to violate its typesetting rules.
You may also force LaTeX to "insist" on these specifications by adding an exclamation mark (!) before the placement parameters, e.g. \begin{figure}[!htb]. Additionally, per @WillRobertson's comment:
Note that the
!means that LaTeX will ignore certain other restrictions for placement (e.g., number of floats on a page; maximum size of bottom floats, etc.); it will not always help and should be used sparingly.
there will be no difference, because your documentclass will change it anyway to ht, which means place the floating object here or, if it is not possible depending to the parameter setting of the lenghts and counters, put it on the top of the next page. For [!ht] the parameter setting will be ignored and you can have for example 20 floats on one page. Without a h in your parameter the float can also appear on the top of the current page.
!means that LaTeX will ignore certain other restrictions for placement (e.g., number of floats on a page; maximum size of bottom floats, etc.); it will not always help and should be used sparingly. – Will Robertson Jan 11 '11 at 02:08the placement options default to [tbp].– Eduardo Reis May 04 '21 at 09:26[p], page of float" should probably be reworded because I first thought it meant "put float on the same page as nearby text", but it really means "put float on a new page uniquely created for floats only." – Mateen Ulhaq Apr 23 '22 at 01:25