File names

Michael John Downes mjd at ams.org
Tue Dec 15 13:35:00 CET 1998


Robert Howlett <rhowlett at mail.usyd.edu.au> writes:

> My experimentation suggests that when TeX is reading a file name
> it continues on expanding things until it finds a space
> (or other thing of category 10) or an unexpandable control sequence.
> Is this right? Is it the same on all platforms?

On my system (standard Unix/web2c TeX) I ran a test file and found that:

1. <space>(10) terminates the file name.

2. <space>(12) terminates the file name.

3. _(10) does not terminate the file name.

Here _(10) means underscore character (ASCII 95), catcode 10.

Bear in mind that when you write

  \catcode`\_=10 \input foo_bar.tex

the character token that TeX actually sees after "foo" is <space>(10)
(character code 32) because TeX does that conversion automatically
during tokenization. You cannot get an _(10) token into TeX's token
stream except by \lowercase-type tricks.

Looking at tex.web I see that the function more_name is explicitly
identified as system-dependent (naturally). But it does not
necessarily follow that the way in which the name is terminated is
part of the system-dependent-ness of \input; on the contrary, it
appears that Knuth intended the statement in "The TeXbook", Chapter
24, p 278, to be definitive:

  A sequence of six or fewer ordinary letters and/or digits followed
  by a space should be a file name that works in essentially the same
  way on all installations of TeX.



More information about the pdftex mailing list