Take the 2-minute tour ×
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.

As explained in this comprehensive answer on floats, the order of the [htb] parameters does not matter and if you allow all of them, LaTeX tries first to place them in the 'here' position, then top, then bottom.

I would like to change this order to here, bottom, top. Now, of course I could ban the top position outright using [hb], but that's not really what I want. I just want LaTeX to strongly prefer the bottom position to the top, just like it currently prefers top to bottom. Is there a (resonable) way to achieve that?

share|improve this question
    
could you use [hbt] ? –  Ma Ming Jun 14 at 19:56
2  
@MaMing As explained in the answer the OP linked to, the ordering of the h, b, t and p tokens is not in any way associated with the priority of the positions. –  sudosensei Jun 14 at 19:58

2 Answers 2

up vote 10 down vote accepted

well, this is actually quite hard.

latex tries top before bottom because the code does

\def \@addtotoporbot {%
   \@getfpsbit \tw@
   \ifodd \@tempcnta
     \@flsetnum \@topnum
     \ifnum \@topnum>\z@
       \@tempswafalse
       \@flcheckspace \@toproom \@toplist
       \if@tempswa
         \@bitor\@currtype{\@midlist\@botlist}%
         \if@test
         \else
          \@flupdates \@topnum \@toproom \@toplist
          \@inserttrue
         \fi
       \fi
     \fi
   \fi
   \if@insert
   \else
     \@addtobot
   \fi
}

so you could swap some lines around there to try \@botlist rather than \@toplist first but floats are numbered when encountered and LaTeX doesn't let them float out of sequence, so if you put a float in the bottom area then you'd need to close the top area otherwise the float sequence will be out of order.

So practically speaking you don't really want to change the above: preferring bottom floats is the same preferring top floats but restricting the chance of a top float occurring but either banning them, or restricting the size of the top float area with \topfraction.

To really make a usable option to prefer bottom floats you would want a mechanism where floats are numbered as they are placed rather than as they are encountered, which isn't impossible, but would require major rewrite of most of latex's float placement.

share|improve this answer

You can control the number of floats on each place using

\setcounter{topnumber}{2}
\setcounter{bottomnumber}{2}
\setcounter{totalnumber}{4}

Adjust bottomnumber greater than topnumber, for example.

share|improve this answer
1  
This isn't what the OP asked for, but it's probably the right answer:-) especially if you make \topfraction smaller than \bottomfraction as well –  David Carlisle Jun 14 at 20:14

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.