18

When specifying a float's placement, e.g. [htpb], is the order of the arguments specifying the priority of them?

Example:

\begin{figure}[htpb]
\includegraphics[width=0.7\textwidth]{sampleImage}
\caption{Example caption}
\label{fig:sampleImage} 
\end{figure}
benregn
  • 6,082
  • 4
    General note: \label always belongs after \caption, otherwise you label the last label-able item instead. – Martin Scharrer Dec 19 '11 at 11:25
  • AFAIK, the order of the placement characters is not meaningful. But I don't know enough about it to post a full answer. – Martin Scharrer Dec 19 '11 at 11:27
  • AFAIK the order is irrelevant. See http://tex.stackexchange.com/questions/32359/what-is-the-exact-purpose-of-ftypetype –  Dec 19 '11 at 11:40
  • @AxelSommerfeldt Why did you delete your answer? – egreg Dec 19 '11 at 11:49
  • I was not very awake this morning. I just noticed there is an undelete option, so I did that. –  Dec 19 '11 at 13:42
  • @MartinScharrer: Thank you for that correction, I was not aware of that at all. – benregn Dec 19 '11 at 14:02
  • Note: Placing the label inside of (instead of after) the caption works, too: \caption{Example caption\label{fig:sampleImage}}. – Stephen Dec 19 '11 at 21:05
  • 1
    There a long explanation of how the float algorithm works andh ow it can be influenced: http://tex.stackexchange.com/questions/39017/how-to-influence-the-position-of-float-environments-like-figure-and-table-in-lat – Frank Mittelbach Feb 29 '12 at 14:57

3 Answers3

14

No, the order of the placement options is irrelevant. Every placement option will be stored as bit in a single value, so [tb] and [bt] will give the same value and therefore will have the same result.

See What is the exact purpose of \ftype@<TYPE>? for implementation details.

9
  • if ! is given, ignore all settings by the parameters, like vertical space, number of floats, etc
  • if h is given, try to place it here, if not possible then change h to t, the float then can appear on top of the next page
  • if t is given try to place it on top of the current or next page.
  • if b is given try to place it on bottom of the current or next page.
  • if p is given place the float on the next page without additional text.
cmhughes
  • 100,947
  • 2
    The question is about if the order matters, not what the single character do. If your list is a priority order, please state so explicitly. – Martin Scharrer Dec 19 '11 at 13:17
  • 1
    Not actually addressing the question but did improve my understanding of how LaTeX treats these parameters. It's a better explanation than the table on http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions#Figures – benregn Dec 19 '11 at 14:01
4

The order of placement is irrelevant. You can try it to see for yourself.

\documentclass{octavo}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{figure}[tb]
\rule{5cm}{5cm}
\end{figure}

Another line ...
\end{document}

Changing tb or bt still results in the same output. The 'here' also is immaterial where you place it. Change [bh] and will be placed correctly as 'here'.

yannisl
  • 117,160
  • Some official reference with explanation would be much better than "you can try it yourself". – Martin Scharrer Dec 19 '11 at 12:58
  • @MartinScharrer Martin sure, but as AFAIK there is nothing other than the official source2e algorithm and is painfully long and obscure. Will try and summarize when I get some time. Anyway I thought that proving a hypothesis by experiment was an approved scientific method since the Renaissance and the example clearly demonstrates the answer to the OP's question.:) – yannisl Dec 19 '11 at 13:33
  • There is official documentation (in book form) such as the book by Leslie Lamport and TLC. That is the reference documentation. And I would think that the lshort documentation would also cover it (not checked though). And here on the site there is: http://tex.stackexchange.com/questions/39017/how-to-influence-the-position-of-float-environments-like-figure-and-table-in-lat – Frank Mittelbach Feb 29 '12 at 14:57
  • @FrankMittelbach Could you please also have a look a http://tex.stackexchange.com/questions/32359/what-is-the-exact-purpose-of-ftypetype – yannisl Feb 29 '12 at 15:07