# strange includegraphics behaviour Windows

i have problem including graphics in a document...i have the following structure

document.tex
tex/chap1.tex
tex/chap2.tex
img/image1.png
img/image2.png


I have traying almost anything to specify the path in the includegraphis sentence but it always pdflatex complains and not find the image. Maybe is in conflict with some other package that I put to the style file, but its really weird. I use the following to include a graphic:

\begin{figure}[H]
\centering
\includegraphics[width=8cm]{img/image1}
\caption{Arquitectura Visual Studio}
\label{IMG_VSBasicArchitecture}
\end{figure}


in the preamble i add the following:

\usepackage{graphicx}
\usepackage{float}


I compile from the document.tex directory. this file has the \input{tex/chapX.tex} sentences

-
 try to change the directory name from "tex" to "foobar" and see what happens? – xport Dec 25 '10 at 16:29

project structures:

/project/main.tex
/project/sections/section1.tex
/project/images/image1.png


main.tex contains:

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\input{sections/section1}
\end{document}


section1.tex contains:

\includegraphics{images/image1}


It must work!

Edit 1:

Make sure your file names or directory names are enclosed by a pair of " if they contains spaces. And if you use \include or \includeonly, make sure the file names or directory names containing spaces are enclosed by a pair of " AND for each space is prefixed with \space.

Example: Assume your have a directory family images and a picture holiday 2010.png inside the directory. The following example is what you have to do if you use the inclusion command. Note: it does not mean you must use all commands below :-) Just choose which command you want to use.

\input{"family images/holiday 2010"}
\include{"family\space images/holiday\space 2010"}
\includeonly{"family\space images/holiday\space 2010"}

-
 god damn it i really don't understand, i change the codification of the document.tex to iso8859-1 and now works, then i change the codification back to ANSI and also works,..., i'm really piss of with this erratic behavior, i don't change the file in any other way!!! – Ps1CsCpp Dec 25 '10 at 17:20 It is a miracle :-) Congrat! – xport Dec 25 '10 at 17:23 and i lost 3 hours trying to find a justification to something that don't have, thanks anyway guys, the thing works like before without making any latex ajust, only play with the codification was need it – Ps1CsCpp Dec 25 '10 at 17:26