13

I'm using Emacs with AUCTeX to do all my LaTeX. When it comes to syntax highlighting it seems that all mathematics is by default just orange. Do you know of a mode or package that adds some more fine grained syntax highlighting? For example all commands (\foo), matching braces, sub- and superscripts, etc. should get a different color.

N.N.
  • 36,163
Somebody
  • 1,217

2 Answers2

5

I enabled brace matching within math environments with mic-paren.el, it also offers some customization, just have a look in the header of the file. Well, it doesn't provide a solution for the other syntax highlighting features you mentioned, but it's a start. I found brace matching extremely helpful already.

sebastian
  • 859
1

I have the same problem and couldn't find the proper answer. However at the moment I am using highlight-regexp in my LaTeX-mode to highlight syntax in math mode and everywhere else :). Also you could use default font-lock

(add-hook 'TeX-mode-hook
 (lambda ()
    (font-lock-add-keywords nil
        '(("\\\\alpha" 0 font-lock-warning-face t)))))

However sometimes it messes up conditional AUCTeX highlighting. For example, when I use my own defined face.

Baranas
  • 877