I think at stackexchange the file you gave was the same.  The possible
difference hence is the installation of the newer auctex?



On Fri, Sep 18, 2020 at 10:48 AM Wierdl Máté <[email protected]> wrote:

> Arash,
>
> This is fantastic.  I installed the new auctex via elpa and your style
> file, and now when I enter a tcolorbox environment, I get the keyval labels
> added automatically.  I also see the references when I do C-c ).
>
> I'll report back if I see any bugs but I am happy!
>
> The answer you gave me a while back in stack exchange was only partially
> working, but now this is all good. Maybe you want to update there?
>
>
> https://tex.stackexchange.com/questions/463855/auctex-reftex-how-do-i-handle-labels-that-use-label-name-syntax-instead-of
>
> Thx,  bro,
>
> Máté
>
> On Fri, Sep 18, 2020 at 5:17 AM Arash Esbati <[email protected]> wrote:
>
>> Hi Máté,
>>
>> Wierdl Máté <[email protected]> writes:
>>
>> > I am using the tcolorbox latex package which doesn't use the usual
>> '\label'
>> > command.  Instead, one has to specify a label  in key-val form as in
>> >
>> > \begin{thm}[label={thm:1}]{}{}
>> >   $1=2/2$
>> > \end{thm}
>> >
>> > Is there a way to have reftex/auctex work with this variation?
>>
>> AUCTeX/RefTeX were designed for vanilla LaTeX.  Additional packages are
>> supported via style files (within AUCTeX) and customization in RefTeX.
>> key-val labels are possible, but with some limitations (see below).
>>
>> > What I mean is this
>> >
>> > 1) reftex keeps track of these as labels and  when I want to reference
>> this
>> > theorem, 'C-c )' will show this to me.
>>
>> You can add your environment to `reftex-label-regexps' in order to tell
>> RefTeX about `thm'.  But the regexp is somewhat complicated.
>>
>> > (Until today, this was working fine, but now reftex doesn't recognize
>> > this form of a label.  I have no idea what happened, what's changed. )
>>
>> Which version of Emacs are you using?  Have you updated to 27.1?
>> RefTeX's handling of key-val labels was changed there.
>>
>> > 2) auctex/reftex enters a label in this key-val form when I do 'C-c ('.
>>
>> You can teach AUCTeX to insert a key-val label when you insert the
>> environment with `C-c C-e ENV RET'; hitting `C-c (' in an environment
>> doesn't work.
>>
>> > 3) the "renumber simple labels" function works with such references.
>>
>> This is indeed a missing feature in RefTeX.  I never really looked how
>> RefTeX does this, hence I can't help.
>>
>> Long time ago, I started writing a support file for tcolorbox's theorems
>> library.  That unfinished work is attached.  Set the variable
>> `TeX-style-private' to a directory of your choice, e.g.:
>>
>>     (setq TeX-style-private
>>           (expand-file-name "~/.emacs.d/auctex-style"))
>>
>> save the file there and open your .tex file.  Also hit `C-c C-n' to
>> parse your document.  Maybe you can report back if it works.
>>
>> Best, Arash
>>
>

Reply via email to