[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.1 Modes and Hooks

AUCTeX supports a wide variety of derivatives and extensions of TeX. Besides plain TeX those are LaTeX, AMS-TeX, ConTeXt, Texinfo and docTeX. For each of them there is a separate major mode in AUCTeX and each major mode runs text-mode-hook, TeX-mode-hook as well as a hook special to the mode in this order. (As an exception, Texinfo mode does not run TeX-mode-hook.) The following table provides an overview of the respective mode functions and hooks.

TypeMode functionHook
Plain TeXplain-tex-modeplain-TeX-mode-hook
LaTeXlatex-modeLaTeX-mode-hook
AMS-TeXams-tex-modeAmS-TeX-mode-hook
ConTeXtcontext-modeConTeXt-mode-hook
Texinfotexinfo-modeTexinfo-mode-hook
DocTeXdoctex-modedocTeX-mode-hook

If you need to make a customization via a hook which is only relevant for one of the modes listed above, put it into the respective mode hook, if it is relevant for any AUCTeX mode, add it to TeX-mode-hook and if it is relevant for all text modes, append it to text-mode-hook.

Other useful hooks are listed below.

Variable: TeX-after-compilation-finished-functions

Hook which is run after the TeX/LaTeX processor has successfully finished compiling your document. (See Processing, for finding out how to compile your document.) Each function in the hook is run with the compiled output document as its argument.

This is useful for automatically refreshing the viewer after re-compilation especially when using Emacs viewers such as DocView or PDF Tools. The function TeX-revert-document-buffer can be added to the hook for this purpose.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on January 17, 2024 using texi2html 1.82.