# [texworks] technical problem involving \include, \includegraphics \graphicspath and grffile package

Mehdi Ranjbaran ranjbrans at yahoo.com
Sat Apr 16 17:25:12 CEST 2011

Hello,
I have a couple of difficulties with my Latex document which I hope you can resolve. I have a main file in which a chap2.tex is included:
\include{chap2}
In chap2.tex I include a graphic file fig1.pdf using \includegraphics within the figure environment. The graphic file is in a directory other than the current directory in which main.tex is. The path to the directory contains, however, space characters and that's the source of my problems. I use grffile package together with \graphicspath:
\usepackage[space]{grffile}
\graphicspath{../../My Graphic Files/}
but get the error message:"! Package pdftex.def Error: File `fig1.pdf' not found.

See the pdftex.def package documentation for explanation.
Type  H <return>  for immediate help.
...

l.20 ...udegraphics{fig1.pdf}

?"
However, when I don't use \graphicspath and include the full path of the graphic file in \includegraphics I have no difficulty and the final .pdf file is produced:
\includegraphics{../../My Graphic Files/fig1.pdf}
Do you know how I can get rid of this pesky error? I don't want to write the full path every time I use \includegraphics.
Thank you.

----- configuration info
-----

TeXworks version : 0.4.0r759
(MiKTeX 2.9)

Install location : C:/Program
Files (x86)/MiKTeX 2.9/miktex/bin/texworks.exe

Library
path     :
C:/Users/mehdi/AppData/Local/MiKTeX/2.9/TeXworks/0.4\

pdfTeX location  :
C:/Program Files (x86)/MiKTeX 2.9/miktex/bin/pdftex.exe

Operating system : Windows
Microsoft Windows Vista Home Basic Edition, 64-bit Service Pack 2 (build 6002)

Qt4
version      : 4.7.2 (build) / 4.7.2 (runtime)

------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texworks/attachments/20110416/356c5e1f/attachment-0001.html>