[texhax] includegraphics with spaces in the file path?

Heiko Oberdiek heiko.oberdiek at googlemail.com
Thu Dec 9 13:36:49 CET 2010

On Thu, Dec 09, 2010 at 06:33:57AM -0500, Peter Davis wrote:

> On Wed, Dec 8, 2010 at 11:54 PM, Heiko Oberdiek <
> heiko.oberdiek at googlemail.com> wrote:
> > On Wed, Dec 08, 2010 at 07:52:14PM -0500, Peter Davis wrote:
> >
> > > I've been Googling for information on how to use \includegraphics with
> > > filepaths containing spaces.  I've found some relevant discussions, such
> > as
> > > here: http://programming.itags.org/tex/131025/ but nothing that looks
> > like a
> > > robust and/or cross-platform solution.
> >
> > In case of pdfTeX in PDF: \usepackage{grffile}
> >
> > > Has there been any progress on this?
> >
> > AFAIK, no.
> >
> Thank you, Heiko.  No hope for us XeTeX users?  Hmmm.

It's more complicate, it depends on:
* Primitive support:
  * pdfTeX: \pdfximage
    file name argument as general text (curly braces).
  * XeTeX: \XeTeXpicfile, \XeTeXpdffile
    file name argument in quotes, at least it is known that
    quotes can be used because of XeTeX.
    That solves the problem for spaces, but how quotes
    can be used inside file names?
* File test for existence
  It is needed by graphics package, e.g. for finding a file
  a supported extension.
  * pdfTeX: several primitves can be used, pdftex.def uses
    \pdffilesize with file name argument as general text.
    And package `grffile' cures the problem for package graphics.
  * XeTeX: \openin with file name in quotes.
    Of course, graphics.sty does not know about quotes. 
* Driver part:
  * pdfTeX: PDF driver is part of pdfTeX, thus it's no issue here.
  * XeTeX: Seems to be supported, but I don't know a specification
    of xdv format.

Thus I see, I will update package `grffile' to support
spaces with XeTeX.

Yours sincerely
  Heiko Oberdiek

More information about the texhax mailing list