2

I have inserted a floating figure in my text using [htb]. A part of the text is a list, generated by itemize.

The list is, by chance, placed at the bottom of the page, and consists of three items. Two of the items are at the end of page 1. On the next page, the figure is placed at the top, followed by the last item.

Is there a way to keep the list together, without being split by the figure? I am aware of \FloatBarrier, but I don't care if the figure comes before or after the list, as long as it doesn't split it. I want the figure to float as it pleases, without splitting the list.

ROLF
  • 1,296
  • 5
  • 15
  • 22
  • why don't you allow the float on to a float page? Not allowing that makes it much harder to place the float. Probably (or at least possibly) putting \csname c@topnumber\endcsname=0 after \begin{enumerate} will work. – David Carlisle May 26 '15 at 18:59
  • You could keep the itemize together by placing it in a minipage, but that would also prevent the itemize from breaking across pages. – James May 26 '15 at 19:52
  • @DavidCarlisle: Adding \csname c@topnumber\endcsname=0 worked :). The figure floated to a new page when I added that line. – ROLF May 27 '15 at 09:41
  • @James: That could also solve the problem. I'll keep that in mind for future problems :). – ROLF May 27 '15 at 09:43
  • @DavidCarlisle: What did you mean by allowing it to float to a float page? How do I allow that? – ROLF May 27 '15 at 09:47
  • By default floating figures may be inserted on pages that just contain floats, but the main effect of your option [htb] is to disallow that (as it does not contain p) so makes it more likely that the figures can not be placed and drift to the end of the document. – David Carlisle May 27 '15 at 09:53
  • @DavidCarlisle: Until now I have preferred the floats to float between the first reference to the float and the end of the section (or possibly subsection/subsubsection). That means that it in many cases are only 1 float within that section (or subsection/subsubsection). A separate page for floats would thus contain only 1 float, which leaves the rest of the page kind of empty. I guess that's why I don't have p. Is it customary to let the figures float freely (after the first reference? I'm writing a Master's thesis ... – ROLF May 27 '15 at 09:58
  • @Rolf if you want floats after the reference you should use flafter package. Avoiding leaving pages "kind of empty" is the whole point of the float placement algorithm, a float is only placed on a float page if the that makes it easier to avoid large white space (as measured by the parameters used by the algorithm) – David Carlisle May 27 '15 at 10:01
  • @DavidCarlisle: Thanks for your replies :). I'm already using flafter. What option do you suggest? [p] only? :) – ROLF May 27 '15 at 10:12
  • no if you you use [p] then you do not allow floats at the top or bottom or middle of a text page. If you are using any option all the time, then something is wrong, you should set the default to be what you want and only use the option when you need something different. but the default default is [tbp] which is fine for most uses but if you want to allow h then [htbp] – David Carlisle May 27 '15 at 11:05

0 Answers0