[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problems with thmstools (and automatic insertion of labels (reftex)
From: |
Uwe Brauer |
Subject: |
Re: problems with thmstools (and automatic insertion of labels (reftex) |
Date: |
Sat, 25 Mar 2023 22:47:57 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
>>> "AE" == Arash Esbati <arash@gnu.org> writes:
Hi Arash
Thanks for the quick response
> Hi Uwe,
> Uwe Brauer <oub@mat.ucm.es> writes:
>> I have to work with a file that uses thmtools (which is not supported by
>> auctex, as far as I can tell,
> http://git.savannah.gnu.org/cgit/auctex.git/tree/style/thmtools.el
> is available since 2018.
Yes, as I said in my followup, I checked out the wrong git branch (I should
stick strictly to mercurial (and the hg-git plugins)
>> nor by reftex)
> RefTeX support OOTB isn't feasible since all environments are defined by
> the user.
>> I now run LaTeX-environment and now something strange happens
>>
>> The minibuffer offers me
>> heading (h) key=val (k) Empty (RET)
>>
>> Now, RET does not work, nothing happens,
> RET does work, it just leave the optional argument empty.
Well what I mean I hit RET and *nothing* happens, no environment is inserted,
so I have to chose another option.
>> h leads to a heading (title) which is ok, but then no label is
>> inserted as I am used to by
>> (setq reftex-label-alist
>> ("cor" ?C "cor:%f:" "~\\ref{%s}" t ("Corollary" "Cor." "C.")))
> Note that the setting above cannot work. `reftex-label-alist' is an
> alist, so you have to do:
> (setq reftex-label-alist
> '(("cor" ?C "cor:%f:" "~\\ref{%s}" t ("Corollary" "Cor." "C."))))
Right, I just copied carelessly
Out of the huge list, without taking care of the details.
> And finally, in order to get a label inserted automatically, you have to
> set `LaTeX-label-alist' *and* `reftex-label-alist':
> (add-to-list 'LaTeX-label-alist '("cor" . "cor:"))
> (setq reftex-label-alist
> '(("cor" ?C "cor:%f:" "~\\ref{%s}" t
> ("Corollary" "Cor." "C."))))
I am a bit confused, this would then insert cor:filename:number even if
LaTeX-label-alist does not specify this?
> And then AUCTeX will delegate the generation of label to RefTeX. I
> think this is also documented in thmtools.el, amsthm.el, ntheorem.el
> etc.
>> And
>>
>> (defun LaTeX-cor-insert (environment) ;Version:1.20
>> (if (y-or-n-p
>> (format "Do you want a title "))
>> (let ((title (read-string "(optional) Title: ")))
>> (LaTeX-insert-environment "cor" (concat "[" title "]"))
>> (and (LaTeX-label environment)
>> (newline-and-indent)))
>> (LaTeX-insert-environment "cor")
>> (and (LaTeX-label environment)
>> (newline-and-indent))))
> Why do you need this function? thmtools.el provides
> `LaTeX-thmtools-env-label' which does the job after parsing the
> document.
Because I never ever got that work, I will try now
> Best, Arash
--
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military.
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine.
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/
smime.p7s
Description: S/MIME cryptographic signature
- problems with thmstools (and automatic insertion of labels (reftex), Uwe Brauer, 2023/03/25
- Re: problems with thmstools (and automatic insertion of labels (reftex), Uwe Brauer, 2023/03/25
- Re: problems with thmstools (and automatic insertion of labels (reftex), Arash Esbati, 2023/03/25
- Re: problems with thmstools (and automatic insertion of labels (reftex),
Uwe Brauer <=
- Re: problems with thmstools (and automatic insertion of labels (reftex), Arash Esbati, 2023/03/25
- Re: problems with thmstools (and automatic insertion of labels (reftex), Uwe Brauer, 2023/03/26
- Re: problems with thmstools (and automatic insertion of labels (reftex), Arash Esbati, 2023/03/27
- Re: problems with thmstools (and automatic insertion of labels (reftex), Uwe Brauer, 2023/03/27
- Re: problems with thmstools (and automatic insertion of labels (reftex), Arash Esbati, 2023/03/28
- Re: problems with thmstools (and automatic insertion of labels (reftex), Uwe Brauer, 2023/03/27
- Re: problems with thmstools (and automatic insertion of labels (reftex), Arash Esbati, 2023/03/27