[Tex/LaTex] Figure positions and sizing

floatsgraphicspositioningscaling

I have the following figure code :

\begin{figure}[h]
   \centering
   \includegraphics[scale=.7,bb=0 0 804 401]{f5.png}
   \caption{Case Adaptation \cite{16} }
   \label{fig:f5}
\end{figure}

Even though this figure is not at the end of the document, it is not appear as it supposed to be. Instead, it comes at the end of the document!

One more thing, why do I have to use the bb parameters for the PNG images? Is there any work around?

Best Answer

[h] in floats almost always means "take to end of document" as putting just h there stops LaTeX putting the float in any of its normal places (t p b), and typically the actual position of the float in the document is unsuitable (too close to bottom of page to fit for example).

on why you need bb (or one of the equivalent options) LaTeX needs to know how big the image is to know how much space to leave. pdftex can read the png file and get the natural size from that, but classic TeX can not read the png so needs to be told.