[tex-live] \scantokens and --file-line-error

David Kastrup dak at gnu.org
Thu Aug 19 01:29:41 CEST 2004

karl at freefriends.org (Karl Berry) writes:

> Hi Olaf (I guess this one is for you),
> The \scantokens etex construct and --file-line-error option apparently
> interact in strange ways.
> Second, and more important, if \scantokens is erroneously used from
> within a file, the error refers to the line number within the scantokens
> rather than the line number of the containing file.  Create a file
> junk.tex containing, say, two blank lines and \scantokens{\junky}:
>   echo >junk.tex
>   echo >>junk.tex
>   echo '\scantokens{\junky}' >>junk.tex
> Then:
>   etex --file-line-error junk.tex
> Output:
>   ???:1: Undefined control sequence.
> I think that should be "junk.tex:3", not "???:1".

Unfortunately not, since the error context is from within the
scantokens, not from the file itself.  For example, if I do
\scantokens\expandafter{\woozle \junky}
then I will get

Running `TeX' on `junk' with ``etex  "\input junk.tex"''

This is e-TeXk, Version 3.141592-2.1 (Web2C 7.5.2)
 %&-line parsing enabled.
entering extended mode
! Undefined control sequence.
l.1 rat\junky
l.2 \scantokens\expandafter{\woozle \junky}

Actually, this is about the most unpleasant error message combination
I can imagine.  It will throw AUCTeX completely off the track.

David Kastrup, Kriemhildstr. 15, 44793 Bochum

More information about the tex-live mailing list