2

In my paper I have many images and many floats and thus having issues to get everything well formated. One issue is that floats tend to end up at the end of the paper. How can I encourage LaTeX to split my text and to get my float at the top or bottom of the page, instead of moving the float to the document end?

The main reason I ask is not so much that I don't like the graphic to be at the end, but that I don't like the graphic to have a whole page for itself. Having its own page for itself is wasting precious space that I don't have. I need to get text on the same page, even if it is a little (and looks ugly). Every centimetre counts.

I wish I could give a MWE, but I don't know how to do it for a so document-specific case and without releasing my document. I hope someone is able to help me anyway.

Make42
  • 1,772
  • latex will place the floats as early as possible subject to the constraints set in the documentclass and document, so if they are going to the end of the document there are constraints in code you have not shown that is preventing them being set earlier. If you give no hints then it is pretty hard to help. Perhaps you use [h] or some other highly restrictive option that gave latex no legal position to place the float. how can we guess? – David Carlisle Apr 16 '17 at 20:09
  • @DavidCarlisle: I had it being [b]. When I delete [b], the figure gets its own page - only earlier. But that is not what I was aiming for. I want it to be on a page with text - even if it is little text. Every centimetre counts. – Make42 Apr 16 '17 at 20:22
  • 1
    if you have b on all floats it's almost inevitable they all go to the end, – David Carlisle Apr 16 '17 at 20:44
  • for example article class has \bottomfraction set to .3 so at most 30% of the page is given to a bottom float so if any float is bigger than that it can not be placed anywhere, so will go to the end of the document. as floats are kept in order, all following figures will also go to the end. – David Carlisle Apr 16 '17 at 20:48
  • Take a look at: http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/squeeze.html. Resizing the image might also work. –  Apr 17 '17 at 01:58

1 Answers1

1

To fine tune your document I envision two main alternatives, the former I deem more typographical viable, in the sense that it produces often the best results, the second should be used as a last resort.

Note please try also to run more than once or twice LaTeX, in order to get a stable and viable float positioning.


Relax the positioning specification

When you create a floating environment you could specify where LaTeX has to try to place it. Usually it tries on top, or bottom of the page or on a floating page. When you specify only a subset of alternatives LaTeX only considers them.

For example declaring \begin{table}[ht] makes LaTeX consider to place the table there or on top of the page, and will discard other solutions. So you can try and mess with those options, e.g. providing tbp for some floats will maybe force some better placement. (Thanks @DavidCarlisle)

Force some positioning

No matter how you meddle, sometimes it can be necessary to lose the float environment and have the figure placed right where it is specified. This is done by removing the floating environment, but is an extreme resort that has to be used with care.

Moriambar
  • 11,466
  • any option that does not include p makes going to the end very likely. – David Carlisle Apr 16 '17 at 20:17
  • @DavidCarlisle are you saying I got it the other way around? – Moriambar Apr 16 '17 at 20:19
  • if [ht] goes to the end, the best thing to try is [htbp] (or simply no option at all) – David Carlisle Apr 16 '17 at 20:21
  • @DavidCarlisle: As mentioned, having its own page - even in the middle - is not a solution for me, because it wastes space. That is what I cannot have and the reason I asked my question in the first place. – Make42 Apr 16 '17 at 20:27
  • @Make42 you should try and mess around with the setting, maybe forcing some positions. Maybe some resizing will help too. But basically the procedure I described I think is the most that can be said with what you gave us – Moriambar Apr 16 '17 at 20:29
  • 1
    p doesn't mean that the figure is placed on its own page wasting space, perhaps latex will put 5 floats on a float page filling it completely. But it can't if it is prevented from being placed on such a page. @Make42 – David Carlisle Apr 16 '17 at 20:43