It is mentioned in several places that the environment eqnarray should be avoided, e.g., this Avoid eqnarray! article.

That said, when I am using AUCTeX in emacs, if I type C-c C-e eq TAB, I would get the cycling between eqnarray, eqnarray*, equation, and equation*. How can I turn off this eqnarray related prompt since it is not recommended? Note that I have the following in my .emacs file

  (if (>= emacs-major-version 24)
  (setq completion-cycle-threshold 5))

I guess that I could dig through the .el file somewhere and comment out the related lines. On the other hand, I am hoping that this should be done by just adding a few lines in the .emacs file. Thanks in advance!


You would have to edit latex.el, but as you said, not the best choice.

Not heavily tested, but putting this into your init file should do the trick:

(defun dj/remove-eqnarray ()
  "Remove eqnarray*? from variable `LaTeX-environment-list'."
  (let ((evil-envs '("eqnarray" "eqnarray*")))
    (dolist (env evil-envs)
      (setq LaTeX-environment-list
             (car (assoc env LaTeX-environment-list))

(eval-after-load "latex"
     (add-hook 'TeX-auto-cleanup-hook #'dj/remove-eqnarray t)))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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