In order to find files included in a document via \input
or
\include
, RefTeX searches all directories specified in the
environment variable TEXINPUTS
. Similarly, it will search the
path specified in the variables BIBINPUTS
and TEXBIB
for
BibTeX database files.
When searching, RefTeX will also expand recursive path definitions (directories ending in ‘//’ or ‘!!’). But it will only search and expand directories explicitly given in these variables. This may cause problems under the following circumstances:
There are three ways to solve this problem:
TEXINPUTS
and BIBINPUTS
, define your own
variables and configure RefTeX to use them instead:
(setq reftex-texpath-environment-variables '("MYTEXINPUTS")) (setq reftex-bibpath-environment-variables '("MYBIBINPUTS"))
(setq reftex-texpath-environment-variables '("./inp:/home/cd/tex//:/usr/local/tex//")) (setq reftex-bibpath-environment-variables '("/home/cd/tex/lit/"))
teTeX
uses the
kpathsearch
library which provides the command kpsewhich
to search for files. RefTeX can be configured to use this
program. Note that the exact syntax of the kpsewhich
command depends upon the version of that program.
(setq reftex-use-external-file-finders t) (setq reftex-external-file-finders '(("tex" . "kpsewhich -format=.tex %f") ("bib" . "kpsewhich -format=.bib %f")))
Some people like to use RefTeX with noweb files, which usually have the
extension .nw. In order to deal with such files, the new
extension must be added to the list of valid extensions in the variable
reftex-file-extensions
. When working with AUCTeX as major mode,
the new extension must also be known to AUCTeX via the variable
TeX-file-extension
. For example:
(setq reftex-file-extensions '(("nw" "tex" ".tex" ".ltx") ("bib" ".bib"))) (setq TeX-file-extensions '( "nw" "tex" "sty" "cls" "ltx" "texi" "texinfo"))