Return-Path: <Timothy_Freeman@U.ERGO.CS.CMU.EDU>
Received: from U.ERGO.CS.CMU.EDU by K.GP.CS.CMU.EDU id aa28758;
          8 May 93 17:33:13 EDT
Received: from U.ERGO.CS.CMU.EDU by U.ERGO.CS.CMU.EDU id aa19777;
          8 May 93 17:32:43 EDT
To: bovik@U.ERGO.CS.CMU.EDU
Reply-to: Tim Freeman <tsf@cs.cmu.edu>
Subject: Detecting \begin{foo} with \end{bar} in latex
Date: Sat, 08 May 93 17:32:40 -0400
Message-ID: <19775.736896760@U.ERGO.CS.CMU.EDU>
From: Timothy_Freeman@U.ERGO.CS.CMU.EDU

In article <C5FFz9.J71.1@cs.cmu.edu> tsf@CS.CMU.EDU (Timothy Freeman) writes:

   Does anyone have pointers to a latex package that will warn me when I
   have a \begin{foo} matched by a \end{bar}?

Here are the responses I got.  I decided to use the
TeX-close-LaTeX-block command in tex-mode.el.  You give this command
immediately after typing the \begin{foo} command; it inserts the
\end{foo} command.  Then you type the body of the foo environment
between them.  I'll forward this message to Bovik.

From: Olin Shivers <shivers@FORTRAN.FOX.CS.CMU.EDU>
Subject: latex

My cmulatex package has a add-matching-\end{...} command on C-space,
and a latex-validate command that checks for errors of this sort.

I would imagine the super-hairy auxtex package has similar functionality.
	-Olin

From: nesmith@CTPS.TPS.CS.CMU.EDU
Subject: Re: Detecting \begin{foo} with \end{bar} in latex

There's a program called lacheck which does this kind of checking.  
You should be able to find it through archie.  Here's what it says
given the example:
----
\begin{foo}
\begin{itemize}

\item foo

\end{itemize}

\end{bar}
-----

nesmith> lacheck foo.tex
"foo.tex", line 12: <- unmatched "\end{bar}"
"foo.tex", line 5: -> unmatched "\begin{foo}"

Dan

From: Eliot Moss <moss@FORTRAN.FOX.CS.CMU.EDU>
Subject: Detecting \begin{foo} with \end{bar} in latex


Most people avoid this by using commands in latex-mode that insert both the
\begin and \end stuff at once, making it hard to come out unbracketed. Given
the existence of what I describe, and the moderate hairiness of what you asked
for, I doubt what you asked is implemented ....			EM


