# [texhax] Improved TeX error reporting - feature request

Robin Fairbairns Robin.Fairbairns at cl.cam.ac.uk
Mon May 9 21:06:41 CEST 2005

> I think the error handling in (La)TeX is not as good as it perhaps
> could be. Consider the following
>
> \begin{slide}{Introduction}
> % \end{slide}
>
> 1000 lines of code involving \begin{slide}\end{slide}
>
> In this case latex could not tell me that in fact it was the _very
> first_ slide that did not have a closure w.r.t. the environment. I do
> not know much about what's going on "under the hood", but surely
> there is some (slight) improvement to make here other than just
> "missing bracket inserted" etc (which currently gives NO indication
> to which begin{slide} it found that it could not match)...

the commonest way you discover this sort of error is from messages
like:

! LaTeX Error: \begin{foo} on input line 37 ended by \end{document}.

which is only very slightly round-about from what you might want, and
tells you exactly what you need to know.

i don't recognise the "bracket inserted" message in the context of
this particular error...

> I have talked to another PhD student and he shares my opinion, so I
> guess it's not just me! ;-)

any tex-based errors are pretty ghastly.  this is characteristic of
the age in which it was developed, and of the fiendishly feeble
machines we had to play with back then.  but they're a lot better than
the first algol 68 compiler i played with, which had a single syntax
diagnostic "not a program!".  that was 5 years or so before knuth
started work on tex.