>>> "PDN" == Paul D Nelson <ultr...@gmail.com> writes:

> Uwe Brauer <o...@mat.ucm.es> writes:
>> Thanks very much, I just tried it out, very nice, however I made a small
>> (most likely old fashioned change)

> Thanks Uwe.  I'll share a minor variant that not only adds labels when
> switching to "equation", but also cleans up labels when switching to
> "equation*" or other asterisked environments.  (This is best used with
> the latest master, due to a recent improvement to LaTeX--strip-labels.)

> (defun my-after-insert-environment-hook (new-env beg end)
>   "Hook to run after a LaTeX environment is modified."
>   (when (equal new-env "equation")
>     (unless (save-excursion (goto-char beg)
>                             (search-forward "\\label{" end t))
>       (save-excursion
>         (goto-char beg)
>         (forward-line 1)
>         (open-line 1)
>         (reftex-label)
>         (LaTeX-indent-line))))
>   (when (equal (substring new-env -1) "*")
>     (save-restriction
>       (narrow-to-region beg end)
>       (save-excursion
>         (goto-char (point-min))
>         (LaTeX--strip-labels)))))

> I couldn't quickly think of a simple way to add something like this to
> AUCTeX, accounting for possible preferences: reftex-label vs.
> LaTeX-env-label, end of line vs. next line, which environments to work
> work with, etc.

Now when I run `LaTeX-environment`
and select equation I obtain 
\begin{equation}
          \label{eq:test:1}
          \label{eq:test:2}
          
\end{equation}

Which of course it not useful

Not sure who is the culprit here

-- 
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the EU and NATO membership of Ukraine. 

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

Reply via email to