>>> "Arash" == Arash Esbati <ar...@gnu.org> writes:
Hi Arash


   > Uwe Brauer <o...@mat.ucm.es> writes:

   > Hi Uwe,

   > yes, some code is necessary as AUCTeX has no provisions to add a \label
   > after every \item in an enumerate environment.  I also think that is not
   > necessary, but that's only my opinion.

Right, I agree in general. But I am playing with Leslie Lamports proof
style since a couple of weeks. Finally I decided not to use it nor to
write up a auctex style file because:

    1. It is not on CTAN and Lamport told me that he does not want/know
       how to upload it.

    2. Redefines the proof environment so come into conflict with amsthm

    3. Has this particular reference/label system. The references are
       supported by reftex, as I learned from you, but the labels are
       not (see the problems with the ocgx package and its non standard
       label system)

However it is relatively easy to configure the enumitem package to
produce similar output as Lamport style.

An essential part is then, however ,to refer to the proof steps which are
label of the enumerate environment, and that is why I want automatic
inserted label, in the same way I want them for equations. 



   > My recommendation is to put something like this in your init file:

   > (with-eval-after-load "latex"
   >   (defun ub/LaTeX-item-enumerate ()
   >     (TeX-insert-macro "item")
   >     (save-excursion
   >       (LaTeX-label environment 'environment)))

   >   (add-to-list 'LaTeX-label-alist
   >                '("enumerate" . "item:")
   >                t)

   >   (add-to-list 'LaTeX-item-list
   >                '("enumerate" . ub/LaTeX-item-enumerate)
   >                t))

   > It should do the job.

Unfortunately it does not. The following does though.

(add-hook 'LaTeX-mode-hook 'my-LaTeX-TeX-add-symbols)
(defun my-LaTeX-TeX-add-symbols ()
  (LaTeX-add-environments
   '("enumerate" LaTeX-enumerate-insert)))

(defun LaTeX-enumerate-insert (environment)     ;Version:1.20
  (LaTeX-insert-environment "enumerate")
  (LaTeX-insert-item)
  (and (LaTeX-label environment)
       (newline-and-indent)))

I also liked to have that LaTeX-insert-item inserts a label
automatically, fortunately cdlatex-item does.


Uwe 

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

_______________________________________________
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to