Usually figures are placed where there is enough space, e.g. for begin{figure}[ht]
at the beginning of the next page. Sometimes, some or all figures are placed at the end of the document. What if you want to place the figure within your text, because you have other figures which you do not want to place only at the beginning of the second next page…
There is a little trick, which helps to place figures where you want them. Use an exclamation mark after h:
\begin{figure}[h!b] ... \end{figure}
When there is enough space on that page, by relaxing some constraints.
Try [H] for if [h!] didn’t help:
\begin{figure}[Hb] ... \end{figure}
If you have a really big figure, try reducing its size if possible.
The exclamation mark, [h!] and [H] give you more control on figures placement in the text.
It works the same way for tables.
caela
🙂 thank you that just helped me!
Pandammonium: blogs [pandammonia]
[…] This is exactly what I wanted to find yesterday. Why didn’t Google find it for me then? I happened across it when looking at this post on side-by-side tables. […]
Saif
Thanks man. I really needed it and it worked for me.
Rob
Thank you for this hint i.e \begin{figure}[h!t].
I had been searching the web for ages for how to put two figures on one page straight after a Section heading, with no text on the page. The second figure kept on being pushed to the next page.
But using your trick, I used [htp] on the first figure, and [h!btp] on the second figure – and it worked!!!
I haven’t seen a reference to the ! in this context before.
Thanks again.