Hi, Tassilo and all.

> We're not in a hurry.  If it takes some weeks, that's fine with me.
> I'll take a note that it needs to be done before the next release.

I managed to work out the document for my change.  I'm sorry for being
late.

Although you suggested adding a new node, I found that insertion of a
brace pair is already mentioned in the section "Quotes" with description
of TeX-insert-braces, so I just added explanation of the new features
(part of which were already included in AUCTeX but not mentioned before)
under that section.

Best regards,
Ikumi Keita

diff -r 2f5c47dc24ea doc/auctex.texi
--- a/doc/auctex.texi	Sun Sep 22 20:43:41 2013 +0900
+++ b/doc/auctex.texi	Thu Oct 10 00:32:04 2013 +0900
@@ -315,7 +315,7 @@
 indenting and filling and for navigating through the document.
 
 @menu
-* Quotes::                      Inserting double quotes
+* Quotes::                      Inserting quotes, dollars, and braces
 * Font Specifiers::             Inserting Font Specifiers
 * Sectioning::                  Inserting chapters, sections, etc.
 * Environments::                Inserting Environment Templates
@@ -471,6 +471,110 @@
 it and leave point after the closing brace.
 @end deffn
 
+When writing complex math formulas in @LaTeX{} documents, you
+sometimes need to adjust the size of braces with pairs of macros like
+@samp{\left}-@samp{\right}, @samp{\bigl}-@samp{\bigr} and so on.  You
+can avoid unbalanced pairs with the help of @code{TeX-insert-macro},
+bound to @kbd{C-c C-m} or @kbd{C-c @key{RET}} (@pxref{Completion}).
+If you insert left size adjusting macros such as @samp{\left},
+@samp{\bigl} etc. with @code{TeX-insert-macro}, it asks for left brace
+to use and supplies automatically right size adjusting macros such as
+@samp{\right}, @samp{\bigr} etc. and corresponding right brace in
+addtion to the intended left macro and left brace.
+
+The completion by @code{TeX-insert-macro} also applies when entering
+macros such as @samp{\langle}, @samp{\lfloor} and @samp{\lceil}, which
+produce the left part of the paired braces.  For example, inserting
+@samp{\lfloor} by @kbd{C-c C-m} is immediately followed by the
+insertion of @samp{\rfloor}.  In addition, if the point was located
+just after @samp{\left} or its friends, the corresponding
+@samp{\right} etc. will be inserted in front of @samp{\rfloor}.
+In both cases, active region is honored.
+
+As a side effect, when @code{LaTeX-math-mode} (@pxref{Mathematics}) is
+on, just typing @kbd{`(} inserts not only @samp{\langle}, but also
+@samp{\rangle}.
+
+If you don't like such auto completion at all, it can be disabled by
+an user option.
+
+@defopt TeX-arg-right-insert-p
+If this option is turned off, the automatic supply of the right macros
+and braces is suppressed.
+@end defopt
+
+When you edit @LaTeX{} documents, you can enable automatic brace
+pairing when typing @kbd{(}, @kbd{@{} and @kbd{[}.
+
+@defopt LaTeX-electric-left-right-brace
+If this option is on, just typing @kbd{(}, @kbd{@{} or @kbd{[}
+immediately adds the corresponding right brace @samp{)}, @samp{@}} or
+@samp{]}.  The point is left after the opening brace.  If there is an
+active region, braces are put around it.
+
+They recognize the preceeding backslash or size adjusting macros such
+as @samp{\left}, @samp{\bigl} etc., so the following completions will
+occur:
+@itemize @bullet
+
+@item
+(when typing single left brace)
+@itemize @minus
+
+@item
+@samp{(} -> @samp{()}
+
+@item
+@samp{@{} -> @samp{@{@}}
+
+@item
+@samp{[} -> @samp{[]}
+@end itemize
+
+@item
+(when typing left brace just after a backslash)
+@itemize @minus
+
+@item
+@samp{\(} -> @samp{\(\)}
+
+@item
+@samp{\@{} -> @samp{\@{\@}}
+
+@item
+@samp{\[} -> @samp{\[\]}
+@end itemize
+
+@item
+(when typing just after @samp{\left} or @samp{\bigl})
+@itemize @minus
+
+@item
+@samp{\left(} -> @samp{\left(\right)}
+
+@item
+@samp{\bigl[} -> @samp{\bigl[\bigr]}
+@end itemize
+
+@item
+(when typing just after @samp{\Bigl\})
+@itemize @minus
+
+@item
+@samp{\Bigl\@{} -> @samp{\Bigl\@{\Bigr\@}}
+
+@end itemize
+
+@end itemize
+
+This auto completion feature may be a bit annoying when editing an
+already existing @LaTeX{} document.  In that case, use @kbd{C-u 1} or
+@kbd{C-q} before typing @kbd{(}, @kbd{@{} or @kbd{[}.  Then no
+completion is done and just a single left brace is inserted.  In fact,
+with optional prefix @var{arg}, just that many open braces are
+inserted without any completion.
+@end defopt
+
 @node Font Specifiers
 @section Inserting Font Specifiers
 
diff -r 2f5c47dc24ea doc/changes.texi
--- a/doc/changes.texi	Sun Sep 22 20:43:41 2013 +0900
+++ b/doc/changes.texi	Thu Oct 10 00:32:04 2013 +0900
@@ -46,6 +46,24 @@
 with @samp{slides} it is @samp{slide}.
 
 @item
+Brace pairing feature was enhanced in @LaTeX{} documents.  Support for
+@samp{\bigl}, @samp{\Bigl}, @samp{\biggl} and @samp{\Biggl}, the same
+as the one for @samp{\left}, was added to @code{TeX-insert-macro}.
+For example, @kbd{C-c @key{RET} bigl @key{RET} ( @key{RET}} inserts
+@samp{\bigl(\bigr)}.
+
+You can insert brace pair @samp{()}, @samp{@{@}} and @samp{[]} by typing
+a single left brace if the new user option
+@code{LaTeX-electric-left-right-brace} is enabled.
+
+Macros @samp{\langle}, @samp{\lfloor} and @samp{\lceil}, which produce
+the left part of the paired braces, are treated similarly as @samp{(},
+@samp{@{} and @samp{[} during the course of @code{TeX-insert-macro}.
+@ifclear rawfile
+@xref{Quotes}, for details.
+@end ifclear
+
+@item
 Support for dozens of @LaTeX{} packages was added.
 @end itemize
 
_______________________________________________
auctex-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to