2

I am using the package placeins with the options section and below so the floats will appear in their sections below their section if on the same page; however, the float is appearing above its section which is on the same page. My document class is article.

enter image description here

So why aren't the floats obeying the options I have in place?

dustin
  • 18,617
  • 23
  • 99
  • 204
  • Are you using [htbp]? Add only \begin{figure}[b] – percusse Sep 08 '13 at 02:53
  • Why? Do you have two columns? – percusse Sep 08 '13 at 02:56
  • @percusse no it is just habit but it should operate the same as using just figure, correct? – dustin Sep 08 '13 at 02:57
  • I give the floor to the master http://tex.stackexchange.com/q/39017/3235 – percusse Sep 08 '13 at 02:57
  • @percusse I changed figure* to figure but the outcome is the same. – dustin Sep 08 '13 at 03:00
  • Do you have your figure code before the section command? Move it down a little if that is the case – percusse Sep 08 '13 at 03:02
  • @percusse the figure code is in the appropriate section. – dustin Sep 08 '13 at 03:04
  • Well then we hit the usual MWE discussion. – percusse Sep 08 '13 at 03:05
  • @percusse I tried to create MWE but it doesn't do what I want. – dustin Sep 08 '13 at 03:09
  • 2
    Load the package with the verbose option: \usepackage[section,below,verbose]{placeins}; the .log file will show you what happened to floats; look for information about the problematic one. – Gonzalo Medina Sep 08 '13 at 03:16
  • @GonzaloMedina there isn't anything special in the .log file. All it says is: Package placeins Info: Float barrier, from input line 560, processed on page 8, lands on page 8. – dustin Sep 08 '13 at 03:26
  • If the MWE doesn't do what you want, then the problem is in some other part of the document. You should always be able to make a MWE just start with the document that shows the problem and remove everything while still showing the problem. – David Carlisle Sep 08 '13 at 08:09
  • You probably want to use the standard flafter package to stop the float moving backwards (placeins is mainly about stopping floats moving to far forwards) but without an example, it is hard to be sure. – David Carlisle Sep 08 '13 at 09:09
  • @DavidCarlisle I can't find anything on ctan in regards to flafter package. – dustin Sep 08 '13 at 16:26
  • flafter is part of the base latex distribution, same as say article class. – David Carlisle Sep 08 '13 at 16:43
  • @DavidCarlisle how do I access documentation on it? – dustin Sep 08 '13 at 16:50
  • @dustin interesting question it is part of the latex base source, so documented in source2e, but that's not the most gentle read, there are no commands just \usepackage{flafter} and some examples here http://tex.stackexchange.com/search?q=flafter – David Carlisle Sep 08 '13 at 17:51
  • @DavidCarlisle I tried using flafter with placeins and nothing changed. I tried just using flafter and the floats were all before they were defined. – dustin Sep 08 '13 at 18:05
  • @dustin you've been on the site long enough to know the mantra: questions without a working example are not really answerable – David Carlisle Sep 08 '13 at 19:07
  • @DavidCarlisle I tried creating one by using the lipsum package to position the figures near the bottom of a page and then issuing a new \section but I couldn't re-create the problem. It is not that I didn't try. This just isn't easy for me to recreate. I wanted the figures and new section near a page break since that is where the issue cropped up but the MWE isn't doing it. – dustin Sep 08 '13 at 19:13
  • rather than lipsum which is hard to control the text length just use sometext\\[26\baselineskip]moretext\par to make something that takes the space of a 28line paragraph, then you can easily mess with the numbers to make things come near a page break. – David Carlisle Sep 08 '13 at 19:22

1 Answers1

2

With or without placeins you can prevent a float floating "backwards" to the top of the page with its definition by using

\usepackage{flafter}

which is part of the base latex distribution.

jon
  • 22,325
David Carlisle
  • 757,742