auctex
[Top][All Lists]

## Re: [AUCTeX] RefTeX: Section and chapter numbers into label prefixes

 From: Ralf Angeli Subject: Re: [AUCTeX] RefTeX: Section and chapter numbers into label prefixes Date: Sun, 20 May 2007 11:57:19 +0200 User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.0.96 (gnu/linux)

* Eugenio Piasini (2007-05-20) writes:

> I'm trying to manipulate the "label-prefix" entry of a "reftex-label-alist"
> item descrybing, say, the environment "proposition", in such a way that when
> I insert a label inside this kind of environment I automatically get
> something like
>
> \label{cha:1:sec:2:prop:1}   , or  \label{1:2:prop:1}
>
> where 1 is the number of the current chapter and 2 is the number of the
> current section.
> Initially I thought that the widcard "%S" would do the job, but I found that
> this just writes the section prefix associated with the current sectioning
> level (so that "%Sprop" produces, for example, \label{sec:prop:1} or
> \label{cha:prop:1}).

With %S RefTeX figures out which section _level_ the label will be put in
and inserts the respective string defined in reftex-section-prefixes'.
In contrast, you seem to want to obtain the numbering as in the typeset
document.  I am not aware of a built-in method to do this.

> Does anyone know about a simple way to obtain this result? I mean, I'm a
> newbie and I don't know enough to write a custom function to insert into
> "context-method"..

Getting the numbers as in the typeset document will be very hard.  You
would probably have to parse output files.

In any case, RefTeX works with label types which are related to the
label prefix.  If the prefix becomes subject to change, determination of
the type during referencing might become problematic.

--
Ralf

`

reply via email to