This is ../info/reftex.info, produced by makeinfo version 4.6 from
reftex.texi.

   This file documents RefTeX, a package to do labels, references and
citations for LaTeX documents with Emacs.

   This is edition 1.17 of the RefTeX User Manual for RefTeX 3.17

   Copyright (c) 1997, 1998 Carsten Dominik <dominik@strw.LeidenUniv.nl>


File: reftex.info,  Node: Top,  Up: (dir)

   RefTeX is a package for managing Labels, References and Citations
with GNU Emacs.

   Don't be discouraged by the size of this manual, which covers RefTeX
in great depth.  All you need to know to use RefTeX can be summarized
on a single page (*note RefTeX in a Nutshell::).  You can go back later
to other parts of this document when needed.

* Menu:

* Introduction::                     Quick-Start information.

* Labels and References::            Creating and referencing labels.
* Citations::                        Creating Citations.
* Table of Contents::                A Tool to move around quickly.

* Keybindings::                      The default keybindings.
* Social Matters::                   Cooperation with other Emacs packages.
* Multifile Documents::              Document spread over many files.
* Optimizations::                    When RefTeX is too slow.
* Problems and Work-Arounds::        First Aid.
* Imprint::                          Author, Web-site, Thanks

* Commands::                         Which are the available commands.
* Options::                          How to extend and configure RefTeX.
* Keymaps::                          Where to put new key bindings.
* Hooks::                            Available hooks for customization.

The Index

* Index::                            The full index.

 --- The Detailed Node Listing ---

Introduction

* Installation::                     How to install and activate RefTeX.
* RefTeX in a Nutshell::             A brief summary and quick guide.

Labels and References

* Creating Labels::
* Referencing Labels::
* Builtin Label Environments::       The environments RefTeX knows about.
* Defining Label Environments::        ... and environments it doesn't.
* Displaying Cross References::      View the label corresponding to a \ref.
* xr (LaTeX package)::               References to external documents.
* varioref (LaTeX package)::         How to create \vref instead of \ref.

Defining Label Environments

* Theorem and Axiom::                Defined with `\newenvironment'.
* Quick Equation::                   When a macro sets the label type.
* Figure Wrapper::                   When a macro argument is a label.
* Adding Magic Words::               Other words for other languages.
* Using \eqref::                     How to switch to this AMS-LaTeX macro.
* Putting it Together::              How to combine many entries.

Citations

* Creating Citations::               How to create them.
* Citation Styles::                  Harvard, Chicago, Natbib and CO.
* Displaying Citations::             View the corresponding database entry.
* Chapterbib and Bibunits::          Multiple bibliographies in a Document.
* Citations Outside LaTeX::          How to make citations in Emails etc.

Social Matters

* AUCTeX::                           The ultimate TeX/LaTeX mode for GNU Emacs.
* Bib-Cite::                         Another package dealing with Citations.

Options, Keymaps, Hooks

* Options (Defining Label Environments)::
* Options (Creating Labels)::
* Options (Referencing Labels)::
* Options (Creating Citations)::
* Options (Table of Contents)::
* Options (Optimizations)::
* Options (Misc)::


File: reftex.info,  Node: Introduction,  Next: Labels and References,  Up: Top

Introduction
************

RefTeX is a specialized package for support of labels, references, and
citations in LaTeX.  RefTeX wraps itself round 3 LaTeX macros:
`\label', `\ref', and `\cite'.  Using these macros usually requires
looking up different parts of the document and searching through BibTeX
database files.  RefTeX automates these time-consuming tasks almost
entirely.  It also provides functions to display the structure of a
document and to move around in this structure quickly.

* Menu:

* Installation::                     How to install and activate RefTeX.
* RefTeX in a Nutshell::             A brief summary and quick guide.


File: reftex.info,  Node: Installation,  Next: RefTeX in a Nutshell,  Up: Introduction

Installation
============

If you are using Emacs 20.2 and later or XEmacs 19.16 or 20.2 and
later, RefTeX is installed already.

   You may also have retrieved your own copy of the RefTeX
distribution, because you use an older version of Emacs, or because new
features have been added to RefTeX in the mean time (*note Imprint::
for information on how to obtain the RefTeX distribution).  In order to
install, the following steps are necessary.

  1. Unpack the tarfile.

  2. Edit the header of the `Makefile' to contain the correct
     installation paths for Lisp and Info files, as well as the correct
     name for the Emacs executable.

  3. Type
          make
          make install

     in order to compile the code and install it along with the online
     Info documentation.

  4. Copy the following lines into your `.emacs' file:
          (autoload 'reftex-mode    "reftex" "RefTeX Minor Mode" t)
          (autoload 'turn-on-reftex "reftex" "RefTeX Minor Mode" nil)

   In order to produce a printed version of the documentation, use
`make dvi' or `make ps'.  This will create the files `reftex.dvi' and
`reftex.ps', respectively.  The command `make html' will transform the
documentation into HTML format (file `reftex.html').

Entering RefTeX Minor Mode
==========================

To turn RefTeX Minor Mode on and off in a particular buffer, use `M-x
reftex-mode'.  To turn on RefTeX Minor 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


File: reftex.info,  Node: RefTeX in a Nutshell,  Prev: Installation,  Up: Introduction

RefTeX in a Nutshell
====================

  1. Labels and References
     RefTeX distinguishes labels for different environments.  It always
     knows if a certain label references a figure, table etc..  You can
     configure RefTeX to recognize any additional labeled environments
     you have defined yourself (variable REFTEX-LABEL-ALIST).
        * Creating Labels
          Type `C-c (' (`reftex-label') to insert a label at point.
          RefTeX will either
             - derive a label from context (default for section labels)

             - insert a simple label consisting of a prefix and a number
               (default for equations, enumerate items, and footnotes)
               or

             - prompt for a label string (figures and tables).

          Which labels are created how is configurable (variable
          REFTEX-INSERT-LABEL-FLAGS).

        * Referencing Labels
          Referencing labels is a snap and I promise you'll love it.
          In order to make a reference, type `C-c )'
          (`reftex-reference').  This shows an outline of the document
          with all labels of a certain type (figure, equation,...) and
          context of the label definition.  Selecting one of the labels
          inserts a `\ref' macro into the original buffer.  Online help
          during the selection is available with `?'.

  2. Citations
     After typing `C-c [' (`reftex-citation'), RefTeX will let you
     specify a regular expression to search in current BibTeX database
     files (as specified in the `\bibliography' command) and pull out a
     list of matches for you to choose from.  The list is _formatted_
     and sorted, thus much easier to read than the raw database
     entries.  The text inserted into the buffer is by default just
     `\cite{KEY}', but can also contain author names and the year in a
     configurable way (variable REFTEX-CITE-FORMAT).

  3. Viewing Cross References
     With point on or anywhere before a `\ref' or `\cite' macro, press
     `C-c &' (`reftex-view-crossref').  This will display the
     corresponding label definition or BibTeX database entry in another
     window.

  4. Table of Contents
     Typing `C-c =' (`reftex-toc') will show a table of contents of the
     document.  From that buffer, you can jump quickly to every part of
     your document.

  5. Multifile Documents
     Multifile Documents are fully supported. RefTeX will provide cross
     referencing information from all files which are part of the
     document. You may also use it to reference labels in external
     documents (in cooperation with the LaTeX package `xr').

  6. Document Parsing
     RefTeX needs to parse the document in order to find labels and
     other information.  It will do it automatically once, when you
     start working with a document.  Re-parsing should not be necessary
     too often since RefTeX updates its lists internally when you make
     a new label with `reftex-label'.  To enforce reparsing, call any
     of the commands described above with a raw `C-u' prefix, or press
     the `r' key in the label selection buffer or the table of contents
     buffer.


File: reftex.info,  Node: Labels and References,  Next: Citations,  Prev: Introduction,  Up: Top

Labels and References
*********************

LaTeX provides a powerful mechanism to deal with cross references in a
file.  When writing a document, any part of it can be marked with a
label, like `\label{mark}'.  LaTeX records the current value of a
certain counter when a label is defined.  Later references to this label
(like `\ref{mark}') will produce the recorded value of the counter.

   Labels can be used to mark sections, figures, tables, equations,
footnotes, items in enumerate lists etc.  LaTeX is context sensitive in
doing this: A label defined in a figure environment automatically
records the figure counter, not the section counter.

   Several different environments can share a common counter and
therefore a common label category.  E.g.  labels in both `equation' and
`eqnarray' environments record the value of the same counter - the
equation counter.

* Menu:

* Creating Labels::
* Referencing Labels::
* Builtin Label Environments::       The environments RefTeX knows about.
* Defining Label Environments::        ... and environments it doesn't.
* Displaying Cross References::      View the label corresponding to a \ref.
* xr (LaTeX package)::               References to external documents.
* varioref (LaTeX package)::         How to create \vref instead of \ref.


File: reftex.info,  Node: Creating Labels,  Next: Referencing Labels,  Up: Labels and References

Creating Labels
===============

In order to create a label in a LaTeX document, press `C-c ('
(`reftex-label').  Just like LaTeX, RefTeX is context sensitive and
will figure out the environment it currently is in and adapt the label
to that environment.  A label usually consists of a short prefix
indicating the type of the label and a unique mark.  RefTeX has 3
different modes to create this mark.

  1. A label can be derived from context.  This means, RefTeX takes the
     context of the label definition and construct a label from that.
     This works best for section labels, where the section heading is
     used to construct a label.  In fact, RefTeX's default settings use
     this method only for section labels.  You will be asked to confirm
     the derived label, or edit it.

  2. We may also use a simple unique number to identify a label.  This
     is mostly useful for labels where it is difficult to come up with
     a very good descriptive name.  RefTeX's default settings use this
     method for equations, enumerate items and footnotes.  The author
     of RefTeX tends to write documents with many equations and finds
     it impossible to come up with good names for each of them.  These
     simple labels are inserted without query, and are therefore very
     fast.  Good descriptive names are not really necessary as RefTeX
     will provide context to reference a label (*note Referencing
     Labels::).

  3. The third method is to ask the user for a label.  This is most
     useful for things which are easy to describe briefly and do not
     turn up too frequently in a document.  RefTeX uses this for
     figures and tables.  Of course, one can enter the label directly
     by typing the full `\label{mark}'.  The advantage of using
     `reftex-label' anyway is that RefTeX will know that a new label
     has been defined.  It will then not be necessary to rescan the
     document in order to access this label later.

   If you want to change the way certain labels are created, check out
the variable REFTEX-INSERT-LABEL-FLAGS (*note Options (Creating
Labels)::).


File: reftex.info,  Node: Referencing Labels,  Next: Builtin Label Environments,  Prev: Creating Labels,  Up: Labels and References

Referencing Labels
==================

Referencing Labels is really at the heart of RefTeX.  Press `C-c )' in
order to reference a label (reftex-reference).  This will start a
selection process and finally insert the complete `\ref{label}' into
the buffer.

   First, RefTeX will determine the label category which is required.
Often that can be figured out from context.  For example, if you write
`As shown in eq.' and the press `C-c )', RefTeX knows that an equation
label is going to be referenced.  If it cannot figure out what label
category is needed, it will query for one.

   You will then be presented with a label selection menu.  This is a
special buffer which contains an outline of the document along with all
labels of the given label category.  In addition, next to the label
there will be one line of context of the label definition, which is some
text in the buffer near the label definition.  Usually this is
sufficient to identify the label.  If you are unsure about a certain
label, pressing `SPC' will show the label definition point in another
window.

   In order to reference a label, move to cursor to the correct label
and press `RET'.
Here is a list of commands available in the selection buffer.  A summary
of this information is always available from the selection process by
pressing `?'.

`Cursor'
     All normal cursor motions are available to move through the buffer.
     This includes scrolling and `beginning-of-buffer', `end-of-buffer'.

`b'
     Jump back to the position where you last left the selection buffer.
     Normally this should get you back to the last referenced label.

`c'
     Toggle the display of the one-line label definition context in the
     selection buffer.

`f'
     Toggle follow mode.  When follow mode is active, the other window
     will always display the full context of the current label.  This is
     equivalent to pressing <SPC> after each cursor motion.

`g'
     Update the menu.  This will rebuilt the menu from the internal
     label list, but not reparse the document (see `r').

`i'
     Toggle the display of the file borders of a multifile document in
     the selection buffer.

`l'
     Use the last referenced label again.  This is equivalent to moving
     to that label again and pressing `RET'.

`n'
     Go to next label.

`p'
     Go to previous label.

`q'
     Exit the selection process without inserting any reference into the
     buffer.

`r'
     Reparse the document to update the information on all labels and
     rebuild the menu.  If the variable REFTEX-ENABLE-PARTIAL-SCANS is
     non-`nil' and your document is a multifile document, this will
     reparse only a a part of the document (the file the label at point
     was defined in).

`R'
     Reparse the _entire_ document.

`s'
     Switch the label category.  After prompting for another label
     category, a menu for that category will be shown.

`t'
     Toggle the display of the table of contents in the selection
     buffer.

`v'
     Toggle between `\ref' and `\vref' macro for references.  The
     `\vref' macro is defined in the `varioref' LaTeX package.  With
     this key you can force RefTeX to insert a `\vref' macro.  The
     current state of this flag is displayed in the mode line of the
     selection buffer.

`x'
     Reference a label from an external document.  With the LaTeX
     package `xr' it is possible to reference labels defined in another
     document.  This key will switch to the label menu of an external
     document and let you select a label from there (*note xr: xr
     (LaTeX package).).

`TAB'
     Enter a label with completion.  This may also be a label which
     does not yet exist in the document.

`SPC'
     Show the surroundings of the definition of the current label in
     another window.  See also the `f' key.  The usual bindings to
     scroll the other window are also available.

`RET'
     Insert a reference to the label at point into the buffer from
     which the selection process was started.

`#'
     Toggle the display of a label counter in the selection buffer.

`%'
     Toggle the display of labels hidden in comments in the selection
     buffers.  Sometimes, you may have commented out parts of your
     document.  If these parts contain label definitions, RefTeX can
     still display and reference these labels.

`?'
     Show a summary of the available keys.

`C-c C-n'
     Goto next section heading (like outline mode).

`C-c C-p'
     Goto next section heading (like outline mode).

`C-s / C-r'
     Search forward/backward.  This works almost like incremental
     search - subsequent `C-s'/`C-r' will find other occurrences of the
     same search string.


   Several of these keys toggle certain settings.  The default value for
these flags can be preset by configuring the variable
REFTEX-LABEL-MENU-FLAGS (*note Options (Referencing Labels)::).  In
order to define additional commands for the selection process, the
keymap REFTEX-SELECT-LABEL-MAP may be used (*note Keymaps::).


File: reftex.info,  Node: Builtin Label Environments,  Next: Defining Label Environments,  Prev: Referencing Labels,  Up: Labels and References

Builtin Label Environments
==========================

RefTeX needs to be aware of the environments which can be referenced
with a label (i.e. which carry their own counters).  By default, RefTeX
recognizes all labeled environments and macros discussed in `The LaTeX
Companion by Goossens, Mittelbach & Samarin, Addison-Wesley 1994.'.
These are:

   - `figure', `figure*', `table', `table*', `equation', `eqnarray',
     `enumerate', the `\footnote' macro (this is the LaTeX core stuff)

   - `align', `gather', `multline', `flalign', `alignat', `xalignat',
     `xxalignat', `subequations' (from AMS-LaTeX's `amsmath.sty'
     package)

   - the `\endnote' macro (from `endnotes.sty')

   - `Beqnarray' (`fancybox.sty')

   - `floatingfig' (`floatfig.sty')

   - `longtable' (`longtable.sty')

   - `figwindow', `tabwindow' (`picinpar.sty')

   - `sidewaysfigure', `sidewaystable' (`rotating.sty')

   - `subfigure', `subfigure*', the `\subfigure' macro (`subfigure.sty')

   - `supertabular' (`supertab.sty')

   - `wrapfigure' (`wrapfig.sty')

   If you want to use other labeled environments, for example some
