24

The document Using Imported Graphics in L A TEX and pdfL A TEX talks about the different ways to affect where a floating figure is placed [htbp]. But these arguments are optional ...

So how is the float placed if I don't enter any options? Is not entering any options equal to [htbp] or some other combination of placement demands? If so which?

David Carlisle
  • 757,742
  • 1
    @LaRiFaRi The one thing about floats that Frank's opus does not answer is the question asked here. – David Carlisle Apr 22 '14 at 09:18
  • 1
    Just a small addition. They are optional but also restrictive. Eg if you only put [bp] then you override the default and latex is only allowed to put it in bottom or new page. Took me ages to understand the difference that it's not a preference but requirement :) – Trefex Apr 22 '14 at 09:23
  • 1
    @Trefex yes which is why using [h] is such a bad idea, as it means not top, not bottom and not on a float page, which doesn't give latex many options.... – David Carlisle Apr 22 '14 at 09:29
  • @DavidCarlisle exactly, I always use [!htb] which fits my needs for most of the cases. – Trefex Apr 22 '14 at 13:00
  • @Trefex that's almost as bad:-) It's logically dubious to have a default that you don't want and then over-ride the default on every instance of a float. Better to set the defaults that you want. – David Carlisle Apr 22 '14 at 13:30
  • @DavidCarlisle that certainly makes more sense. However, sometimes one simply doesn't know where to look, or in my case, I was too lazy until now to think about it... :) – Trefex Apr 22 '14 at 13:37

1 Answers1

27

It is set in the class per float type

article.cls defines

\def\fps@figure{tbp}
\def\fps@table{tbp}

so for figures and tables the default is [tbp]


In two column mode, where figure* and table* span the columns this default is not used, and latex defines

\def\@dbflt#1{\@ifnextchar[{\@xdblfloat{#1}}{\@xdblfloat{#1}[tp]}}

so the default is tp you could redefine that to be p but simpler if you just wanted p would be to declare

\setcounter{dbltopnumber}{0}

to ban spanning top floats.

David Carlisle
  • 757,742
  • report.cls contains the same lines indicating tbp placement – SpinUp __ A Davis Aug 24 '17 at 18:19
  • @spinup yes, article report and book are all produced from the same source file (classes.dtx) – David Carlisle Aug 24 '17 at 19:08
  • What about figure* default position? The above solution does not work for figure*, at least when used, as supposed, in a two column document. See https://tex.stackexchange.com/q/544563/28685 – mmj May 17 '20 at 09:02
  • @mmj sorry wrong comment initially, latex does \def\@dbflt#1{\@ifnextchar[{\@xdblfloat{#1}}{\@xdblfloat{#1}[tp]}} so it's always tp but you could redefine that command to be just p – David Carlisle May 17 '20 at 09:25