help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Howto disable syntax-highlighting for '$'-enclosed math?


From: Thamer Mahmoud
Subject: Re: Howto disable syntax-highlighting for '$'-enclosed math?
Date: Mon, 22 Mar 2010 16:09:39 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Stefan Klinger <all-lists@stefan-klinger.de> writes:

> Hello,
>
> I need to disable the syntax-highlighting for '$'-enclosed math in LaTeX
> mode.
[...]
> Emacs always displays text following a '$' in green until another '$'
> occurs. This is annoying, and basically wrong because I never entered math
> mode.

I think you're better of using AUCTeX, which has built-in support for
syntax-highlighting in listings environment (and many other features).

Get it from here:
http://www.gnu.org/software/auctex/

As for vanilla tex-mode, this should partially work (it works for the
text after the `$', but not the `$' itself):

(font-lock-remove-keywords nil ''("\\$\\$\\([^$]+\\)\\$\\$" 1 tex-math-face))
(font-lock-remove-keywords nil ''("\\$\\$\\([^$]+\\)\\$\\$" (1 tex-math-face)))

I got this information by looking at the value of `font-lock-keywords'
(using C-h v). Also see the documentation of `font-lock-remove-keywords'
(using C-h f) for other options.

hth,
Thamer





reply via email to

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