14.2 Style Files

Style files are Emacs Lisp files which are evaluated by AUCTeX in
association with the \documentclass and \usepackage
commands of a document (see (auctex)Style Files). Support for
RefTeX in such a style file is useful when the LaTeX style
defines macros or environments connected with labels, citations, or the
index. Many style files (e.g., amsmath.el or natbib.el)
distributed with AUCTeX already support RefTeX in this
way.

Before calling a RefTeX function, the style hook should always
test for the availability of the function, so that the style file will
also work for people who do not use RefTeX.

Additions made with style files in the way described below remain local
to the current document. For example, if one package uses AMSTeX, the
style file will make RefTeX switch over to \eqref, but
this will not affect other documents.

A style hook may contain calls to
reftex-add-label-environments12 which defines additions to
reftex-label-alist. The argument taken by this function must have
the same format as reftex-label-alist. The amsmath.el
style file of AUCTeX for example contains the following:

The hook may contain a call to reftex-add-index-macros to
define additional \index-like macros. The argument must have
the same format as reftex-index-macros. It may be a symbol, to
trigger support for one of the builtin index packages. For example,
the style multind.el contains

Finally the hook may contain a call to reftex-add-section-levels
to define additional section statements. For example, the FoilTeX class
has just two headers, \foilhead and \rotatefoilhead. Here
is a style file foils.el that will inform RefTeX about these: