[Tex/LaTex] How to insert an image into LaTeX document


I have already included graphicx package and include

% declare the path(s) where your graphic files are
 % and their extensions so you won't have to specify these with
 % every instance of \includegraphics

In the place that I want to insert the image I use the following example.

 \caption{A picture of the same gull
       looking the other way!}

I use the "LaTeX => DVI" option.
I am a newbie to LATeX, so I do not know the difference between "LaTeX => PDF" and "LaTeX => PS => PDF"
My ultimate goal is to convert the document into a pdf file. Any help will be much appreciated.

Best Answer

Various pieces of your preamble are superfluous. Just use:


That will take care of choosing the right driver whether you're using latex (it will automatically select a driver suitable for xdvi and dvips) or pdflatex. No \ifCLASSINFOpdf is needed. Also, it sets the valid extensions automatically, so you don't have to do that either. Lastly, if you put the pdf-compatible image files and the dvi-compatible image files in the same directory, then you don't need to use the \ifCLASSINFOpdf conditional to set the right \graphicspath.

The figure code later on when you actually insert the image is completely correct. It's exactly what I use when I write.