bug-auctex
[Top][All Lists]

## Re: [Bug-AUCTeX] 2008-02-02; Highlighting verbatim environments gets con

 From: Ralf Angeli Subject: Re: [Bug-AUCTeX] 2008-02-02; Highlighting verbatim environments gets confused Date: Sun, 03 Feb 2008 18:36:58 +0100

* Uwe Siart (2008-02-02) writes:

> \usepackage{alltt}
> \newenvironment{Enter}{\begin{alltt}}{\end{alltt}}
[...]
> I found that the problem is provoked through the use of 'alltt'.
> Admittedly, this is a very nasty arrangement. However, in AUCTeX
> 2007-01-23 it is handled correctly.

In April there was a problem report that stuff like
{\small\begin{verbatim}
foo
\end{verbatim}}
is not fontified as verbatim because the \begin statement was only found
when preceded by whitespace or nothing.  This requirement for \begin was
relaxed after the report, however, the same requirement is still in
place for the \end statement.  (If you write something in the same line
before the \end, a spurious newline is inserted in the typeset output.)
So in your case the \begin{alltt} is found, but not the \end{alltt}.

So there are two ways of solving this (apart from you changing your
LaTeX file):

1) Relax the requirement for the \end statement and find such statements
without looking at text in the same line preceding it.

2) Revert the change made in April, i.e. find the \begin statement only
if it is only preceded by whitespace or nothing.

I currently tend to do the latter because it would be the safer, more
conservative option.

--
Ralf