GNU bug report logs - #28382
11.90.2.2017-07-25; Wrapping content in an equation with LaTeX-environment results in invalid LaTeX

Previous Next

Package: auctex;

Reported by: Thibaut Verron <thibaut.verron <at> gmail.com>

Date: Thu, 7 Sep 2017 13:21:02 UTC

Severity: normal

Found in version 11.90.2.2017

Done: Ikumi Keita <ikumi <at> ikumi.que.jp>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Thibaut Verron <thibaut.verron <at> gmail.com>
Cc: 28382 <at> debbugs.gnu.org
Subject: bug#28382: 11.90.2.2017-07-25; Wrapping content in an equation with LaTeX-environment results in invalid LaTeX
Date: Sun, 10 Sep 2017 03:20:07 +0900
[Message part 1 (text/plain, inline)]
Hello Thibaut,

>>>>> Thibaut Verron <thibaut.verron <at> gmail.com> writes:
> If now you insert the equation first, select it, and use `C-c C-e` to
> wrap it in an "equation" environment, the result is

> \begin{equation}
> 2+2=4\label{eq:2}
> [point here]
> \end{equation}

Confirmed.  The reason for this behaviour is that `LaTeX-env-label' does
not take care of the case that the region is active.  In fact, it seems
that most of the functions to insert environments in latex.el don't,
either.

The attached quick hack basically gives the output you suggested as
option 2, though for `LaTeX-env-label' only.

I hope that anyone else makes out a comprehensive solution that covers
other functions as well...

Bye,
Ikumi Keita

[tentative-patch (text/x-diff, attachment)]

This bug report was last modified 2 years and 168 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.