Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I'm using auctex with emacs to write LaTeX documents, I would like to be able to add a couple more options to the list of environment types that auctex "recognises" and can autocomplete, namely Theorem, Lemma, Proof, itemize* and a couple of others. Which variable to I need to edit? I have played around in customize-apropos LaTeX and auctex, but I haven't found it.

(lisp code snippet to add to my .emacs would be preferred, I don't quite understand the syntax yete)

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Have a look at the AUCTeX manual that explains this in some detail. For your case and assuming you do not want to write new style files you would add this code to your ~/.emacs file.

(add-hook 'LaTeX-mode-hook
          (lambda ()
            (LaTeX-add-environments
              '("theorem" LaTeX-env-label)
              '("lemma" LaTeX-env-label)
              '("proof" LaTeX-env-label)
              '("itemize" LaTeX-env-label)
              '("a_couple_of_others" LaTeX-env-label))))
share|improve this answer

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.