3.1 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
three different modes to create this mark.
-
A label can be derived from context. This means, RefTeX takes
the context of the label definition and constructs a label from
that(1). 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.
-
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 (see Referencing Labels).
-
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
(see Options (Creating Labels)).
If you are using AUCTeX to write your LaTeX documents, you can
set it up to delegate the creation of labels to
RefTeX. See AUCTeX, for more information.
This document was generated by Ralf Angeli on August, 9 2009 using texi2html 1.78.