LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Michael John Downes <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Wed, 7 Aug 2002 09:35:50 -0400
text/plain (92 lines)
Julius Smith <[log in to unmask]> writes:

> When LaTeX encounters an error, we see something like the following:
>      ! LaTeX Error: \begin{itemize} on input line 21 ended by \end{document}.
> However, I typically have many "\input" statements, so it is often annoying
> to figure out which file contains the offending line.  (In an emacs shell,
> I routinely type "\C-u\C-r([a-z]" to get back to the last opened file, but
> this is only right some of the time.)  It seems it should not be hard to
> improve the error message to say instead
>    ! LaTeX Error: \begin{itemize} on input line 21 in foo.tex ended by
> \end{document}.

You are right of course that it is a good idea. I think it was already
implemented in one of the early LaTeX 3 prototypes.

But you don't have to wait until LaTeX 3 to get that functionality.
There is a package "fink" on CTAN that tracks input file names (provided
that you use \include{filename} or \InputIfFileExists{filename}{}). And
with that, you "merely" need to redefine \begin and \@badend as shown
below. You might want to suggest to the author of the fink package that
he add this feature as an option. Failing that, write your own package
that loads the fink package and adds the rest.


What if we have a missing end-itemize?
\item First item
\item Second item
% end-itemize should have been here

Some more text after.

Just another file.


    \typeout{>> Entering "#1"}%

      \@latex@error{Environment #1 undefined}\@eha}%
  \@ignorefalse \begingroup \@endpefalse

    in file "\@beginfile"\MessageBreak
    ended by \protect\end{#1}%

\@ifundefined{everyeof}{}{% e-TeX only
  \everyeof{\typeout{>> Exiting "\finkfile"}}%


La de dah.

More text after.