# text over figure in latex

I just need to insert a figure in the latex document I am writing -nothing big.Problem is the text keeps floating over the figure and the figure is not centered.Here is my code

\begin{figure}[h!]
\begin{center}
\resizebox{20pt}{!}{\includegraphics{FigureStereo.jpg}}
\caption{Epipolar Geometry}
\label{fig:cclogo}
\end{center}
\end{figure}

-
In standard LaTeX this is usually caused by a wrong %BoundingBox in the (e)ps file included, but since you are using pdflatex w/ a JPG file this should not happen. –  Marco Lombardi Jun 1 '11 at 22:17
I don't quite understand. Do you mean that the text is put on top of the image? Please add a minimal working example (MWE) that illustrates your problem. –  Caramdir Jun 1 '11 at 22:52
Use \centering instead of the center environment. The \resizebox{20pt}{!}{\includegraphics{FigureStereo.jpg}} can also be written as \includegraphics[width=20pt]{FigureStereo.jpg}. –  Martin Scharrer Jun 2 '11 at 9:50

Your image might have the wrong bounding box information stored which makes LaTeX think it is smaller than it is. You could test it by using \frame{\includegraphics[width=20pt]{FigureStereo.jpg}} and see where the frame is drawn. Maybe opening the image in an image editor and saving it again will fix it.

If a wrong height is used you could add some vertical space to compensate for that. You need to try which amount is right:

\begin{figure}[h!]
\centering
\vspace{20pt}%
\includegraphics[width=20pt]{FigureStereo.jpg}
\caption{Epipolar Geometry}
\label{fig:cclogo}
\end{figure}

-

Have you tried putting the graphic in a tabular environment, inside the figure?

\begin{figure}
\begin{tabular}{c}
\includegraphics[width=20pt]{FigureStereo.jpg}
\end{tabular}
\caption{Epipolar Geometry}
\label{fig:cclogo}
\end{figure}

-
and why should a tabular here make sense? –  Herbert Jul 15 '11 at 21:13
Don't know, the poster never responded if it helped or not. –  Justin Bailey Jul 15 '11 at 22:55