Skip to content

Instantly share code, notes, and snippets.

Created September 5, 2011 19:34
Show Gist options
  • Save anonymous/1195737 to your computer and use it in GitHub Desktop.
Save anonymous/1195737 to your computer and use it in GitHub Desktop.
Enabling math specific syntax highlighting/prettifying in auctex
;; Code from Phil Hirschhorn's suggestion
(add-hook 'LaTeX-mode-hook 'add-my-latex-environments)
(defun add-my-latex-environments ()
(LaTeX-add-environments
'("dmath" LaTeX-env-label)))
;; Code I added to make syntax highlighting work in Auctex
(custom-set-variables
'(font-latex-math-environments (quote
("display" "displaymath" "equation" "eqnarray" "gather" "multline"
"align" "alignat" "xalignat" "dmath")))
'(TeX-insert-braces nil)) ;;Stops putting {} on argumentless commands to "save" whitespace
;; Additionally, reftex code to recognize this environment as an equation
(setq reftex-label-alist
'(("dmath" ?e nil nil t)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment