[texhax] [NTG-pdftex] Passing Underscore

Taco Hoekwater taco at elvenkind.com
Wed Sep 20 08:16:08 CEST 2006


Hi,

Reinhard Kotucha wrote:
>>>>>>"John" == John R Culleton <john at wexfordpress.com> writes:
> 
> 
>   > Very interesting, although I usually rename all those (IMO silly)
>   > Windows type filenames with spaces in them.
> 
> I do so as well.  It's more a GUI than a Windows problem.
> 
>   > Now what about two spaces in a row? Just curious.
> 
> I tried and it seems that there is a severe bug in pdftex.

>      \input "foo    bar"

It would be a severe bug if the documentation said this would
work and it did not, but that is not the case. As it stands,
this is a documented limitation: multiple consecutive spaces
are always collapsed into one.

There is no easy way to extend pdftex, because the token
scanning routines do not know exactly when a filename is being
read. Consider, for instance, \LaTeX's \include command, that
accepts a filename as an argument, and could itself be part
of a macro expansion.

That said, pdftex *can* read files with multiple spaces in them,
if you are able to intercept the tokenizer fast enough.

either
   \catcode`\ =12\relax\input"foo    bar"\catcode`\ =10\relax
or
      {\catcode`\ =12\gdef\notaspace{ }}
      \input"a\notaspace\notaspace b"
works fine.

Cheers,

Taco






More information about the texhax mailing list