TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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}
share|improve this question
up vote 74 down vote accepted

These are optional parameters to fine tune the placement of tables and figures, with the following meaning:

  • h, here
  • t, top
  • b, bottom
  • p, page of float

and 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].

share|improve this answer
1  
The argument for a separate page of floats is called p (page), not f. – lockstep Jan 10 '11 at 18:37
1  
@lockstep Thanks. This is fixed now. – chl Jan 10 '11 at 18:42
8  
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. – Will Robertson Jan 11 '11 at 2:08
6  
The order of the arguments doesn't actually matter. See How to influence the position of float environments like figure and table in LaTeX? for "the full story" on float placement. – Torbjørn T. Apr 11 '13 at 22:03
1  
@OAH Yes, I meant the place when one put the float in the flow of the document. – chl Jan 17 at 11:03

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.

share|improve this answer
3  
[ht] differs from [h] in that it allows top of current page (latex only changes h to ht after the page that the float is on) – David Carlisle Apr 11 '13 at 21:59

With a capital H \begin{figure}[H] the location is "strong" fixed, even generating some white gaps...

share|improve this answer
3  
Yes, the H parameter, defined by the float package, disables floating altogether, so if a figure/table is too large to fit on what is left of the page, it will move to the next page, and the remainder of the page left blank. This is one of the reasons for not using H. – Torbjørn T. Sep 3 '15 at 11:08
    
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. – Andrew Swann Sep 3 '15 at 11:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.