# [XeTeX] includegraphics and spaces in the graphic's filename path

Elliott Roper elliott at yrl.co.uk
Tue Aug 24 02:28:49 CEST 2010

Sorry for the newbie question but the few faq entries I can find don't seem to help.
I'm on OS X 6.4, editing in Aquamacs 2.1 with the XeTeX TeXing option set, I'm using MacTeXLive 2009 and mostly loving it.

I think these are the relevant excerptions from the file I'm learning with:-
\usepackage{graphicx}

\begin{figure}[htp]
\centering
\includegraphics[width=\columnwidth]{../Pictures/DJMk2/swing 3.jpg}
\caption{DJ Don't be more silly}
\end{figure}

It does not give any errors, yet prints a few lines of stuff above the correct picture "swing 3.jpg"
like 3.jpg 3.jpg.pdf 3.jpg.eps....3.bb as though it is confused about whether I asked for another file whose name starts with 3.jpg as well as the one I really wanted (and got) "swing 3.jpg".

Without the space in the file name (and the filename itself changed to "swing3.jpg") all that stuff above it goes away.

I tried untold ways of escaping the space, the whole filename, the whole pathname, mostly getting a file not found error.

I followed a faq that suggested that \XeTeXpicfile was inferior to \includegraphics after failing to find an escaping method for its very loose looking syntax and ultra-terse doco in XeTeX-notes.pdf

I found a package called grffile whose doco (item 139 in newfaq.pdf) suggested an option [space] that looked promising but I have given up trying to make it work and throw myself at your mercy.
tia
Elliott Roper