Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers 2

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.

share|improve this answer
    
Very nice addition. Just added it to my .emacs. –  jon Aug 16 '12 at 14:07
add comment

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.

share|improve this answer
    
Could you please share your highlight-regexp settings? –  Somebody Nov 28 '12 at 19:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.