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.

AFAIK a figure or table should always be placed after the first reference to it in the text.

So I always place the code for my figures and tables after the paragraph which contains the first reference \ref to them. When I then use the command \begin{figure}[t], it is possible that the figure is placed at the top of the same page where it is referenced, so IMHO that is against the rule mentioned above.

  • Is there a way to force pdflatex to place the floats after the paragraph which precedes them in the source text?
    (so in my example that would be at the top of the following page or later)
share|improve this question
add comment

2 Answers

up vote 12 down vote accepted

You could try with the flafter package:

\usepackage{flafter}
share|improve this answer
5  
+1 I was just going to give the same answer :-) Note that the flafter package will make sure that the floats are not placed before their definition, e.g. the figure or table environment, not where it was first \ref-erenced. So you need to place this environments close to the first \ref to make it work. Also check out the TeX FAQ for this. –  Martin Scharrer Apr 13 '11 at 11:48
    
Thank you, that does the trick. –  Martin Apr 13 '11 at 18:52
    
@Martin Scharrer: Thanks for your comments - mentioning the difference between the definition and the first \ref is an important point (I had already seen that problem and placed the code for the figures accordingly). Thanks again for reminding me of the TeX FAQ which contains useful information. –  Martin Apr 13 '11 at 19:00
add comment

Or you could replace the [t] option with [b] so that floats preferentially lie at the page bottom instead of the top if that's suitable to your tastes or needs.

share|improve this answer
add comment

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.