This is part of the Emacs Starter Kit.
Support for editing LatexIn order to use AUCTeX the following software is required in addition:
A popular TEX system is TEX Live which may also be available via the package system of your operating system distribution.
A popular TEX system for Mac OS X is MacTEX which is based on TEX Live.
This is needed for operation of preview-latex in both DVI and PDF mode. Most versions of Ghostscript nowadays in use should work fine (version 7.0 and newer).
(starter-kit-install-if-needed 'auctex)
(when (locate-library "auctex")
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(add-hook 'LaTeX-mode-hook 'auto-fill-mode)
(add-hook 'LaTeX-mode-hook 'visual-line-mode)
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq reftex-plug-into-AUCTeX t)
)