[Top][All Lists]

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

Re: [AUCTeX-devel] Auto insertion of ampersands

From: Mosè Giordano
Subject: Re: [AUCTeX-devel] Auto insertion of ampersands
Date: Sun, 13 Jul 2014 17:47:56 +0200

Hi Ikumi,

2014-07-08 13:23 GMT+02:00 Ikumi Keita <address@hidden>:
> Hi, AUCTeX developpers,
> The attatched patch enhances the support for array and tabular(*)
> environments in LaTeX mode of AUCTeX.  With this change, the right
> number of ampersands are inserted automatically in the buffer at the
> following situations:
> (1) After inserting a new environment with C-c C-e.
> (2) After terminating a row with C-c C-j (or M-RET).
> For example, C-c C-e tabular RET t RET |l|c|r RET yields
> \begin{tabular}[t]{|l|c|r}
>   &&
> \end{tabular}
> .  Note that two &'s are inserted according to the column specification
> "|l|c|r".  The number of &'s is determined from the column specification
> on the fly.  It is robust enough not to be confused with the presence
> of bars("|") and construcs such as "@{,}" and "p{30pt}".
> In addition, C-c C-j (or M-RET) at the end of line of the &'s asks for
> optional argument for the line breaking macro "\\" and supplies two &'s
> in the next line.
> You will get similar experience with array and tabular* environments,
> too.
> The patch includes:
> 1. support for alignat environment and its friends in amsmath.el
> 2. support for enhancement of array.sty in array.el
> 3. support for enhancement of plext.sty (pLaTeX only) in plext.el, a
>    newly created file
> This feature is inspired from YaTeX(  If you like
> this change, please include it into AUCTeX.

I looked at the patch and it looks globally good, thank you!  I have
only a few remarks:
- there are some undocumented functions (`LaTeX-amsmath-env-alignat',
`LaTeX-amsmath-env-alignedat', `LaTeX-item-equation',
- a couples of variables (`LaTeX-array-skipping-regexp' and
`LaTeX-tabular*-skipping-regexp') are defined after being used for the
first time.  Although this is not a big deal, defining them before
first use silences some compilation warnings;
- style/plext.el lacks the copyright notice;
- please provide the ChangeLog entries and the appropriate
documentation if needed.

Also, a test suite for this feature would be nice.


reply via email to

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