1

Well say I have a float (figure/table) - how can I make it so this float is always before a certain piece of text (and always after another).

If the float would switch to the page the next it should be before should also drop to the next page. So basically I have:

\begin{document}
....lots of text BEFORE IMAGE...

...part where image can move around inside....
\begin{figure}
\end{figure}
...lots of text after image....
\end{docuement}

The "part where image can move around inside" the image should (ideally) behave just as if it is was marked with [h]. But it most definitelly should not move after/before the boundaries. Even if that means adding white pages/not using half the page.

  • placeins package and \FloatBarrier or its [section] option to put a barrier automatically on each section – David Carlisle Sep 25 '14 at 11:21
  • @DavidCarlisle Well problem with floatbarrier seems to be that it doesn't prevent images to go "higher" (so before the text you wish it to go). Or am I mistaken? – paul23 Sep 25 '14 at 11:28
  • for that you also want flafter package (part of the base latex distrib) – David Carlisle Sep 25 '14 at 11:29
  • Compiling those in an answer would allow me to mark this question solved :P. - I take it you can use both packages at the same time (flafter as well as placeins)? – paul23 Sep 25 '14 at 19:00
2

The placeins package provides a \FloatBarrier command that automatically inserts \clearpage at points if there are pending floats. It's section option adds this automatically to every section.

To prevent floats moving to the top of the page with their callout you can use the standard flafter package which has no options or commands but just re-arranges the float placemnt algorithm so that the "top" position is only considered on later pages which means that floats only appear after their position in the source file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.