Here is a summary of RefTeX’s commands which can be executed from
LaTeX files. Command which are executed from the special buffers are
not described here. All commands are available from the
menu. See Key Bindings.
Show the table of contents for the current document. When called with one ore two C-u prefixes, rescan the document first.
Insert a unique label. With one or two C-u prefixes, enforce document rescan first.
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.
Make a citation using BibTeX database files. After prompting for a regular
expression, scans the buffers with BibTeX entries (taken from the
\bibliography command or a
and offers the matching entries for selection. The selected entry is
formatted according to
reftex-cite-format and inserted into the
When called with a C-u prefix, prompt for optional arguments in cite macros. 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
The regular expression uses an expanded syntax: ‘&&’ is interpreted as
and. Thus, ‘aaaa&&bbb’ matches entries which contain
both ‘aaaa’ and ‘bbb’. While entering the regexp, completion
on knows citation keys is possible. ‘=’ is a good regular
expression to match all entries in all files.
Query for an index macro and insert it along with its arguments. The
index macros available are those defined in
by a call to
reftex-add-index-macros, typically from an AUCTeX
style file. RefTeX provides completion for the index tag and the
index key, and will prompt for other arguments.
Put current selection or the word near point into the default index
macro. This uses the information in
to make an index entry. The phrase indexed is the current selection or
the word near point. When called with one C-u prefix, let the
user have a chance to edit the index entry. When called with 2
C-u as prefix, also ask for the index macro and other stuff. When
called inside TeX math mode as determined by the texmathp.el
library which is part of AUCTeX, the string is first processed with the
reftex-index-math-format, which see.
Add current selection or the word at point to the phrases buffer. When you are in transient-mark-mode and the region is active, the selection will be used; otherwise the word at point. You get a chance to edit the entry in the phrases buffer; to save the buffer and return to the LaTeX document, finish with C-c C-c.
Switch to the phrases buffer, initialize if empty.
Index all index phrases in the current region. This works exactly like global indexing from the index phrases buffer, but operation is restricted to the current region.
Display a buffer with an index compiled from the current document. When the document has multiple indices, first prompts for the correct one. When index support is turned off, offer to turn it on. With one or two C-u prefixes, rescan document first. With prefix 2, restrict index to current document section. With prefix 3, restrict index to active region.
View cross reference of macro at point. Point must be on the key
argument. Works with the macros
\index and many derivatives of
these. Where it makes sense, subsequent calls show additional
locations. See also the variable
reftex-view-crossref-from-bibtex. With one or two
C-u prefixes, enforce rescanning of the document. With argument
2, select the window showing the cross reference.
View location in a LaTeX document which cites the BibTeX entry at point. Since BibTeX files can be used by many LaTeX documents, this function prompts upon first use for a buffer in RefTeX mode. To reset this link to a document, call the function with a prefix arg. Calling this function several times find successive citation locations.
Create TAGS file by running
etags on the current document. The
TAGS file is also immediately visited with
Run grep query through all files related to this document. With prefix arg, force to rescan document. No active TAGS table is required.
Regexp search through all files of the current document. Starts always in the master file. Stops when a match is found. No active TAGS table is required.
Run a query-replace-regexp of from with to over the entire document. With prefix arg, replace only word-delimited matches. No active TAGS table is required.
Toggle a minor mode which enables incremental search to work globally on the entire multifile document. Files will be searched in the sequence they appear in the document.
Prompt for a label (with completion) and jump to the location of this label. Optional prefix argument other-window goes to the label in another window.
Query replace from with to in all
\ref commands. Works on the entire multifile document. No
active TAGS table is required.
Renumber all simple labels in the document to make them sequentially.
Simple labels are the ones created by RefTeX, consisting only of the
prefix and a number. After the command completes, all these labels will
have sequential numbers throughout the document. Any references to the
labels will be changed as well. For this, RefTeX looks at the
arguments of any macros which either start or end with the string
‘ref’. This command should be used with care, in particular in
multifile documents. You should not use it if another document refers
to this one with the
Produce a list of all duplicate labels in the document.
Create a new BibTeX database file with all entries referenced in
document. The command prompts for a filename and writes the collected
entries to that file. Only entries referenced in the current document
\cite-like macros are used. The sequence in the new
file is the same as it was in the old database.
Entries referenced from other entries must appear after all referencing entries.
You can define strings to be used as header or footer for the created
files in the variables
Run the customize browser on the RefTeX group.
Show the commentary section from reftex.el.
Run info on the top RefTeX node.
Parse the entire document in order to update the parsing information.
Enforce rebuilding of several internal lists and variables. Also removes the parse file associated with the current document.