[tex-k] About spaces in file names

Olaf Weber olaf at infovore.xs4all.nl
Fri Apr 22 17:41:07 CEST 2005

Heiko Oberdiek writes:

> Afaik Olaf did somethink regarding TeX. Spaces are supported by
> using quotes. However, the problem are now the quotes :-(

> Therefore I would appreciate an interface with explicit curly
> braces with catcodes 1 and 2, so that all bytes (0-255) can
> be expressed inside (example, see below).

Right now, if you use (plain) TeX and do


the file being looked for will be "{story}.tex"; do

 \input{sto ry}

and TeX will look for "{sto.tex".  It would be possible to get TeX to
interpret these braces.

For LaTeX's |\input| macro I presume you'd not want to add the braces

 \input{{sto ry}}

and instead use

 \input{sto ry}

Doing this without getting LaTeX to add additional braces before
feeding the filename to the |\input| or |\openin| primitive turns out
to be hard: the filename scanner is not in a good position to tell
whether it is scanning normal text (where it would interpret braces
and in their absence stop at the first space) or (say) a macro
argument (where might want to scan to the end of the argument even in
the presence of spaces); cases like \input #1.sty turn out to be
"interesting" to handle.  When I last looked at this I couldn't get
this completely right, so fell back on the rather primitive hack we
have today.

Olaf Weber

               (This space left blank for technical reasons.)

More information about the tex-k mailing list