[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
insert environment + automatic label (reftex) seems not to work correctl
From: |
Uwe Brauer |
Subject: |
insert environment + automatic label (reftex) seems not to work correctly anymore |
Date: |
Sun, 05 Mar 2023 21:09:20 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Hi
I am using, for years, auctex+reftex, and insert either in article or in
beamer class, theorems, lemma and examples like this
(LaTeX-add-environments
'("thm" LaTeX-thm-insert)
'("exmp" LaTeX-example-insert)
'("lem" LaTeX-lem-insert)
Where:
(defun LaTeX-thm-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 "thm" (concat "[" title "]"))
(and (LaTeX-label environment)
(newline-and-indent)))
(LaTeX-insert-environment "thm")
(and (LaTeX-label environment)
(newline-and-indent))))
(defun LaTeX-lem-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 "lem" (concat "[" title "]"))
(and (LaTeX-label environment)
(newline-and-indent)))
(LaTeX-insert-environment "lem")
(and (LaTeX-label environment)
(newline-and-indent))))
(defun LaTeX-example-insert (environment)
(if (y-or-n-p
(format "Do you want a title "))
(let ((title (read-string "(optional) Title: ")))
(LaTeX-insert-environment "exmp" (concat "[" title "]"))
(and (LaTeX-label environment)
(newline-and-indent)))
(LaTeX-insert-environment "exmp")
(and (LaTeX-label environment)
(newline-and-indent))))
However to my surprised, when I tried it out on a vanilla (no amsthm loaded)
I obtained
\begin{lem}[this]
\label{lem:new:1}
\end{lem}
\begin{thm}[this]
\label{thr:new:1}
\end{thm}
\begin{exmp}[this]
\label{sec:3}
\end{exmp}
So exmp did not get any label and thm got thr instead of thm
I am very confused, was there a syntax change recently I am not aware of?
Thanks and 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/
- insert environment + automatic label (reftex) seems not to work correctly anymore,
Uwe Brauer <=