[tex-k] Bug in TeX (or LaTeX)

Robin Fairbairns Robin.Fairbairns at cl.cam.ac.uk
Sat Feb 19 20:40:57 CET 2005

> I am using LaTeX.  When I type `latex', it displays the 
> normal `This is TeX' banner.  If I type \end at the prompt, 
> it just displays `LaTeX2e <1998/06/01>'.  If I type \end 
> agian, it exits, but in a rude way:
> (latex)
> This is TeX, version 3.14159 (Web2C 7.5.3) 
> **\end

[first \end command]

> LaTeX2e <1998/06/01>
> *\end

[second \end command]

> ! TeX capacity exceeded, sorry [parameter stack size=600].
> \end#1->
>         \csname end#1\endcsname \@checkend #1\expandafter \endgroup \if at e...
> <*> \end

you've written the equivalent of \end{\end} which is plainly nonsense
(in latex).

now, if this particular insanity were common, it might be worth while
latex actually detecting it and producing an error other than the
baseline tex error.  tex has no exception mechanism, so any error
detection has to happen in the main loop.  given the nature of the tex
language such code is clunky and potentially slow.  you just don't
want to clutter up such frequently-used code with such stuff.

> It dosen't happen with plain TeX:
> (tex)
> This is TeX, version 3.14159 (Web2C 7.5.3)
> *\end
> No pages of output.
> Transcript written to texput.log.

but \end in tex doesn't take an argument, and has a completely
different meaning.

> But strangely, with the LaTeX executable running plain, the 
> same thing happens, but it displays the message more than 
> once.

i'm not sure i understand what you mean here.  latex "executables" are
typically merely some virtex-equivalent which is programmed to run the
format corresponding to the link's name.  plain (which is the source
for a format) won't read into an executable that's already got a
format loaded.

More information about the tex-k mailing list