[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: tex-mode: too many _ (underscores) interpreted as su

From: Ralf Angeli
Subject: Re: address@hidden: tex-mode: too many _ (underscores) interpreted as subscripts]
Date: Sun, 03 Oct 2004 15:52:48 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

* Richard Stallman (2004-10-03) writes:

> Would someone please investigate this bug report and DTRT?
> Stefan made these changes, but he hasn't responded to
> my mail about this, so I think it is time to look
> for someone else.
> From: Christian Schlauer <address@hidden>
> Subject: tex-mode: too many _  (underscores) interpreted as subscripts
> To: address@hidden
> Date: Fri, 30 Jul 2004 15:21:23 +0200
> The News file of CVS Emacs announces the following for TeX mode:
> *** verbatim environments are now highlighted in courier by font-lock
> and super/sub-scripts are made into super/sub-scripts.
> At the moment, it considers too many underscores as subscript
> commands. While it leaves \cite{blah99:_long_title} and
> \verb+file_name+ alone, it displays the commands
> \nolinkurl{file_name_with_underscore.txt} and
> \url{file_name_with_underscore.txt} (both available with the hyperref
> package, the last one also with url.sty) wrong, that is, the first
> letter after an underscore in these commands is transformed into a
> subscript.

Inhibiting the subscript and superscript fontification is achieved by
checking if certain faces are present.  So a quick fix, only covering
\nolinkurl and \url, would be to add these commands e.g. to the
`citations' keywords in `tex-font-lock-keywords-2'.

If this should be fixed for arbitrary LaTeX commands which are not
fontified, one would have to check if the underscores in concern are
located inside of math environments.  In AUCTeX we are using
texmathp.el (which is distributed with AUCTeX) for these purposes.
But calls to `texmathp' can get very expensive especially in larger
LaTeX files.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]