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?

6
  • 1
    @LaRiFaRi The one thing about floats that Frank's opus does not answer is the question asked here. Apr 22, 2014 at 9: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, 2014 at 9: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.... Apr 22, 2014 at 9:29
  • @DavidCarlisle exactly, I always use [!htb] which fits my needs for most of the cases.
    – Trefex
    Apr 22, 2014 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. Apr 22, 2014 at 13:30

1 Answer 1

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.

4
  • report.cls contains the same lines indicating tbp placement Aug 24, 2017 at 18:19
  • @spinup yes, article report and book are all produced from the same source file (classes.dtx) Aug 24, 2017 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 tex.stackexchange.com/q/544563/28685
    – mmj
    May 17, 2020 at 9: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 May 17, 2020 at 9:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .