[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
\def\woozle{rat}
\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.
 (/usr/local/TeX/texmf/web2c/cp8bit.tcx)
entering extended mode
(./junk.tex
! 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