RefTeX has been bundled and pre-installed with Emacs since version 20.2. It has also been bundled and pre-installed with XEmacs 19.16–20.x. XEmacs 21.x users want to install the corresponding plug-in package which is available from the XEmacs FTP site. See the XEmacs 21.x documentation on package installation for details.
Users of earlier Emacs distributions (including Emacs 19) or people craving for new features and bugs can get a copy of the RefTeX distribution from the maintainer's web page. See Imprint, for more information. The following instructions will guide you through the process of installing such a distribution.
Note: Currently installation is supported for Emacs only. XEmacs users might want to refer to the RefTeX package available through the package system of XEmacs.
In order to install RefTeX, unpack the distribution and edit the header of the Makefile. Basically, you need to change the path specifications for Emacs Lisp files and info files. Also, enter the name of your Emacs executable (usually either ‘emacs’ or ‘xemacs’).
make make install
to compile and install the code and documentation.
Per default RefTeX is installed in its own subdirectory which might not be on your load path. In this case, add it to load path with a command like the following, replacing the sample directory with the one where RefTeX is installed in your case.
(add-to-list 'load-path "/path/to/reftex")
Put this command into your init file before other RefTeX-related settings.
If you want to get your hands dirty, there is also the possibility to install by manually copying files.
In order to make the most important functions for entering RefTeX mode available add the following line to your init file.
To turn RefTeX Mode on and off in a particular buffer, use M-x reftex-mode <RET>. To turn on RefTeX Mode for all LaTeX files, add the following lines to your .emacs file:
(add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode
To get started, read the documentation, in particular the summary. (see RefTeX in a Nutshell)
In order to produce a printed version of the documentation, use
make pdf to produce a reftex.pdf file. Analogously you can use
html targets to create DVI,
PostScript or HTML files.
RefTeX needs to access all files which are part of a multifile
document, and the BibTeX database files requested by the
\bibliography command. To find these files, RefTeX will
require a search path, i.e., a list of directories to check. Normally
this list is stored in the environment variables
BIBINPUTS which are also used by RefTeX. However, on some
systems these variables do not contain the full search path. If
RefTeX does not work for you because it cannot find some files,
See Finding Files.