[Top][All Lists]

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

[AUCTeX-devel] Auto insertion of ampersands

From: Ikumi Keita
Subject: [AUCTeX-devel] Auto insertion of ampersands
Date: Tue, 08 Jul 2014 20:23:43 +0900

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
.  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,

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 confirmed the change works with emacs 24.3 and 22.3.  I believe it
also works with emacs 23.  Confirmations with emacs 21 and xemacs are
omitted, because AUCTeX in the current git repository does not seem to
be compatible with them.  (Errors occur during byte compilation.)

Ikumi Keita

P.S. I'm not on the list address@hidden, so please include me on
Cc: when replying.

Attachment: auctex-array-autoinsert-ampersand-patch
Description: auto insertion of ampersands

reply via email to

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