[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX-devel] Label prefix for customized environments
From: |
Arash Esbati |
Subject: |
Re: [AUCTeX-devel] Label prefix for customized environments |
Date: |
Sun, 20 Sep 2015 22:16:01 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 |
Tassilo Horn <address@hidden> writes:
> Arash Esbati <address@hidden> writes:
>
>>> and then `reftex-label-alist' is your friend. Or rather
>>> `reftex-label-alist-builtin' in order to have the former be
>>> completely in the user's hands.
>>
>> What would be best practice for a style? Update `LaTeX-label-alist'
>> for non-reftex users and check if `reftex-label-alist' is bound and
>> then update it?
>
> Yes, exactly. But I'd update `reftex-label-alist-builtin'.
Thanks. I went again through the docs of RefTeX and found:
,----
| 6.8.2 Style Files
|
| A style hook may contain calls to `reftex-add-label-environments' which
| defines additions to reftex-label-alist. The argument taken by this
| function must have the same format as reftex-label-alist. [...]
|
| a package `myprop' defining a proposition environment with
| \newtheorem might use
|
| (TeX-add-style-hook "myprop"
| (lambda ()
| (LaTeX-add-environments '("proposition" LaTeX-env-label))
| (if (fboundp 'reftex-add-label-environments)
| (reftex-add-label-environments
| '(("proposition" ?p "prop:" "~\\ref{%s}" t
| ("Proposition" "Prop.") -3))))))
`----
I tried this approach in my style and it works.
`reftex-add-label-environments' seems more clear to me. Should I stick
with it or update `reftex-label-alist-builtin'?
Best, Arash