auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] Support for empheq


From: Mosè Giordano
Subject: Re: [AUCTeX] Support for empheq
Date: Sat, 13 Aug 2016 16:44:55 +0200

Hi Arash,

2016-08-12 12:09 GMT+02:00 Arash Esbati <address@hidden>:
>> A feature request: do you think you can make `TeX-insert-item' work in
>> `empheq' environment when one specifies `align', `gather', or
>> `alignat' ams-environments, just like it works in the parent
>> environments?  This may not really easy to implement, tough.
>
> Done, new version is attached, the function is called
> `LaTeX-empheq-item-equation'.

Thank you so much, that's exactly what I was thinking!

> One thing occured to me as I wrote it:
> AUCTeX inserts an `\item' if one hits `M-RET' in an equation env:
>
> --8<---------------cut here---------------start------------->8---
> \documentclass{article}
>
> \usepackage[overload]{empheq}
>
> \begin{document}
>
> \begin{equation}
>   \label{eq:1}
>   Hit `M-RET' here
> \end{equation}
>
> \begin{empheq}{equation}
>   \label{eq:2}
>   Hit `M-RET' here
> \end{empheq}
>
> \end{document}
> --8<---------------cut here---------------end--------------->8---
>
> I added some code to `LaTeX-empheq-item-equation' to suppress this.
> Should AUCTeX do something like this for standard equation?  WDYT?

I think this is fine in `empheq' environment, not sure it's valuable
elsewhere.  One shouldn't use it in environments that doesn't have an
item-like style: I consider it an error of the user to try to issue
C-c C-j in an `equation' environment.  We could prevent them from
doing the wrong thing, but I consider a feature having
`TeX-insert-item' inserting "\item" macro in an environment not
present in `LaTeX-item-list': there can be environments that we don't
support that require "\item"s and users can easily insert them even
without a proper style file in AUCTeX.

>>> And while we're at it: Are you also using features from mathtools.sty?
>>> I think AUCTeX's style file has a bug in \shoveleft and \shoveright.
>>
>> What do you refer to?
>
> Hit `C-c C-m shoveleft RET 4 RET 5 RET' in example above and AUCTeX asks
> for a width and height resulting in \shoveleft(4,5){}.  \shoveleft takes
> an optional dimension argument, it should be \shoveleft[1cm]{} (see
> mathtools doc page 17).  The entries
>
>     '("shoveleft"  [ TeX-arg-size ] 1)
>     '("shoveright" [ TeX-arg-size ] 1)
>
> should be
>
>     '("shoveleft"  [ TeX-arg-length ] 1)
>     '("shoveright" [ TeX-arg-length ] 1)

Oh, yes, I think you're right, good catch.

I think you can install this empheq style file.

Bye,
Mosè



reply via email to

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