With help from the question How to add custom math-environments I taught AUCTeX that
IEEEeqnarray and its starred counterpart are math environments. I added the following to my
;; teach auctex IEEEeqnarray (add-hook 'LaTeX-mode-hook 'add-my-latex-environments) (defun add-my-latex-environments () (LaTeX-add-environments '("IEEEeqnarray" LaTeX-env-label) '("IEEEeqnarray*" LaTeX-env-label)))
custom-set-variables section I added
(custom-set-variables '(font-latex-math-environments (quote ("display" "displaymath" "equation" "eqnarray" "gather" "multline" "align" "alignat" "xalignat" "IEEEeqnarray" "IEEEeqnarray*")))
And finally made reftex aware of it
;; Additionally, reftex code to recognize this environment as an equation (setq reftex-label-alist '(("IEEEeqnarray" ?e nil nil t) ("IEEEeqnarray*" ?e nil nil t)))
There's some more emacs customisation stuff found at How to Typeset Equations in LaTeX
Now my question is:
How can I teach AUCTeX that it should also auto-expand the sub- and superscripts in these custom environments?
At the beginning of my
.emacs I set
(setq TeX-electric-sub-and-superscript t) ; auto-expand sub- and superscript
But even though I integrated the
IEEEeqnarray environments into AUCTeX with the above customisations, it doesn't auto-expand the
^ symbols in these environments, as it does in, e.g.
eqnarray. I love this functionality, and need it in my custom math environments as well.