I have some code for a picture that looks like this:
...Text before pic...
\begin{figure}[h!]
\caption{caption stuff}
\centering
\includegraphics{somegraph.png}
\end{figure}
... Text after pic...\\
\part{New Part}
However, LaTeX seems to be doing some weird positioning stuff, since what happens is this:
...Text before pic...
... Text after pic...
pic
New Part
Whereas what I want is this
...Text before pic...
pic
... Text after pic...
New Part
I can achieve what I want with only a \includegraphics{somegraph.png}, but I would like the captioning too, and the ability of LaTeX to automatically number figures for me. I tried isolating the problem, but the figure just keeps jumping around and eventually lands in the right place. h! worked before for a previous figure, but no longer... What should I be doing here?
Hspecifier from thefloatpackage, or you could use the\captionofmacro from thecapt-ofpackage. – TH. Apr 03 '11 at 08:47figureto float without anything extra. Stefan's answer comes very close, but doesn't provide the solution in-text but only as external link. – Martin Scharrer Apr 03 '11 at 09:19