Tassilo Horn <[email protected]> writes:

> Arash Esbati <[email protected]> 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


_______________________________________________
auctex-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to