reftex: Multifile Documents
10 Multifile Documents
**********************
The following is relevant when working with documents spread over many
files:
• RefTeX has full support for multifile documents. You can edit
parts of several (multifile) documents at the same time without
conflicts. RefTeX provides functions to run ‘grep’, ‘search’ and
‘query-replace’ on all files which are part of a multifile
document.
• All files belonging to a multifile document should define a File
Variable (‘TeX-master’ for AUCTeX or ‘tex-main-file’ for the
standard Emacs LaTeX mode) containing the name of the master file.
For example, to set the file variable ‘TeX-master’, include
something like the following at the end of each TeX file:
%%% Local Variables: ***
%%% mode:latex ***
%%% TeX-master: "thesis.tex" ***
%%% End: ***
AUCTeX with the setting
(setq-default TeX-master nil)
will actually ask you for each new file about the master file and
insert this comment automatically. For more details see the
documentation of the AUCTeX (
(auctex)Multifile), the
Print::) and the Emacs documentation on File Variables (
(emacs)File Variables).
• The context of a label definition must be found in the same file as
the label itself in order to be processed correctly by RefTeX. The
only exception is that section labels referring to a section
statement outside the current file can still use that section title
as context.
• RefTeX knows about the ‘\include’ and ‘\input’ macros. In case you
use different commands to include files in a multifile document,
customize the variable ‘reftex-include-file-commands’.