auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problems with thmstools (and automatic insertion of labels (reftex)


From: Uwe Brauer
Subject: problems with thmstools (and automatic insertion of labels (reftex)
Date: Sat, 25 Mar 2023 18:20:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)


Hi  all


I have to work with a file that uses thmtools (which is not supported by
auctex, as far as I can tell, nor by reftex)

By it as it may

Here is a sample file 

,----
| \documentclass[10pt]{book}
| \usepackage{thmtools}
| \declaretheorem[name=Lemma,Refname={Lemma,Lemmas},numberwithin=section]{lem}
| 
\declaretheorem[name=Proposition,Refname={Proposition,Proposition},numberwithin=section]{prop}
| 
\declaretheorem[name=Theorem,Refname={Theorem,Theorems},numberwithin=section]{thm}
| 
\declaretheorem[name=Corollary,Refname={Corollary,Corollaries},numberwithin=section]{cor}
| 
\declaretheorem[name=Definition,Refname={Definition,Definitions},numberwithin=section]{defn}
| 
\declaretheorem[name=Remark,Refname={Remark,Remarks},numberwithin=section]{rem}
| \declaretheorem[name=Proof,Refname={Proof,Proofs}]{proof}
| 
| \begin{document}
| 
| 
| \end{document}
`----


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, 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.")))

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))))


So I don't see why this does not work! Of course 
the command 

reftex-label inserts the correct label, but that is a annoying extra step.


Anybody has an idea what is going on


(Maybe in the long run, I would give it a try to write a style file for
thmtools, but it is a huge package with many many options)...


Regards


Uwe Brauer 

-- 
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/

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]