[Tex/LaTex] Figures overlapping text above it

floatspositioning

I am writing a two column technical paper and have a number of figures. The figures are included in the following way:

\begin{figure}
  \includegraphics[bb=0 0 160 160,scale=0.5]{figures/chap6_conflictpercentage_5000.jpg}
  \caption{Percentage Of Transactions Conflicting In Each Set Of Workload}
  \label{graph1}
\end{figure}

I am using Miktex and Winedit for editing the tex file.

In the output the figures overlap the text above it. How do I prevent that?

Best Answer

If TeX knows the correct size of the figure it will reserve the right amount of space and you will not see an overlap with text. Thus, if this happens then the amount of space that is reserved is smaller than the actual priniting space of the figure. This can happen

  • if you explicitly set a bounding box that is not fitting the picture size
  • if the bounding box is explicitly calculated from the graphics and for some reason that value is wrong (some graphcis programs record wrong bounding box parameters inside the picture)

As you explicitly give a bb= setting and the problem doesn't appear if you don't do this you are in the first case and your setting is simply wrong. But the question is why do you specify it in the first place. Normally you don't need (nor should) set this if you want to place the full picture and the bounding box of that picture is correct.

If your intention is to clip the picture so that only parts of it are shown then you need to additionally use the parameter clip in which case you bb= values are used to define the part that is shown.