defined with `\newtheorem', RefTeX needs to be configured to recognize
them (*note Defining Label Environments::).


File: reftex.info,  Node: Defining Label Environments,  Next: Displaying Cross References,  Prev: Builtin Label Environments,  Up: Labels and References

Defining Label Environments
===========================

RefTeX can be configured to recognize additional labeled environments
and macros.  This is done with the variable REFTEX-LABEL-ALIST (*note
Options (Defining Label Environments)::).  If you are not familiar with
Lisp, you should use the `custom' library to configure this rather
complex variable.  To do this, use

     M-x customize-variable <RET> reftex-label-alist <RET>

   Here we will discuss a few examples, in order to make things clearer.
It can also be instructive to look at the constant
REFTEX-LABEL-ALIST-BUILTIN which contains the entries for all the
builtin environments and macros (*note Builtin Label Environments::).

* Menu:

* Theorem and Axiom::                Defined with `\newenvironment'.
* Quick Equation::                   When a macro sets the label type.
* Figure Wrapper::                   When a macro argument is a label.
* Adding Magic Words::               Other words for other languages.
* Using \eqref::                     How to switch to this AMS-LaTeX macro.
* Putting it Together::              How to combine many entries.


File: reftex.info,  Node: Theorem and Axiom,  Next: Quick Equation,  Up: Defining Label Environments

Theorem and Axiom Environments
------------------------------

Suppose you are using `\newtheorem' in LaTeX in order to define two new
environments, `theorem' and `axiom'

     \newtheorem{axiom}{Axiom}
     \newtheorem{theorem}{Theorem}

to be used like this:

     \begin{axiom}
     \label{ax:first}
       ....
     \end{axiom}

   So we need to tell RefTeX that `theorem' and `axiom' are new labeled
environments which define their own label categories.  We can either
use Lisp to do this (e.g. in `.emacs') or use the custom library.  With
lisp it would look like this

     (setq reftex-label-alist
        '(("axiom"   ?a "ax:"  "~\\ref{%s}" nil ("Axiom"   "Ax."))
          ("theorem" ?h "thr:" "~\\ref{%s}" t   ("Theorem" "Theor." "Th."))))

   The type indicator characters `?a' and `?h' are used for prompts
when RefTeX queries for a label type.  Note that `?h' was chosen for
`theorem' since `?t' is already taken by `table'.  Note that also `?s',
`?f', `?e', `?i', `?n' are already used for standard environments.

The automatic labels for Axioms and Theorems will look like `ax:23' or
`thr:24'.

The `~\ref{%s}' is a format string indicating how to insert references
to these labels.

The next item indicates how to grab context of the label definition.
   - `t' means to get it from a default location (from the beginning of
     a `\macro' or after the `\begin' statement).  `t' is _not_ a good
     choice for eqnarray and similar environments.

   - `nil' means to use the text right after the label definition.

   - For more complex ways of getting context, see the variable
     REFTEX-LABEL-ALIST (*note Options (Defining Label Environments)::).

   The strings at the end of each entry are used to guess the correct
label type from the word before point when creating a reference.  E.g.
if you write: `As we have shown in Theorem' and then press `C-c )',
RefTeX will know that you are looking for a theorem label and restrict
the menu to only these labels without even asking.

   To do the same configuration with `customize', you need to click on
the `[INS]' button twice to create two templates and fill them in like
this:

     Reftex Label Alist: [Hide]
     [INS] [DEL] Choice: [Value Menu] Detailed label alist entry:
                 Environment or \macro : [Value Menu] String: axiom
                 Typekey character     : a
                 Label prefix string   : [Value Menu] String: ax:
                 Label reference format: [Value Menu] String: ~\ref{%s}
                 Context: [Value Menu] 1 method: [Value Menu] After label
                 List of Magic Words:
                 [INS] [DEL] String: Axiom
                 [INS] [DEL] String: Ax.
                 [INS]
     [INS] [DEL] Choice: [Value Menu] Detailed label alist entry:
                 Environment or \macro : [Value Menu] String: theorem
                 Typekey character     : h
                 Label prefix string   : [Value Menu] String: thr:
                 Label reference format: [Value Menu] String: ~\ref{%s}
                 Context: [Value Menu] 1 method: [Value Menu] Default position
                 List of Magic Words:
                 [INS] [DEL] String: Theorem
                 [INS] [DEL] String: Theor.
                 [INS] [DEL] String: Th.
                 [INS]

   Depending on how you would like the label insertion and selection for
the new environments to work, you might want to add the letters `a' and
`h' to some of the flags in the variables REFTEX-INSERT-LABEL-FLAGS
(*note Options (Creating Labels)::) and REFTEX-LABEL-MENU-FLAGS (*note
Options (Referencing Labels)::).


File: reftex.info,  Node: Quick Equation,  Next: Figure Wrapper,  Prev: Theorem and Axiom,  Up: Defining Label Environments

Quick Equation Macro
--------------------

