[texhax] includegraphics with spaces in the file path?

Peter Davis pfd at pfdstudio.com
Thu Dec 9 14:36:01 CET 2010


On Thu, Dec 9, 2010 at 7:36 AM, Heiko Oberdiek <
heiko.oberdiek at googlemail.com> wrote:

> 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?
>


I've tried quoting with XeTeX (Mik2.9), but no go.  I've tried both "s
around the entire file spec., and replacing the " " with "\ ".  Neither of
those approaches work.  Is there some other method of quoting?

* 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.
>

>From my (very limited) understanding, redefining the calls to \openin only
works on Windows, not Mac or Linux systems.  At least, I've read that in
some discussions.


> * 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.
>

A spec. for xdv would be very useful indeed!


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


That would be fantastic!

Thank you again, Heiko.

-pd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20101209/fedf9790/attachment.html>


More information about the texhax mailing list