auctex-devel
[Top][All Lists]
Advanced

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

[AUCTeX-devel] insert a label with the file name as suffix.


From: Uwe Brauer
Subject: [AUCTeX-devel] insert a label with the file name as suffix.
Date: Thu, 04 May 2017 15:10:55 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Hi
currently I am using reftex-label which does precisely what I want, it
inserts, after some configuration, a label which consists of the
abbreviated environment name, a suffix, reflecting the file name and a
number.

Example
\begin{equation}
\label{eq:test:4}
\int f dx=0  
\end{equation}


Now for the exam class, Arash proposed to use

(defun LaTeX-exam-insert-label (_optional &optional name type)
  "Indent the line and query/insert a label incl. the \"\\label\" macro.
Arguments NAME and TYPE are the same as for the function
`LaTeX-label'.  OPTIONAL is ignored."
  (indent-according-to-mode)
  (let ((currenv (LaTeX-current-environment)))
    (LaTeX-label (or name currenv) (or type 'environment))))

Which does not use anything from reftex. I looked at reftex-label and it
is a bit complicated to say the least. So I would appreciate if someone
had an idea how to modify LaTeX-exam-insert-label that is behaves the
way I just described. probably I could hack something up using concat and
friends but I bet there are more elegant solutions.

Thanks

Uwe Brauer



reply via email to

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