[Top][All Lists]

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

Re: [AUCTeX-devel] enumerate a kludge

From: Arash Esbati
Subject: Re: [AUCTeX-devel] enumerate a kludge
Date: Mon, 20 Aug 2018 21:32:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1

Uwe Brauer <address@hidden> writes:

> I finally did the following 
> (defun LaTeX-enumerate-insert (environment)   ;Version:1.20
>     (LaTeX-insert-environment "enumerate")
>     (and (LaTeX-label environment)
>        (newline-and-indent)))
> (defun my-LaTeX-TeX-add-symbols ()
>   (LaTeX-add-environments
>    '("enumerate" LaTeX-enumerate-insert)))
> Is this really necessary?

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.

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")
      (LaTeX-label environment 'environment)))

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

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

It should do the job.

Best, Arash

reply via email to

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