Suppose you would like to have a macro for quick equations.  It could
be defined like this:

     \newcommand{\quickeq}[1]{\begin{equation} #1 \end{equation}}

and used like this:

     Einstein's equation is \quickeq{E=mc^2 \label{eq:einstein}}.

   We need to tell RefTeX that any label defined in the argument of the
`\quickeq' is an equation label.  Here is how to do this with lisp:

     (setq reftex-label-alist '(("\\quickeq{}" ?e nil nil 1 nil)))

   The first element in this list is now the macro with empty braces as
an _image_ of the macro arguments.  `?e' indicates that this is an
equation label, the different `nil' elements indicate to use the
default values for equations.  The `1' as the fifth element indicates
that the context of the label definition should be the 1st argument of
the macro.

   Here is again how this would look in the customization buffer:

     Reftex Label Alist: [Hide]
     [INS] [DEL] Choice: [Value Menu] Detailed label alist entry:
                 Environment or \macro : [Value Menu] String: \quickeq{}
                 Typekey character     : e
                 Label prefix string   : [Value Menu] Default
                 Label reference format: [Value Menu] Default
                 Context: [Value Menu] 1 method: [Value Menu] Macro arg nr: 1
                 List of Magic Words:
                 [INS]


File: reftex.info,  Node: Figure Wrapper,  Next: Adding Magic Words,  Prev: Quick Equation,  Up: Defining Label Environments

Figure Wrapping Macro
---------------------

Suppose you want to make figures not directly with the figure
environment, but with a macro like

     \newcommand{\myfig}[5][tbp]{%
       \begin{figure}[#1]
         \epsimp[#5]{#2}
         \caption{#3}
         \label{#4}
       \end{figure}}

which would be called like

     \myfig[htp]{filename}{caption text}{label}{1}

   Now we need to tell RefTeX that the 4th argument of the `\myfig'
macro _is itself_ a figure label, and where to find the context.

     (setq reftex-label-alist
           '(("\\myfig[]{}{}{*}{}" ?f nil nil 3)))

   The empty pairs of brackets indicate the different arguments of the
`\myfig' macro. The `*' marks the label argument.  `?f' indicates that
this is a figure label which will be listed together with labels from
normal figure environments.  The `nil' entries for prefix and reference
format mean to use the defaults for figure labels.  The `3' for the
context method means to grab the 3rd macro argument - the caption.

   As a side effect of this configuration, `reftex-label' will now
insert the required naked label (without the `\label' macro) when point
is directly after the opening parenthesis of a `\myfig' macro argument.

   Again, here the configuration in the customization buffer:

     [INS] [DEL] Choice: [Value Menu] Detailed label alist entry:
                 Environment or \macro : [Value Menu] String: \myfig[]{}{}{*}{}
                 Typekey character     : f
                 Label prefix string   : [Value Menu] Default
                 Label reference format: [Value Menu] Default
                 Context: [Value Menu] 1 method: [Value Menu] Macro arg nr: 3
                 List of Magic Words:
                 [INS]


File: reftex.info,  Node: Adding Magic Words,  Next: Using \eqref,  Prev: Figure Wrapper,  Up: Defining Label Environments

Adding Magic Words
------------------

Sometimes you don't want to define a new label environment or macro, but
just change the information associated with a label category.  Maybe you
want to add some magic words, for another language.  Changing only the
information associated with a label category is done by giving `nil'
for the environment name and then specify the items you want to define.
Here is an example which adds German magic words to all predefined
label categories.

     (setq reftex-label-alist
       '((nil ?s nil nil nil ("Kapitel" "Kap." "Abschnitt" "Teil"))
         (nil ?e nil nil nil ("Gleichung" "Gl."))
         (nil ?t nil nil nil ("Tabelle"))
         (nil ?f nil nil nil ("Figur" "Abbildung" "Abb."))
         (nil ?n nil nil nil ("Anmerkung" "Anm."))
         (nil ?i nil nil nil ("Punkt"))))


File: reftex.info,  Node: Using \eqref,  Next: Putting it Together,  Prev: Adding Magic Words,  Up: Defining Label Environments

Using `\eqref'
--------------

Another case where one only wants to change the information associated
with the label category is to change the macro which is used for
referencing the label.  When working with the AMS-LaTeX stuff, you might
prefer the `\eqref' for doing equation references.  Here is how to do
this:

     (setq reftex-label-alist '((nil ?e nil "~\\eqref{%s}" nil nil)))

   RefTeX has also a predefined symbol for this special purpose.  The
following is equivalent to the line above.

     (setq reftex-label-alist '(AMSTeX))


File: reftex.info,  Node: Putting it Together,  Prev: Using \eqref,  Up: Defining Label Environments

Putting it all together
-----------------------

When you have to put several entries into REFTEX-LABEL-ALIST, just put
them after each other in a list, or create that many templates in the
customization buffer.  Here is a lisp example which uses several of the
entries described above:

     (setq reftex-label-alist
       '(("axiom"   ?a "ax:"  "~\\ref{%s}" nil ("Axiom"   "Ax."))
         ("theorem" ?h "thr:" "~\\ref{%s}" t   ("Theorem" "Theor." "Th."))
         ("\\quickeq{}" ?e nil nil 1 nil)
         AMSTeX
         ("\\myfig[]{}{}{*}{}" ?f nil nil 3)))


File: reftex.info,  Node: Displaying Cross References,  Next: xr (LaTeX package),  Prev: Defining Label Environments,  Up: Labels and References

Displaying Cross References
===========================

RefTeX can display the definition site of a label which is referenced
in the text.  With the cursor on or anywhere before a `\ref' macro,
type `C-c &'.  RefTeX will then display the definition of the label in
another window.  This works also with references to external labels
(*note xr (LaTeX package)::).

   See also *Note Displaying Citations::.


File: reftex.info,  Node: xr (LaTeX package),  Next: varioref (LaTeX package),  Prev: Displaying Cross References,  Up: Labels and References

`xr': Cross-Document References
===============================

The LaTeX package `xr' makes it possible to create references to labels
defined in external documents.  The preamble of a document using `xr'
will contain something like this:

     \usepackage{xr}
     \externaldocument[V1-]{volume1}
     \externaldocument[V3-]{volume3}

and we can make references to any labels defined in these external
documents by using the prefixes `V1-' and `V3-', respectively.

   RefTeX can be used to create such labels as well.  Start the
referencing process normally, by pressing `C-c )'.  Select a label type
if necessary.  When you see the label selection buffer, pressing `x'
will switch to the label selection buffer of one of the external
documents.  You may then select a label as before and RefTeX will
insert it along with the required prefix.

   For this kind of inter-document cross references, saving of parsing
information and the use of multiple selection buffers can mean a large
speed-up (*note Optimizations::).


File: reftex.info,  Node: varioref (LaTeX package),  Prev: xr (LaTeX package),  Up: Labels and References

`varioref': Variable Page References
====================================

`varioref' is a frequently used LaTeX package to create cross
references with page information.  When you want to make a reference
with the `\vref' macro, just press the `v' key in the selection buffer
to toggle between the `\ref' and `\vref' (*note Referencing Labels::.
The mode line of the selection buffer shows the current status of this
switch.  If you find that you almost always use `\vref', you may want
to make it the default by customizing the variable
REFTEX-VREF-IS-DEFAULT


File: reftex.info,  Node: Citations,  Next: Table of Contents,  Prev: Labels and References,  Up: Top

Citations
*********

Citations in LaTeX are done with the `\cite' macro or variations of it.
The argument of the macro is a citation key which identifies a piece
literature in either a BibTeX database file or in an explicit
`thebibliography' environment in the document.  RefTeX's support for
citations helps to select the correct key quickly.

* Menu:

* Creating Citations::               How to create them.
* Citation Styles::                  Harvard, Chicago, Natbib and CO.
* Displaying Citations::             View the corresponding database entry.
* Chapterbib and Bibunits::          Multiple bibliographies in a Document.
* Citations Outside LaTeX::          How to make citations in Emails etc.


File: reftex.info,  Node: Creating Citations,  Next: Citation Styles,  Up: Citations

Creating Citations
==================

In order to create a citation, press `C-c ['.  RefTeX then prompts for
a regular expression which will be used to search through the database
and present the list of matches to choose from in a selection process
similar to that for selecting labels (*note Referencing Labels::).

   The regular expression uses an extended syntax: `&&' defines a logic
`and' for regular expressions. For example `Einstein&&Bose' will match
all articles which mention Bose-Einstein condensation, or which are
co-authored by Bose and Einstein.

   RefTeX prefers to use BibTeX database files specified with a
`\bibliography' macro to collect its information.  However, if you have
an explicit `thebibliography' environment in your document, it will be
scanned instead.  Note that in this case the information presented in
the selection buffer will just be a copy of relevant `\bibitems', not
the structured listing available with BibTeX database files.

   In the selection buffer, the following keys are available to find and
select an article.  A summary of this information is always available
from the selection process by pressing `?'.

`Cursor'
     All normal cursor motions are available to move through the buffer.
     This includes scrolling and `beginning-of-buffer', `end-of-buffer'.

`a'
     Accept all entries in the selection buffer and create `\cite'
     macros referring to them.

`e'
     Start a recursive edit in the other window (which usually displays
     the full database entry when using this).  See <SPC> and `f' keys.

`f'
     Toggle follow mode.  When follow mode is active, the other window
     will always display the full database entry of the current
     article.  This is equivalent to pressing SPC after each cursor
     motion.  With BibTeX entries, follow mode can be rather slow.

`g'
     Start over with a new regular expression.  The full database will
     be rescanned with the new expression (see also `r').

`n'
     Go to next article.

`p'
     Go to previous article.

`q'
     Exit the selection process without inserting any citation into the
     buffer.

`r'
     Refine the current selection with another regular expression.
     This will _not_ rescan the entire database, but just the already
     selected entries.

`TAB'
     Enter a citation key with completion.  This may also be a key
     which does not yet exist.

`SPC'
     Show the database entry corresponding to the article at point, in
     another window.  See also the `f' key.  The usual bindings to
     scroll the other window are also available.

`RET'
     Insert a citation to the article at point into the buffer from
     which the selection process was started.

`C-s / C-r'
     Search forward/backward.  This works almost like incremental
     search - subsequent `C-s'/`C-r' will find other occurrences of the
     same search string.

`?'
     Show a summary of the available keys.

   In order to define additional commands for this selection process,
the keymap REFTEX-SELECT-BIB-MAP may be used (*note Keymaps::).


File: reftex.info,  Node: Citation Styles,  Next: Displaying Citations,  Prev: Creating Citations,  Up: Citations

Citation Styles
===============

The standard LaTeX macro `\cite' works well with numeric or simple key
citations.  To deal with the more complex task of author-year citations
as used in many natural sciences, a variety of packages has been
developed which define derived forms of the `\cite' macro.  RefTeX can
be configured to produce these citation macros as well by setting the
variable REFTEX-CITE-FORMAT.  For the most commonly used packages
(`natbib', `harvard', `chicago') this may be done from the menu, under
`Ref/Citation Options'.  Since there are usually several macros to
create the citations, executing `reftex-citation' (`C-c [') starts by
prompting for the correct macro.  For the Harvard style, this looks
like this:

     SELECT A CITATION FORMAT
     
     [^M]   \cite{%l}
     [p]    \cite{%l}
     [t]    \citeasnoun{%l}
     [n]    \citeasnoun{%l}
     [s]    \possessivecite{%l}
     [e]    \citeaffixed{%l}{?}
     [y]    \citeyear{%l}
     [a]    \citename{%l}

   Following the most generic of these packages, `natbib', the builtin
citation packages always accept the `t' for a _textual_ citation (like:
`Jones et al. (1997) have shown...')  as well as the `p' key for a
parenthetical citation (like: `As shown earlier (Jones et al, 1997)').

   To make one of these styles the default, customize the variable
REFTEX-CITE-FORMAT or put into `.emacs':

     (setq reftex-cite-format 'harvard)


File: reftex.info,  Node: Displaying Citations,  Next: Chapterbib and Bibunits,  Prev: Citation Styles,  Up: Citations

   Top

Displaying Citations
====================

RefTeX can display the full database entry for any citation key used in
the document.  With the cursor on or anywhere before a `\cite' macro,
type `C-c &'. RefTeX will show the full database entry in another
window.  If you press `C-c &' immediately again, RefTeX will move to
the next following citation key - so this can be used to display the
database entries for several keys in a single `\cite' macro, or in
subsequent macros.

   See also *Note Displaying Cross References::.


File: reftex.info,  Node: Chapterbib and Bibunits,  Next: Citations Outside LaTeX,  Prev: Displaying Citations,  Up: Citations

Chapterbib and Bibunits
=======================

`chapterbib' and `bibunits' are two LaTeX packages which produce
multiple bibliographies in a document.  This is no problem for RefTeX
as long as all bibliographies use the same BibTeX database files.  If
they do not, it is best to have each document part in a separate file
(as it is required for `chapterbib' anyway).  Then RefTeX will still
scan the locally relevant databases correctly.  If you have multiple
bibliographies within a _single file_, this may or may not be the case.


File: reftex.info,  Node: Citations Outside LaTeX,  Prev: Chapterbib and Bibunits,  Up: Citations

Citations outside LaTeX
=======================

The command `reftex-citations' can also be executed outside a LaTeX
buffer.  This can be useful to reference articles in Emails and other
documents.  The list of BibTeX files will in this case be taken from the
variable REFTEX-DEFAULT-BIBLIOGRAPHY.  Setting the variable
REFTEX-CITE-FORMAT to the symbol 'locally does a decent job of putting
all relevant information about a citation directly into the buffer.
Here is the lisp code to add the `C-c [' binding to the mail buffer.
It also provides a local binding for REFTEX-CITE-FORMAT.

     (add-hook
      'mail-setup-hook
      (lambda ()
        (define-key mail-mode-map "\C-c["
          (lambda ()
            (interactive)
            (require 'reftex)
            (let ((reftex-cite-format 'locally))
              (reftex-citation))))))


File: reftex.info,  Node: Table of Contents,  Next: Keybindings,  Prev: Citations,  Up: Top

Table of Contents
*****************

When you press `C-c =', RefTeX will pop up a buffer showing the table
of contents of the document.  With the cursor in any of the lines
denoting a section, simple key strokes will jump to that section or
perform other actions.  Here is a list of available commands.  A summary
of this information is always available by pressing `?'.

`0-9, -'
     Prefix argument.

`f'
     Toggle follow mode on and of.  When follow mode is active, the
     other window will always show the section corresponding to the
     line in the `*toc*' buffer at point.  This is equivalent to
     pressing <SPC> after each cursor motion.  The default for this
     flag can be set with the variable REFTEX-TOC-FOLLOW-MODE.

`g'
     Rebuild the `*toc*' buffer.  This does _not_ rescan the document.

`n'
     Goto next line.

`p'
     Goto previous line.

`q'
     Hide the `*toc*' buffer, return to the position where `reftex-toc'
     was last called.

`Q'
     Kill the `*toc*' buffer, return to the position where `reftex-toc'
     was last called.

`r'
     Reparse the LaTeX document and rebuild the `*toc*' buffer.  When
     REFTEX-ENABLE-PARTIAL-SCANS is non-nil, rescan only the file this
     section is defined in, not the entire document.

`R'
     Reparse the _entire_ LaTeX document and rebuild the `*toc*' buffer.

`x'
     Switch to the `*toc*' buffer of an external document.  When the
     current document is using the `xr' package (*note xr (LaTeX
     package)::), RefTeX will switch to one of these external documents.

`SPC'
     Show the corresponding section in another window.  This command
     does _not_ select that other window.

`TAB'
     Goto the section in another window.

`RET'
     Go to the section and hide the `*toc*' buffer.  This will restore
     the window configuration before `reftex-toc' (`C-c =') was called.

   In order to define additional commands for the `*toc*' buffer, the
keymap REFTEX-TOC-MAP may be used (*note Keymaps::).


File: reftex.info,  Node: Keybindings,  Next: Social Matters,  Prev: Table of Contents,  Up: Top

Default Keybindings
===================

All RefTeX commands can be reached from its menu, which is installed as
`Ref' menu in the menu bar.  Here is a summary of the available
keybindings.

     C-c =    `reftex-toc'
     C-c (    `reftex-label'
     C-c )    `reftex-reference'
     C-c [    `reftex-view-crossref'

   These keys were chosen to avoid interfering with AUCTeX's settings.
Personally, I also bind some functions in the `C-c <letter>' map for
easier access:

     C-c t    `reftex-toc'
     C-c l    `reftex-label'
     C-c r    `reftex-reference'
     C-c c    `reftex-citation'
     C-c v    `reftex-view-crossref'
     C-c s    `reftex-search-document'
     C-c g    `reftex-grep-document'

If you want to copy these as well, set in your `.emacs' file:

     (setq reftex-extra-bindings t)

   It is also possible to bind the function for viewing cross references
and citations (`reftex-view-crossref') to a mouse event.  Something
like the following will do the trick:

     (add-hook 'reftex-load-hook
        (lambda ()
          (define-key reftex-mode-map [(shift mouse-2)]
            'reftex-mouse-view-crossref)))


File: reftex.info,  Node: Social Matters,  Next: Multifile Documents,  Prev: Keybindings,  Up: Top

Social Matters
==============

There are two Emacs packages related to RefTeX.  RefTeX can interact
with both of them.

* Menu:

* AUCTeX::                           The ultimate TeX/LaTeX mode for GNU Emacs.
* Bib-Cite::                         Another package dealing with Citations.


File: reftex.info,  Node: AUCTeX,  Next: Bib-Cite,  Up: Social Matters

AUCTeX
------

If you are writing TeX or LaTeX documents with Emacs, you should have a
look at AUCTeX, the definitive package to work with TeX and LaTeX.
Information on AUCTeX can be found here:

     http://www.sunsite.auc.dk/auctex/

   Instead of using the RefTeX functions described above directly, you
can also use them indirectly, through AUCTeX (version 9.8a or later).
RefTeX provides several interface functions which can be used as
replacement for corresponding AUCTeX functions dealing with labels and
citations.  In this way you can work normally with AUCTeX and use
RefTeX internals to create and complete labels and citation keys.

   * `reftex-label' can be used as the LATEX-LABEL-FUNCTION which does
     label insertion when new environments are created with `C-c C-e'.

   * `reftex-arg-label', `reftex-arg-ref' and `reftex-arg-cite' can
     replace the corresponding `TeX-arg-...' functions.  E.g. when you
     insert a label macro with `C-c <RET> label <RET>', RefTeX will be
     transparently used to create the label.

In order to plug all 4 functions into AUCTeX, use:

     (setq reftex-plug-into-AUCTeX t)

You may also choose to plug in only some of these functions.  Try `M-x
customize-variable <RET> reftex-plug-into-AUCTeX <RET>' to find out
more about this.

   AUCTeX can support RefTeX via style files.  A style file may contain
calls to `reftex-add-to-label-alist' 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 (>9.7p) for example contains the following:

     (TeX-add-style-hook "amsmath"
        (function
          (lambda ()
            (if (featurep 'reftex)
                (reftex-add-to-label-alist '(AMSTeX))))))

while a package `myprop' defining a proposition environment with
`\newtheorem' might use

     (TeX-add-style-hook "myprop"
       (function
        (lambda ()
          (if (featurep 'reftex)
              (reftex-add-to-label-alist
               '(("proposition" ?p "prop:"  "~\\ref{%s}" t
                                ("Proposition" "Prop."))))))))

   Similarly, the style file `harvard.el' for the Harvard citation
style could switch RefTeX's citation format to `harvard' like this:

     (TeX-add-style-hook "myprop"
       (function
        (lambda ()
          (if (featurep 'reftex)
              (setq reftex-cite-format 'harvard)))))


File: reftex.info,  Node: Bib-Cite,  Prev: AUCTeX,  Up: Social Matters

Bib-Cite
--------

Once you have written a document with labels, references and citations,
it can be nice to read it like a hypertext document.  RefTeX has some
support for that (`reftex-view-crossref', `reftex-search-document').  A
more elegant interface with mouse support is provided (among other
things) by Peter S. Galbraith's `bib-cite.el'.  There is some overlap
in the functionalities of Bib-cite and RefTeX.  Bib-cite.el comes
bundled with AUCTeX.  You can also get the latest version from

     ftp://ftp.phys.ocean.dal.ca/users/rhogee/elisp/bib-cite.el

   Bib-cite versions 3.06 and later can be configured so that bib-cite's
mouse functions use RefTeX for displaying references and citations.
This can be useful in particular when working with the LaTeX `xr'
package or with an explicit `thebibliography' environment (rather than
BibTeX).  Bib-cite cannot handle those, but RefTeX does.  To make use
of this feature, try

     (setq bib-cite-use-reftex-view-crossref t)


File: reftex.info,  Node: Multifile Documents,  Next: Optimizations,  Prev: Social Matters,  Up: Top

Multifile Documents
===================

RefTeX will work smoothly with documents spread over many files
(so-called multifile documents).  The following is relevant when using
RefTeX for multi-file documents:

   * 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 have a File
     Variable (TEX-MASTER for AUCTeX or TEX-MAIN-FILE for the standard
     Emacs LaTeX mode) set to the name of the master file.  See the
     documentation of your (La)TeX mode and *Note 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.


File: reftex.info,  Node: Optimizations,  Next: Problems and Work-Arounds,  Prev: Multifile Documents,  Up: Top

Optimizations
=============

The default settings of RefTeX ensure a safe ride for beginners and
casual users.  However, when using RefTeX for a large project and/or on
a small computer, there are ways to improve speed or memory usage.

   * Removing Lookup Buffers
     RefTeX will load other parts of a multifile document as well as
     BibTeX database files for lookup purposes.  These buffers are
     kept, so that subsequent use of the same files is fast.  If you
     can't afford keeping these buffers around, and if you can live
     with a speed penalty, try

          (setq reftex-keep-temporary-buffers nil)

   * Files Visited with Follow Mode
     Follow-mode in the selection and `*toc*' buffers shows the context
     of the current line in another window.  If the context is in an
     unvisited file, RefTeX normally visits the file.  The setting

          (setq reftex-revisit-to-follow nil)

     disables follow mode for such cases, so that only context in live
     buffers is displayed.  However, pressing <SPC> will always visit
     the file to show the context.

   * Partial Document Scans
     A `C-u' prefix on the major RefTeX commands `reftex-label' (`C-u
     C-c ('), `reftex-reference' (`C-u C-c )'), `reftex-citation' (`C-u
     C-c ['), `reftex-toc' (`C-u C-c ='), and `reftex-view-crossref'
     (`C-u C-c &') initiates re-parsing of the entire document in order
     to update the parsing information.  For a large document this can
     be unnecessary, in particular if only one file has changed.
     RefTeX can be configured to do partial scans instead of full ones.
     `C-u' re-parsing then does apply only to the current buffer and
     files included from it.  Likewise, the `r' key in both the label
     selection buffer and the table-of-contents buffer will only prompt
     scanning of the file in which the label or section macro near the
     cursor was defined.  Re-parsing of the entire document is still
     available by using `C-u C-u' as a prefix, or the capital `R' key
     in the menus.  To use this feature, try

          (setq reftex-enable-partial-scans t)

   * Saving Parser Information
     Even with partial scans enabled, RefTeX still has to make one full
     scan, when you start working with a document.  To avoid this,
     parsing information can be stored in a file.  The file
     `MASTER.rel' is used for storing information about a document with
     master file `MASTER.tex'.  It is written each time RefTeX parses
     (part of) the document, and restored when you begin working with a
     document in a new editing session.  To use this feature, put into
     `.emacs':

          (setq reftex-save-parse-info t)

   * Automatic Document Scans
     At rare occasions, RefTeX will automatically rescan a part of the
     document.  If this gets into your way, it can be turned off with

          (setq reftex-allow-automatic-rescan nil)

     RefTeX will then occasionally annotate new labels in the selection
     buffer, saying that their position in the label list in uncertain.
     I manual document scan will fix this.

   * Multiple Selection Buffers
     Normally, the selection buffer `*RefTeX Select*' is re-created
     newly for every selection process.  In documents with very many
     labels this can take several seconds - in particular with context
     refontification turned on.  RefTeX provides an option to create a
     separate selection buffer for each label type and to keep this
     buffer from one selection to the next.  These buffers are updated
     automatically only when a new label has been added in the buffers
     category with `reftex-label'.  Updating the buffer takes as long
     as recreating it - so the time saving is limited to cases where no
     new labels of that category have been added.  To turn on this
     feature, use

          (setq reftex-use-multiple-selection-buffers t)

     You can also inhibit the automatic updating entirely.  Then the
     selection buffer will always pop up very fast, but may not contain
     the most recently defined labels.  You can always update the
     buffer hand, with the `g' key.  To get this behavior, use instead

          (setq reftex-use-multiple-selection-buffers t
                reftex-auto-update-selection-buffers nil)

As a summary, here are the settings I recommend for heavy use of RefTeX
with large documents:

     (setq reftex-enable-partial-scans t
           reftex-save-parse-info t
           reftex-use-multiple-selection-buffers t
           reftex-revisit-to-follow nil)


File: reftex.info,  Node: Problems and Work-Arounds,  Next: Imprint,  Prev: Optimizations,  Up: Top

Problems and Work-arounds
=========================

   * `\input', `\include', `\bibliography' and `\section' (etc.)
     statements have to be first on a line (except for white space).

   * RefTeX sees also labels in regions commented out and will refuse to
     make duplicates of such a label.  This is considered to be a
     feature.

   * When using partial scans (REFTEX-ENABLE-PARTIAL-SCANS), the section
     numbers in the table of contents may eventually become wrong.  A
     full scan will fix this.

   * RefTeX keeps only a global copy of the configuration variables.
     Also, any additions from style files go into a global variable.
     Practically, this should not be a problem.  Theoretically, it could
     give conflicts if two documents used environments with identical
     names, but different associated label types.

   * When using AUCTeX and AMS-LaTeX, the `amsmath.el' style file will
     automatically cause RefTeX to use the macro `\eqref' for equation
     references.  This will take effect for _all_ current documents,
     not only for the one actually using AMS-LaTeX.  The best
     work-around is to use AMS-LaTeX in _all_ documents.  The other
     possibility is to enforce the use of the `\ref' macro for all
     documents with

          (setq reftex-label-alist '((nil ?e nil "~(\\ref{%s})" nil nil)))

   * When using packages which make the buffer representation of a file
     different from its disk representation (e.g. x-symbol, isotex,
     iso-cvt) you may find that RefTeX's parsing information sometimes
     reflects the disk state of a file.  This happens only in
     _unvisited_ parts of a multifile document, because RefTeX visits
     these files literally for speed reasons.  Then both short context
     and section headings may look different from what you usually see
     on your screen.  In rare cases `reftex-toc' may have problems to
     jump to an affected section heading.  There are three possible
     ways to deal with this:
        - `(setq reftex-keep-temporary-buffers t)'
          This implies that RefTeX will load all parts of a multifile
          document into Emacs (i.e. there will be no temporary buffers).

        - `(setq reftex-initialize-temporary-buffers t)'
          This means full initialization of temporary buffers.  It
          involves a penalty when the same unvisited file is used for
          lookup often.

        - Set `reftex-initialize-temporary-buffers' to a list of hook
          functions doing a minimal initialization.
     See also the variable REFTEX-REFONTIFY-CONTEXT.

   * Some packages use an additional argument to a `\begin' macro to
     specify a label.  E.g. Lamport's `pf.sty' uses both

          \step{LABEL}{CLAIM}   and      \begin{step+}{LABEL}
                                            CLAIM
                                         \end{step+}

     We need to trick RefTeX into swallowing this:

          ;; Configuration for Lamport's pf.sty
          (setq reftex-label-alist
              '(("\\step{*}{}"       ?p "st:" "~\\stepref{%s}" 2 ("Step" "St."))
                ("\\begin{step+}{*}" ?p "st:" "~\\stepref{%s}" 1000)))

     The first line is just a normal configuration for a macro.  For the
     `step+' environment we actually tell RefTeX to look for the
     _macro_ `\begin{step+}' and interpret the _first_ argument (which
     really is a second argument to the macro `\begin') as a label of
     type `?p'.  Argument count for this macro starts only after the
     `{step+}', also when specifying how to get context.

   * In XEmacs 19.15, the overlay library has a bug.  RefTeX does not
     suffer from it, but since it loads the library, other packages like
     GNUS will switch from extents to overlays and hit the bug.  Upgrade
     to XEmacs 20, or fix the overlay library (in line 180 of
     overlay.el, change `(list before after)' to `(cons before after)').

   * If you use Viper mode, you need to protect RefTeX's keymaps with

          (viper-harness-minor-mode "reftex")



File: reftex.info,  Node: Imprint,  Next: Commands,  Prev: Problems and Work-Arounds,  Up: Top

Imprint
=======

RefTeX was written by Carsten Dominik <dominik@strw.LeidenUniv.nl>,
with contributions by Stephen Eglen.  RefTeX is currently maintained by

     Carsten Dominik <dominik@strw.LeidenUniv.nl>

   If you find a bug in RefTeX or its documentation, or if you want to
contribute code or ideas, please contact the maintainer.  Remember to
provide all necessary information such as version numbers of Emacs and
RefTeX, and the relevant part of your configuration in `.emacs'.  When
reporting a bug, please include a backtrace if you know how to produce
one.

   RefTeX is distributed with Emacs (version 20.2 and later) and XEmacs
(version 19.16 and 20.2 and later).  The newest version of RefTeX is
available at

     http://www.strw.leidenuniv.nl/~dominik/Tools/
     ftp://strw.leidenuniv.nl/pub/dominik/

The version at this site is actually compatible with Emacs 19 - the
versions of RefTeX distributed with Emacs 20 are not.

   Thanks to the people on the Net who have used RefTeX and helped
developing it with their reports.  In particular thanks to F. Burstall,
Alastair Burt, Soren Dayton, Stephen Eglen, Karl Eichwalder, Peter
Galbraith, Dieter Kraft, Adrian Lanz, Rory Molinari, Laurent Mugnier,
Sudeep Kumar Palat, Daniel Polani, Robin Socha, Richard Stanton, Allan
Strand, Jan Vroonhof, Christoph Wedler.

   The view crossref feature was inspired by the similar function in
Peter Galbraith's `bib-cite.el'.

   Finally thanks to Uwe Bolick who first got me (some years ago) into
supporting LaTeX labels and references with an Editor (which was
MicroEmacs at the time).


File: reftex.info,  Node: Commands,  Next: Options,  Prev: Imprint,  Up: Top

Commands
********

Here is a summary of RefTeX's commands.  All commands are available
from the `Ref' menu.  For keybindings, *note Keybindings::.

 - Command: reftex-label
     Insert a unique label.  With one or two `C-u' prefixes, enforce
     document rescan first.

 - Command: reftex-reference
     Start a selection process to select a label, and insert a
     reference to it.  With one or two `C-u' prefixes, enforce document
     rescan first.

 - Command: reftex-citation
     Make a citation using BibTeX database files.  After asking for a
     Regular Expression, it scans the buffers with BibTeX entries
     (taken from the `\bibliography' command or a `thebibliography'
     environment) and offers the matching entries for selection.  The
     selected entry is formated according to REFTEX-CITE-FORMAT and
     inserted into the buffer.
     When called with one or two `C-u' prefixes, first rescans the
     document.  When called with a numeric prefix, make that many
     citations.  When called with point inside the braces of a `\cite'
     command, it will add another key, ignoring the value of
     REFTEX-CITE-FORMAT.
     The regular expression uses an expanded syntax: `&&' is
     interpreted as `and'.  Thus, `aaaa&&bbb' matches entries which
     contain both `aaaa' and `bbb'.

 - Command: reftex-view-crossref
     View cross reference of `\ref' or `\cite' macro at point.  If the
     macro at point is a `\ref', show the corresponding label
     definition.  If it is a `\cite', show the BibTeX database entry or
     the `\bibitem'.  If there is no such macro at point, search
     forward to find one.  When you call this function several times in
     direct succession, point will move to view subsequent cross
     references further down in the buffer.  To cope with the plethora
     of variations in packages, this function assumes any macro either
     starting with or ending in `ref' or `cite' to contain cross
     references.  When the LaTeX package `xr' is being used, this
     command will also view cross-references in external documents.
     However, this works correctly only when the `\externaldocument'
     macros are used with the optional label prefix argument.
     With one or two `C-u' prefixes, enforce rescanning of the
     document.  With argument t or 1, select the window showing the
     cross reference.

 - Command: reftex-toc
     Show the table of contents for the current document.  When called
     with one ore two `C-u' prefixes, rescan the document first.

 - Command: reftex-create-tags-file
     Create TAGS file by running `etags' on the current document.  The
     TAGS file is also immediately visited with `visit-tags-table'.

 - Command: reftex-grep-document
     Run grep query through all files related to this document.  With
     prefix arg, force to rescan document.  This works also without an
     active TAGS table.

 - Command: reftex-search-document
     Regexp search through all files of the current TeX document.
     Starts always in the master file.  Stops when a match is found.
     This works also without an active TAGS table.

 - Command: reftex-query-replace-document
     Run a query-replace-regexp of FROM with TO over the entire TeX
     document.  With prefix arg, replace only word-delimited matches.
     This works also without an active TAGS table.

 - Command: reftex-change-label
     Query replace FROM with TO in all `\label' and `\ref' commands.
     Works on the entire multifile document.  This works also without
     an active TAGS table.

 - Command: reftex-find-duplicate-labels
     Produce a list of all duplicate labels in the document.

 - Command: reftex-customize
     Run the customize browser on the RefTeX group.

 - Command: reftex-show-commentary
     Show the commentary section from `reftex.el'.

 - Command: reftex-info
     Run info on the top RefTeX node.

 - Command: reftex-parse-document
     Parse the entire document in order to update the parsing
     information.

 - Command: reftex-reset-mode
     Enforce rebuilding of several internal lists and variables.


File: reftex.info,  Node: Options,  Next: Keymaps,  Prev: Commands,  Up: Top

Options, Keymaps, Hooks
***********************

Here is a complete list of RefTeX's configuration variables.  All
variables have customize support - so if you are not familiar with Emacs
Lisp (and even if you are) you might find it more comfortable to use
`customize' to look at and change these variables. `M-x
reftex-customize' will get you there.

* Menu:

* Options (Defining Label Environments)::
* Options (Creating Labels)::
* Options (Referencing Labels)::
* Options (Creating Citations)::
* Options (Table of Contents)::
* Options (Optimizations)::
* Options (Misc)::


File: reftex.info,  Node: Options (Defining Label Environments),  Next: Options (Creating Labels),  Up: Options

Defining Label Environments
===========================

 - User Option: reftex-default-label-alist-entries
     Default label alist specifications.  It is a list of symbols with
     associations in the constant REFTEX-LABEL-ALIST-BUILTIN.  `LaTeX'
     should always be the last entry.

 - User Option: reftex-label-alist
     Set this variable to define additions and changes to the default.
     The only things you _must not_ change is that `?s' is the type
     indicator for section labels, and <SPC> for the `any' label type.
     These are hard-coded at other places in the code.

     The value of the variable must be a list of items.  Each item is a
     list itself and has the following structure:

           (ENV-OR-MACRO  TYPE-KEY  LABEL-PREFIX  REFERENCE-FORMAT
              CONTEXT-METHOD  (MAGIC-WORD ... ))

     Each list entry describes either an environment carrying a counter
     for use with `\label' and `\ref', or a LaTeX macro defining a
     label as (or inside) one of its arguments.  The elements of each
     list entry are:

    ENV-OR-MACRO
          Name of the environment (like `table') or macro (like
          `\myfig').  For macros, indicate the arguments, as in
          `\myfig[]{}{}{*}{}'.  Use square brackets for optional
          arguments, a star to mark the label argument, if any.  The
          macro does not have to have a label argument - you could also
          use `\label{...}' inside one of its arguments.

          Special names: `section' for section labels, `any' to define a
          group which contains all labels.

          This may also be `nil' if the entry is only meant to change
          some settings associated with the type indicator character
          (see below).

    TYPE-KEY
          Type indicator character, like `?t', must be a printable ASCII
          character.  The type indicator is a single character which
          defines a label type.  Any label inside the environment or
          macro is assumed to belong to this type.  The same character
          may occur several times in this list, to cover cases in which
          different environments carry the same label type (like
          `equation' and `eqnarray').

    LABEL-PREFIX
          Label prefix string, like `tab:'.  The prefix is a short
          string used as the start of a label.  It may be the empty
          string.  The prefix may contain the following `%' escapes:

               %f Current file name, directory and extension stripped.
               %F Current file name relative to master file directory.
               %u User login name, on systems which support this.

          Example: In a file `intro.tex', `eq:%f:' will become
          `eq:intro:'.

    REFERENCE-FORMAT
          Format string for reference insert in buffer.  `%s' will be
          replaced by the label.  When the format starts with `~', this
          `~' will only be inserted when the character before point is
          _not_ a whitespace.

    CONTEXT-METHOD
          Indication on how to find the short context.
             - If `nil', use the text following the `\label{...}' macro.

             - If `t', use
                  - the section heading for section labels.

                  - text following the `\begin{...}' statement of
                    environments (not a good choice for environments
                    like eqnarray or enumerate, where one has several
                    labels in a single environment).

                  - text after the macro name (starting with the first
                    arg) for macros.

             - If an integer, use the nth argument of the macro.  As a
               special case, 1000 means to get text after the last
               macro argument.

             - If a string, use as regexp to search _backward_ from the
               label.  Context is then the text following the end of
               the match.  E.g. putting this to `\\caption[{]]' will
               use the caption in a figure or table environment.
               `\\begin{eqnarray}\\|\\\\' works for eqnarrays.

             - If any of `caption', `item', `eqnarray-like',
               `alignat-like', this symbol will internally be
               translated into an appropriate regexp (see also the
               variable REFTEX-DEFAULT-CONTEXT-REGEXPS).

             - If a function, call this function with the name of the
               environment/macro as argument.  On call, point will be
               just after the `\label' macro.  The function is expected
               to return a suitable context string.  It should throw an
               exception (error) when failing to find context.  As an
               example, here is a function returning the 10 chars
               following the label macro as context:

                    (defun my-context-function (env-or-mac)
                       (if (> (point-max) (+ 10 (point)))
                           (buffer-substring (point) (+ 10 (point)))
                         (error "Buffer too small")))

          Label context is used in two ways by RefTeX: For display in
          the label menu, and to derive a label string.  If you want to
          use a different method for each of these, specify them as a
          dotted pair.  E.g. `(nil . t)' uses the text after the label
          (`nil') for display, and text from the default position (`t')
          to derive a label string.  This is actually used for section
          labels.

          Setting the variable REFTEX-USE-TEXT-AFTER-LABEL-AS-CONTEXT to
          `t' overrides the setting here.

    MAGIC-WORD-LIST
          List of magic words which identify a reference to be of this
          type.  If the word before point is equal to one of these
          words when calling `reftex-reference', the label list offered
          will be automatically restricted to labels of the correct
          type.  If the first element of this word-list is the symbol
          `regexp', the strings are interpreted as regular
          expressions(1).

     If the type indicator characters of two or more entries are the
     same, RefTeX will use
        - the first non-`nil' format and prefix

        - the magic words of all involved entries.

     Any list entry may also be a symbol.  If that has an association in
     REFTEX-LABEL-ALIST-BUILTIN, the `cddr' of that association is
     spliced into the list.  However, builtin defaults should normally
     be set with the variable REFTEX-DEFAULT-LABEL-ALIST-ENTRIES.

 - User Option: reftex-section-levels
     Commands and levels used for defining sections in the document.
     The car of each cons cell is the name of the section macro.  The
     cdr is a number indicating its level.

 - User Option: reftex-default-context-regexps
     Alist with default regular expressions for finding context.  The
     emacs lisp form `(format regexp (regexp-quote environment))' is
     used to calculate the final regular expression - so `%s' will be
     replaced with the environment or macro.

 - User Option: reftex-use-text-after-label-as-context
     Non-`nil' means, grab context from directly after the
     `\label{...}' macro.  This is the fastest method for obtaining
     context of the label definition, but requires discipline when
     placing labels.  Setting this variable to `t' takes precedence
     over the individual settings in REFTEX-LABEL-ALIST.  This variable
     may be set to `t', `nil', or a string of label type letters
     indicating the label types for which it should be true.

   ---------- Footnotes ----------

   (1) Careful:  RefTeX will add stuff to the beginning and end of
these regular expressions.


File: reftex.info,  Node: Options (Creating Labels),  Next: Options (Referencing Labels),  Prev: Options (Defining Label Environments),  Up: Options

Creating Labels
===============

 - User Option: reftex-insert-label-flags
     Flags governing label insertion.  The value has the form

          (DERIVE PROMPT)

     If DERIVE is `t', RefTeX will try to derive a sensible label from
     context.  A section label for example will be derived from the
     section heading.  The conversion of the context to a legal label is
     governed by the specifications given in
     REFTEX-DERIVE-LABEL-PARAMETERS.  If DERIVE is `nil', the default
     label will consist of the prefix and a unique number, like `eq:23'.

     If PROMPT is `t', the user will be prompted for a label string.
     When PROMPT is `nil', the default label will be inserted without
     query.

     So the combination of DERIVE and PROMPT controls label insertion.
     Here is a table describing all four possibilities:

          DERIVE PROMPT ACTION
          -----------------------------------------------------------
          nil    nil    Insert simple label, like `eq:22' or `sec:13'. No query.
          nil    t      Prompt for label.
          t      nil    Derive a label from context and insert. No query.
          t      t      Derive a label from context, prompt for confirmation.

     Each flag may be set to `t', `nil', or a string of label type
     letters indicating the label types for which it should be true.
     Thus, the combination may be set differently for each label type.
     The default settings `"s"' and `"sft"' mean: Derive section labels
     from headings (with confirmation).  Prompt for figure and table
     labels.  Use simple labels without confirmation for everything
     else.

     The available label types are: `s' (section), `f' (figure), `t'
     (table), `i' (item), `e' (equation), `n' (footnote), plus any
     definitions in REFTEX-LABEL-ALIST.

 - Hook: reftex-format-label-function
     If non-`nil', should be a function which produces the string to
     insert as a label definition.  The function will be called with two
     arguments, the LABEL and the DEFAULT FORMAT (usually
     `\label{%s}').  It should return the string to insert into the
     buffer.

 - User Option: reftex-derive-label-parameters
     Parameters for converting a string into a label.  This variable is
     a list of the following items:
    NWORDS
          Number of words to use.

    MAXCHAR
          Maximum number of characters in a label string.

    ILLEGAL
          `nil': Throw away any words containing characters illegal in
          labels.
          `t':   Throw away only the illegal characters, not the whole
          word.

    ABBREV
          `nil': Never abbreviate words.
          `t':   Always abbreviate words (see REFTEX-ABBREV-PARAMETERS).
          `1':   Abbreviate words if necessary to shorten label string.

    SEPARATOR
          String separating different words in the label.

    IGNOREWORDS
          List of words which should not be part of labels.

 - User Option: reftex-label-illegal-re
     Regexp matching characters not legal in labels.  For historic
     reasons, this character class comes _with_ the `[]' brackets.

 - User Option: reftex-abbrev-parameters
     Parameters for abbreviation of words.  A list of four parameters.
    MIN-CHARS
          Minimum number of characters remaining after abbreviation.

    MIN-KILL
          Minimum number of characters to remove when abbreviating
          words.

    BEFORE
          Character class before abbrev point in word.

    AFTER
          Character class after  abbrev point in word.


File: reftex.info,  Node: Options (Referencing Labels),  Next: Options (Creating Citations),  Prev: Options (Creating Labels),  Up: Options

Referencing Labels
==================

 - User Option: reftex-label-menu-flags
     List of flags governing the label menu makeup. The flags are:
    TABLE-OF-CONTENTS
          Show the labels embedded in a table of context.

    SECTION-NUMBERS
          Include section numbers (like 4.1.3) in table of contents.

    COUNTERS
          Show counters.  These are just numbers the labels in the menu.

    NO-CONTEXT
          Non-`nil' means do NOT show the short context.

    FOLLOW
          Follow full context in other window.

    SHOW-COMMENTED
          Show labels from regions which are commented out.

    MATCH-EVERYWHERE
          Searches in label menu will also match in toc lines etc.

    SHOW FILES
          Show Begin and end of included files.

     Each of these flags can be set to `t' or `nil', or to a string of
     type letters indicating the label types for which it should be
     true.  These strings work like character classes in regular
     expressions.  Thus, setting one of the flags to `"sf"' makes the
     flag true for section and figure labels, `nil' for everything
     else.  Setting it to `"^ft"' makes it the other way round.

     The available label types are: `s' (section), `f' (figure), `t'
     (table), `i' (item), `e' (equation), `n' (footnote), plus any
     definitions in REFTEX-LABEL-ALIST.

     Most options can also be switched from the label menu itself - so
     if you decide here to not have a table of contents in the label
     menu, you can still get one interactively during selection from
     the label menu.

 - Hook: reftex-format-ref-function
     If non-`nil', should be a function which produces the string to
     insert as a reference.  Note that the insertion format can also be
     changed with REFTEX-LABEL-ALIST.  The function will be called with
     two arguments, the LABEL and the DEFAULT FORMAT (usually
     `~\ref{%s}').  It should return the string to insert into the
     buffer.

 - User Option: reftex-vref-is-default
     Non-`nil' means, the varioref macro `\vref' is used as default.
     In the selection buffer, the `v' key toggles the reference macro
     between `\ref' and `\vref'.  The value of this variable determines
     the default which is active when entering the selection process.
     Instead of `nil' or `t', this may also be a string of type letters
     indicating the label types for which it should be true.

 - User Option: reftex-level-indent
     Number of spaces to be used for indentation per section level.

 - User Option: reftex-refontify-context
     Non-`nil' means, re-fontify the context in the label menu with
     font-lock.  This slightly slows down the creation of the label
     menu.  It is only necessary when you definitely want the context
     fontified.

     This option may have 3 different values:
    `nil'
          Never refontify.

    `t'
          Always refontify.

    `1'
          Refontify when necessary, e.g. with the x-symbol package.
     The option is ignored when REFTEX-USE-FONTS is `nil'.

 - User Option: reftex-guess-label-type
     Non-`nil' means, `reftex-reference' will try to guess the label
     type.  To do that, RefTeX will look at the word before the cursor
     and compare it with the magic words given in REFTEX-LABEL-ALIST.
     When it finds a match, RefTeX will immediately offer the correct
     label menu - otherwise it will prompt you for a label type.  If
     you set this variable to `nil', RefTeX will always prompt.


File: reftex.info,  Node: Options (Creating Citations),  Next: Options (Table of Contents),  Prev: Options (Referencing Labels),  Up: Options

Creating Citations
==================

 - User Option: reftex-bibpath-environment-variables
     List of environment variables which might contain the path to
     BibTeX database files.

 - User Option: reftex-bibfile-ignore-list
     List of files in `\bibliography{...}' RefTeX should not parse.
     The file names have to be in the exact same form as in the
     bibliography macro - i.e. without the `.bib' extension.  Intended
     for files which contain only `@string' macro definitions and the
     like, which are ignored by RefTeX anyway.

 - User Option: reftex-default-bibliography
     List of BibTeX database file which should be used if none are
     specified.  When `reftex-citation' is called from a document which
     has neither a `\bibliography{...}' statement nor a
     `thebibliography' environment, RefTeX will scan these files
     instead.  Intended for using `reftex-citation' in non-LaTeX files.

 - User Option: reftex-sort-bibtex-matches
     Sorting of the entries found in BibTeX databases by
     reftex-citation.  Possible values:
          nil          Do not sort entries.
          author       Sort entries by author name.
          year         Sort entries by increasing year.
          reverse-year Sort entries by decreasing year.

 - User Option: reftex-cite-format
     The format of citations to be inserted into the buffer.  It can be
     a string or an alist.  In the simplest case this is just the string
     `\cite{%l}', which is also the default.  See the definition of
     REFTEX-CITE-FORMAT-BUILTIN for more complex examples.

     If REFTEX-CITE-FORMAT is a string, it will be used as the format.
     In the format, the following percent escapes will be expanded.

    `%l'
          The BibTeX label of the citation.

    `%a'
          List of author names, see also REFTEX-CITE-PUNCTUATION.

    `%2a'
          Like %a, but abbreviate more than 2 authors like Jones et al.

    `%A'
          First author name only.

    `%e'
          Works like `%a', but on list of editor names. (`%2e' and `%E'
          work a well).

     It is also possible to access all other BibTeX database fields:

          %b booktitle     %c chapter        %d edition    %h howpublished
          %i institution   %j journal        %k key        %m month
          %n number        %o organization   %p pages      %P first page
          %r address       %s school         %u publisher  %t title
          %v volume        %y year

     Usually, only `%l' is needed.  Try, however, `(setq
     reftex-comment-citations t)'.

     Beware that all this only works when using BibTeX database files.
     When citations are made from the `\bibitems' in an explicit
     `thebibliography' environment, only `%l' is available.

     If REFTEX-CITE-FORMAT is an alist of characters and strings, the
     user will be prompted for a character to select one of the possible
     format strings.

     In order to configure this variable, you can either set
     REFTEX-CITE-FORMAT directly yourself or set it to the _symbol_ of
     one of the predefined styles (see REFTEX-CITE-FORMAT-BUILTIN).
     E.g.: `(setq reftex-cite-format 'harvard)'.

 - Hook: reftex-format-cite-function
     If non-`nil', should be a function which produces the string to
     insert as a citation.  Note that the citation format can also be
     changed with the variable REFTEX-CITE-FORMAT.  The function will
     be called with two arguments, the CITATION KEY and the DEFAULT
     FORMAT (taken from REFTEX-CITE-FORMAT).  It should return the
     string to insert into the buffer.

 - User Option: reftex-comment-citations
     Non-`nil' means add a comment for each citation describing the full
     entry.  The comment is formatted according to
     REFTEX-CITE-COMMENT-FORMAT.

 - User Option: reftex-cite-comment-format
     Citation format used for commented citations.  Must _not_ contain
     `%l'.

 - User Option: reftex-cite-punctuation
     Punctuation for formatting of name lists in citations.  This is a
     list of 3 strings.
       1. normal names separator, like `, ' in Jones, Brown and Miller

       2. final names separator, like ` and '  in Jones, Brown and
          Miller

       3. The `et al.' string, like ` {\it et al.}' in Jones {\it et
          al.}


File: reftex.info,  Node: Options (Table of Contents),  Next: Options (Optimizations),  Prev: Options (Creating Citations),  Up: Options

Table of Contents
=================

 - User Option: reftex-toc-follow-mode
     Non-`nil' means, point in `*toc*' buffer (the table-of-contents
     buffer) will cause other window to follow.  The other window will
     show the corresponding part of the document.  This flag can be
     toggled from within the `*toc*' buffer with the `f' key.


File: reftex.info,  Node: Options (Optimizations),  Next: Options (Misc),  Prev: Options (Table of Contents),  Up: Options

Optimizations
=============

 - User Option: reftex-keep-temporary-buffers
     Non-`nil' means, keep buffers created for parsing and lookup.
     RefTeX sometimes needs to visit files related to the current
     document.  We distinguish files visited for
    PARSING
          Parts of a multifile document loaded when (re)-parsing the
          document.

    LOOKUP
          BibTeX database files and TeX files loaded to find a
          reference, to display label context, etc.
     The created buffers can be kept for later use, or be thrown away
     immediately after use, depending on the value of this variable:

    `nil'
          Throw away as much as possible.

    `t'
          Keep everything.

    `1'
          Throw away buffers created for parsing, but keep the ones
          created for lookup.

     If a buffer is to be kept, the file is visited normally (which is
     potentially slow but will happen only once). If a buffer is to be
     thrown away, the initialization of the buffer depends upon the
     variable REFTEX-INITIALIZE-TEMPORARY-BUFFERS.

 - User Option: reftex-initialize-temporary-buffers
     Non-`nil' means do initializations even when visiting file
     temporarily.  When `nil', RefTeX may turn off find-file hooks and
     other stuff to briefly visit a file. When `t', the full default
     initializations are done (`find-file-hook' etc.).  Instead of `t'
     or `nil', this variable may also be a list of hook functions to do
     a minimal initialization.

 - User Option: reftex-no-include-regexps
     List of regular expressions to exclude certain input files from
     parsing.  If the name of a file included via `\include' or
     `\input' is matched by any of the regular expressions in this
     list, that file is not parsed by RefTeX.

 - User Option: reftex-enable-partial-scans
     Non-`nil' means, re-parse only 1 file when asked to re-parse.
     Re-parsing is normally requested with a `C-u' prefix to many RefTeX
     commands, or with the `r' key in menus.  When this option is `t'
     in a multifile document, we will only parse the current buffer, or
     the file associated with the label or section heading near point
     in a menu.  Requesting re-parsing of an entire multifile document
     then requires a `C-u C-u' prefix or the capital `R' key in menus.

 - User Option: reftex-save-parse-info
     Non-`nil' means, save information gathered with parsing in a file.
     The file `MASTER.rel' in the same directory as `MASTER.tex' is
     used to save the information.  When this variable is `t',
        - accessing the parsing information for the first time in an
          editing session will read that file (if available) instead of
          parsing the document.

        - each time (part of) the document is rescanned, a new version
          of the file is written.

 - User Option: reftex-allow-automatic-rescan
     Non-`nil' means, RefTeX may rescan the document when this seems
     necessary.  Applies (currently) only in rare cases, when a new
     label cannot be placed with certainty into the internal label list.

 - User Option: reftex-use-multiple-selection-buffers
     Non-`nil' means use a separate selection buffer for each label
     type.  These buffers are kept from one selection to the next and
     need not to be created for each use - so the menu generally comes
     up faster.  The selection buffers will be erased (and therefore
     updated) automatically when new labels in its category are added.
     See the variable REFTEX-AUTO-UPDATE-SELECTION-BUFFERS.

 - User Option: reftex-auto-update-selection-buffers
     Non-`nil' means, selection buffers will be updated automatically.
     When a new label is defined with `reftex-label', all selection
     buffers associated with that label category are emptied, in order
     to force an update upon next use.  When `nil', the buffers are left
     alone and have to be updated by hand, with the `g' key from the
     label selection process.  The value of this variable will only
     have any effect when REFTEX-USE-MULTIPLE-SELECTION-BUFFERS is
     non-`nil'.


File: reftex.info,  Node: Options (Misc),  Prev: Options (Optimizations),  Up: Options

Miscellaneous
=============

 - User Option: reftex-extra-bindings
     Non-`nil' means, make additional key bindings on startup.  These
     extra bindings are located in the users `C-c letter' map. *Note
     Keybindings::.

 - User Option: reftex-plug-into-AUCTeX
     Plug-in flags for AUCTeX interface.  This variable is a list of 4
     boolean flags.  When a flag is non-`nil', it means:

          Flag 1:  use `reftex-label'     as `LaTeX-label-function'.
          Flag 2:  use `reftex-arg-label' as `TeX-arg-label'
          Flag 3:  use `reftex-arg-ref'   as `TeX-arg-ref'
          Flag 4:  use `reftex-arg-cite'  as `TeX-arg-cite'

     You may also set the variable itself to `t' or `nil' in order to
     turn all plug-ins on or off, respectively.  The value of
     LATEX-LABEL-FUNCTION is the function used for label insertion when
     you enter a new environment in AUCTeX.  The `TeX-arg-label' etc.
     functions are for entering macro arguments during macro insertion
     with AUCTeX.  See the AUCTeX documentation for more information.
     RefTeX uses `fset' to take over the function calls.  Changing the
     variable may require a restart of Emacs in order to become
     effective.

 - User Option: reftex-use-fonts
     Non-`nil' means, use fonts in label menu and on-the-fly help.
     Font-lock must be loaded as well to actually get fontified display.

 - User Option: reftex-auto-show-entry
     Non-`nil' means, do something when context in other window is
     hidden.  Some modes like `outline-mode' or `folding-mode' hide
     parts of buffers.  When RefTeX is asked to show context for a label
     definition, and the context is invisible, it can unhide that
     section permanently (value `t'), or copy the context to a
     temporary buffer (value 'copy).

 - User Option: reftex-revisit-to-follow
     Non-`nil' means, follow-mode will revisit files if necessary.
     When nil, follow-mode will be suspended for stuff in unvisited
     files.


File: reftex.info,  Node: Keymaps,  Next: Hooks,  Prev: Options,  Up: Top

Keymaps
=======

 - Variable: reftex-mode-map
     The keymap for RefTeX minor mode.

 - Variable: reftex-select-label-map
     The keymap which is active in the labels selection process (*note
     Referencing Labels::).  Commands added to this map must return to
     the selection buffer after any excursion.

 - Variable: reftex-select-bib-map
     The keymap which is active in the citation-key selection process
     (*note Creating Citations::).  Commands added to this map must
     return to the selection buffer after any excursion.

 - Variable: reftex-toc-map
     The keymap which is active in the `*toc*' buffer.  (*note Table of
     Contents::).


File: reftex.info,  Node: Hooks,  Prev: Keymaps,  Up: Top

Hooks
=====

 - Normal Hook: reftex-load-hook
     Normal hook which is being run when loading `reftex.el'.

 - Normal Hook: reftex-mode-hook
     Normal hook which is being run when turning on RefTeX mode.

   See also the following variables which have hook properties as well:

   * REFTEX-FORMAT-LABEL-FUNCTION (*Note Options (Creating Labels)::)

   * REFTEX-FORMAT-REF-FUNCTION (*Note Options (Referencing Labels)::)

   * REFTEX-FORMAT-CITE-FUNCTION (*Note Options (Creating Citations)::)

   * REFTEX-INITIALIZE-TEMPORARY-BUFFERS (*Note Options
     (Optimizations)::)


File: reftex.info,  Node: Index,  Up: Top

Index
*****

* Menu:

* *toc* buffer:                          Table of Contents.
* .emacs:                                Installation.
* \bibliography:                         Creating Citations.
* \endnote, LaTeX macro:                 Builtin Label Environments.
* \eqref, AMS-LaTeX macro:               Using \eqref.
* \externaldocument:                     xr (LaTeX package).
* \footnote, LaTeX macro:                Builtin Label Environments.
* \label:                                Labels and References.
* \newtheorem:                           Theorem and Axiom.
* \ref:                                  Referencing Labels.
* \vref:                                 varioref (LaTeX package).
* Acknowledgments:                       Imprint.
* align, AMS-LaTeX environment:          Builtin Label Environments.
* alignat, AMS-LaTeX environment:        Builtin Label Environments.
* AMS-LaTeX <1>:                         Using \eqref.
* AMS-LaTeX:                             Builtin Label Environments.
* amsmath, LaTeX package:                Builtin Label Environments.
* AUCTeX, Emacs package:                 AUCTeX.
* autoload forms, required:              Installation.
* Automatic document scans:              Optimizations.
* axiom, newtheorem:                     Theorem and Axiom.
* Beqnarray, LaTeX environment:          Builtin Label Environments.
* bib-cite, Emacs package:               Bib-Cite.
* bib-cite-use-reftex-view-crossref:     Bib-Cite.
* Bibliographies, multiple:              Chapterbib and Bibunits.
* bibunits, LaTeX package:               Chapterbib and Bibunits.
* Bug reports:                           Imprint.
* Builtin label environments:            Builtin Label Environments.
* C-c & <1>:                             Displaying Cross References.
* C-c &:                                 Displaying Citations.
* C-c (:                                 Creating Labels.
* C-c ):                                 Referencing Labels.
* C-c =:                                 Table of Contents.
* C-c [:                                 Creating Citations.
* C-c c:                                 Keybindings.
* C-c g:                                 Keybindings.
* C-c l:                                 Keybindings.
* C-c r:                                 Keybindings.
* C-c s:                                 Keybindings.
* C-c t:                                 Keybindings.
* C-c v:                                 Keybindings.
* chapterbib, LaTeX package:             Chapterbib and Bibunits.
* chicago, citation style:               Citation Styles.
* Citation styles:                       Citation Styles.
* Citation styles, chicago:              Citation Styles.
* Citation styles, harvard:              Citation Styles.
* Citation styles, natbib:               Citation Styles.
* Citations:                             Citations.
* Citations outside LaTeX:               Citations Outside LaTeX.
* Citations, creating:                   Creating Citations.
* Citations, displaying:                 Displaying Citations.
* Commands, list of:                     Commands.
* Creating citations:                    Creating Citations.
* Creating labels:                       Creating Labels.
* Cross references, displaying:          Displaying Cross References.
* Cross-document references:             xr (LaTeX package).
* Displaying citations:                  Displaying Citations.
* Displaying cross references:           Displaying Cross References.
* Document scanning, automatic:          Optimizations.
* Document scanning, partial:            Optimizations.
* Documents, spread over files:          Multifile Documents.
* Emacs packages, AUCTeX:                AUCTeX.
* Emacs packages, bib-cite:              Bib-Cite.
* Emacs packages, iso-cvt:               Problems and Work-Arounds.
* Emacs packages, isotex:                Problems and Work-Arounds.
* Emacs packages, x-symbol:              Problems and Work-Arounds.
* endnote, LaTeX package:                Builtin Label Environments.
* enumerate, LaTeX environment:          Builtin Label Environments.
* Environments, builtin:                 Builtin Label Environments.
* eqnarray, LaTeX environment:           Builtin Label Environments.
* equation, LaTeX environment:           Builtin Label Environments.
* External documents:                    xr (LaTeX package).
* fancybox, LaTeX package:               Builtin Label Environments.
* Figure wrapping macro:                 Figure Wrapper.
* figure*, LaTeX environment:            Builtin Label Environments.
* figure, LaTeX environment:             Builtin Label Environments.
* figwindow, LaTeX environment:          Builtin Label Environments.
* flalign, AMS-LaTeX environment:        Builtin Label Environments.
* floatfig, LaTeX package:               Builtin Label Environments.
* floatingfig, LaTeX environment:        Builtin Label Environments.
* ftp, RefTeX site:                      Imprint.
* gather, AMS-LaTeX environment:         Builtin Label Environments.
* German magic words:                    Adding Magic Words.
* Getting Started:                       RefTeX in a Nutshell.
* harvard, citation style:               Citation Styles.
* Hooks:                                 Hooks.
* http, RefTeX home page:                Imprint.
* Imprint:                               Imprint.
* Installation:                          Installation.
* Introduction:                          Introduction.
* iso-cvt, Emacs package:                Problems and Work-Arounds.
* isotex, Emacs package:                 Problems and Work-Arounds.
* Keybindings, problems with Viper mode: Problems and Work-Arounds.
* Keybindings, summary:                  Keybindings.
* Keymaps:                               Keymaps.
* Label category <1>:                    Using \eqref.
* Label category <2>:                    Labels and References.
* Label category:                        Adding Magic Words.
* Label environment:                     Labels and References.
* Label environments, builtin:           Builtin Label Environments.
* Label environments, defining:          Defining Label Environments.
* Labels in LaTeX:                       Labels and References.
* Labels, commented out:                 Problems and Work-Arounds.
* Labels, creating:                      Creating Labels.
* Labels, deriving from context:         Creating Labels.
* Labels, referencing:                   Referencing Labels.
* LaTeX core:                            Builtin Label Environments.
* LaTeX macro footnote:                  Builtin Label Environments.
* LaTeX packages, amsmath:               Builtin Label Environments.
* LaTeX packages, endnote:               Builtin Label Environments.
* LaTeX packages, fancybox:              Builtin Label Environments.
* LaTeX packages, floatfig:              Builtin Label Environments.
* LaTeX packages, longtable:             Builtin Label Environments.
* LaTeX packages, pf:                    Problems and Work-Arounds.
* LaTeX packages, picinpar:              Builtin Label Environments.
* LaTeX packages, rotating:              Builtin Label Environments.
* LaTeX packages, subfigure:             Builtin Label Environments.
* LaTeX packages, supertab:              Builtin Label Environments.
* LaTeX packages, varioref:              varioref (LaTeX package).
* LaTeX packages, wrapfig:               Builtin Label Environments.
* LaTeX packages, xr:                    xr (LaTeX package).
* LaTeX-label-function:                  AUCTeX.
* longtable, LaTeX environment:          Builtin Label Environments.
* longtable, LaTeX package:              Builtin Label Environments.
* Macros as environment wrappers <1>:    Figure Wrapper.
* Macros as environment wrappers:        Quick Equation.
* Magic words:                           Adding Magic Words.
* Maintainer:                            Imprint.
* Multifile documents:                   Multifile Documents.
* Multiple selection buffers:            Optimizations.
* multline, AMS-LaTeX environment:       Builtin Label Environments.
* natbib, citation style:                Citation Styles.
* Nutshell, RefTeX in a:                 RefTeX in a Nutshell.
* Optimizations:                         Optimizations.
* Options, creating citations:           Options (Creating Citations).
* Options, creating labels:              Options (Creating Labels).
* Options, defining label environments:  Options (Defining Label Environments).
* Options, list of:                      Options.
* Options, misc:                         Options (Misc).
* Options, optimizations:                Options (Optimizations).
* Options, referencing labels:           Options (Referencing Labels).
* Options, table of contents:            Options (Table of Contents).
* Overlays, problems with XEmacs 19.15:  Problems and Work-Arounds.
* Parse information, saving to a file:   Optimizations.
* Partial documents scans:               Optimizations.
* pf, LaTeX package:                     Problems and Work-Arounds.
* picinpar, LaTeX package:               Builtin Label Environments.
* Problems and work-arounds:             Problems and Work-Arounds.
* Quick equation macro:                  Quick Equation.
* Quick-Start:                           RefTeX in a Nutshell.
* References in LaTeX:                   Labels and References.
* References to external documents:      xr (LaTeX package).
* Referencing labels:                    Referencing Labels.
* RefTeX in a Nutshell:                  RefTeX in a Nutshell.
* reftex-abbrev-parameters:              Options (Creating Labels).
* reftex-add-to-label-alist:             AUCTeX.
* reftex-allow-automatic-rescan <1>:     Options (Optimizations).
* reftex-allow-automatic-rescan:         Optimizations.
* reftex-arg-cite:                       AUCTeX.
* reftex-arg-label:                      AUCTeX.
* reftex-arg-ref:                        AUCTeX.
* reftex-auto-show-entry:                Options (Misc).
* reftex-auto-update-selection-buffers <1>: Optimizations.
* reftex-auto-update-selection-buffers:  Options (Optimizations).
* reftex-bibfile-ignore-list:            Options (Creating Citations).
* reftex-bibpath-environment-variables:  Options (Creating Citations).
* reftex-change-label:                   Commands.
* reftex-citation <1>:                   Creating Citations.
* reftex-citation:                       Commands.
* reftex-cite-comment-format:            Options (Creating Citations).
* reftex-cite-format:                    Options (Creating Citations).
* reftex-cite-punctuation:               Options (Creating Citations).
* reftex-comment-citations:              Options (Creating Citations).
* reftex-create-tags-file:               Commands.
* reftex-customize:                      Commands.
* reftex-default-bibliography:           Options (Creating Citations).
* reftex-default-context-regexps:        Options (Defining Label Environments).
* reftex-default-label-alist-entries:    Options (Defining Label Environments).
* reftex-derive-label-parameters:        Options (Creating Labels).
* reftex-enable-partial-scans <1>:       Optimizations.
* reftex-enable-partial-scans:           Options (Optimizations).
* reftex-extra-bindings <1>:             Keybindings.
* reftex-extra-bindings:                 Options (Misc).
* reftex-find-duplicate-labels:          Commands.
* reftex-format-cite-function:           Options (Creating Citations).
* reftex-format-label-function:          Options (Creating Labels).
* reftex-format-ref-function:            Options (Referencing Labels).
* reftex-grep-document:                  Commands.
* reftex-guess-label-type:               Options (Referencing Labels).
* reftex-info:                           Commands.
* reftex-initialize-temporary-buffers <1>: Options (Optimizations).
* reftex-initialize-temporary-buffers:   Problems and Work-Arounds.
* reftex-insert-label-flags:             Options (Creating Labels).
* reftex-keep-temporary-buffers <1>:     Options (Optimizations).
* reftex-keep-temporary-buffers <2>:     Optimizations.
* reftex-keep-temporary-buffers:         Problems and Work-Arounds.
* reftex-label <1>:                      Creating Labels.
* reftex-label <2>:                      Commands.
* reftex-label:                          AUCTeX.
* reftex-label-alist <1>:                Defining Label Environments.
* reftex-label-alist <2>:                Options (Defining Label Environments).
* reftex-label-alist:                    Builtin Label Environments.
* reftex-label-alist-builtin:            Builtin Label Environments.
* reftex-label-illegal-re:               Options (Creating Labels).
* reftex-label-menu-flags:               Options (Referencing Labels).
* reftex-level-indent:                   Options (Referencing Labels).
* reftex-load-hook:                      Hooks.
* reftex-mode:                           Installation.
* reftex-mode-hook:                      Hooks.
* reftex-mode-map:                       Keymaps.
* reftex-mouse-view-crossref <1>:        Displaying Citations.
* reftex-mouse-view-crossref <2>:        Displaying Cross References.
* reftex-mouse-view-crossref:            Keybindings.
* reftex-no-include-regexps:             Options (Optimizations).
* reftex-parse-document:                 Commands.
* reftex-plug-into-AUCTeX <1>:           AUCTeX.
* reftex-plug-into-AUCTeX:               Options (Misc).
* reftex-query-replace-document:         Commands.
* reftex-reference <1>:                  Commands.
* reftex-reference:                      Referencing Labels.
* reftex-refontify-context <1>:          Problems and Work-Arounds.
* reftex-refontify-context:              Options (Referencing Labels).
* reftex-reset-mode:                     Commands.
* reftex-revisit-to-follow <1>:          Optimizations.
* reftex-revisit-to-follow:              Options (Misc).
* reftex-save-parse-info <1>:            Options (Optimizations).
* reftex-save-parse-info:                Optimizations.
* reftex-search-document:                Commands.
* reftex-section-levels:                 Options (Defining Label Environments).
* reftex-select-bib-map:                 Keymaps.
* reftex-select-label-map:               Keymaps.
* reftex-show-commentary:                Commands.
* reftex-sort-bibtex-matches:            Options (Creating Citations).
* reftex-toc <1>:                        Commands.
* reftex-toc:                            Table of Contents.
* reftex-toc-follow-mode:                Options (Table of Contents).
* reftex-toc-map:                        Keymaps.
* reftex-use-fonts:                      Options (Misc).
* reftex-use-multiple-selection-buffers <1>: Options (Optimizations).
* reftex-use-multiple-selection-buffers: Optimizations.
* reftex-use-text-after-label-as-context: Options (Defining Label Environments).
* reftex-view-crossref <1>:              Commands.
* reftex-view-crossref <2>:              Displaying Cross References.
* reftex-view-crossref:                  Displaying Citations.
* reftex-vref-is-default:                Options (Referencing Labels).
* Removing lookup buffers:               Optimizations.
* rotating, LaTeX package:               Builtin Label Environments.
* Saving parser information:             Optimizations.
* Selection buffer, citations:           Creating Citations.
* Selection buffer, labels:              Referencing Labels.
* Selection buffers, multiple:           Optimizations.
* Selection buffers, updating:           Optimizations.
* Selection process <1>:                 Creating Citations.
* Selection process:                     Referencing Labels.
* sidewaysfigure, LaTeX environment:     Builtin Label Environments.
* sidewaystable, LaTeX environment:      Builtin Label Environments.
* Style files, AUCTeX:                   AUCTeX.
* subequations, AMS-LaTeX environment:   Builtin Label Environments.
* subfig, LaTeX package:                 Builtin Label Environments.
* subfigure*, LaTeX environment:         Builtin Label Environments.
* subfigure, LaTeX environment:          Builtin Label Environments.
* supertab, LaTeX package:               Builtin Label Environments.
* supertabular, LaTeX environment:       Builtin Label Environments.
* Table of contents buffer:              Table of Contents.
* table*, LaTeX environment:             Builtin Label Environments.
* table, LaTeX environment:              Builtin Label Environments.
* tabwindow, LaTeX environment:          Builtin Label Environments.
* TeX-arg-cite, AUCTeX function:         AUCTeX.
* TeX-arg-label, AUCTeX function:        AUCTeX.
* TeX-arg-ref, AUCTeX function:          AUCTeX.
* tex-main-file:                         Multifile Documents.
* TeX-master:                            Multifile Documents.
* Thanks:                                Imprint.
* thebibliography, LaTeX environment:    Creating Citations.
* theorem, newtheorem:                   Theorem and Axiom.
* turn-on-reftex:                        Installation.
* varioref, LaTeX package:               varioref (LaTeX package).
* Viewing citations:                     Displaying Citations.
* Viewing cross references:              Displaying Cross References.
* Viper mode:                            Problems and Work-Arounds.
* viper-harness-minor-mode:              Problems and Work-Arounds.
* wrapfig, LaTeX package:                Builtin Label Environments.
* wrapfigure, LaTeX environment:         Builtin Label Environments.
* x-symbol, Emacs package:               Problems and Work-Arounds.
* xalignat, AMS-LaTeX environment:       Builtin Label Environments.
* xr, LaTeX package:                     xr (LaTeX package).
* xxalignat, AMS-LaTeX environment:      Builtin Label Environments.



Tag Table:
Node: Top335
Node: Introduction3589
Node: Installation4317
Node: RefTeX in a Nutshell6043
Node: Labels and References9308
Node: Creating Labels10704
Node: Referencing Labels12920
Node: Builtin Label Environments18092
Node: Defining Label Environments19469
Node: Theorem and Axiom20751
Node: Quick Equation24479
Node: Figure Wrapper26008
Node: Adding Magic Words27873
Node: Using \eqref28825
Node: Putting it Together29500
Node: Displaying Cross References30169
Node: xr (LaTeX package)30725
Node: varioref (LaTeX package)31895
Node: Citations32567
Node: Creating Citations33380
Node: Citation Styles36545
Node: Displaying Citations38083
Node: Chapterbib and Bibunits38739
Node: Citations Outside LaTeX39404
Node: Table of Contents40352
Node: Keybindings42447
Node: Social Matters43688
Node: AUCTeX44077
Node: Bib-Cite46588
Node: Multifile Documents47646
Node: Optimizations48852
Node: Problems and Work-Arounds53545
Node: Imprint57701
Node: Commands59394
Node: Options63586
Node: Options (Defining Label Environments)64245
Ref: Options (Defining Label Environments)-Footnote-172006
Node: Options (Creating Labels)72101
Node: Options (Referencing Labels)75812
Node: Options (Creating Citations)79464
Node: Options (Table of Contents)83916
Node: Options (Optimizations)84403
Node: Options (Misc)88671
Node: Keymaps90751
Node: Hooks91491
Node: Index92130

End Tag Table
