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 (see 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. When entering the regular expression, you can complete on
known citation keys. RefTeX also offers a default when prompting for
a regular expression. This default is the word before the cursor or the
word before the current ‘\cite’ command. Sometimes this may be a
good search key.
RefTeX prefers to use BibTeX database files specified with a
\bibliography
macro to collect its information. Just like
BibTeX, it will search for the specified files in the current directory
and along the path given in the environment variable BIBINPUTS
.
If you do not use BibTeX, but the document contains an explicit
thebibliography
environment, RefTeX will collect its
information from there. Note that in this case the information
presented in the selection buffer will just be a copy of relevant
\bibitem
entries, not the structured listing available with
BibTeX database files.
In the selection buffer, the following keys provide special commands. A summary of this information is always available from the selection process by pressing ?.
Show a summary of available commands.
Prefix argument.
Go to next article.
Go to previous article.
Show the database entry corresponding to the article at point, in another window. See also the f key.
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.
Insert a citation referencing the article at point into the buffer from which the selection process was started.
Clicking with mouse button 2 on a citation will accept it like RET
would. See also variable reftex-highlight-selection
,
Miscellaneous.
Mark the current entry. When one or several entries are marked, pressing a or A accepts all marked entries. Also, RET behaves like the a key.
Unmark a marked entry.
Accept all (marked) entries in the selection buffer and create a single
\cite
macro referring to them.
Accept all (marked) entries in the selection buffer and create a
separate \cite
macro for each of it.
Create a new BibTeX database file which contains all marked entries in the selection buffer. If no entries are marked, all entries are selected.
Create a new BibTeX database file which contains all unmarked entries in the selection buffer. If no entries are marked, all entries are selected.
Enter a citation key with completion. This may also be a key which does not yet exist.
Show insertion point in another window. This is the point from where you
called reftex-citation
.
Exit the selection process without inserting a citation into the buffer.
Start over with a new regular expression. The full database will be rescanned with the new expression (see also r).
Refine the current selection with another regular expression. This will not rescan the entire database, but just the already selected entries.
In order to define additional commands for this selection process, the
keymap reftex-select-bib-mode-map
may be used.
Note that if you do not use Emacs to edit the BibTeX database files, RefTeX will ask if the related buffers should be updated once it detects that the files were changed externally. If you do not want to be bothered by such queries, you can activate Auto Revert mode for these buffers by adding the following expression to your init file:
(add-hook 'bibtex-mode-hook 'turn-on-auto-revert-mode)