auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] Fontifying commands in math


From: Tassilo Horn
Subject: Re: [AUCTeX] Fontifying commands in math
Date: Wed, 19 Dec 2012 21:19:02 +0100
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux)

Uday S Reddy <address@hidden> writes:

Hi Uday,

> I am wondering if there is a way to get AucTeX to fontify the LaTeX
> commands inside the math.  Right now, I get everything inside math in
> one uniform color.

Well, currently there a functions `font-latex-match-math-env' and
`font-latex-match-math-envII' that are used by font-lock for fontifying
every math content in math environments in `font-latex-math-face', and
also a math-command class in `font-latex-built-in-keyword-classes' for
fontifying math content in macros such as \ensuremath{\frac{1}{2}} [uh,
the latter doesn't seem to work for me now...].

So basically with

  (defun font-latex-match-math-env (limit)
    nil)

you'd omit math-face fontification of \[ ... \] and \( ... \), and with

  (defun font-latex-match-math-envII (limit)
    nil)

you'd omit the math-face fontification for math environments like
eqnarray etc (see `font-latex-math-environments').  Then the macros in
\[ ... \] and the environments are fontified with the usual macro face.

However, $$ ... $$ is hard-coded, but you can remove its matcher using
`font-lock-remove-keywords' if you like.

Bye,
Tassilo




reply via email to

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