Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
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
1  
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
2  
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
add comment

2 Answers 2

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}
share|improve this answer
add comment

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}
share|improve this answer
1  
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.