views:

42

answers:

2

Hello,

I wanna insert a .jpg image(that is in my current folder, where the .tex file is) after a paragraph. How can i do it in Latex? What should i include / what commands should i use?

Thanks

+2  A: 

You need to use a graphics library. Put this in your preamble:

\usepackage{graphicx}

You can then add images like this:

\begin{figure}[ht!]
\centering
\includegraphics[width=90mm]{fixed_dome1.jpg}
\caption{A simple caption}
\label{overflow}
\end{figure}

This is the basic template I use in my documents. The position and size should be tweaked for your needs. Refer to the guide below for more information on what parameters to use in \figure and \includegraphics. You can then refer to the image in your text using the label you gave in the figure:

And here we see figure \ref{overflow}.

Read this guide here for a more detailed instruction: http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions

Jonno_FTW
The image it's displayed OK, the caption also, but at the compile time i got the error '\caption outside float'
qwerty
You don't really need to worry about these errors that much. You can also place the label inside the caption, like so: `\caption{caption \label{overflow}`
Jonno_FTW
OK, but what's wrong then, so that i got that error?
qwerty
Could you be using `\caption` after `\end{figure}`, i.e. outside the float?
Aniko
No, i'm using: \begin{figure}[ht!]\centering\includegraphics[width=100mm]{fig1.jpg}\caption{My caption....}\label{Fig.1}\end{figure}
qwerty
A: 

Regarding your error, are you sure you don't have any tabular object with a caption as well? This can cause this kind of error. Check this: Caption outside Table?

Richard
No, i don't have any tabular object
qwerty
@qwerty: does the error say the line number of the problem?
Vivi