[OS X TeX] Filenames for \includegraphics

Morten Høgholm morten.hoegholm at gmail.com
Thu Jul 13 20:57:48 CEST 2006


On Thu, 13 Jul 2006 20:03:59 +0200, Gary L. Gray <gray at engr.psu.edu> wrote:

Hi all,

> I don't know about getting TeX to see them (this is probably more of a  
> TeX thing rather than a TeXShop thing), but there are some nice apps  
> that allow you to batch rename files. For example, you might look at:

Yes, decidedly a TeX thing. These days all the major ditributions support  
the quoted "file with spaces" syntax for \input which also applies to  
\openout and other primitives dealing with the actual file name.

Since the graphic(s|x) package was written before this happened it of  
course lacks support for it. In order for it to work one has to cater for  
this on a per system basis and that is somewhat difficult. No matter what  
it will require a good deal of work to make it work as expected.

Above all it is important to understand that even though  
\includegraphics{"file with space"} might work, \includegraphics{"file  
with space.eps"} will not so this is not really a reliable method. As it  
is now renaming the files to not include spaces is the best solution (or  
least bad depending on your point of view - I'm a glass-half-full kinda  
guy ;-)

      *  *  *  *  *

Now for a glimpse of the not too distant future...

I think for our work in LaTeX3 we will make sure that all file inputs are  
given in braces. It may be forced by doing something like this: (see  
current xparse for details).

   \DeclareArgumentType n\c_group_begin_token{catcode}{}{\NoValue}{#1#2}{#2}

Declares the argument type "n" to be an optional argument where it is  
delimited by a token which has catcode equal to \c_group_begin_token  
(\bgroup in 2e). If no such token is found it puts the special marker  
\NoValue instead.

Then the document command can be something like this:
   \DeclareDocumentCommand\InputFile {n}{
     \IfValueTF{#1}{\file_input:n{#1}}{
       \ERROR % some mumbo jumbo about always using {}
     }
   }

And of course there is \file_input:n which is just defined as
   \def:Npn \file_input:n #1{\tex_input:D "#1"}

All of this is available from the LaTeX Project website.

Cheers,
-- 
Morten
------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list