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

Heiko Oberdiek heiko.oberdiek at googlemail.com
Tue Aug 24 10:31:29 CEST 2010


On Tue, Aug 24, 2010 at 09:52:13AM +0200, Ulrike Fischer wrote:

> Well the docu of grffile says that "space" works only for pdftex in
> pdf-mode. It is perhaps possible to extend grffile for xetex:
> xdvipdfmx seems to be able to use the graphic. You could ask the
> author or a comp.text.tex. 

I would be happy to improve the support for XeTeX in grffile.
However, I do not know any other driver than pdfTeX (or LuaTeX)
that provide a safe file existence check. In case of pdfTeX
package grffile uses \pdffilesize, the file name argument
is <general text> as \pdfximage uses.

Some TeX ports support double quotes, but
* a simple reliable test is missing whether this feature is supported,
* a specification of the quoting rules is missing,
* it makes the problem worse, now also quotes can't be used
  in file names, although most file systems and OPs allow them.
* ...

> But my advice is: Avoid spaces.

Agreed.

> Nowadays spaces in file names are
> not a problem in the majority of cases. But you can waste a lot of
> time to find out how to escape them, to quote them or to get around
> problems in the few cases (like this here) were it doesn't work as
> expected. Rename your graphic to swing_3.jpg and go on with your
> work. 

However it would be nice, if the file name problem could
be solved in a clean way.

Yours sincerely
  Heiko Oberdiek


More information about the XeTeX mailing list